Open3d: ColorMapOptimizationOption is not defined

Created on 4 Apr 2019  路  6Comments  路  Source: intel-isl/Open3D

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):

  • OS: Ubuntu 16.04
  • Python version: 2.7
  • Open3D version: latest
  • Is this remote workstation?: no
  • How did you install Open3D?build_from_source

i made sure the python versions in cmake built and running the python script is the same

Any ideas?

possible bug

All 6 comments

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 "", line 1, in
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:

  1. Run the privided example code and make sure you can reproduce the resutls.
  2. Look at http://www.open3d.org/docs/python_api/open3d.color_map.ColorMapOptimizationOption.html#open3d.color_map.ColorMapOptimizationOption as well as the C++ code to understand the effect of the parameters.
  3. When you use your own dataset, save and visualise intermediate images, e.g. boundary masks, camera vertex visibility and etc to debug.
  4. Check camera calibration and use static scene: colormap optimization relies on accurate camera parameters

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

taochenshh picture taochenshh  路  3Comments

DKandrew picture DKandrew  路  4Comments

masonsun picture masonsun  路  3Comments

Timu777 picture Timu777  路  3Comments

lordlycastle picture lordlycastle  路  3Comments