赞
踩
资源简介:
MATLAB程序下载——一基于MATLAB的灰度投影算法仿真与分析。
if nargin == 2
range = 7;
flag = 0;
end
[m n] = size(imRef);
% vertical projection
refPv = sum(imRef);
curPv = sum(imCur);
% horizontal projection
refPh = sum(imRef');
curPh = sum(imCur');
% alculate MAD
for i=0:2*range
Pv_sum(i+1) = sum(abs(refPv(range+1:end-range) - curPv(i+1:end-2*range+i)));
Ph_sum(i+1) = sum(abs(refPh(range+1:end-range) - curPh(i+1:end-2*range+i)));
end
[vmin a] = min(Pv_sum);
[hmin b] = min(Ph_sum);
dc = a-range-1;
dr = b-range-1;
if flag == 1
% sub-pixel
% 抛物线插值法
if a>1&b>1
dc_sub = (Pv_sum(a-1)-Pv_sum(a+1))/(Pv_sum(a-1)+Pv_sum(a+1)-2*Pv_sum(a))/2.0;
dr_sub = (Ph_sum(b-1)-Ph_sum(b+1))/(Ph_sum(b-1)+Ph_sum(b+1)-2*Ph_sum(b))/2.0;
% sub-pixel 精度的位移矢量
else
dc_sub = 0;
dr_sub = 0;
end;
dc = dc + dc_sub;
dr = dr + dr_sub;
end
output = [dr dc];
资源下载:
解压密码均为:QQ1224848052
-------------------------------------------------------------------------------------
FPGA嵌入式代做,ZYNQ代做,APAC代做
QQ:1224848052
联系:highspeedlogic
QQ :1224848052
微信:HuangL1121
邮箱:1224848052@qq.com
微信扫一扫:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。