资源简介
用相位一致性理论对图像进行边缘检测,比canny,sobel等边缘检测算子效果更好,供学习。
代码片段和文件信息
% PHASECONG - Computes phase congruency on an image.
%
% Usage: [pc or ft] = phasecong(im)
%
% This function calculates the PC_2 measure of phase congruency.
% For maximum speed the input image should be square and have a
% size that is a power of 2 but the code will operate on images
% of arbitrary size.
%
%
% Returned values:
% pc - Phase congruency image (values between 0 and 1)
% or - Orientation image. Provides orientation in which
% local energy is a maximum in in degrees (0-180)
% angles positive anti-clockwise.
% ft - A complex valued image giving the weighted mean
% phase angle at every point in the image for the
% orientation having maximum energy. Use the
% function DISPFEAT to display this data.
%
% Parameters:
% im - A greyscale image to be processed.
%
% You can also specify numerous optional parameters. See the code to find
% out what they are. The convolutions are done via the FFT. Many of the
% parameters relate to the specification of the filters in the frequency
% plane. Default values for parameters are set within the file rather than
% being required as arguments because they rarely need to be changed - nor
% are they very critical. However you may want to experiment with
% specifying/editing the values of ‘nscales‘ and ‘noiseCompFactor‘.
%
% Note this phase congruency code is very computationally expensive and uses
% *lots* of memory.
%
%
% Example MATLAB session:
%
% >> im = imread(‘picci.tif‘);
% >> image(im); % Display the image
% >> [pc or ft] = phasecong(im);
% >> imagesc(pc) colormap(gray); % Display the phase congruency image
%
%
% To convert the phase congruency image to an edge map (with my usual parameters):
%
% >> nm = nonmaxsup(pc or 1.5); % Non-maxima suppression.
% The parameter 1.5 can result in edges more than 1 pixel wide but helps
% in picking up ‘broad‘ maxima.
% >> edgim = hysthresh(nm 0.4 0.2); % Hysteresis thresholding.
% >> edgeim = bwmorph(edgim‘skel‘Inf); % Skeletonize the edgemap to fix
% % the non-maximal suppression.
% >> imagesc(edgeim) colormap(gray);
%
%
% To display the different feature types present in your image use:
%
% >> dispfeat(ftedgim);
%
% With a small amount of editing the code can be modified to calculate
% a dimensionless measure of local symmetry in the image. The basis
% of this is that one looks for points in the image where the local
% phase is 90 or 270 degrees (the symmetric points in the cycle).
% Editing instructions are within the code.
%
% Notes on filter settings to obtain even coverage of the spectrum
% dthetaOnSigma 1.5
% sigmaOnf .85 mult 1.3
% sigmaOnf .75 mult 1.6 (bandwidth ~1 octave)
% sigmaOnf .65 mult 2.1
% sigmaOnf .55 mult 3 (ba
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-04-10 18:35 phasecong1\
文件 179920 2011-11-22 09:34 phasecong1\Baboon.jpg
文件 49206 2006-12-04 11:01 phasecong1\hua.bmp
文件 16644 2006-09-08 10:22 phasecong1\phasecong.m
文件 303 2012-03-19 16:58 phasecong1\phasecong_edge1.asv
文件 303 2012-03-19 16:58 phasecong1\phasecong_edge1.m
文件 5632 2007-03-19 19:17 phasecong1\Thumbs.db
文件 17464 2002-06-10 16:59 phasecong1\WORD.BMP
- 上一篇:十六进制解密10进制和16进制之间的加密解密
- 下一篇:计时器Verilog
评论
共有 条评论