Extract color with in region

2 ビュー (過去 30 日間)
Noor us Saba
Noor us Saba 2019 年 4 月 19 日
コメント済み: Noor us Saba 2019 年 4 月 22 日
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

回答 (1 件)

Image Analyst
Image Analyst 2019 年 4 月 19 日
% 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 件のコメント
Noor us Saba
Noor us Saba 2019 年 4 月 22 日
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

サインインしてコメントする。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by