I have centroid and area of a particular object in an image,please suggest how to color that particular object differently

1 次查看(过去 30 天)
Area distribution around centroid

回答(1 个)

Image Analyst
Image Analyst 2013-10-19
I don't understand the body of your question. What does it have to do with the subject line?
Anyway, if you have a grayscale image and a binary image, you can use ismember to select a particular object out of the binary image
oneObject = ismember(labeledImage, labelToExtract);
Then color it in the gray scale image
% Initialize an rgb image
redChannel = grayImage;
greenChannel = grayImage;
blueChannel = grayImage;
% Now color the object r, g, b where r, g, b are in the 255 range
% and are the color you want
binaryImage = oneObject > 0; % change from labeled image to binary image.
redChannel(binaryImage) = r;
greenChannel(binaryImage) = g;
blueChannel(binaryImage) = b;
% Create RGB image
rgbImage = cat(3, redChannel, greenChannel, blueChannel);

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by