Matlab axis position camera

2 次查看(过去 30 天)
Umberto Fontana
Umberto Fontana 2017-7-20
Hi, I have a problem in axis position in perspective vision of the camera. I don't understand where it place the axis origin. Could someone help me? Thank you
  2 个评论
Jan
Jan 2017-7-20
What is your question? Please post some code which demonstrates your problem? Otherwise it would be required to rephrase the complete documentation of camorbit, zoom, axes, axis, camdolly, campan, camroll, camzoom, etc. Better spend the time to explain your specific problem.
Umberto Fontana
Umberto Fontana 2017-7-20
编辑:Umberto Fontana 2017-7-20
thank you for your answer. I will try to explain better. 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 ceneter it by acting on axis position, but i don't understand where matlab places axis origin.

请先登录,再进行评论。

回答(1 个)

Will Nitsch
Will Nitsch 2017-7-27
You can find some useful diagrams/information on camera properties here: https://www.mathworks.com/help/matlab/visualize/low-level-camera-properties.html
The origin in MATLAB is at 0,0,0. So if you want to calculate new camera positions for something like rotating around the center of your data, your math that does so should include an offset for x, y and z that account for the position of the center of the data. This point is also the camera target.

类别

Help CenterFile Exchange 中查找有关 Camera Views 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by