필터 지우기
필터 지우기

lsqnonlin and rotation problem

조회 수: 2 (최근 30일)
chaton
chaton 2012년 8월 13일
댓글: AD 2021년 5월 11일
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
AD
AD 2021년 5월 11일
I have almost exactly the same problem

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by