|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
4 b9 u2 M; C$ a9 q
一、简介
- P3 Y! Q' U1 D# ], f
" ?( o% \) |/ O2 M* a; @图像边缘检测是一种定位二维或三维图像(特别是医学图像)中的对象的边缘的系统。通过输入端(310)接收表示该图像的各元素值的数据元素集。该数据集被存储在存储装置(320)中。处理器(340)确定该图像中的对象的边缘。该处理器计算所述数据元素的至少一阶和/或二阶导数,并且计算该图像的等照度线曲率,所述曲率由κ标识。该处理器还确定校正因数α,该校正因数α对于由对象的曲率和/或所述数据的模糊造成的边缘错位进行校正。该校正因数α取决于所述等照度线曲率κ。然后,该处理器确定取决于所计算出的导数和所述等照度线曲率的算子的过零点。该系统的输出端(330)提供对于该图像中的边缘位置的指示。/ `0 T# {! K P& e0 k/ X: ^3 z
+ |, i# x0 d, f
1 图像边缘检测的基本步骤
4 M( S! S. [0 C7 n(1)滤波。边缘检测主要基于导数计算,但受噪声影响。但滤波器在降低噪声的同时也导致边缘强度的损失。, a' E6 G4 w- ?6 D
(2)增强。增强算法将领域中灰度有显著变化的点突出显示。一般通过计算梯度幅值完成。
7 ?- P% Q4 ~5 C- T1 l8 |1 a. ?, @(3)检测。但在有些图像中梯度幅值较大的并不是边缘点。 u1 b" J- X6 n1 K0 ^$ I2 b
(4) 定位。精确确定边缘的位置。$ e; u: Q( D( B" r& n+ n% C
+ R; n; @4 B; \2 边缘算法:sobel prewitt3 Z: A$ E6 g( n% m. J, z
进行了平滑处理,对噪声具有一定抑制能力,但容易出现多像素宽度。
6 g4 d) W9 X. O% Y
+ c2 B4 Z" L4 _$ T5 A$ \3 边缘算法:robert
+ J$ c) L) P- Q5 [边缘定位精度较高,对于陡峭边缘且噪声低的图像效果较好,但没有进行平滑处理,没有抑制噪声的能力。
+ U& d. O. s' t; Z) g8 h
% _0 S" T9 D' E' i( D& h& s6 W& q) P' ~9 Y; S: R a# s z
二、源代码
7 I$ m- |( {' z6 a" C2 l, C$ g
- T0 j' G0 F+ |- 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
' E! Y; I- A \) q
( L$ J! \5 P$ x9 i8 k2 A- Q! W& _! ?6 D% z( C5 s
4 N# d* D. h) L$ |* @" a( U: \& n5 @
三、运行结果
& n0 d- T3 p* p8 K( n0 h6 k9 Y+ H) @, g4 }4 Z
$ r3 e" E' ]* k7 o9 K
" a3 ? e- c, S! |( ^6 s1 y
2 J. r; W# s% \! v+ B& W6 f
" X- Y3 l, v8 W
6 [ U; a, }. |; [' b4 u) {
: a0 \4 D$ S# h. _# \
" |1 M7 S8 D5 G1 d" \0 J" m/ G# U9 t2 [" `% m$ H
: ?: X+ ^9 ?' O, Y2 L, k& O
) i9 W# \) a `7 j+ ?" S; F/ j" V. [; s1 C( @% s" m
|
|