MATLAB Answers

I have a segmented image.. Now i need to find the smallest area from the image using the pixels values. How to do this in Matlab? Thank you in advanced...

1 view (last 30 days)
NO
NO on 3 Oct 2019
image-ques.jpg
From the above image i need the regions marked with red circles. The marked regions hold the lowest number of pixels in the image. Please suggest some techniques.

  0 Comments

Sign in to comment.

Answers (2)

Constantino Carlos Reyes-Aldasoro
Hello
If the areas are defined by the pixel values then you can discard all other pixels by comparing against the value of interest. It looks like you have 4 values and the one you want is the second darkest after the background. Say your image is contained in a variable called brain, then your regions of interest can be extracted like this
brain2 = (brain==2);
that will keep only the two regions of interest. Then you need to distinguish them, to do that use bwlabel
brain3 = bwlabel(brain2);
bran4 = regionprops(brain3,'area');
And that will identify your regions and their propoerties

  1 Comment

NO
NO on 3 Oct 2019
Thank you for the answer.
But it may not be the second darkest part for other images.... it may be changed...
and sir regarding the pixel values it is unknown (manually it can be checked but at the time of segmentation itself how to do this?)

Sign in to comment.


Constantino Carlos Reyes-Aldasoro
to find the values of your pixels, add the colorbar to your figure and you can find out. Alternatively you can use this
unique(brain)
and will give you the unique values of your image.

  0 Comments

Sign in to comment.

Sign in to answer this question.