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)

寒泊
- 粉丝: 90
- 资源: 1万+
最新资源
- python图像识别源码
- Screenshot_20250217_133314.jpg
- 电子工程中状态变量滤波器的精密运放电路设计及应用
- 将EBSD数据高效转换为有限元inp格式文件的方法与步骤,基于EBSD数据的有限元inp格式文件转换方法,EBSD数据转有限元inp格式文件 ,EBSD数据转换; 有限元inp格式文件; 数据处理;
- Ubuntu服务器巡检脚本
- spring templape
- GraphRAG输出中文提示词
- 零基础入门转录组下游分析-机器学习算法之SVM-RFE(筛选特征基因)教程配套资源
- test123456setse
- wsl.2.4.11.0.arm64.msi
- pycharm安装教程.md
- 【DeepSeek大模型应用:视频字幕自动生成+双语字幕srt生成】+【效果超级好】+【视频博主必备+软件永久免费】
- pycharm安装教程.md
- Comsol模拟下的锂离子电池析锂现象与锂枝晶生长相场模型可视化动画展示,基于相场模型的锂离子电池锂枝晶生长模拟:全面展示枝晶生长动画,Comsol锂离子电池析锂 锂枝晶生长相场模型 可以输出完整枝晶
- pycharm安装教程.md
- pycharm安装教程.md
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


