Hello, I have another question from the image processing. This is the X-ray Diffraction image of metal sample and black dots are pores.
Yesterday, I successfully found the ratio of black and white pixel area in the circular area.
[rows colm]=size(BW);white_pixels=sum(BW(:));black_pixels=~BW;black_pixels=sum(black_pixels(:));result=bwareafilt(~BW,1,'Largest');outer_black=sum(result(:));% Area with respect to circle only
black_pixels_area=(black_pixels-outer_black)/((rows*colm)-outer_black);fprintf('The Percentage of black pixels covered area is %.2f ',black_pixels_area);fprintf('\n The ratio black/white is %.2f',black_pixels/white_pixels);
Now my senior wants me to find out the ways to categorize the pores by the number of dots in the picture. For example,
-number of pores with only one pixel = n1
-number of pores with two pixels = n2
-number of pores with three pixels = n3
and so on…
I guess I have to find out the ways to calculate the number of pixels for each pores, there are many qna about the total number of pixels in the area but could hardly find the ways to calculate the pixel number for each feature…
I would really appreciate your assistance.
Best Answer