Borrar filtros
Borrar filtros

edit-color detection

2 visualizaciones (últimos 30 días)
FIR
FIR el 2 de Mzo. de 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);

Respuestas (0)

Categorías

Más información sobre Read, Write, and Modify Image en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by