Extract color with in region
2 views (last 30 days)
Show older comments
I want to extract the color of tablets from the strips. i segmented the tablets using bwboundaries. kindly help me to extract the color of each region
Here is my code
[TotalSampleObjNo,L] = bwboundaries(Noise_FreeImg,'noholes'); % Search only for object
imshow(label2rgb(L,@jet,[.5 .5 .5]))
hold on
%disp (length (TotalSampleObjNo));
for k = 2:length(TotalSampleObjNo) % Starts with 1 for all boundries
boundary = TotalSampleObjNo{k};
plot(boundary(:,2),boundary(:,1),'w','LineWidth',2)
end
0 Comments
Answers (1)
Image Analyst
on 19 Apr 2019
% Extract your color channels
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Extract mean color in the binary image mask
redMean = redChannel(Noise_FreeImg)
greenMean = greenChannel(Noise_FreeImg)
blueMean = blueChannel(Noise_FreeImg)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!