|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
' c& Y( F& V& j6 L! a% P一、简介
3 u' l' r% y$ {
$ Z$ a5 [! \; F5 ?! w$ g/ P; n% w3 w图像边缘检测是一种定位二维或三维图像(特别是医学图像)中的对象的边缘的系统。通过输入端(310)接收表示该图像的各元素值的数据元素集。该数据集被存储在存储装置(320)中。处理器(340)确定该图像中的对象的边缘。该处理器计算所述数据元素的至少一阶和/或二阶导数,并且计算该图像的等照度线曲率,所述曲率由κ标识。该处理器还确定校正因数α,该校正因数α对于由对象的曲率和/或所述数据的模糊造成的边缘错位进行校正。该校正因数α取决于所述等照度线曲率κ。然后,该处理器确定取决于所计算出的导数和所述等照度线曲率的算子的过零点。该系统的输出端(330)提供对于该图像中的边缘位置的指示。' R& T' M, N% z) e
0 Y% ?' Q$ t: s5 w
1 图像边缘检测的基本步骤4 K/ q$ W- O! q% b, u n& U, g4 N8 h7 v
(1)滤波。边缘检测主要基于导数计算,但受噪声影响。但滤波器在降低噪声的同时也导致边缘强度的损失。. b8 O6 u0 W& _$ N, G7 t% x
(2)增强。增强算法将领域中灰度有显著变化的点突出显示。一般通过计算梯度幅值完成。( X- c! Q/ w( a( ?. L( h
(3)检测。但在有些图像中梯度幅值较大的并不是边缘点。
9 \' W: ?4 l, h' w0 N+ y- V) G1 q(4) 定位。精确确定边缘的位置。
( _7 ^4 o% a, ], q: k* t% [+ E$ J- P2 t! k5 k3 e: o
2 边缘算法:sobel prewitt' q3 E0 L, w( l1 J' h( m h
进行了平滑处理,对噪声具有一定抑制能力,但容易出现多像素宽度。$ I! U) Z, H# L/ \- b- L) o
j2 w( P( X6 ^9 H, `+ v3 边缘算法:robert
- A! V+ m" `* P- V" j边缘定位精度较高,对于陡峭边缘且噪声低的图像效果较好,但没有进行平滑处理,没有抑制噪声的能力。' L8 i5 N+ ?5 f: G i7 { C
1 j+ @' `( f2 \$ R4 p! G5 \
& j8 F; I$ Y" ~1 F" O/ b7 M二、源代码; V5 C+ M/ C' o
7 A" E. |# _% D$ W* C' i
- 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 EDIT/ c5 n# S9 A. A2 i3 {" G% }0 T ^8 W
* P; R# h* [ H0 I. ~! V! _) e1 R
! T" |1 d+ f' ]5 s7 t5 s) E, }0 U* K( Y) F2 Z& N6 \% e! [$ t7 B# Y4 z
三、运行结果4 z% X0 b: e. Q: x, r
, u" y4 `5 w K5 I8 l
: G3 j" L, |- e* M, e; c8 ?
3 p4 G2 N. K! F2 c
& j$ g* j; f3 o) z! `# V. L' B7 w, [$ f
4 N/ K ?4 R" _
* R) p( v" q5 `' @% W
f2 ^8 L/ Q0 k% @1 T
4 n/ V, C ?' J
# m' l0 S1 h7 |3 w- ?" W; m
6 u Z) z% d7 d) p0 f! o) I; Z& Y! c$ R7 U& }
: ?( o$ k9 k8 F) o
|
|