IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 人工智能 -> 【图像检测-缺陷检测】基于灰度共生矩阵实现痕迹检测matlab代码 -> 正文阅读

[人工智能]【图像检测-缺陷检测】基于灰度共生矩阵实现痕迹检测matlab代码

1 简介

纹理分析是图像处理中一种十分重要的方法.通过纹理分析,利用灰度共生矩阵惯性矩特征值能够反映图像灰度空间复杂度的特性,成功获取了LOG边缘检测算子最佳空间系数,抑制了图像中的大部分噪声.并通过基于TMS320C6000专用信号处理器的图像处理系统实现了图像边缘检测的自动提取.实验结果表明,采用这种方法可以取得很好的噪声抑制效果,并且检测出的边缘精度高,实时性强,便于实现.

2 部分代码

function?varargout?=?td(varargin)
% TD M-file for td.fig
% ? ? TD, by itself, creates a new TD or raises the existing
% ? ? singleton*.
%
% ? ? H = TD returns the handle to a new TD or the handle to
% ? ? the existing singleton*.
%
% ? ? TD('CALLBACK',hObject,eventData,handles,...) calls the local
% ? ? function named CALLBACK in TD.M with the given input arguments.
%
% ? ? TD('Property','Value',...) creates a new TD or raises the
% ? ? existing singleton*. Starting from the left, property value pairs are
% ? ? applied to the GUI before td_OpeningFunction gets called. An
% ? ? unrecognized property name or invalid value makes property application
% ? ? stop. All inputs are passed to td_OpeningFcn via varargin.
%
% ? ? *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% ? ? instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Copyright 2002-2003 The MathWorks, Inc.

% Edit the above text to modify the response to help td

% Last Modified by GUIDE v2.5 12-May-2015 11:29:39

% Begin initialization code - DO NOT EDIT
gui_Singleton?=?1;
gui_State?=?struct('gui_Name', ? ? ??mfilename,?...
? ? ? ? ? ? ? ? ??'gui_Singleton', ?gui_Singleton,?...
? ? ? ? ? ? ? ? ??'gui_OpeningFcn',?@td_OpeningFcn,?...
? ? ? ? ? ? ? ? ??'gui_OutputFcn', ?@td_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
% End initialization code - DO NOT EDIT


% --- Executes just before td is made visible.
function?td_OpeningFcn(hObject,?eventdata,?handles,?varargin)
% This function has no output args, see OutputFcn.
% hObject ? handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? structure with handles and user data (see GUIDATA)
% varargin ? command line arguments to td (see VARARGIN)

% Choose default command line output for td
handles.output?=?hObject;

% Update handles structure
guidata(hObject,?handles);

% UIWAIT makes td wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function?varargout?=?td_OutputFcn(hObject,?eventdata,?handles)?
% varargout cell array for returning output args (see VARARGOUT);
% hObject ? handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} =?handles.output;


% --- Executes on button press in open1.
function?open1_Callback(hObject,?eventdata,?handles)
% hObject ? handle to open1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? structure with handles and user data (see GUIDATA)
global?im1
[filename,pathname]=uigetfile({'*.jpg';'*.bmp';'*.tif';'*.png'},'select picture'); ?%??????????????????§??????????§??????
%??????????????§??????????§?????????????
str=[pathname?filename];
%????????????????
im1=imread(str);
%???????????axes????
axes(handles.axes1);
imshow(im1);


% --- Executes on button press in open2.
function?open2_Callback(hObject,?eventdata,?handles)
% hObject ? handle to open2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? structure with handles and user data (see GUIDATA)
global?im2
[filename,pathname]=uigetfile({'*.jpg';'*.bmp';'*.tif';'*.png'},'select picture'); ?%??????????????????§??????????§??????
%??????????????§??????????§?????????????
str=[pathname?filename];
%????????????????
im2=imread(str);
%???????????axes????
%im1= uint8(255 * im1* 0.5 + 0.5);?
%th=graythresh(im1);
%im1=im2bw(im1,th);
axes(handles.axes1);
imshow(im1);
im2=rgb2gray(im2);
%th=graythresh(im2);
%im2=im2bw(im2,th);
axes(handles.axes2);
imshow(im2);

% --- Executes during object creation, after setting all properties.
function?text1_CreateFcn(hObject,?eventdata,?handles)
% hObject ? handle to text1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? empty - handles not created until after all CreateFcns called




% --- Executes on button press in quzao.
function?quzao_Callback(hObject,?eventdata,?handles)
% hObject ? handle to quzao (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? structure with handles and user data (see GUIDATA)
global?im1
global?im2
%im1=double(im1);
im1=medfilt2(im1);
axes(handles.axes1);
imshow(im1);


function?edit1_Callback(hObject,?eventdata,?handles)
% hObject ? handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit1 as text
% ? ? ? str2double(get(hObject,'String')) returns contents of edit1 as a double


% --- Executes during object creation, after setting all properties.

end



function?dui1_Callback(hObject,?eventdata,?handles)
% hObject ? handle to dui1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of dui1 as text
% ? ? ? str2double(get(hObject,'String')) returns contents of dui1 as a double


% --- Executes during object creation, after setting all properties.
function?dui1_CreateFcn(hObject,?eventdata,?handles)
% hObject ? handle to dui1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
% ? ? ? See ISPC and COMPUTER.
if?ispc?&&?isequal(get(hObject,'BackgroundColor'),?get(0,'defaultUicontrolBackgroundColor'))
? ?set(hObject,'BackgroundColor','white');
end



function?xiang1_Callback(hObject,?eventdata,?handles)
% hObject ? handle to xiang1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of xiang1 as text
% ? ? ? str2double(get(hObject,'String')) returns contents of xiang1 as a double


% --- Executes during object creation, after setting all properties.
function?xiang1_CreateFcn(hObject,?eventdata,?handles)
% hObject ? handle to xiang1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
% ? ? ? See ISPC and COMPUTER.
if?ispc?&&?isequal(get(hObject,'BackgroundColor'),?get(0,'defaultUicontrolBackgroundColor'))
? ?set(hObject,'BackgroundColor','white');
end



function?shang2_Callback(hObject,?eventdata,?handles)
% hObject ? handle to shang2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of shang2 as text
% ? ? ? str2double(get(hObject,'String')) returns contents of shang2 as a double


% --- Executes during object creation, after setting all properties.
function?shang2_CreateFcn(hObject,?eventdata,?handles)
% hObject ? handle to shang2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
% ? ? ? See ISPC and COMPUTER.
if?ispc?&&?isequal(get(hObject,'BackgroundColor'),?get(0,'defaultUicontrolBackgroundColor'))
? ?set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in pushbutton11.
function?pushbutton11_Callback(hObject,?eventdata,?handles)
% hObject ? handle to pushbutton11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? structure with handles and user data (see GUIDATA)


% --- Executes during object creation, after setting all properties.
function?jieguo_CreateFcn(hObject,?eventdata,?handles)
% hObject ? handle to jieguo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
% ? ? ? See ISPC and COMPUTER.
if?ispc?&&?isequal(get(hObject,'BackgroundColor'),?get(0,'defaultUicontrolBackgroundColor'))
? ?set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in tuichu.
function?tuichu_Callback(hObject,?eventdata,?handles)
% hObject ? handle to tuichu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? structure with handles and user data (see GUIDATA)
close;

% --- Executes on button press in suanfa.
function?suanfa_Callback(hObject,?eventdata,?handles)
% hObject ? handle to suanfa (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles ? structure with handles and user data (see GUIDATA)
%global jiao1 jiao2 xiang1 xiang2 dui1 dui2 shang1 shang2
%G=sqrt(0.25*((jiao1-jiao2)*(jiao1-jiao2)+(dui1-dui2)*(dui1-dui2)+(xiang1-xiang2)*(xiang1-xiang2)+(shang1-shang2)*(shang1-shang2)));
%set(handles.jieguo,'string',num2str(G));
global?G
str1=['两组特征匹配成功,判定为同一工具'];
str2=['两组特征匹配失败,判定为不同工具'];
if?G<0.06
? ?set(handles.jieguo,'string',str1);
end
if?G>=0.06
? ?se(handles.jieguo,'string',str2);
end
?

3 仿真结果

4 参考文献

[1]赵海涛, 董介春, and 张屹. "基于灰度共生矩阵的自适应图像边缘检测." 微计算机信息 06Z(2006):3.

  人工智能 最新文章
2022吴恩达机器学习课程——第二课(神经网
第十五章 规则学习
FixMatch: Simplifying Semi-Supervised Le
数据挖掘Java——Kmeans算法的实现
大脑皮层的分割方法
【翻译】GPT-3是如何工作的
论文笔记:TEACHTEXT: CrossModal Generaliz
python从零学(六)
详解Python 3.x 导入(import)
【答读者问27】backtrader不支持最新版本的
上一篇文章      下一篇文章      查看所有文章
加:2021-11-11 12:42:26  更:2021-11-11 12:42:30 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/27 6:39:01-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码