request text for display in visualization with python
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().
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.
Definitely a wanted feature by many of us!
Duplicate of #2 ?
Please check out this suggestion.
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.
Still working on this for 0.12
Hope can add display text function soon. Thanks for your extraordinary work!
still waiting for the release of this USEFUL feature
This feature would be super helpful! When is it likely to be released?
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
@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?
@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.
@luke-sockhill I also had the same issue as yours when I was using o3d
v1.12, and now I justpip install --upgrade open3dtov1.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.
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