Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove false detections?

I am using OpenCV to detect ellipses in a binary image as shown below. In the image, there are eight ellipses to be detected. I can use findContours to obtain a lot of contours including the eight ellipses. The problem is: how can I judge and which one is ellipse which one is not? How to remove all the other false detections?

enter image description hereenter image description here

like image 348
Shiyu Avatar asked Apr 16 '13 08:04

Shiyu


People also ask

How do you remove a false positive object detection?

False Positive is reduced by training on weakly labelled negative samples. Negative examples are also used in Contrastive Learning type unsupervised methods. Where distance between positive and negative images are increased in the latent space [12].


1 Answers

In this specific case, the Hough Circle Transform is probably the easiest solution.

Copy the code from the tutorial and change the parameters of cv::HoughCircles() to:

/// Apply the Hough Transform to find the circles
HoughCircles( src_gray, circles, CV_HOUGH_GRADIENT, 1, 10, 40, 30, 0, 0 );

Output:

enter image description here

But I loved @George's idea, go with it, it's more robust than specifying hardcoded constants. My approach works great for this image, but if you have images with different sizes of circles and stuff, you want to use cv::minEnclosingCircle().

like image 98
karlphillip Avatar answered Jun 10 '23 21:06

karlphillip