资源简介
计算机视觉Harris角点检测算法, 利用matlab实现,简单易懂。
代码片段和文件信息
img = imresize3(imread(‘pic.png‘) [1000 1000 3]);
corn_thresh = 0.18;
interactive = 1;
% function [locscornerness] = detHarrisCorners(img corn_thresh interactive)
%% parse the parameters
if(~exist(‘corn_thresh‘‘var‘))
corn_thresh = 0.01;
end
if(~exist(‘interactive‘‘var‘))
interactive = 0;
end
if(size(img3)>1)
img = rgb2gray(img);
end
%%
[nrnc] = size(img);
%Filter for horizontal and vertical direction
fx = [1 0 -1];
fy = [1; 0; -1];
% Convolution of image with dx and dy
Ix = conv2(img fx ‘same‘);
Iy = conv2(img fy ‘same‘);
if(interactive)
figure(1); % imagesc 对图像进行缩放后显示
subplot(121); imagesc(Ix); axis equal image off; colormap(‘gray‘); title(‘Ix‘);
subplot(122); imagesc(Iy); axis equal image off; colormap(‘gray‘); title(‘Iy‘);
cdata = print(‘-RGBImage‘);
%imwrite(cdata fullfile(‘corner‘ [name ‘-grad.png‘]));
imwrite(cdata ‘/Users/liziniu/Downloads/计算机视觉与模式识别/角点检测/affine_transform/corner/grad.png‘);
end
%% Raw Hessian Matrix
% Hessian Matrix Ixx Iyy Ixy
Ixx = Ix.*Ix;
Ixy = Ix.*Iy;
Iyy = Iy.*Iy;
if(interactive)
figure(2); title(‘Before Smoothing‘);
subplot(221); imagesc(Ixx); axis equal image off; colormap(‘gray‘); title(‘Ixx‘);
subplot(222); imagesc(Ixy); axis equal image off; colormap(‘gray‘); title(‘Ixy‘);
subplot(223); imagesc(Ixy); axis equal image off; colormap(‘gray‘); title(‘Ixy‘);
subplot(224); imagesc(Iyy); axis equal image off; colormap(‘gray‘); title(‘Ixy‘);
cdata = print(‘-RGBImage‘);
%imwrite(cdata fullfile(‘corner‘ [name ‘-rawHessian.png‘]));
imwrite(cdata ‘/Users/liziniu/Downloads/计算机视觉与模式识别/角点检测/affine_transform/corner/rawHessian.png‘);
end
%% Gaussian filter definition (https://en.wikipedia.org/wiki/Canny_edge_detector)
G = [2 4 5 4 2; 4 9 12 9 4;5 12 15 12 5;4 9 12 9 4;2 4 5 4 2];
G = 1/159.* G;
% Convolution with Gaussian filter
Ixx = conv2(Ixx G ‘same‘);
Ixy = conv2(Ixy G ‘same‘);
Iyy = conv2(Iyy G ‘same‘);
if(interactive)
figure(3); title(‘After Smoothing‘);
subplot(221); imagesc(Ixx); axis equal image off; colormap(‘gray‘); title(‘Ixx‘);
subplot(222); imagesc(Ixy); axis equal image off; colormap(‘gray‘); title(‘Ixy‘);
subplot(223); imagesc(Ixy); axis equal image off; colormap(‘gray‘); title(‘Ixy‘);
subplot(224); imagesc(Iyy); axis equal image off; colormap(‘gray‘); title(‘Iyy‘);
cdata = print(‘-RGBImage‘);
%imwrite(cdata fullfile(‘corner‘ [name ‘-smoothHessi
- 上一篇:最大似然法_监督分类_遥感影像
- 下一篇:RPCA图像去噪算法
相关资源
- harris角点检测并精确到亚像素级
- 基于MATLAB的Harris角点检测并精确到亚
- 亚像素harris角点检测
- harris角点检测代码
- harris特征点提取,matlab
- Harris角点检测拼接包含ransac灰度图像
- 利用matlab实现图像的角点检测
- 基于harris角点特征的图像配准程序M
- harris分块提取特征点(matlab)
- Harris算子 Matlab源代码 直接可以运行
- 基于harris角点特征提取的matlab图像拼
- MATLAB实现Harris角点检测与图像配准
- harris角点提取以及影像配准
- docs
- Harris.rar 特征提取是图像配准的重要步
- pinjie 本文用用Harris算子提取特征点
- RANSAC-match 可以在harris角点检测和ncc粗
- harris2807740
- 0301 图像配准和拼接
- match_version_1.3 该程序主要功能是实现
- imageMosaic 基于Harris角点检测的图像拼
- harris-ncc-ransac 本代码主要是harris角点
- harris-match harris角点检测
- Harris
- Forstner算子和Harris算子的matlab代码
- harris角点检测 matlab版本
- MATLAB实现HARRIS算法
评论
共有 条评论