资源简介
计算SSD 与NCC用于匹配 完整matlab程序及图片
计算SSD 与NCC用于匹配 完整matlab程序及图片
计算SSD 与NCC用于匹配 完整matlab程序及图片
代码片段和文件信息
function [I_SSDI_NCCIdata]=template_matching(TIIdataIn)
% TEMPLATE_MATCHING is a cpu efficient function which calculates matching
% score images between template and an (color) 2D or 3D image.
% It calculates:
% - The sum of squared difference (SSD Block Matching) robust template
% matching.
% - The normalized cross correlation (NCC) independent of illumination
% only dependent on texture
% The user can combine the two images to get template matching which
% works robust with his application.
% Both measures are implemented using FFT based correlation.
%
% [I_SSDI_NCCIdata]=template_matching(TIIdata)
%
% inputs
% T : Image Template can be grayscale or color 2D or 3D.
% I : Color image can be grayscale or color 2D or 3D.
% (optional)
% Idata : Storage of temporary variables from the image I to allow
% faster search for multiple templates in the same image.
%
% outputs
% I_SSD: The sum of squared difference 2D/3D image. The SSD sign is
% reversed and normalized to range [0 1]
% I_NCC: The normalized cross correlation 2D/3D image. The values
% range between 0 and 1
% Idata : Storage of temporary variables from the image I to allow
% faster search for multiple templates in the same image.
%
% Example 2D
% % Find maximum response
% I = im2double(imread(‘lena.jpg‘));
% % Template of Eye Lena
% T=I(124:140124:140:);
% % Calculate SSD and NCC between Template and Image
% [I_SSDI_NCC]=template_matching(TI);
% % Find maximum correspondence in I_SDD image
% [xy]=find(I_SSD==max(I_SSD(:)));
% % Show result
% figure
% subplot(221) imshow(I); hold on; plot(yx‘r*‘); title(‘Result‘)
% subplot(222) imshow(T); title(‘The eye template‘);
% subplot(223) imshow(I_SSD); title(‘SSD Matching‘);
% subplot(224) imshow(I_NCC); title(‘Normalized-CC‘);
%
% Example 3D
% % Make some random data
% I=rand(506050);
% % Get a small volume as template
% T=I(20:3020:3020:30);
% % Calculate SDD between template and image
% I_SSD=template_matching(TI);
% % Find maximum correspondence
% [xyz]=ind2sub(size(I_SSD)find(I_SSD==max(I_SSD(:))));
% disp(x);
% disp(y);
% disp(z);
%
% Function is written by D.Kroon University of Twente (February 2011)
if(nargin<3) IdataIn=[]; end
% Convert images to double
T=double(T); I=double(I);
if(size(T3)==3)
% Color Image detected
[I_SSDI_NCCIdata]=template_matching_color(TIIdataIn);
else
% Grayscale image or 3D volume
[I_SSDI_NCCIdata]=template_matching_gray(TIIdataIn);
end
function [I_SSDI_NCCIdata]=template_matching_color(TIIdataIn)
if(isempty(IdataIn)) IdataIn.r=[]; IdataIn.g=[]; IdataIn.b=[]; end
% Splite color image and do template matching on RG and B image
[I_SSD_RI_NCC_RIdata.r]=template_matching_gray(T(::1)I(::1)IdataIn.r);
[I_SSD_GI_NCC_GIdata.g]=t
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 10757 2011-02-22 16:07 lena.jpg
文件 1335 2011-02-22 11:05 license.txt
文件 5910 2011-02-22 16:48 template_matching.m
- 上一篇:最大类间方差阈值matlab程序
- 下一篇:MATLAB GUI 图片open
相关资源
- 利用时域有限差分FDTD仿真三维3D电磁
- 无刷直流电机控制brushlessDCmotor
- 压缩感知稀疏度自适应匹配追踪算法
- 单枝节阻抗匹配的Matlab实现
- 双枝节阻抗匹配的Matlab实现
- 双目立体视觉匹配程序
- MATLAB图像匹配
- 一个模板匹配算法的MATLAB程序
- Matlab实现的HHT中的波形匹配延拓
- 基于相关系数的影像匹配matlab
- SSDA算法基于MATLAB
- LSB匹配隐写代码
- 线性FM波形的匹配滤波Matlab实现
- SAM_SSD.m
- matlab实现图像模板匹配
- matlab基于SAD的区域立体匹配方法
- RANSAC去除误匹配算法
- NCC匹配算法
- matlab实现的基于颜色直方图的特征匹
-
OQPSK的Matlab_Simuli
nk调制解调仿真系统 - MATLAB基于肤色模型和模板匹配的人脸
- 最小二乘影像匹配程序matlab
- 多目标模板匹配
- matlab对两张彩色图进行直方图匹配并
- 多路径匹配追踪广度优先MMP_BFMATLAB代
- 压缩感知 贪婪追踪算法成功率的比较
- NCC图像匹配源码matlab
- matlab中ICP点云匹配算法
- Matlab图像处理模板匹配完整程序小飞
- 基于特征匹配和RANSAC的三维点云拼接
评论
共有 条评论