Skip to content

ICP expects ccHObject? #192

Open
Open

Description

@ngriese

Hi,

I'm trying to register two point clouds using ICP, following the documentation (Section 4.1).

Here is my code. My point clouds are stored as .las:

UAVLS_cloud = cc.loadPointCloud(UAVLS_path) 
TLS_cloud = cc.loadPointCloud(TLS_path) 

matching = cc.ICP(data=TLS_cloud, model=UAVLS_cloud, randomSamplingLimit=1e6)

This is the error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: ICP(): incompatible function arguments. The following argument types are supported:
    1. (data: _cloudComPy.ccHObject, model: _cloudComPy.ccHObject, minRMSDecrease: float = 1e-05, maxIterationCount: int = 20, randomSamplingLimit: int = 50000, removeFarthestPoints: bool = False, method: _cloudComPy.CONVERGENCE_TYPE = <CONVERGENCE_TYPE.MAX_ITER_CONVERGENCE: 1>, adjustScale: bool = False, finalOverlapRatio: float = 1.0, useDataSFAsWeights: bool = False, useModelSFAsWeights: bool = False, transformationFilters: int = <TRANSFORMATION_FILTERS.SKIP_NONE: 0>, maxThreadCount: int = 0) -> _cloudComPy.ICPres

Invoked with: kwargs: data=<_cloudComPy.ccPointCloud object at 0x1554c888b9b0>, model=<_cloudComPy.ccPointCloud object at 0x155554757eb0>, randomSamplingLimit=1000000.0

I found the same error message in an older issue #163. I have tried to add more arguments to see if the old problem still exists, but I still get the same error message.
I'm a little bit confused by the ccHObject. ICP expects this class object but, following the docs, we give it a ccPointCloud.

Activity

  1. prascle commented on Sep 26, 2024

    @prascle
    Collaborator

    Hello,
    The problem is not related to ccHObject which is a generic class for clouds, meshes, etc... : ccPointCloud derives from ccHObject, so it's OK.
    randomSamplingLimit requires an integer, and 1e6 is interpreted as a float. You can replace it by 1000000 and it should work.

    Maybe it would be preferable to accept floats also here, I will check.
    Best regards,
    Paul

  2. added a commit that references this issue on Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions