How to choose a specific area of an image?
Show older comments
I would like to ask you how to choose a specific area of an image and then use the elements of this content?
5 Comments
How are you going to selct this particular region? Is the "specific region" defined by coordinates, some properties of the image, some external data, is the region picked randomly? Each of these requires a slightly different approach, so if you tell us how you select this specific region, then we can help you extract those values.
What kind of image do you have? RGB or indexed or B&W? What size is the image array?
Ann G
on 6 Oct 2015
Image Analyst
on 6 Oct 2015
Define "select". I offered to give you masking demos in my answer but you didn't ask. So, I don't know what you mean now by "select". Please define it. Do you want all the pixel in the area in a 1-D list of intensity values? Do you want a 2D image with outside the polygon blacked out? Do you want the polygon part cropped out to a new image? What??? Be specific.
Yap Sam
on 9 Dec 2017
Hi, I have a question here. Lets say, I have defined an area of polygon using its x and y coordinates. But,how do I able to find out the mean pixels intensity of this area of polygon? Secondly,how should I apply the"if" condition to thershold a certain value of mean intensity of this polygon area.
Kindly advice
Image Analyst
on 9 Dec 2017
Make a mask and then use mean on the masked image:
mask = poly2mask(x, y, rows, columns);
theMeanIntensity = mean(grayImage(mask));
Accepted Answer
More Answers (1)
Image Analyst
on 5 Oct 2015
0 votes
If you want masking demos, ask me.
Categories
Find more on DICOM Format in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!