필터 지우기
필터 지우기

Translation info from imregtform?

조회 수: 5 (최근 30일)
Claire
Claire 2014년 2월 20일
댓글: Claire 2014년 2월 21일
I am trying to register two images using a rigid transformation. When I use imregister and then imshowpair, the moving image is properly rotated and translated. It appears be restricted to the same dimensions as the fixed image to achieve the appropriate translation.
When I use imregtform to obtain the transformation matrix and then apply the transformation to the moving image using imwarp(moving, tform), the warped image is appropriately rotated. However,the warped image hasn't been restricted to the same size as the fixed image, so the warped and fixed images appear misaligned in XY (as if the warped image hasn't been translated).
Is there a way to recover this translation information from imregtform and appropriately crop or pad the warped image so that it is the same size as the fixed image? I ultimately want to apply the same transformation to a lot of images and have them be the same size.
I have tried preemptively padding the fixed image so that it will always be larger than the warped image; this did not solve the issue.
Thanks!
  댓글 수: 1
Anand
Anand 2014년 2월 20일
Pictures (and code) speak a thousand words...

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

채택된 답변

Alex Taylor
Alex Taylor 2014년 2월 21일
What you want is to use the 'OutputView' Name-value pair of imwarp with a value equal to the spatial referencing of the fixed image.
Take a look at the examples in the documentation for imregtform.
  댓글 수: 1
Claire
Claire 2014년 2월 21일
Thanks! This worked perfectly.

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by