I'm using trainCascadeObjectDetector function to detect multiple objects. The detector can detect almost all of the object, but there are many false positives. I'm trying to find out the reason. Is there any threshold or probability that detector uses to determine whether a region is an object or background? If yes, where can I found it?
I presume you're usingvision.CascadeObjectDetector and nottrainCascadeObjectDetector for detection. ThetrainCascadeObjectDetector trains an object detector using training examples you provide and returns an XML file which you can use as input to thevision.CascadeObjectDetector function.
There are a few levers you can play with to tune detection performance:
Update'MinSize' and'MaxSize' parameters to constrain size of detected objects.
Increase'MergeThreshold', which controls the threshold used to merge multiple near by detections to a single final detection.