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

request text for display in visualization with python #1157

Closed
yzl96 opened this issue Sep 4, 2019 · 13 comments
Closed

request text for display in visualization with python #1157

yzl96 opened this issue Sep 4, 2019 · 13 comments

Comments

@yzl96
Copy link

yzl96 commented Sep 4, 2019

Hi, I want to display text in visualization.
the solution I can get is two: 1.set position (x,y,z), and use a function to display the text in the position. 2. because I want to display text in bounding box, so just add a parameter(text) to open3d.geometry.LineSet().

@yzl96 yzl96 changed the title request text for display in visualization request text for display in visualization with python Sep 4, 2019
@syncle
Copy link
Contributor

syncle commented Oct 5, 2019

Sorry, @yzl96. This request has not been addressed for a long time. We are considering large update on the visualization module to provide the requested feature.

@hcoohb
Copy link

hcoohb commented Jan 19, 2020

Definitely a wanted feature by many of us!

Duplicate of #2 ?

@syncle
Copy link
Contributor

syncle commented Feb 27, 2020

Please check out this suggestion.

@germanros1987
Copy link
Contributor

We haven't forgotten about this. It will happen. In fact, part of this is already out as part of the new GUI module and the python API for the GUI module, but displaying text in the Render widget is still not possible.

@germanros1987
Copy link
Contributor

Still working on this for 0.12

@Physu
Copy link

Physu commented Jan 14, 2021

Hope can add display text function soon. Thanks for your extraordinary work!

@JianqiangDing
Copy link

still waiting for the release of this USEFUL feature

@luke-sockhill
Copy link

This feature would be super helpful! When is it likely to be released?

@prewettg
Copy link
Contributor

The new GUI has this as of 0.12:

import numpy as np
import open3d as o3d
import open3d.visualization.gui as gui
import open3d.visualization.rendering as rendering

def make_point_cloud(npts, center, radius):
    pts = np.random.uniform(-radius, radius, size=[npts, 3]) + center
    cloud = o3d.geometry.PointCloud()
    cloud.points = o3d.utility.Vector3dVector(pts)
    colors = np.random.uniform(0.0, 1.0, size=[npts, 3])
    cloud.colors = o3d.utility.Vector3dVector(colors)

def main():
    app = gui.Application.instance
    app.initialize()

    points = make_point_cloud(100, (0, 0, 0), 1.0)

    w = app.create_window("Open3D - 3D Text", 1024, 768)
    widget3d = gui.SceneWidget()
    widget3d.scene = rendering.Open3DScene(w.renderer)
    mat = rendering.Material()
    mat.shader = "defaultUnlit"
    mat.point_size = 5 * w.scaling
    widget3d.scene.add_geometry("Points", points, mat)
    for idx in range(0, len(points.points)):
        widget3d.add_3d_label(points.points[idx], "{}".format(idx))
    bbox = widget3d.scene.bounding_box
    widget3d.setup_camera(60.0, bbox, bbox.get_center())
    w.add_child(widget3d)

    app.run()

if __name__ == "__main__:
    main()

#3233 also adds this to O3DVisualizer, and adds an example in examples/python/gui/text3d.py

@luke-sockhill
Copy link

luke-sockhill commented Apr 8, 2021

@prewettg When trying to run the code above I get this error:
AttributeError: 'open3d.cpu.pybind.visualization.O3DVisualizer' object has no attribute 'add_3d_label'

EDIT: I realise this is because I haven't installed directly from Git, but I cannot find instructions on how to download and install directly from git, could you please point me in the right direction?

@Eralien
Copy link

Eralien commented Jul 9, 2021

@luke-sockhill I also had the same issue as yours when I was using o3d v1.12, and now I just pip install --upgrade open3d to v1.13, and problems solved. I am not sure how your o3d was installed, but it seems installation from source is not necessary now. I am using python=3.8.

@tangyipeng100
Copy link

@luke-sockhill I also had the same issue as yours when I was using o3d v1.12, and now I just pip install --upgrade open3d to v1.13, and problems solved. I am not sure how your o3d was installed, but it seems installation from source is not necessary now. I am using python=3.8.

Thanks, problem solved.

@satyajit-ink
Copy link

For anyone having issues with the above code, here's the updated code: http://www.open3d.org/docs/release/python_example/visualization/index.html#text3d-py

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

No branches or pull requests