Axis Position in perspective vision

1 view (last 30 days)
Umberto Fontana
Umberto Fontana on 21 Jul 2017
Edited: Rena Berman on 30 Jul 2019
I want to simulate a camera which points to the center of a grid of known measures, so i specify the camera features. This is the code:
% code
pos_cam_z = 4450;
fig = figure;
imshow(imIn);
[altezza,larghezza] = size(im);
axis on;
ax=gca;
ax.Units = 'pixel';
ax.Projection = 'perspective';
ax.CameraViewAngle = Vfov;
ax.CameraUpVector = [0 -1 0]';
ax.DataAspectRatio = [1 1 1];
ax.CameraTarget = [larghezza/2 altezza/2 0];
ax.CameraPosition = [(larghezza/2) altezza/2 pos_cam_z];
My problem is that the representation of the scene is not centered. I want to center it by acting on axis position, but i don't understand where matlab places axis origin.

Answers (0)

Community Treasure Hunt

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

Start Hunting!