资源简介
图像处理,霍夫圆边缘检测,MATLAB,霍夫变换
代码片段和文件信息
function [y0detectx0detectAccumulator] = houghcircle(Imbinaryrthreshnumpeaks)
%HOUGHCIRCLE - detects circles with specific radius in a binary image.
%
%Comments:
% Function uses Standard Hough Transform to detect circles in a binary image.
% According to the Hough Transform for circles each pixel in image space
% corresponds to a circle in Hough space and vise versa.
% upper left corner of image is the origin of coordinate system.
%
%Usage: [y0detectx0detectAccumulator] = houghcircle(Imbinaryrthresh)
%
%Arguments:
% Imbinary - a binary image. image pixels that have value equal to 1 are
% interested pixels for HOUGHLINE function.
% r - radius of circles.
% thresh - a threshold value that determines the minimum number of
% pixels that belong to a circle in image space. threshold must be
% bigger than or equal to 4(default).
%
%Returns:
% y0detect - row coordinates of detected circles.
% x0detect - column coordinates of detected circles.
% Accumulator - the accumulator array in Hough space.
%
%Written by :
% Amin Sarafraz
% Photogrammetry & Computer Vision Devision
% Geomatics DepartmentFaculty of Engineering
% University of TehranIran
% sarafraz@geomatics.ut.ac.ir
%
%May 52004 - Original version
%November 242004 - Modified versionfaster and better performance
if nargin == 2
thresh = 4;
numpeaks=1;
elseif nargin == 3
numpeaks=1;
end
if thresh < 4
error(‘treshold value must be bigger or equal to 4‘);
return
end
%Voting
Accumulator = zeros(size(Imbinary));
[yIndex xIndex] = find(Imbinary);
for cnt = 1:length(xIndex)
low=xIndex(cnt)-r;
high=xIndex(cnt)+r;
if (low<1) low=1; end
if (high>size(Imbinary2)) high=size(Imbinary2); end
for x0 = low:high
y01 = yIndex(cnt)-sqrt(r^2-(xIndex(cnt)-x0)^2);
y02 = yIndex(cnt)+sqrt(r^2-(xIndex(cnt)-x0)^2);
y01 = round(y01); y02 = round(y02);
if y01 < size(Imbinary1) & y01 >= 1
Accumulator(y01x0) = Accumulator(y01x0)+1;
end
if y02 < size(Imbinary1) & y02 >= 1
Accumulator(y02x0) = Accumulator(y02x0)+1;
end
end
end
% Finding local maxima in Accumulator
Accumulatortemp = Accumulator - thresh;
% [Potential_y0 Potential_x0]=find(Accumulatortemp<0);
% Accumulatortemp(Potential_y0Potential_x0)=0;
[y0detect x0detect hnew] = houghpeaks_circle(Accumulatortempnumpeaks);
% y0detect = []; x0detect = [];
% AccumulatorbinaryMax = imregionalmax(Accumulator);
% [Potential_y0 Potential_x0] = find(AccumulatorbinaryMax == 1);
% Accumulatortemp = Accumulator - thresh;
% for cnt = 1:length(Potential_y0)
% if Accumulatortemp(Potential_y0(cnt)Potential_x0(cnt)) >= 0
% y0detect = [y0detect;Potential_y0(cnt)];
% x0detect = [x0dete
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3044 2010-01-08 21:54 霍夫圆变换\houghcircle.m
文件 2718 2010-01-08 19:18 霍夫圆变换\houghpeaks_circle.m
文件 3182 2010-01-09 21:44 霍夫圆变换\hough_circle_feed.m
目录 0 2010-05-04 22:37 霍夫圆变换
----------- --------- ---------- ----- ----
8944 4
- 上一篇:matlab BP神经网络 0-9数字识别
- 下一篇:arnold变换源代码
相关资源
- 数字图像处理作业canny边缘检测坎尼边
- 基于品质因数的边缘检测算子性能优
- 基于matlab的模糊边缘检测
- 边缘检测+hough直线检测
- 基于MATLAB-GUI图形界面的数字图像处理
- Canny边缘检测Matlab代码
- GVFSnake(matlab)边缘检测和图像分割
- 基于数字图像处理对蔬菜叶面积的测
- 基于MATLAB的图像边缘检测算法的仿真
- 形态学边缘检测
- 图像处理-边缘检测和特征提取MATLAB源
- 指纹识别数字图像处理+模式识别+机器
- edges-master
- 论文研究-基于MATLAB的数字图像边缘检
- 基于Matlab的几种常用边缘检测算子的
- 亚像素边缘检测的matlab代码,比一般
- matlab图像边缘检测GUI
- matlab 车牌边缘检测
- 基于matlab的八个方向sobel图像边缘检测
- matlab实验显示RGB分量图像,边缘检测
- MATLAB 对SAR 图像做二值分割 边缘检测
- MATLAB缺陷检测系统
- 小波边缘检测源程序代码-小波边缘检
- Matlab边缘检测和区域生长图像分割算
- Matlab Sobel/prewitt边缘检测
- 基于小波变换模极大的多尺度图像边
- 基于神经网络的边缘检测GUI
- 边缘检测的matlab实现代码
- 梯度和边缘检测算法提取图像边缘
- 基于cnn的灰度图像边缘检测
评论
共有 条评论