Homographic image transformation issue for sattelite images

半世苍凉 提交于 2019-12-11 01:33:21

问题


I want to apply homography to the satellite images. I found this post quite helpful. So I decided to use the same Matlab code.

 im = imread('cameraman.tif');
 n = [0;0;-1];
 d = Inf

       theta = 60*pi/180;

       R = [ 1     0           0 ;
           0  cos(theta) -sin(theta);
           0  sin(theta)  cos(theta)];

       t = [0;0;0];

      K=[300 0    0;
            0    300 0;
            0    0    1];

      H=K*R/K-1/d*K*t*n'*K;

     img=imagehomog(im,H','c');
     figure;imshow(img)

but the output is just the small box. I am using MATLAB 2015b

EDIT Homography using imtransform and maketform

n = [0;0;-1];
d = Inf;

im = imread('cameraman.tif');

   theta = 60*pi/180;

   R = [ 1     0           0 ;
       0  cos(theta) -sin(theta);
       0  sin(theta)  cos(theta)];

   t = [0;0;0];

  K=[300 0    0;
        0    300 0;
        0    0    1];

  H=K*R/K-1/d*K*t*n'*K;

  tform = maketform('projective',H');
  imT = imtransform(im,tform);

  imshow(imT)

Output

How can I do it from the center. Something like this

来源:https://stackoverflow.com/questions/42264563/homographic-image-transformation-issue-for-sattelite-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!