Wrong point cloud color when using RGBA images
- 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](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).
### Describe the issue
The point cloud has wrong colors when using source RGBA images depending on the alpha value. I don't know if the problem is linked to the point cloud creation or just to the visualization. This problem doesn't happen if the source image has just 3 channels.
This is the point cloud if using the RGB image:

This is the point cloud if using RGBA image with `ALPHA_VALUE=0`:

This is the point cloud if using RGBA image with `ALPHA_VALUE=100`:

This is the point cloud if using RGBA image with `ALPHA_VALUE=255`:

### Steps to reproduce the bug
```python
import open3d as o3d
import numpy as np
np.random.seed(0)
ALPHA_VALUE = 0
rgb = (np.random.rand(512, 512, 3) * 255).astype(np.uint8)
alpha = np.full((512, 512, 1), fill_value=ALPHA_VALUE, dtype=np.uint8)
image = np.concatenate([rgb, alpha], axis=2)
depth = np.ones((512, 512), dtype=np.float32)
image_o3d = o3d.geometry.Image(image)
depth_o3d = o3d.geometry.Image(depth)
rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(
image_o3d,
depth_o3d,
convert_rgb_to_intensity=False,
depth_scale=1,
depth_trunc=1000,
)
pc = o3d.geometry.PointCloud.create_from_rgbd_image(
rgbd_image, o3d.camera.PinholeCameraIntrinsic()
)
o3d.visualization.draw_geometries([pc])
```
### Error message
_No response_
### Expected behavior
The point cloud should have the same color as the source image.
### Open3D, Python and System information
```markdown
- Operating system: Ubuntu 20.04
- Python version: Python 3.8.10
- Open3D version: 0.16.0
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip
```
### Additional information
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.