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

  • 大小: 2KB
    文件類型: .m
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-04
  • 語言: Matlab
  • 標簽:

資源簡介

經典的NCC匹配算法,精度較高,可以精確到亞像素級別

資源截圖

代碼片段和文件信息

function??[correlate_peakimg?peak_coordination]?=?Matchimg(?imgimg0)
%UNtitleD3?Summary?of?this?function?goes?here
%???Detailed?explanation?goes?here

%?img?:?origin?image
%?img0:?template?image
%?

%?tic;

%?img=imread(inputargs);
%?img0=imread(inputargs0);
%?%Convert?RGB?image?to?gray?image
%?
%?if?size(img3)?>?1
%?????????img?=?rgb2gray(img);
%?end
%?if?size(img03)?>?1
%?????????img0?=?rgb2gray(img0);
%?end

%?%?t1=isgray(img);
%?t2=isgray(img0);
%?if?~t1
%????img=rgb2gray(img);
%?end
%?if?~t2
%?????img0=rgb2gray(img0);
%?end

[M?N]=size(img);
[M0?N0]=size(img0);
new=rand(M-M0N-N0);
%?to?calculate?the?R‘s?average
img0=im2double(img0);
i=0;
j=0;
Ssum=0;
for?j=1:M0
????for?i=1:N0
????????SGrayVlue=img0(ji);
????????Ssum=Ssum+SGrayVlue;
????end
end
Saverage=Ssum/(N0*M0);
%?--**
%?NCCO
img=im2double(img);
MAX=0;
u=0;
v=0;
for?j=1:M-M0
????for?i=1:N-N0
????????cropimg=imcrop(img[i?j?N0-1?M0-1]);
????????%?to?calculate?the?S‘s?average
????????cropimg=im2double(cropimg);
????????Rsum=0;
????????for?j1=1:M0
????????????for?i1=1:N0
????????????????RGrayVlue=cropimg(j1i1);
????????????????Rsum=Rsum+RGrayVlue;
????????

評論

共有 條評論

相關資源