Extract color with in region

2 visualizzazioni (ultimi 30 giorni)
Noor us Saba
Noor us Saba il 19 Apr 2019
Commentato: Noor us Saba il 22 Apr 2019
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

Risposte (1)

Image Analyst
Image Analyst il 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)
  1 Commento
Noor us Saba
Noor us Saba il 22 Apr 2019
i didnt get how to use these mean value to detect the color of sample tablet.
regionprops give the binary image how we used to extract the color information from the binary image

Accedi per commentare.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by