Matlab 卫星图像的单应图像变换问题
我想对卫星图像应用单应性。我觉得这很有帮助。所以我决定使用相同的Matlab代码Matlab 卫星图像的单应图像变换问题,matlab,transformation,homography,projective-geometry,Matlab,Transformation,Homography,Projective Geometry,我想对卫星图像应用单应性。我觉得这很有帮助。所以我决定使用相同的Matlab代码 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
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)
但输出只是一个小盒子。
我正在使用Matlab2015b
编辑
使用imtransform
和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)
输出
我怎样才能从中心做到这一点。像这样的
该代码没有运行,它充满了bug
ImageHolog
不是MATLAB函数,它不是MATLAB函数。我使用了帖子中提到的代码。如果是完全错误,那么他是如何在答案中显示输出的?我不知道,因为您的for
循环没有end
,因此MATLAB无法运行该代码。你能把imagehomog
的文档链接起来吗?很抱歉,我已经更正了该代码,该for
不应该在那里。以下是imagehomg
的示例。完整的哦,所以它不是MATLAB内部的函数。我建议你看看它给你带来的多种可能性。我不能用你在网上随机找到的代码发表评论。