I am trying to run color_map_optimization.py from the examples and I am getting this
error
Reading PLY: [========================================] 100%
Read TriangleMesh: 1033745 triangles and 536872 vertices.
Traceback (most recent call last):
File "color_map_optimization.py", line 43, in
option = ColorMapOptimizationOption()
NameError: name 'ColorMapOptimizationOption' is not defined
Environment (please complete the following information):
i made sure the python versions in cmake built and running the python script is the same
Any ideas?
Is ColorMapOptimizationOption imported? Could you post the terminal output for the following commands?
python -c "import open3d as o3d; print(o3d.__version__)"
python -c "import open3d as o3d; print(o3d.PointCloud)"
python -c "import open3d as o3d; print(o3d.ColorMapOptimizationOption)"
I checked open3d pip-releases 0.5 and 0.6 as well as building 0.6 from source, all three work fine with python 3.6 (on ubuntu 18.04).
Mb double check that you did build open3d for python (using make install-pip-package)?
Can you also perhaps provide output of pip list | grep open3d ?
hi @yxlao and @mike239x sorry for the late response, here is the output :
python -c "import open3d as o3d; print(o3d.__version__)"
0.4.0.0
python -c "import open3d as o3d; print(o3d.PointCloud)"
python -c "import open3d as o3d; print(o3d.ColorMapOptimizationOption)"
Traceback (most recent call last):
File "
AttributeError: 'module' object has no attribute 'ColorMapOptimizationOption'
pip list | grep open3d
open3d-python 0.4.0.0
It is also worth to mention that I ran the ColorMapOptimization.cpp C++ example and the results were really bad.
First, 0.4.0 is an old version, there has been bug fixes since then in https://github.com/intel-isl/Open3D/pull/819/files. It is recommended to use the latest version. Also, seems that you have both the compile-from-source and pre-compiled version mixed, it is recommended to use one of them.
Second, for the quality of the color map optimization, there are many reasons. Besides the bug fix above, hyper-parameters can significantly affect the output quality. I'd recommend:
To correct @yxlao, having only open3d-python 0.4.0.0 as the output of pip list | grep open3d means you got only pip-installed open3d (v 0.4), so either you didn't really build it from source, or you didn't run make install-pip-package, or you got something wrong about your python environment (like mb you forgot to switch it on or something).
You can either install a newer version of open3d using pip: pip install open3d, or precisely follow "installation from source" guide: http://www.open3d.org/docs/compilation.html
thanks @yxlao and @mike239x got it working.