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

1 visualizzazione (ultimi 30 giorni)
Area distribution around centroid

Risposte (1)

Image Analyst
Image Analyst il 19 Ott 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);

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by