-1

Looking to write a piece of software that can take in images like this, and count the number of circular "holes" in the picture. You can see that there are circular holes, as well as non-circular holes. The image is basically a plastic plane consisting of cylinders melted together, and the diamond-ish holes should not be counted.

ImageToBeProcessed

I am at the point where I can load the image into a C# WPF application, and resize or recenter the image to where I want to work with, but how to count the shadows or circular holes is not something I've been able to find in my research so far.

What I've thought about is having the user place a line on top of the image that crosses the holes, and counting how many times on that line the color drops approaching black, but that seems time consuming.

Any help in solving this problem would be appreciated even if it's referring to a manual or textbook/reference on image processing in this form.

Sakamoto Kazuma
  • 2,573
  • 7
  • 34
  • 75

1 Answers1

1

I will not go too much into detail here. What you are attempting to do is a very common problem in image processing. Finding groups of similar pixels and sorting them by shape / size.

https://en.wikipedia.org/wiki/Blob_detection

https://en.wikipedia.org/wiki/Image_segmentation

https://en.wikipedia.org/wiki/Statistical_classification

Will give you a good starting point into this topic.

Basically you separate the image into regions that belong to the plastic and regions that belong to the holes. Then you find connected regions of "hole-pixels". Once you have that you can calculate their area and/or some shape descriptors like circularity to classify your regions.

I suggest you read any book on image processing fundamentals befor you continue. That's very basic knowledge anyone should know befor writing any code...

Piglet
  • 27,501
  • 3
  • 20
  • 43