加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
polynomial_correlation.m 799 Bytes
一键复制 编辑 原始数据 按行查看 历史
dongqiaqia 提交于 2017-06-20 20:00 . fisrt commit
function kf = polynomial_correlation(xf, yf, a, b)
%POLYNOMIAL_CORRELATION Polynomial Kernel at all shifts, i.e. kernel correlation.
% Evaluates a polynomial kernel with constant A and exponent B, for all
% relative shifts between input images XF and YF, which must both be MxN.
% They must also be periodic (ie., pre-processed with a cosine window).
% The result is an MxN map of responses.
%
% Inputs and output are all in the Fourier domain.
%
% Joao F. Henriques, 2014
% http://www.isr.uc.pt/~henriques/
%cross-correlation term in Fourier domain
xyf = xf .* conj(yf);
xy = sum(real(ifft2(xyf)), 3); %to spatial domain
%calculate polynomial response for all positions, then go back to the
%Fourier domain
kf = fft2((xy / numel(xf) + a) .^ b);
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化