edit-color detection
1 次查看(过去 30 天)
显示 更早的评论
I have a code for brown colour detection from that please tell how to detect for whit also,it shoul;d track both colour also,if brown colour is there it should trach it and even if white is there it should also track it
cform = makecform('srgb2lab');
J = applycform(I,cform);
%figure;imshow(J);
K=J(:,:,3);
%figure;imshow(K);
L=graythresh(J(:,:,3));
BW1=im2bw(J(:,:,3),L);
%figure;imshow(BW1);
M=graythresh(J(:,:,2));
%figure;imshow(J(:,:,2));
BW2=im2bw(J(:,:,2),M);
%figure;imshow(BW2);
O=BW1.*BW2;
% Bounding box
P=bwlabel(O,8);
BB=regionprops(P,'Boundingbox');
BB1=struct2cell(BB);
BB2=cell2mat(BB1);
[s1 s2]=size(BB2);
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Biomedical Imaging 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!