www.gusucode.com > 个用于图像标定的算法matlab源码程序 > code16/lk20_common/sd_images_weight.m

    function VI_dW_dp = sd_images_weight(dW_dp, nabla_Ix, nabla_Iy, weight, N_p, h, w)
% SD_IMAGES_WEIGHT - Compute weighted steepest descent images
%   VI_DW_DP = SD_IMAGES(DW_DP, NABLA_IX, NABLA_IY, WEIGHT, N_P, H, W)

% Iain Matthews, Ralph Gross
% Carnegie Mellon University, Pittsburgh

if nargin<7 error('Not enough input arguments'); end

for p=1:N_p		
  Tx = nabla_Ix .* dW_dp(1:h,((p-1)*w)+1:((p-1)*w)+w);
  Ty = nabla_Iy .* dW_dp(h+1:end,((p-1)*w)+1:((p-1)*w)+w);
  VI_dW_dp(:,((p-1)*w)+1:((p-1)*w)+w) = weight.*(Tx + Ty);
end