91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 13KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-13
  • 語言: Matlab
  • 標簽: SSD??NCC??匹配??matlab??

資源簡介

計算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

評論

共有 條評論