-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathshili74.m
58 lines (58 loc) · 1.67 KB
/
shili74.m
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
50
51
52
53
54
55
56
57
58
h0=figure('toolbar','none',...
'position',[198 56 350 468],...
'name','实例74');
h1=axes('parent',h0,...
'position',[0.25 0.45 0.5 0.5],...
'visible','off');
I=imread('trees.tif');
imshow(I)
b1=uicontrol('parent',h0,...
'units','points',...
'tag','b1',...
'style','pushbutton',...
'string','区域过滤一',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[30 100 50 20],...
'callback',[...
'cla,',...
'I=imread(''trees.tif'');,',...
'imshow(I),',...
'BW=roipoly;,',...
'h=fspecial(''unsharp'');,',...
'I2=roifilt2(h,I,BW);,',...
'imshow(I2)']);
b2=uicontrol('parent',h0,...
'units','points',...
'tag','b2',...
'style','pushbutton',...
'string','区域过滤二',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[100 100 50 20],...
'callback',[...
'cla,',...
'BW=imread(''text.tif'');,',...
'f=inline(''imadjust(x,[],[],0.01)'');,',...
'I2=roifilt2(I,BW,f);,',...
'imshow(I2)']);
b3=uicontrol('parent',h0,...
'units','points',...
'tag','b3',...
'style','pushbutton',...
'string','区域填充',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[170 100 50 20],...
'callback',[...
'cla,',...
'load trees,',...
'I=ind2gray(X,map);,',...
'imshow(I),',...
'I2=roifill;,',...
'imshow(I2)']);
b4=uicontrol('parent',h0,...
'units','points',...
'tag','b4',...
'style','pushbutton',...
'string','关闭',...
'backgroundcolor',[0.75 0.75 0.75],...
'position',[90 50 70 30],...
'callback','close');