Effacer les filtres
Effacer les filtres

lsqnonlin and rotation problem

1 vue (au cours des 30 derniers jours)
chaton
chaton le 13 Août 2012
Commenté : AD le 11 Mai 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 commentaire
AD
AD le 11 Mai 2021
I have almost exactly the same problem

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Geometric Transformation and Image Registration dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by