Converts the gradient in essential matrix E to the gradient in X. function egrad = essential_egradE2egrad(X, egradE) egradE is the function handle for the gradient in E. The output is a matrix in the space of X. See also: essential_costE2cost essential_ehessE2ehess
0001 function egrad = essential_egradE2egrad(X, egradE) 0002 % Converts the gradient in essential matrix E to the gradient in X. 0003 % 0004 % function egrad = essential_egradE2egrad(X, egradE) 0005 % 0006 % egradE is the function handle for the gradient in E. 0007 % 0008 % The output is a matrix in the space of X. 0009 % 0010 % See also: essential_costE2cost essential_ehessE2ehess 0011 0012 0013 % This file is part of Manopt: www.manopt.org. 0014 % Original author: Roberto Tron, Aug. 8, 2014 0015 % Contributors: Bamdev Mishra, May 22, 2015. 0016 0017 e3hat = [0 -1 0; 1 0 0; 0 0 0]; 0018 RA = X(:,1:3,:); 0019 RB = X(:,4:6,:); 0020 E = multiprod(multiprod(multitransp(RA), e3hat), RB); 0021 G = egradE(E); 0022 0023 %The following is the vectorized version of egrad = e3hat*[RB*G' -RA*G]; 0024 egrad = multiprod(e3hat, cat(2,... 0025 multiprod(RB, multitransp(G)),... 0026 -multiprod(RA, G))); 0027 end 0028