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 Center および File ExchangeImage Processing Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by