a | b/Image features calculation code/Not Working/cropper1.m | ||
---|---|---|---|
1 | %Take imageSOPs and put them in imageSOP_UIDs matrix |
||
2 | |||
3 | |||
4 | for i=1:size(coords1, 1) |
||
5 | s1 = coords1{i,:}; |
||
6 | |||
7 | s2 = regexp(s1, '\|', 'split'); |
||
8 | |||
9 | |||
10 | s2(:); |
||
11 | for j= 1:size(s2,2) |
||
12 | s3(j) = regexp(s2(j), '\;', 'split'); |
||
13 | end |
||
14 | |||
15 | for k=1:size(s2,2)-1 |
||
16 | c=s3{k}; |
||
17 | y=c{1}; |
||
18 | x=c{2}; |
||
19 | x=str2num(x); |
||
20 | y=str2num(y); |
||
21 | b(k)=x; |
||
22 | d(k)=y; |
||
23 | % a(1,k)=x-287; |
||
24 | % a(2,k)=y-87; |
||
25 | |||
26 | end |
||
27 | |||
28 | |||
29 | contour=zeros(512,512); |
||
30 | for f=1:size(s2,2)-1 |
||
31 | x=b(f); |
||
32 | y=d(f); |
||
33 | contour(x,y)= 1; |
||
34 | end |
||
35 | contour=im2bw(contour); |
||
36 | figure; |
||
37 | imshow(contour); |
||
38 | clear I; |
||
39 | clear I3; |
||
40 | |||
41 | clear d; |
||
42 | clear b; |
||
43 | end |
||
44 |