资源简介
1722zw_PhaseCorrelationRegistration.zip
代码片段和文件信息
function [diracSignal_2DtranslationVector_PixtranslationVector_SubpeakValue] = PhaseCorrelationRegistration(imageInput_PreimageInput_Cur)
% % This function estimates the (pixel and subpixel level) motion vector using the phase correlation method;
% % The frame which will be interpolated matches the first variable
% % Compare the size of two images
[row_Precol_Predimen_Pre] = size(imageInput_Pre);
% [row_Curcol_Curdimen_Cur] = size(imageInput_Cur);
% if (row_Pre~=row_Cur)|(col_Pre~=col_Cur)|(dimen_Pre~=dimen_Cur)
% error(‘The two images input should be of the same size!‘);
% return;
% end
% % Convert the RGB images to gray images
if dimen_Pre==3
gray_Pre = rgb2gray(imageInput_Pre);
gray_Cur = rgb2gray(imageInput_Cur);
elseif dimen_Pre==1
gray_Pre = imageInput_Pre;
gray_Cur = imageInput_Cur;
else
error(‘Not the proper image format!‘);
return;
end
% % To reduce the computational cost
%截取图象大小128*128
% gray_Pre = gray_Pre(51:178101:228);
% gray_Cur = gray_Cur(51:178101:228);
% row_Pre = 128;
% col_Pre = 128;
%下采样图象大小256*256
% for u=1:256
% for v=1:256
% gray_Pre1(uv) = gray_Pre(u*2v*2);
% gray_Cur1(uv) = gray_Cur(u*2v*2);
% end
% end
% gray_Pre = gray_Pre1;
% gray_Cur = gray_Cur1;
% row_Pre = 256;
% col_Pre = 256;
%chipping is end.
% % Fourier transform of the two images
spectrum_Pre = fft2(double(gray_Pre));
spectrum_Cur = fft2(double(gray_Cur));
% % Acquire the CPS(Cross Power Spectrum)
% CPS = ones(row_Precol_Pre);
CPS = spectrum_Cur./spectrum_Pre;
% Shift the spectrum centre so the (00) vector will be at (N/2N/2)
for u=1:row_Pre
for v=1:col_Pre
CPS(uv) = CPS(uv)*power(-1u+v); % MATLAB offers fftshift function
% % -----------------------------------------------------------------------
% Experiment of new method which is used to remove the content varying effect
% if abs(spectrum_Pre(uv))<50
% CPS(uv) = 0*CPS(uv);
% end
% % -----------------------------------------------------------------------
end
end
% % Inverse DFT of CPS to get the diracSignal_2D
diracSignal_2D = ifft2(CPS);
% % Acquire the peak value of 2D dirac signal and the pixel level translation vector
peakValue = diracSignal_2D(11);
translationVector_Pix = [1 1];
for u=1:row_Pre
for v=1:col_Pre
if diracSignal_2D(uv)>peakValue
translationVector_Pix = [u v];
peakValue = diracSignal_2D(uv);
end
end
end
% % Acquire the subpixel level traslation vector
% tv_Row = translationVector_Pix(1);
% tv_Col = translationVector_Pix(2);
% temp_Row = 0; % To record row neigbour peak value
% temp_Col = 0; % To record column neigbour peak value
% flag_Row = 1; % To record the direction of the row neigbour peak value
% flag_Col = 1; % To record the direction of the column neigbour pea
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4216 2019-01-15 21:36 \PhaseCorrelationRegistration.m
文件 36 2019-01-15 21:36 \no.txt
- 上一篇:zw_虚拟仪器1105.zip
- 下一篇:zw_ns-3网络仿真.zip
相关资源
- zw_ns-3网络仿真.zip
- zw_虚拟仪器1105.zip
- zw_text.zip
- zw_xutils-3.1.2-sources.zip
- zw_源程序.zip
- zw_STMicroelectronicsSTM32F4.zip
- zw_vhd2v.zip
- zw_multiwavelet.zip
- zw_CRC_test.zip
- zw_fullcalendar-1.6.1.zip
- zw_convert_envistandard_to_tiff.zip
- docker.dmg最新版百度网盘地址密码.tx
- 芒果云客户端v2.9-副本.exe
- EWSA7.01注册码.txt
- malloclab.zip
- MusicToolsv1.4.exe
- 新建文件夹(3).rar
- 汉字模板库.zip
- JCD_Highlighting.unitypackage
- ShuiBoWen.unitypackage
- 51实验程序库.zip
- 迷宫小车代码.c
- 超星尔雅小助手答题版本.exe
- Facedetectionfacerecognitiondataset.txt
- 1.2北理工成电东南.pdf
- A2012MCMProblems.pdf
- 2020美赛专用模板-替换成控制号.zip
- testdata.txt
- 集码客户端.rar
- AltiumDesigner19软件安装与破解详细图文
评论
共有 条评论