can anyone solve the following error, that comes in the below given code lines in the code of SolveHomo, in the image mosaic.

4 visualizaciones (últimos 30 días)
The following error occurred converting from struct to double:
Error using double
Conversion to double from struct is not possible.
program code lines:
n = size(pts1,2);
A = zeros(2*n,9);
A(1:2:2*n,1:2) = pts1';
A(1:2:2*n,3) = 1;
A(2:2:2*n,4:5) = pts1';
A(2:2:2*n,6) = 1;
  5 comentarios
Rochan Patel
Rochan Patel el 3 de Oct. de 2013
Editada: Walter Roberson el 3 de Oct. de 2013
function H = solveHomo(pts1,pts2)
% H is 3*3, H*[pts1(:,i);1] ~ [pts2(:,i);1], H(3,3) = 1
% the solving method see "projective-Seitz-UWCSE.ppt"
n = size(pts1,2);
A = zeros(2*n,9);
A(1:2:2*n,1:2) = pts1';
A(1:2:2*n,3) = 1;
A(2:2:2*n,4:5) = pts1';
A(2:2:2*n,6) = 1;
x1 = pts1(1,:)';
y1 = pts1(2,:)';
x2 = pts2(1,:)';
y2 = pts2(2,:)';
A(1:2:2*n,7) = -x2.*x1;
A(2:2:2*n,7) = -y2.*x1;
A(1:2:2*n,8) = -x2.*y1;
A(2:2:2*n,8) = -y2.*y1;
A(1:2:2*n,9) = -x2;
A(2:2:2*n,9) = -y2;
[evec,~] = eig(A'*A);
H = reshape(evec(:,1),[3,3])';
H = H/H(end); % make H(3,3) = 1
end

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Dates and Time en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by