From: abhi m on 7 May 2010 12:58 Am not understanding the logic used behind this code can anyone help me... below code is used to recognise shape of the object such as square,ellipse,cirlce,triangle,rectangle,diamond..... bw = imfill(erodedImage,'holes'); L = bwlabel(bw); S=rgbImage; s = regionprops(L, 'centroid'); dt = regionprops(L, 'area'); dim = size(s); BW_filled = imfill(bw,'holes'); boundaries = bwboundaries(BW_filled); figure,imshow(S); hold on; size(boundaries) for k=1:dim(1) b= boundaries{k}; dim = size(b); for i=1:dim(1) khoangcach{k}(1,i) = sqrt ( ( b(i,2) - s(k).Centroid(1) )^2 + ( b(i,1) - s(k).Centroid(2) )^2 ); end a=max(khoangcach{k}); b=min(khoangcach{k}); c=dt(k).Area;
|
Pages: 1 Prev: Oracle DB Next: lasso (L1 constrained fitting) for Matlab |