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