How do I find the pixel co-ordinates in an image in order to find the colour properties like red_mean, blue_mean, etc at that pixel?
1 view (last 30 days)
Show older comments
I want to find the pixel co-ordinates of an image containing nuclei of cells. I implemented the following commands:
conn_c = bwconncomp(tneg_bwLabel);
PixelListTo = regionprops(conn_c,'PixelList');
I received a struct that has a pixel list. How do I find the red mean, blue mean, gray mean and standard deviation at these particular pixel co-ordinates that I have received in the pixel list?
Also, I am getting values like 29 x 1 double in PixelList. Could you help me understand how to find co-ordinates using these values?
0 Comments
Accepted Answer
Image Analyst
on 5 May 2019
You don't need to get the pixel locations of every pixel in the blobs. You just pass in the labeled image itself and ask regionprops for the MeanIntensity. Try this:
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Now find the mean intensities for each blob identified by the labeled image.
propsRed = regionprops(tneg_bwLabel, redChannel, 'MeanIntensity');
propsGreen = regionprops(tneg_bwLabel, greenChannel, 'MeanIntensity');
propsBlue = regionprops(tneg_bwLabel, blueChannel, 'MeanIntensity');
11 Comments
Image Analyst
on 7 May 2019
- SD of what? The areas of all the blobs, or the sd of the intensities within each blob?
- I think you can use join() or vertcat() or semicolon to stitch tables together. Like
tBoth = [t1;t2]; % untested though!
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!