|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
% ~- J9 f1 ?9 J/ D6 |一、简介" ]+ h S& f1 n. P1 a
% v" I. j* K0 a! @: J: @6 O
图像边缘检测是一种定位二维或三维图像(特别是医学图像)中的对象的边缘的系统。通过输入端(310)接收表示该图像的各元素值的数据元素集。该数据集被存储在存储装置(320)中。处理器(340)确定该图像中的对象的边缘。该处理器计算所述数据元素的至少一阶和/或二阶导数,并且计算该图像的等照度线曲率,所述曲率由κ标识。该处理器还确定校正因数α,该校正因数α对于由对象的曲率和/或所述数据的模糊造成的边缘错位进行校正。该校正因数α取决于所述等照度线曲率κ。然后,该处理器确定取决于所计算出的导数和所述等照度线曲率的算子的过零点。该系统的输出端(330)提供对于该图像中的边缘位置的指示。' ]+ e1 r. x2 E) W8 W! i3 W4 j
# v" z9 c. P2 q9 Q1 图像边缘检测的基本步骤+ E$ J, W) t% [9 r9 [5 R J
(1)滤波。边缘检测主要基于导数计算,但受噪声影响。但滤波器在降低噪声的同时也导致边缘强度的损失。
. w H2 i! [' k* t- N8 W8 R9 g(2)增强。增强算法将领域中灰度有显著变化的点突出显示。一般通过计算梯度幅值完成。
5 s& x6 f% J% D! y5 {(3)检测。但在有些图像中梯度幅值较大的并不是边缘点。
! U3 |/ M0 \4 `( r# C& f" h& @(4) 定位。精确确定边缘的位置。
; ~; ~! t( v$ a* F9 I# y
7 N6 S6 C- |3 \' Q8 Z# I2 边缘算法:sobel prewitt$ A- \! V! X- A/ V
进行了平滑处理,对噪声具有一定抑制能力,但容易出现多像素宽度。# x6 R( s8 A; N, K* D
$ K' y9 h: d* ?5 w9 X3 边缘算法:robert
8 n+ x" l4 F2 q! F- O9 j边缘定位精度较高,对于陡峭边缘且噪声低的图像效果较好,但没有进行平滑处理,没有抑制噪声的能力。% K. m8 k& w5 q y6 M6 ] ]: H
1 {1 B, Z! C- f+ S5 Y
5 S3 J* Q: G2 j1 a- a
二、源代码
* p/ W @2 U, ~$ K5 j* S6 G; B6 F( Q* g( ?- F8 }
- 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, X3 a/ j' G2 N( N
7 N( G6 r" T/ o" L6 {5 U5 z+ u: M
7 {9 D! U" Z; L7 e7 p6 D7 c8 P' v, I
三、运行结果
7 j, w% h5 P7 }
; C" M4 T$ g0 R* t. s* F
9 Y9 H1 R: p8 [# R' q Z1 S! A6 ^& N& u- j1 W, `
* U/ |: z9 U5 L* m# f' _4 W1 r" J D2 p; q
3 v: ]1 o. Y3 g/ X/ |6 P6 n
! g( U8 _& U+ `: a6 b5 B1 v9 X
) O: A( g, t% o+ x6 _
" J a$ Z% v$ H$ L, U
" C6 A& P9 c5 y0 d; ~2 t3 }
: }' S) p) r0 `: a% o2 W1 F1 v3 v! H
7 |0 x$ O3 `, S7 N' N- k4 ^ |
|