Reputation: 464
Can someone give me example of fully set classifier< I´m talking about parameters i just don´t understand this example:
cv2.CascadeClassifier.detectMultiScale(image, rejectLevels, levelWeights[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) → objects
I am detecting my face but I need to set min and max size of it. To do that you have to set rejectLevels, levelWeights etc.
I´m using module CV2.
Upvotes: 1
Views: 6463
Reputation: 851
In this problem, first you have to create a collection file with bounding boxes on positive images before you create a list of negative images. Then you have to create opencv samples in order to train your cascade. Once you have finished that, You can simply use following code in order to detect your face samples.
#load detection file
cascade = cv2.CascadeClassifier("cascade.xml")
# detect objects, return as list
rects = cascade.detectMultiScale(img)
Then you can iterate over your rect list. Please have a look on this ref:
Upvotes: 3