|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
$ \; P$ ]% U# m5 L: a
一、简介- s& G" S) G6 ?
1 u) F1 x! K) @7 `3 q图像边缘检测是一种定位二维或三维图像(特别是医学图像)中的对象的边缘的系统。通过输入端(310)接收表示该图像的各元素值的数据元素集。该数据集被存储在存储装置(320)中。处理器(340)确定该图像中的对象的边缘。该处理器计算所述数据元素的至少一阶和/或二阶导数,并且计算该图像的等照度线曲率,所述曲率由κ标识。该处理器还确定校正因数α,该校正因数α对于由对象的曲率和/或所述数据的模糊造成的边缘错位进行校正。该校正因数α取决于所述等照度线曲率κ。然后,该处理器确定取决于所计算出的导数和所述等照度线曲率的算子的过零点。该系统的输出端(330)提供对于该图像中的边缘位置的指示。
7 \. K$ c5 X4 z4 t* A. a/ V, L( Q! z7 @4 r4 a
1 图像边缘检测的基本步骤
4 G7 _, a) T) v. M: H: ^5 r3 k(1)滤波。边缘检测主要基于导数计算,但受噪声影响。但滤波器在降低噪声的同时也导致边缘强度的损失。
- P7 c3 c0 _! Y3 G( x7 K(2)增强。增强算法将领域中灰度有显著变化的点突出显示。一般通过计算梯度幅值完成。+ F/ @+ f; m& D2 l- Q& V) {0 X5 I
(3)检测。但在有些图像中梯度幅值较大的并不是边缘点。1 m" A X7 _, @, J Q! {
(4) 定位。精确确定边缘的位置。
% w& `6 j' v. o. l: q, Y! q- L- w- T7 y3 R
2 边缘算法:sobel prewitt
5 r3 R7 @: K4 a$ u6 E5 |进行了平滑处理,对噪声具有一定抑制能力,但容易出现多像素宽度。
0 y6 T9 S% u" K2 T5 X" f
3 ]. e ~+ v h+ F/ J3 ]9 F3 边缘算法:robert! m' k" M( J2 X
边缘定位精度较高,对于陡峭边缘且噪声低的图像效果较好,但没有进行平滑处理,没有抑制噪声的能力。) Y) u" Z/ X9 f
' K7 U; V" J2 B4 R4 h7 d; X* u
6 Q: }0 w, C- t! w二、源代码6 Y( T" f" @6 G7 S+ }9 C! x/ t4 ]
, Z% ?) h- ~# V1 v2 T
- function varargout = aaa(varargin)
- % AAA MATLAB code for aaa.fig
- % AAA, by itself, creates a new AAA or raises the existing
- % singleton*.
- %
- % H = AAA returns the handle to a new AAA or the handle to
- % the existing singleton*.
- %
- % AAA('CALLBACK',hObject,eventData,handles,...) calls the local
- % function named CALLBACK in AAA.M with the given input arguments.
- %
- % AAA('Property','Value',...) creates a new AAA or raises the
- % existing singleton*. Starting from the left, property value pairs are
- % applied to the GUI before aaa_OpeningFcn gets called. An
- % unrecognized property name or invalid value makes property application
- % stop. All inputs are passed to aaa_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
- % Edit the above text to modify the response to help aaa
- % Last Modified by GUIDE v2.5 10-Jul-2016 21:47:39
- % Begin initialization code - DO NOT EDIT
- gui_Singleton = 1;
- gui_State = struct('gui_Name', mfilename, ...
- 'gui_Singleton', gui_Singleton, ...
- 'gui_OpeningFcn', @aaa_OpeningFcn, ...
- 'gui_OutputFcn', @aaa_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 EDIT0 J6 p+ T# K' [$ B$ C, w
5 R% S% a( m! s6 l5 C# z5 L* v, b
) ?( |! W: Q8 J% X$ i3 {( ~7 X9 F& ^5 W- X
三、运行结果7 x; z" T8 t7 R G4 Z3 y
( w$ d5 K$ v k6 n, F
( W# p7 i j- b% a# q
2 ^( A$ H. y! A+ R! d
: ^7 M4 _, ~- ~1 ]
( C, l) L/ ?' n
4 X' I4 Q% U4 X5 m P6 ]5 C
+ n# ?/ D! n! ]
' P5 Y8 W* h- k. L4 ?+ M
+ g$ \5 _6 M8 y( q; \
4 w8 C$ y2 u- u" q; x* V R! Y8 D% j4 [( @) T! [
/ f, a4 \ w) m7 _
|
|