-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimageCutter.m
More file actions
49 lines (49 loc) · 1.07 KB
/
imageCutter.m
File metadata and controls
49 lines (49 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
function [c,cat]=imageCutter(OrgImg);
[rows,coloumns,maps]=size(OrgImg);
n=1;
c{1}=[0];
r{1}=OrgImg;
n=n+1;
if rows==coloumns
c{2}=(OrgImg);
cat{2}='no need';
end
if rows>coloumns
for i=1:10000
[remrow,remcoloumn,remmap]=size(r{n-1});
if remrow==remcoloumn
c{n}=r{n-1};
break
end
if remrow>remcoloumn
[c{n},r{n}]=rowsGreater(r{n-1});
cat{n}=1;
n=n+1;
end
if remcoloumn>remrow
[c{n},r{n}]=coloumnGreater(r{n-1});
cat{n}=0;
n=n+1;
end
end
end
if coloumns>rows
for i=1:500
[remrow,remcoloumn,remmap]=size(r{n-1});
if remrow==remcoloumn
c{n}=r{n-1};
break
end
if remrow>remcoloumn
[c{n},r{n}]=rowsGreater(r{n-1});
cat{n}=1;
n=n+1;
end
if remcoloumn>remrow
[c{n},r{n}]=coloumnGreater(r{n-1});
cat{n}=0;
n=n+1;
end
end
end
end