Croolman
Croolman

Reputation: 1123

Detect a cutout/semicircle in an image

Below is a binary image in which I would like to detect the "hills", semicircles, cutouts.. In the image below in the red circle. The detection does not have to be precise, I just need to know that something like this is in the picture. I am thinking about the algorithm which would use kind of line sweep approach and count the black pixels on the line and evaluate that with some kind of "cleveristic", but before that I would like to know if I am missing any technique that would be easier or more robust. I have tried the HoughCircles, but with no good results, because the circles have quite huge radius and there is many of them (houghCircles takes grayscale image as input).

Binary

Upvotes: 1

Views: 1050

Answers (2)

user1196549
user1196549

Reputation:

As @piglet said, this is a case of blob analysis.

If you want to further characterize and classify the defects, you have to compute some geometrical features of the shapes such as area, diameter, elungation... and feed them to a classifier/neural net.

Upvotes: 1

Piglet
Piglet

Reputation: 28954

Counting pixels should be fine in this simple situation. If you face more complex scenarios with other things you don't want to count in, you should consider a blob detector. This method searches for regions of connected pixels. Once you have blobs you can easily sort them by size, shape, position which helps to get rid of unwanted things.

https://www.learnopencv.com/blob-detection-using-opencv-python-c/

This is a very basic technique. Please read a book on image processing fundamentals befor you continue. It will make life much easier.

Upvotes: 2

Related Questions