WIll imtransform shift the center?

조회 수: 8 (최근 30일)
Marco Yu
Marco Yu 2016년 7월 30일
댓글: Image Analyst 2016년 8월 1일
Hi, I am trying to rotate the image by using imtransform. However I realise that it is different to imrotate as I cant define the center. I believe that by using the imtransform will shift the image center. Is there a way that I can define the center point for transformation or I better to use imrotate instead? Sorry for asking stupid question.
  댓글 수: 1
Marco Yu
Marco Yu 2016년 8월 1일
편집: Marco Yu 2016년 8월 1일
to make this clear, I have a image which size 200x200, then I want to change it to 300x300 because I don't want information loss as I will rotate the image. therefore, the image center changed from 100,100 to 150,150(theoretically). Then I would apply imtransform to the 300x300 image, is there a way that I can transform the image from the origin(0,0) to somewhere I define? The reason of I need to use imtransform is because I have a TForm, as a result I think by using imtransform/imwrap would be the best way to handle the image. I am not sure whether I am right or not.

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

채택된 답변

Image Analyst
Image Analyst 2016년 7월 30일
Don't use imtransform to shift the center. Use imtranslate() instead.
  댓글 수: 2
Marco Yu
Marco Yu 2016년 8월 1일
편집: Marco Yu 2016년 8월 1일
thank you for helping. But this is not what I want sorry :( I am trying to transform the image i.e resize and rotate. However I think by using imtransform will rotate the image from point (0,0) is there a way that I can define the rotation point instead?
Image Analyst
Image Analyst 2016년 8월 1일
Use the 'loose' option of imrotate. It will enlarge the canvass enough to contain the image. It will not clip corners off as they rotate out of the original matrix.

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by