Borrar filtros
Borrar filtros

lsqnonlin and rotation problem

1 visualización (últimos 30 días)
chaton
chaton el 13 de Ag. de 2012
Comentada: AD el 11 de Mayo de 2021
Hello,
i'm sorry for this basic question but i have some problems with lsqnonlin and image registration. I want to use lsqnonlin in order to find the rotation (just the rotation because it's a study case) whish has been applied to a reference image. I use direct registration method comparing the intensity of the two images (reference and rotated image).
basically the pseudo code looks like that:
% load reference image % apply a rotation to the reference image im2 = imrotate(imref,23,'bicubic','crop');
% roiCmp is the subarea of the reference image which is considered for comparing intensity beetween ref and im2 guessValue = [10]; [afrotation,resNorm,residual,exitFlag] = lsqnonlin(@fitRot, guessValue, [], [], options,imref,im2, roiCmp);
%% The function fitRot use imrotate to rotate im2: function err = fitRot(x0,ref,tar,roiCmp)
rTrg = imrotate(sTrg,x0(3),'bicubic','crop');
overallRes = abs(double(rTrg) - double(ref));
resTemp = abs(overallRes(roiComp(2):roiComp(2)+roiComp(4),roiComp(1):roiComp(1)+roiComp(3)));
res = resTemp(:);
end
When i run this algorithm, it obtain the same result as my initial guess. I have no warning or error message and their is 3 step of optimisations but no change ...
Any help will be appreciate. Thx all (i hope to be clear and again sorry for this basic question)
  1 comentario
AD
AD el 11 de Mayo de 2021
I have almost exactly the same problem

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by