-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImageProCess.sce
85 lines (66 loc) · 6.21 KB
/
ImageProCess.sce
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// This GUI file is generated by guibuilder version 3.0
//////////
f=figure('figure_position',[400,50],'figure_size',[656,582],'auto_resize','on','background',[33],'figure_name','Graphic window number %d');
//////////
delmenu(f.figure_id,gettext('File'))
delmenu(f.figure_id,gettext('?'))
delmenu(f.figure_id,gettext('Tools'))
toolbar(f.figure_id,'off')
handles.dummy = 0;
handles.Axes= newaxes();handles.Axes.margins = [ 0 0 0 0];handles.Axes.axes_bounds = [0.003125,0.0041667,0.69375,0.6895833];
handles.pb_select=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.743125,0.90625,0.2,0.11],'Relief','default','SliderStep',[0.01,0.1],'String','Select Image','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','pb_select','Callback','pb_select_callback(handles)')
handles.pb_show=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.7415625,0.7041667,0.2,0.11],'Relief','default','SliderStep',[0.01,0.1],'String','Show Image','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','pb_show','Callback','pb_show_callback(handles)')
handles.pb_rgb2gray=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.743125,0.5041667,0.2,0.11],'Relief','default','SliderStep',[0.01,0.1],'String','RGB 2 Gray','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','pb_rgb2gray','Callback','pb_rgb2gray_callback(handles)')
handles.pb_rbg2hsv=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.743125,0.3041667,0.2,0.11],'Relief','default','SliderStep',[0.01,0.1],'String','RGB 2 HSV','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','pb_rbg2hsv','Callback','pb_rbg2hsv_callback(handles)')
handles.pb_imageNegtive=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.003125,0.1020833,0.2,0.11],'Relief','default','SliderStep',[0.01,0.1],'String','Image -VE','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','pb_imageNegtive','Callback','pb_imageNegtive_callback(handles)')
handles.pb_HighPassFilter=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2296875,0.0941667,0.2,0.12],'Relief','default','SliderStep',[0.01,0.1],'String','HighPassFilter','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','pb_HighPassFilter','Callback','pb_HighPassFilter_callback(handles)')
handles.pb_SaltandPepper=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.4765625,0.0941667,0.2,0.12],'Relief','default','SliderStep',[0.01,0.1],'String','Salt & Pepper','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','pb_SaltandPepper','Callback','pb_SaltandPepper_callback(handles)')
handles.pb_lowPassFilter=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.7515625,0.1,0.2,0.11],'Relief','default','SliderStep',[0.01,0.1],'String','Low Pass Filter','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','pb_lowPassFilter','Callback','pb_lowPassFilter_callback(handles)')
//////////
// Callbacks are defined as below. Please do not delete the comments as it will be used in coming version
//////////
function pb_select_callback(handles)
//Write your callback for pb_select here
a = uigetfile("*");
b = imread(a);
handles.b = b;
handles = resume(handles);
endfunction
function pb_show_callback(handles)
//Write your callback for pb_show here
imshow(handles.b)
endfunction
function pb_rgb2gray_callback(handles)
//Write your callback for pb_rgb2gray here
c = rgb2gray(handles.b);
imshow(c)
handles.c = c;
handles = resume(handles);
endfunction
function pb_rbg2hsv_callback(handles)
//Write your callback for pb_rbg2hsv here
d = rgb2ntsc(handles.b);
imshow(d);
endfunction
function pb_imageNegtive_callback(handles)
//Write your callback for pb_imageNegtive here
e = imcomplement(handles.c);
imshow(e);
endfunction
function pb_HighPassFilter_callback(handles)
//Write your callback for pb_HighPassFilter here
mask1 = [-1,-1,-1,-1,8,-1,-1,-1,-1]/9;
highpainim = imfilter(handles.c,mask1);
imshow(highpainim);
endfunction
function pb_SaltandPepper_callback(handles)
//Write your callback for pb_SaltandPepper here
pepper = imnoise(handles.c,'gaussian');
imshow(pepper);
endfunction
function pb_lowPassFilter_callback(handles)
//Write your callback for pb_lowPassFilter here
mask = fspecial('average');
lowimage = imfilter(handles.c,mask);
imshow(lowimage);
endfunction