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)
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?

Accepted Answer

Image Analyst
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
Image Analyst on 7 May 2019
  1. SD of what? The areas of all the blobs, or the sd of the intensities within each blob?
  2. I think you can use join() or vertcat() or semicolon to stitch tables together. Like
tBoth = [t1;t2]; % untested though!
Rucha Apte
Rucha Apte on 7 May 2019
  1. SD of intensities within each blob.
  2. join() , vertcat() and horzcat() aren't working as it requires both table t1 and t2 to have same number of rows.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!