资源简介
zw_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-03-09 20:48 \PhaseCorrelationRegistration.m
文件 36 2019-03-09 20:48 \no.txt
相关资源
- zw_linux0.11带注解源代码.zip
- zw_上海交通大学《计算机网络》动画
- zw_麻省理工学院公开课:计算机科学
- zw_PlistView.zip
- zw_INGPS.zip
- BaiDu.exe
- 41695044Array-antenna-simulation.zip
- DaemonTool_10.6.0.283.rar
- CAD点坐标获取小工具.exe
- 2016年城市POI数据.rar
- zw_with-ReadWrite.zip
- zw_MOEA-NSGA-II.zip
- 878732zw_源程序.zip
- zw_贪吃蛇游戏毕业论文地址.zip
- zw_STM32定时器捕获PWM波以及占空比.z
- zw_cadence16.6地址.zip
- zw_修改文件备注.zip
- zw_(proteus仿真图程序).zip
- zw_chap03美食资讯网站.zip
- zw_20170208101916191.zip
- zw_20161127133641125.zip
- zw_packing.zip
- 2-1.rar
- zw_2048-master.zip
- zw_TomGpsTest.zip
- zw_300门IT开发类免费课程分享.zip
- zw_UsbHidTest.zip
- zw_MCGS与S7200实现红绿灯.zip
- zw_MyEducateSystem2.zip
- zw_大型软件项目投标书范文.zip
评论
共有 条评论