Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualization tool #16

Closed
ngoductuanlhp opened this issue Mar 21, 2022 · 9 comments
Closed

Visualization tool #16

ngoductuanlhp opened this issue Mar 21, 2022 · 9 comments

Comments

@ngoductuanlhp
Copy link

Hi @anhquancao , your .gif demo is very interesting. Could you share the script to generate this demo?

Thank you very much.

@anhquancao
Copy link
Collaborator

Hi @ngoductuanlhp, to generate the demo, I first generate each frame with the same viewpoint, then use the video editor e.g. davinci resolve tool to assemble the frames into a video.

@ngoductuanlhp
Copy link
Author

Do you have any tricks to fix the viewpoint when using mayavi tool?

@anhquancao
Copy link
Collaborator

You can take a look at the following codes:
[1] https://github.com/anhquancao/SSC2d-[2] visualize/blob/6b07bdb310cd24c48c08c2fa5cac8c98bccee512/lib/helper_kitti.py#L12
https://github.com/anhquancao/SSC2d-visualize/blob/master/kitti_vis_pred.py#L94

To generate the code to change the camera viewpoint as in [1], you need to follow the following tutorial:
https://docs.enthought.com/mayavi/mayavi/application.html#recording-mayavi-actions-to-a-script

@ngoductuanlhp
Copy link
Author

Thanks a lot. Now I can get the same camera viewpoint in different frames.

@kebijuelun
Copy link

[1] https://github.com/anhquancao/SSC2d-[2] visualize/blob/6b07bdb310cd24c48c08c2fa5cac8c98bccee512/lib/helper_kitti.py#L12
https://github.com/anhquancao/SSC2d-visualize/blob/master/kitti_vis_pred.py#L94

Thanks for the wonderful work, these links failed to open, could you please udpate the links?

best

@anhquancao
Copy link
Collaborator

I make the repo public

@kebijuelun
Copy link

[1] https://github.com/anhquancao/SSC2d-[2] visualize/blob/6b07bdb310cd24c48c08c2fa5cac8c98bccee512/lib/helper_kitti.py#L12
https://github.com/anhquancao/SSC2d-visualize/blob/master/kitti_vis_pred.py#L94

Thanks for the wonderful work, these links failed to open, could you please udpate the links?

best

I have found out the way to use generated scripts, such like:

from mayavi.api import Engine
engine = Engine()
engine.start()
scene = engine.scenes[0]
    scene.scene.camera.position = [-60.58825795977401, 21.157014981545093, 50.718208823185556]
    scene.scene.camera.focal_point = [26.360000076238066, 25.800000071525574, 1.9100000262260437]
    scene.scene.camera.view_angle = 30.0
    scene.scene.camera.view_up = [0.490062445498992, -0.015325179458712417, 0.8715526021911161]
    scene.scene.camera.clipping_range = [49.30213893945163, 161.93546276257854]
    scene.scene.camera.compute_view_plane_normal()
    scene.scene.render()

@anhquancao
Copy link
Collaborator

You can also check my post here
https://anhquancao.github.io/blog/2022/how-to-define-viewpoint-programmatically-in-mayavi/

@kebijuelun
Copy link

You can also check my post here https://anhquancao.github.io/blog/2022/how-to-define-viewpoint-programmatically-in-mayavi/

Many thanks, I have solved the visualization problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants