资源简介
mathwork上的有关广义霍夫变换学习的代码,其中的输入变量需要自己更改。
代码片段和文件信息
function [score y x ] = Generalized_hough_transform(IsItm)
%Find template/shape Itm in greyscale image Is using generalize hough trasform
%Use generalized hough transform to find Template/shape binary image given in binary image Itm in grayscale image Is (greyscale image)
%Is is greyscale picture were the template Itm should be found
%Itm is bool edge image of the template with edges markedd ones
%Return the xy location cordniates which gave the best match
%Also return the score of each this point (number of point matching)
%The xy are the cordinates in image Is in which the the top left edge of image Itm (11) should be positioned in order to give the best match
%Is=imread(‘‘);
%Itm=imread(‘‘);
%if nargin<3 thresh=1;end;
%--------------------------create edge and system edge images------------------------------------------------------------------------------------------------------------------------
%Is=rgb2gray(Is);
Iedg=edge(Is‘canny‘); % Take canny edge images of Is with automatic threshold
%}
%--------------------------------------------------------------------------------------------------------------------------------------
[y x]=find(Itm>0); % find all yx cordinates of all points equal 1 inbinary template image Itm
nvs=size(x);% number of points in the template image
%-------------------Define Yc and Xc ----------------------------------------------
Cy=1;%round(mean(y));% find object y center note that any reference point will do so the origin of axis hence 1 could be used just as well
Cx=1;%round(mean(x));% find object z center note that any reference point will do so the origin of axis hence 1 could be used just as well
%------------------------------create gradient map of Itm distrobotion between zero to pi %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GradientMap = gradient_direction( Itm );
%%%%%%%%%%%%%%%%%%%%%%%Create an R-Table of Itm gradients to parameter space in parameter space.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%---------------------------create template descriptor array------------------------------------
MaxAngelsBins=30;% devide the angel space to MaxAngelsBins uniformed space bins
MaxPointsPerangel=nvs(1);% maximal amount of points corresponding to specific angel
PointCounter=zeros(MaxAngelsBins);% counter for the amount of edge points associate with each angel gradient
Rtable=zeros(MaxAngelsBinsMaxPointsPerangel2); % assume maximum of 100 points per angle with MaxAngelsBins angles bins between zero and pi and xy for the vector to the center of each point
% the third adimension are vector from the point to the center of the vessel
%------------------fill the angel bins with points in the Rtable---------------------------------------------------------
for f=1:1:nvs(1)
bin=round((GradientMap(y(f) x(f))/pi)*(MaxAngelsBins-1))+1; % transform from continues gradient angles to discrete angle bins and
PointCounter(bin)=PointCounter
- 上一篇:matlab轮廓匹配的物体识别系统
- 下一篇:乘同余法产生M序列的matlab源程序
相关资源
- 乘同余法产生M序列的matlab源程序
- matlab轮廓匹配的物体识别系统
- JPEG2000MATLAB代码
- matlab 图像离散余弦变换(源代码)
- 六自由度机器人避障问题的MATLAB仿真
- Matlab混沌工具箱
- 空间球拟合程序Matlab
- 信道估计的matlab仿真
- 基于matlab的数字图像处理论文
- 基于DTW语音识别matlab代码
- 质心定位算法MATLAB仿真
- 蚁群算法求解旅行商最优路径问题
- AR参数模型功率谱估计仿真程序
- MATLAB样例之雅克比迭代法
- 快速人脸定位matlab程序
- B样条弹性配准matlab
- bp算法 matlab实现 图像分类
- matlab2010b破解文件,lisensce,序列号
- matlab实现的粒子群动态寻路算法
- MATLAB写的scm信道程序
- 求图像边缘像素最短距离
- MATLAB 学生信息管理系统
- 一个简单的自适应控制matlab
- MATLAB实现人体识别
- Matlab特征向量归一化
- 直流电机滤波环节
- SRAD各向异性去噪实现图像平滑
- 2DPSK的matlab实现
- 电压骤降MATLAB仿真函数
- T-S模糊辨识与广义预测控制GPCMATLAB源
评论
共有 条评论