Home > other >  Matlab for answers
Matlab for answers

Time:09-18

Have who can help me and explain the following program, thank you!
Bw=im2bw (im, graythresh (im));
Bw=~ bw;
/r, c=find (bw);
The rect=[min min (r) (c) - 1-1 Max - min (c) (c) + 2 (r) - Max min (r) + 2);
BWT=imcrop (bw, the rect);
Rate=70/size (BWT, 1);
Rc=round (size (BWT) * rate);
BWT=imresize (BWT, rc, 'bilinear');
If the size (BWT, 2) & lt; 50
BWZ=zeros (70, 50);
Ss=round ((size (BWZ, 2) - size (BWT, 2)) * 0.5);
Tt=round ((size (BWZ, 1) - size (BWT, 1)) * 0.5);
BWZ (:, ss: ss + size (BWT, 2) - 1)=BWT;
The else
BWZ=imresize (BWT, 50 [70], 'bilinear');
End
BWZ=logical (BWZ);
For k=1:7
For k2=1
Dt=sum (BWZ (((k * 10 to 9) : (k * 10)), ((k2 * 10 to 9) : (k2 * 10))));
(f (k - 1) * 5 + k2)=sum (dt);
End
End
F=((100 - f)/100);
P=f (:).
  • Related