Matlab image centre, 3D points to pixel coordinates

Working on a code to simulate image triangulation i've found some troubles on how 3D points are mapped into 2D images in Matlab, so i wrote an easy example code to find out:
plot3(0,0,0,'marker','x');
set(gca, 'CameraPosition', [2 0 0],...
'PlotBoxAspectRatio',[1 1 1],...
'CameraTarget', [0,0,0],...
'CameraUpVector', [0,0,1],...
'DataAspectRatio', [1,1,1],...
'CameraViewAngle', 50);
axis on;
grid on;
print -dpng -r100 test_img;
Since the camera has been moved only on X axis and it is pointing the axes origin i'm expecting the image centre to be [400 300], but it is not.
Why is the point [0 0 0] projected into [415 290]?
This is happening even with generic rotations and translations (image centre always at [415 290]) but that's not what i can read on computer vision books (as Zisserman for example) so i guess Matlab is taking something else into account when mapping 3D points into 2D.
Can anyone help me with that please?

답변 (0개)

카테고리

도움말 센터File Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

질문:

2014년 2월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by