Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 2016-08-04 13:53:12 -0600

Nbb gravatar image

Viz initialize camera position

When I run my program, the camera starts off far off from the scene with its translation and rotation parameters wrong (second figure). I have to do a lot of dragging and scrolling before I get it to a decent but still wrong position and viewing angle (third figure). I would like the camera to be initialized and viewing the 3D scene just like in the 2D image in the first figure.

I could try functions such as http://docs.opencv.org/2.4/modules/viz/doc/viz3d.html#viz-viz3d-setviewerpose but I would need the parameters which I don't know. Would it be the origin ?

image description image description image description

Viz initialize camera position

How do I initialize the camera such that the scene in 3D is viewed like the image in 2D ?

When I run my program, the camera starts off far off from the scene with its translation and rotation parameters wrong (second figure). I have to do a lot of dragging and scrolling before I get it to a decent but still wrong position and viewing angle (third figure). I would like the camera to be initialized and viewing the 3D scene just like in the 2D image in the first figure.

I could try functions such as http://docs.opencv.org/2.4/modules/viz/doc/viz3d.html#viz-viz3d-setviewerpose but I would need the parameters which I don't know. Would it be the origin ?

image description image description image description

Viz initialize camera position

How do I initialize the camera such that the scene in 3D is viewed like the image in 2D ?

When I run my program, the camera starts off far off from the scene with its translation and rotation parameters wrong (second figure). scene. I have to do a lot of dragging and scrolling before I get it to a decent but still wrong position and viewing angle (third figure). angle. I would like the camera to be initialized and viewing view the 3D scene just like in the 2D image in the first figure.

image descriptionEDIT: I am able to get something decent by initializing the camera at the origin with the focal length extracted from stereorectify. I still had to drag the camera back a little just to be able to visualize things.

image description image description
Vec3d cam_pos(0, 0, 0), cam_focal_point(3155.774902, -1965.979706, 24912.193125), cam_y_dir(0.0f, 1.0f, 0.0f);
Affine3f cam_pose = viz::makeCameraPose(cam_pos, cam_focal_point, cam_y_dir);
myWindow.setViewerPose(cam_pose);

I'm still hoping someone can suggest how I can initialize the camera such that the scene is viewed just like the image

image description image description