MemoryError and Segmentation Fault when visualizing textured mesh
- 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
I tried to add texture to a mesh that has been loaded from a `.obj` file, but I get a `MemoryError: std::bad_alloc` error. Repeating `o3d.visualization.draw_geometries([mesh])` eventually cause to `Segmentation fault (core dumped)` error.
### Steps to reproduce the bug
```python
import cv2
import open3d as o3d
print(o3d.__version__)
mesh = o3d.io.read_triangle_mesh('sample.obj')
image = cv2.imread('sample_texture.png')
mesh.textures = [o3d.geometry.Image(image)]
o3d.visualization.draw_geometries([mesh])
```
### Error message
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
Input In [7], in ()
----> 1 o3d.visualization.draw_geometries([mesh])
MemoryError: std::bad_alloc
### Expected behavior
Visualize the mesh without any error
### Open3D, Python and System information
```markdown
- Operating system: Ubuntu 20.04
- Python version: Python 3.9.5
- Open3D version: 0.15.2
- 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.