Filter löschen
Filter löschen

lsqnonlin and rotation problem

1 Ansicht (letzte 30 Tage)
chaton
chaton am 13 Aug. 2012
Kommentiert: AD am 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 Kommentar
AD
AD am 11 Mai 2021
I have almost exactly the same problem

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by