Effacer les filtres
Effacer les filtres

edit-color detection

2 vues (au cours des 30 derniers jours)
FIR
FIR le 2 Mar 2012
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);

Réponses (0)

Catégories

En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by