资源简介
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
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
评论
共有 条评论