2

My question is, after applying an image transformation such as

    T =  [1,  0,  0;
          0,  1,  0;
         -5, -5,  1];

My initial image of 128x128 becomes 123x123. Is there a way I can keep the intial dimension of the image?

Here is how I am applying my transformation:

     Reg = imtransform(B, Tform,...
       'XData', [1 (size(B, 2)+Translation(3, 1))],...
       'YData', [1 (size(B, 1)+Translation(3, 2))],...
       'FillValues', 255);

Thanks!

4

1 回答 1

3

Thanks @jucestain, by adding the

    +Translation(3,1) ...

portion, I was adding -5 to the initial dimension of 128!

I simply changed the code to

    Reg = imtransform(B, Tform,...
       'XData', [1 (size(B, 2))],...
       'YData', [1 (size(B, 1))],...
       'FillValues', 255);
于 2013-03-31T15:30:01.877 回答