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

1 Ansicht (letzte 30 Tage)
Area distribution around centroid

Antworten (1)

Image Analyst
Image Analyst am 19 Okt. 2013
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);

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by