How to initialize a float Image from a vector in C++
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
### Checklist
- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](https://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [x] I have checked the [release documentation](https://www.open3d.org/docs/release/) and the [latest documentation](https://www.open3d.org/docs/latest/) (for `main` branch).
### My Question
I'm looking to use the `open3d::geometry::PointCloud::CreateFromDepthImage` function from some depth images I have. These depth images are stored as TIFF files, where each value represents a distance in meters (unscaled), which I can then read into a 1D vector. However, I am unable to find a way to create an open3d image from this float vector.
I've tried creating a blank Image and then updating the `.data_`, `.height_`, etc parameters, but the data vector type is unsigned char.
```
// depth_data is a std::vector and depth_mat is an OpenCV mat
auto depth_img = open3d::geometry::Image();
depth_img_p->data_ = depth_data; // ERROR HERE
depth_img.width_ = depth_mat.size().width;
depth_img.height_ = depth_mat.size().height;
depth_img.channels_ = depth_mat.channels();
```
I know that there are functions to convert an image to a float image, but the documentation is nonexistent and after running that function the type of the underlying data vector in the Image class is still unsigned char. Any help is much appreciated!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.