资源简介
hough变换检测多个圆的matlab程序。就是对内存要求大点
代码片段和文件信息
function [Accumulator xdim ydim] = houghcircle2(Imbinaryr)
% Fast implementation of Circular HOUGH-Transform
%
% parameters:
% Imbinary ... a binary image (after applying an edge-detection algorithm)
% r ... the radius of circle to detect within the image
% Accumulator ... result of the HOUGH-Transform - an image where all circles are accumulated
% the image is 2*r larger than the input image
% xdim ydim ... dimensions of the Accumulator image
xdim = size(Imbinary 2) + ceil(2*r);
ydim = size(Imbinary 1) + ceil(2*r);
[circle_x circle_y] = circle(r r r);
[edge_y edge_x] = find(Imbinary);
clear Imbinary;
circlepoints = length(circle_x);
edgepoints = length(edge_x);
points = zeros((circlepoints*edgepoints)1);
pos = 1;
points = (ones(size(edge_x))*round(circle_x) + round(edge_x)*ones(size(circle_x))) * ydim + ...
(ones(size(edge_y))*round(circle_y) + round(edge_y)*ones(size(circle_y)));
clear circle_x;
clear circle_y;
clear edge_x;
clear edge_y;
points = reshape(points 1 (size(points1) * size(points2)));
Accumulator = histc(points (0:1:(max(points(:)))));
clear points;
Accumulator(1) = 0; % delete counts from zeros
if (length(Accumulator) < (xdim*ydim))
Accumulator = [Accumulator zeros(1 (xdim*ydim)-length(Accumulator))];
end;
Accumulator = reshape(Accumulator(1:(xdim*ydim)) ydim xdim);
function [xy] = circle(center_x center_y radius)
% returns a vector with all circle-corner points containing the correct number of points
numpoints = ceil(2*radius*pi);
theta = linspace(02*pi numpoints);
rho = ones(1numpoints) * radius;
[xy] = pol2cart(theta rho);
x = x+center_x;
y = y+center_y;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1711 2004-11-18 23:22 houghcircle2.m
相关资源
- 高等电力网络节点导纳矩阵LDU分解M
- 多层感知器解决异或问题MATLAB代码
- 基于MATLAB的光学干涉仿真
- 机器学习——逻辑回归logistic实现二分
- matlab Q-learning 无障碍路径规划仿真
- 产生2FSK信号的matlab程序
- 猫捉老鼠动画演示程序
- Matlab多层感知器解决异或分类问题
- 质心算法 matlab实现代码
- LMS算法 matlab编程
- matlab前推回代 潮流计算
- 改进的PSO的matlab源程序
- HOG特征matlab代码实现
- Ransac算法Matlab
- 三次样条插值函数的构造与Matlab实现
- 信噪比matlab代码
- 二维DOA估计中的ROOTMUSIC算法
- 基于多尺度块的LBP(MB-LBP)代码(m
- gabor滤波器的matlab源代码
- MATLAB下扩展卡尔曼滤波的S函数实现
- 边界链码差分链码matlab
- 车型识别算法-matlab
- 字符识别matlab程序
- 基于Matlab的GPS卫星仿真器设计
- 三维重建 网格交叉点的提取 MATLAB程序
- JPEG2000代码_matlab
- 任意发送天线,任意接收天线的STBC
- matlab识别英文字母程序 附带图像处理
- 二维码识别 matlab代码 内
- MIMO通信系统matlab实现
评论
共有 条评论