matlab练习程序(Harris角点检测)
来源:互联网 发布:86西游记高清源码下载 编辑:程序博客网 时间:2024/05/24 03:21
转自:http://www.cnblogs.com/tiandsp/archive/2012/04/09/2439678.html
close all;clear all;clc;img=imread('rice.png');imshow(img);[m n]=size(img);tmp=zeros(m+2,n+2);tmp(2:m+1,2:n+1)=img;Ix=zeros(m+2,n+2);Iy=zeros(m+2,n+2);E=zeros(m+2,n+2);Ix(:,2:n)=tmp(:,3:n+1)-tmp(:,1:n-1);Iy(2:m,:)=tmp(3:m+1,:)-tmp(1:m-1,:);Ix2=Ix(2:m+1,2:n+1).^2;Iy2=Iy(2:m+1,2:n+1).^2;Ixy=Ix(2:m+1,2:n+1).*Iy(2:m+1,2:n+1);h=fspecial('gaussian',[7 7],2);Ix2=filter2(h,Ix2);Iy2=filter2(h,Iy2);Ixy=filter2(h,Ixy);Rmax=0;R=zeros(m,n);for i=1:m for j=1:n M=[Ix2(i,j) Ixy(i,j);Ixy(i,j) Iy2(i,j)]; R(i,j)=det(M)-0.06*(trace(M))^2; if R(i,j)>Rmax Rmax=R(i,j); end endendre=zeros(m+2,n+2);tmp(2:m+1,2:n+1)=R;img_re=zeros(m+2,n+2);img_re(2:m+1,2:n+1)=img;for i=2:m+1 for j=2:n+1 if tmp(i,j)>0.01*Rmax &&... tmp(i,j)>tmp(i-1,j-1) && tmp(i,j)>tmp(i-1,j) && tmp(i,j)>tmp(i-1,j+1) &&... tmp(i,j)>tmp(i,j-1) && tmp(i,j)>tmp(i,j+1) &&... tmp(i,j)>tmp(i+1,j-1) && tmp(i,j)>tmp(i+1,j) && tmp(i,j)>tmp(i+1,j+1) img_re(i,j)=255; end endendfigure,imshow(mat2gray(img_re(2:m+1,2:n+1)));
图片福利:
0 0
- matlab练习程序(Harris角点检测)
- MatLab角点检测(harris经典程序)
- MatLab角点检测(harris经典程序)
- Harris角点检测及matlab程序
- Harris角点检测算法优化(有matlab源代码)
- Harris角点检测算法优化(有matlab源代码)
- Harris、SUSAN角点检测Matlab源代码
- 【算法】Harris角点算法matlab程序
- Harris 角点检测
- Harris角点检测
- Harris角点检测
- Harris角点检测
- Harris角点检测
- harris角点检测
- Harris角点检测
- Harris角点检测
- Harris角点检测
- Harris角点检测
- 应用服务器和WEB服务器的区别
- 高效学习法--之SQ4R学习法和相关思维导图
- 【cocos2d-x】 Box2d的使用----弹球小例子
- java 注解的几大作用及使用方法详解
- JavaScript Prototype in Plain Language
- matlab练习程序(Harris角点检测)
- EasyUI得到实心父节点的值
- make: *** 没有规则可以创建“obj/local/armeabi//CCConfiguration.o”需要的目标“/Users/wanglei/andon.cpp”。 停止。
- jquery取得元素集的val值
- 工具
- Hive中的RCFile
- input text控件的onkeydown、onKeyPress、onkeyup事件的区别
- libsvm在vc下的使用
- Class类--反射