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?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Image Analyst
2019-5-5
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 个评论
Image Analyst
2019-5-7
- 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!
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!