I was trying to train the cascade object detector in matlab with the 30 positive images with specified ROI and 10 negative images (without specified ROI). My code resembles with the matlab example code of 'Stop Sign Detector'. But when I tried to run my code these error occurs: Error using ocvTrainCascade Error in generating samples for training. No samples could be generated for training the first cascade stage.
My code is to detect 'mouth' from a given image of face. As positive image I have selected the images of human faces with the ROI specifying the mouth region. And as negative image, I have selected images like this:
https://i.stack.imgur.com/7X1BK.png
Can anybody please tell me what should I do to correct my code?