(question)The coordinates of the reconstructed 3D points are different after the virtual camera intrinsic K has also changed proportionally after image resize?
Ältere Kommentare anzeigen
As far as I know, after image resize, the corresponding intrinsic parameter K also changes proportionally, but why the coordinates of the 3D reconstruction of the same point are not the same?
The following program is a simple experiment, the original image size is 1080*1920, after resize it becomes 480*640, the intrinsic parameter K1 corresponds to the original image, the intrinsic parameter K2 corresponds to the resize, RT1, RT2 are the extrinsic projection matrix of the camera (should remain unchanged?,[R,T],3*4 size), why is there a difference in the reconstructed 3D points?
%% 验证图像resize后,内参是否成比例缩放的正确性,使用重建3D点来建立
fx = 1040;
fy = 1040;
cx = 1920/2;
cy = 1080/2;
K1 = [fx,0,cx;
0,fy,cy;
0,0,1];
RT1 = [eye(3),[4;5;6]];% just random set
RT2 = [rotz(30),[40;50;60]];% just random set
p1 = K1*RT1;% extrinsic projection matrix
p2 = K1*RT2;% extrinsic projection matrix
pt1 = [100,200];
pt2 = [300,400];
point3d1 = triangulate(pt1, pt2, p1,p2)
% resize 3D construct test,from (1080,1920)to (480,640)
rx = 640/1920;
ry = 480/1080;
fx = fx*rx;
fy = fy*ry;
cx = cx*rx;
cy = cy*ry;
K2 = [fx,0,cx;
0,fy,cy;
0,0,1];
p1 = K2*RT1;
p2 = K2*RT2;
pt1 = [pt1(1)*rx,pt1(2)*ry];
pt2 = [pt2(1)*rx,pt2(2)*ry];
point3d2 = triangulate(pt1, pt2, p1,p2)
you see, point3d1 and point3d2 is not same,why?
your answer would be greatly appreciate!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!