numpyopencvrosopen3d

How to convert numpy array to Open3D Image in python?


I use image_transport pkg in ROS to transport numpy arrays (from OpenCV) to a listener written in python.

Now I want to convert a numpy array (from OpenCV) to Open3D Image data structure. How can I write this conversion? Is there any method that Open3D already have to finish this job?


Solution

  • To convert a numpy array into Opne3d Image:

    import open3d as o3d
    # numpyarray_image
    open3d_image = o3d.geometry.Image(numpy_image)