资源简介
计算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
相关资源
- Matlab实现基于相关的模板匹配程序
- 基于harris算法的角点检测matlab原代码
- 图像匹配matlab源程序sift算法
- 基于MATLAB的图像特征点匹配和筛选
- matlab模板匹配车牌识别
- 直线匹配程序
- 基于matlab的坐标变换程序,通过坐标
- 使用matlab实现ICP点云匹配
- 基于蚁群算法和神经网络匹配算法的
- 基于matlab+模板匹配的车牌识别程序
- 基于matlab的模板匹配与车牌识别
- matlab实现sift算法匹配
- 基于角点检测的图像匹配
-
基于Simuli
nk的匹配滤波器设计 - SAD模板匹配算法matlab实现
- Census及Hamming距离三维立体重建Matlab程
- SIFT特征匹配 MATLAB 实现
- matlab 基于HOG特征值模板匹配的汉字识
- 最佳接收机的实现与仿真,matlab仿真
- 人脸识别及匹配的matlab实现
- 运动估计快速算法(TSSDS)matlab
- Matlab图像匹配
- matlab指纹匹配
- 基于乘积量化的快速特征匹配
- 直线匹配程序MATLAB.zip
- 基于蚁群算法和神经网络匹配算法的
- 基于模板匹配的人脸检测实现-MATLAB
- MATLAB 程序 实现图像拼接,自动匹配特
- matlab中关于三维重建的源代码,《计
- 基于模板匹配的人脸检测-教程-matla
评论
共有 条评论