I use python3 script to find out the area proportion of pixel clusters, threads and points in my image. They are originally 8-bit greyscale TIFF images with a resolution of 2048x2168 pixels. I have binarised it into an image composing of the matrix (white) and component particles (black). The particles have random morphologies. I would like to widely categorise them as:
- Points which can range between 1x1 to 3x3 blocks of independent square pixels completely surrounded by the matrix
- Threads which are linear or diagonal sets of continuous pixels of at least 3 pixels in length and at most 3 pixels in width
- Clusters which are any randomly shaped closed morphologies with more than 10 pixels in overall area (or any arbitrary high value)
- Others which by any chance is not included the three listed above
Here is an Example(400x400) portion of the image.
First of all, I am confused about the order of progress in this situation. I could scan the whole image pixel by pixel and extract the points in my first step. A second scanning can see for threads and final scanning can look for clusters using boundary tracing.
As you can see, the component is spread in a very uneven manner. To a human eye, the threads appear as blocks with very low aspect ration (AR). Points as noises and clusters as blocks of distinguishable larger areas. Therefore the accuracy level of this classification scheme does not needfully be a high score. The objective, however, is minimal user interaction (fully automatic). One another thing to note is that holes within clusters or threads (that does not break it) can be ignored. The ultimate aim is to get the area percentage of each of the objects so that the detection method can be limited keeping it in mind.
Some specific questions:
- Let us say that I identify a large cluster of pixels within the image. How can I split this into a component cluster (high AR) and thread (low AR)? (something similar to Watershed Algorithm)
- Should I go for the OpenCV contouring method like Border Following or border tracing (and later ignoring the holes) or something more suitable
- I was curious to know if there have been approaches in the past that used random sampling of pixels instead of a pixel by pixel scanning across the entire image.
I would like to know the steps a computer scientist would follow in such a scenario. I am a beginner in image processing and any reference material would be appreciated. For anybody interested in metallography, the images are micrographs and what we see are defects. I am trying to separate cracks, porosities and other openings based on pixel density.