资源简介
基于轮廓提取的多边形近似匹配算法 matlaB编的
代码片段和文件信息
%script FILE FOR CONTOUR FOLLOWING IN A BINARY IMAGE
%AUTHOR : RAJJAN SINGH THAKUR (VIT UNIVERSITY)
%DATE :14/2/09
function [cntcnt2area1area2]= mobanpipei()
% for(i=1:100)
% for(j=1:100)
%
% a(ij)=0;
% end
% end
% c=roipoly(a);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 图像轮廓提取 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%a=imread(‘000.bmp‘);
%%c=im2bw(rgb2gray(a)254/255);
%imshow(c);
%%t=0;
%s=input(‘press l to select row from left and r to select row from right \n enter the alphabet within single quote \n press enter after each result to continue‘);
%switch(s)
%case ‘l‘
%%for(i=1:size(c1));
%% for(j=1:size(c2));
%%if(c(ij)==0)
%% t=t+1;
%% col2(t:)=[ij];
%% break;
%% end
%% end
%%end
%case ‘r‘
% for(i=1:size(c1));
% for(j=size(c2):-1:1);
% if(c(ij)==1)
% t=t+1;
% col2(t:)=[ij];
% break;
% end
% end
% end
%otherwise
% []
%end
%FUNCTION TO COMPUTE THE CONTOUR IN BINARY IMAGE
%%[k1mn]=contour_b_trial_2(ccol2(11)col2(12));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 图像轮廓提取 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 多边形近似 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%k=im2bw(k10);
k=openpic();
h=boundaries(k4‘cw‘);
h=h{1};
[M1N1]=size(k);
xmin=min(h(:1));
ymin=min(h(:2));
bim=bound2im(hM1N1xminymin);
[xy]=minperpoly(k3);
b2=connectpoly(xy);
B2=bound2im(b2M1N1xminymin);
B3=zeros(size(B21)size(B22));
for i=1:size(B21)
for j=1:size(B22)
if B2(ij)==0
B3(ij)=0;
end
if B2(ij)==1
B3(ij)=255;
end
end
end
B3=mat2gray(B3);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 多边形近似 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Harris角点检测 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[coutmarked_imgcd] = cpda(B3);
%%ori_im2=B3;
%%fx = [5 0 -5;8 0 -8;5 0 -5]; % % la gaucienne,ver axe x
%%Ix = filter2(fxori_im2); % la convolution vers axe x
%%fy = [5 8 5;0 0 0;-5 -8 -5]; % la gaucienne,ver axe y
%%Iy = filter2(fyori_im2); % la convolution vers axe y
%%Ix2 = Ix.^2;
%%Iy2 = Iy.^2;
%%Ixy = Ix.*Iy;
%%clear Ix;
%%clear Iy;
%%h= fspecial(‘gaussian‘[3 3]2); % générer une fonction gaussienne,sigma=2
%%Ix2 = filter2(hIx2)
- 上一篇:基于matlab代码实现的SVPWM程序
- 下一篇:采样频率绘制matlab代码
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论