function varargout = fna3(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @fna3_OpeningFcn, ...
'gui_OutputFcn', @fna3_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
function fna3_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
function varargout = fna3_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
% --- Executes on button press in resmi_getir.
function resmi_getir_Callback(hObject, eventdata, handles)
% hObject handle to resmi_getir (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global image
[filename,pathname] = uigetfile();
if filename==0
msgbox(sprintf('L�tfen bir resim se�iniz'),'Hata','error')
end
axes(handles.image)
image=imread(filename);
imshow(image);
% --- Executes on button press in hazir_threshold.
function hazir_threshold_Callback(hObject, eventdata, handles)
% hObject handle to hazir_threshold (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global image
axes(handles.image_processing)
level = graythresh(image);
thresh = im2bw(image, level);
imshow(thresh)
% --- Executes on button press in histogram.
function histogram_Callback(hObject, eventdata, handles)
% hObject handle to histogram (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global image
axes(handles.axes3)
x = (0:1:255);
freq = zeros(256,1);
for i=1:size(image,1)
for j = 1:size(image,2)
value = image(i,j);
freq(value+1) = freq(value+1)+1;
end
end
bar(x,freq);
axis([0 256 0 30000]);
% --- Executes on button press in otsu.
function otsu_Callback(hObject, eventdata, handles)
% hObject handle to otsu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global image
axes(handles.image_processing)
img=rgb2gray(image);
imshow(img>110);
% --- Executes on button press in sobel.
function sobel_Callback(hObject, eventdata, handles)
% hObject handle to sobel (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global image
axes(handles.image_processing)
B = rgb2gray(image);
C = double(B);
for i=1:size(C,1)-2
for j=1:size(C,2)-2%Sobel mask for x-direction:
Gx=((2*C(i+2,j+1)+C(i+2,j)+C(i+2,j+2))-(2*C(i,j+1)+C(i,j)+C(i,j+2)));%Sobel mask for y-direction:
Gy=((2*C(i+1,j+2)+C(i,j+2)+C(i+2,j+2))-(2*C(i+1,j)+C(i,j)+C(i+2,j)));%The gradient of the image
%B(i,j)=abs(Gx)+abs(Gy);
B(i,j)=sqrt(Gx.^2+Gy.^2);
end
end
imshow(B)
% --- Executes on button press in prewitt.
function prewitt_Callback(hObject, eventdata, handles)
% hObject handle to prewitt (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global image
axes(handles.image_processing)
B = rgb2gray(image);
C = double(B);
for i=1:size(C,1)-2
for j=1:size(C,2)-2%Sobel mask for x-direction:
Gx=((C(i+2,j+1)+C(i+2,j)+C(i+2,j+2))-(C(i,j+1)+C(i,j)+C(i,j+2)));%Sobel mask for y-direction:
Gy=((C(i+1,j+2)+C(i,j+2)+C(i+2,j+2))-(C(i+1,j)+C(i,j)+C(i+2,j)));%The gradient of the image
%B(i,j)=abs(Gx)+abs(Gy);
B(i,j)=sqrt(Gx.^2+Gy.^2);
end
end
imshow(B)
寒泊
- 粉丝: 86
- 资源: 1万+
最新资源
- 住家保姆的工作职责、照顾老人住家保姆服务内容.docx
- 遵守交通规则中班教案.docx
- 《高温中暑事件卫生》一级(红色),二级(橙色),三级(黄色),四级(蓝色).docx
- 办公用品采购申请表(表格模板).docx
- 帮扶车间资金补贴申请表.docx
- 保障性安居工程考评内容和评价标准.docx
- 本级项目申请书(表格模板).docx
- 残疾儿童基本康复服务标准表.docx
- 残疾儿童定点康复机构综合评估标准表.docx
- 柴油货车报废补贴标准表.docx
- 常备借贷便利系统应急服务申请表.docx
- 产品生产过程质量问题表.docx
- 产品退货情况表.docx
- 城市快速路、主干路、重型车道典型路面、次干路、支路、非机动车专用道典型路面结构表.docx
- 城市社区工作者岗位一览表.docx
- 城乡环境基础设施建设考评内容和评分标准表.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈