Matlab Fit Geo Trans

7 views (last 30 days)
Noah Noah
Noah Noah on 9 Mar 2022
Commented: Noah Noah on 9 Mar 2022
I am projecting a rotated image into its desired position by using fitgeotrans with its fixedpoints and moving points using the projective attribute.
I have found that this works - however the background image sometimes come into the picture and messes up my binary mask.
Would it be possible to fit geotrans and only display the image in its rotated form?
t = fitgeotrans(MovingPoints,FixedPoints,"projective")
transform = imwarp(targetImg,t);
My image has this black corner which i'm guessing is coming from the background image that it has been projected onto. I wish to simply rotate the image and display it rotated. :)

Accepted Answer

Benjamin Thompson
Benjamin Thompson on 9 Mar 2022
imwarp accepts an argument 'FillValues' if you want to specify some other intensity or color. Depending on the nature of the transformation you get from fitgeotrans, some parts of the output image may be undefined and so they need some color to assign.
Also look at the 'OutputView' argument which gives you more control over which part of the output image is provided as output from imwarp.
  1 Comment
Noah Noah
Noah Noah on 9 Mar 2022
Thank you! I have Filled Values with all white and I guess it's more accepted form than before.
Thank you

Sign in to comment.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!