|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
% r4 m2 f) k" `" ^3 r1 v一、简介
) p; m4 r+ |. ]7 ?5 m/ s" z5 g; ]! M' L0 k: ]% I
图像边缘检测是一种定位二维或三维图像(特别是医学图像)中的对象的边缘的系统。通过输入端(310)接收表示该图像的各元素值的数据元素集。该数据集被存储在存储装置(320)中。处理器(340)确定该图像中的对象的边缘。该处理器计算所述数据元素的至少一阶和/或二阶导数,并且计算该图像的等照度线曲率,所述曲率由κ标识。该处理器还确定校正因数α,该校正因数α对于由对象的曲率和/或所述数据的模糊造成的边缘错位进行校正。该校正因数α取决于所述等照度线曲率κ。然后,该处理器确定取决于所计算出的导数和所述等照度线曲率的算子的过零点。该系统的输出端(330)提供对于该图像中的边缘位置的指示。3 A' ]% \1 e' D# v0 e
0 T8 J& t' [# m6 {
1 图像边缘检测的基本步骤
/ z' E" A! J( C1 }5 [0 w/ {3 y(1)滤波。边缘检测主要基于导数计算,但受噪声影响。但滤波器在降低噪声的同时也导致边缘强度的损失。
7 r3 j' f, E6 ~1 ?5 C( w(2)增强。增强算法将领域中灰度有显著变化的点突出显示。一般通过计算梯度幅值完成。8 x0 p5 R% r7 ?5 N p2 w5 w& |
(3)检测。但在有些图像中梯度幅值较大的并不是边缘点。
# l2 w+ H. }5 j* N8 a(4) 定位。精确确定边缘的位置。
4 O5 g; p$ @; T. l+ W' w/ l% L$ V, G2 F/ L1 e3 A- ?* d2 \
2 边缘算法:sobel prewitt: {) \' g$ x9 k8 |7 z$ ]/ P" T
进行了平滑处理,对噪声具有一定抑制能力,但容易出现多像素宽度。' Y8 [* U9 k8 e% u2 o/ @
; y) r; c5 D" Y3 边缘算法:robert% @4 d7 s2 r; z O, P
边缘定位精度较高,对于陡峭边缘且噪声低的图像效果较好,但没有进行平滑处理,没有抑制噪声的能力。
+ p2 h2 }# Y8 f# i5 v' \ V1 w/ H ?4 K! q3 d: c2 t: B4 p
& U9 F& j m5 b! r二、源代码. _2 y( V5 k/ k- J& G7 t# p
0 U( a5 j ?- h+ {+ l# j- 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, B# G2 u9 }& h
+ ~7 ]5 p# H' k' a# ]! J' o X
}) u+ i& N' M; x& E
, j1 \! O2 n5 \' \3 q% g9 x4 d三、运行结果' J4 a2 m4 m# T }+ y
) P7 S) k7 k, M @- `$ _% w3 F0 T
" D8 T# U8 S" B2 m- t( H$ x1 n& g
: Y+ |; N# @8 S, X8 r9 ?
' r6 w+ u3 Q8 U+ F7 O; I- `
. k! Y; `; o4 Q" Z
$ J$ D8 w" n7 Z2 O$ |* Y
& C( g3 O( Q) V1 T0 A7 l; X! l
+ `7 G. W3 B$ l) ?8 r
, o1 B5 s6 U$ n& ] R
2 L* M) X, ^, W8 ^4 d4 M5 n" s% q5 z t! q7 a4 S% k `( v
|
|