python-pcl icon indicating copy to clipboard operation
python-pcl copied to clipboard

Example not working

Open tino opened this issue 8 years ago • 4 comments

After installing in an Ubuntu 14.04 docker container like so:

FROM ubuntu:14.04

RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
RUN apt-get update && \
    apt-get install -y libpcl-all

RUN apt-get install -y python-pip git
RUN apt-get install -y python-dev
RUN pip install cython
RUN pip install numpy
RUN pip install git+https://github.com/strawlab/python-pcl.git#egg=pcl

With poincloudlib:

$ dpkg -s libpcl-all
Package: libpcl-all
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 25
Maintainer: Jochen Sprickerhof <[email protected]>
Architecture: all
Source: pcl-defaults
Version: 1.7+trusty1
Depends: libpcl-1.7-all
Description: The Point Cloud Library (or PCL) for point cloud processing - development
 The PCL framework contains numerous state-of-the art algorithms including
 filtering, feature estimation, surface reconstruction, registration, model
 fitting and segmentation.
 .
 This package depends on all PCL packages.
 .
 This package is a dependency package, which depends on the default PCL version (currently 1.7).
Homepage: http://pointclouds.org/

Trying the example from the readme doesn't work:

>>> import pcl
>>> import numpy as np
>>> p = pcl.PointCloud(np.array([[1, 2, 3], [3, 4, 5]], dtype=np.float32))
>>> seg = p.make_segmenter()
>>> seg.set_model_type(pcl.SACMODEL_PLANE)
>>> seg.set_method_type(pcl.SAC_RANSAC)
>>> indices, model = seg.segment()
[pcl::SampleConsensusModel::getSamples] Can not select 0 unique points out of 2!
[pcl::RandomSampleConsensus::computeModel] No samples could be selected!
[pcl::SACSegmentation::segment] Error segmenting the model! No solution found.

And make test returns:

nosetests -s
..................[pcl::PLYReader] /tmp/tmp9iTMsNpcl-test/foo.ply:21: property 'float32 focal' of element 'camera' is not handled
[pcl::PLYReader] /tmp/tmp9iTMsNpcl-test/foo.ply:22: property 'float32 scalex' of element 'camera' is not handled
[pcl::PLYReader] /tmp/tmp9iTMsNpcl-test/foo.ply:23: property 'float32 scaley' of element 'camera' is not handled
[pcl::PLYReader] /tmp/tmp9iTMsNpcl-test/foo.ply:24: property 'float32 centerx' of element 'camera' is not handled
[pcl::PLYReader] /tmp/tmp9iTMsNpcl-test/foo.ply:25: property 'float32 centery' of element 'camera' is not handled
[pcl::PLYReader] /tmp/tmp9iTMsNpcl-test/foo.ply:28: property 'float32 k1' of element 'camera' is not handled
[pcl::PLYReader] /tmp/tmp9iTMsNpcl-test/foo.ply:29: property 'float32 k2' of element 'camera' is not handled
..........E
======================================================================
ERROR: Failure: ImportError (No module named registration)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/tmp/python-pcl/tests/test_registration.py", line 9, in <module>
    from pcl.registration import icp, gicp, icp_nl
ImportError: No module named registration

----------------------------------------------------------------------
Ran 29 tests in 3.847s

FAILED (errors=1)
make: *** [test] Error 1

Any suggestions on how to get RANSAC segmentation working? I tried different inputs, like a plane at height 1, or random height values between 0 and 1, but all with the same result.

tino avatar Feb 01 '16 12:02 tino