Automatically aligning point clouds

Feel free to ask any question here
Post Reply
jmont5
Posts: 2
Joined: Sat Apr 18, 2026 9:15 pm

Automatically aligning point clouds

Post by jmont5 »

Hello,

I am trying to write a python script that is able to automatically align two point clouds of nearly identical shape. I've been using the -ICP command which has worked well, but it has some limitations that I don't know how to work around. When the two clouds are on the same plane but rotated by say 180 degrees, ICP naturally does not work.

I realize that you first can manually align them, but my goal is to use the command line to align them automatically since for my purposes manually aligning many clouds is very time consuming. Do you have any idea on how I could achieve this? I left an attachment of the point clouds if it helps give a better idea of what I'm asking.

An idea I thought of is measuring what percentage of the clouds are on top of each other, and then rotating and translating it repeatedly until they are overlapping a large amount and then using ICP to finish the job. Even if this were a good idea I am not yet familiar enough with CloudCompare commands to know how the percentage could be calculated or how to automatically rotate them a certain amount.

Any insight would be greatly appreciated.

Thank you.
Attachments
Two point clouds of the same shape, rotated 180 degrees
Two point clouds of the same shape, rotated 180 degrees
Screenshot 2026-04-18 at 4.23.34 PM.png (290.63 KiB) Viewed 3702 times
daniel
Site Admin
Posts: 8178
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Automatically aligning point clouds

Post by daniel »

Hum, I guess you'll have to indeed try to add a first pass to find the rough alignment. Something like what you suggest would work but it can be very time consuming (i.e. rotating the cloud every 5 degrees and trying to perform the alignment, and then keeping the best result). Or you can dabble with some feature detector, such ad the Radon transform. Or with some unique feature extraction (SIFT, etc.).

But you won't be able to use the command line only (well, apart maybe for the first brute-force technique, as you can use the 'Apply Transformation' option/tool to do it). So Python might be a good way to do it (not sure as I'm not a Python developer myself).
Daniel, CloudCompare admin
c3kkos
Posts: 38
Joined: Thu Apr 05, 2018 1:41 pm

Re: Automatically aligning point clouds

Post by c3kkos »

Manual rough alignment is often required even with expensive closed source software (Leica, Faro).

Quick & dirty
jmont5
Posts: 2
Joined: Sat Apr 18, 2026 9:15 pm

Re: Automatically aligning point clouds

Post by jmont5 »

Thanks for the input! I'm happy to hear the expensive softwares brute force it too as its most likely the simplest way. Radon transforms seem very cool and like a cleaner solution but unfortunately I am not knowledgeable enough to make use of it.
daniel
Site Admin
Posts: 8178
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Automatically aligning point clouds

Post by daniel »

I double expensive SW use a brute force approach. I was just implying it's the easiest to implement.

We had in the past in CC a more refined algorithm named '4-CPS' (but its implementation was very buggy and the initial contributor never maintained it, so we had to remove it eventually):
https://github.com/CloudCompare/CCCoreL ... .cpp#L1225

The article describing the algorithm is "4-points congruent sets for robust pairwise surface registration", by Dror Aiger, Niloy Mitra, Daniel Cohen-Or.
Daniel, CloudCompare admin
c3kkos
Posts: 38
Joined: Thu Apr 05, 2018 1:41 pm

Re: Automatically aligning point clouds

Post by c3kkos »

Daniel i find myself using "AAA" expensive software and they do have indeed a very good way to automate all the workflow and to give you back the full aligned cloud.

However this is what you get when your site workflow is "flawless".

There were some cases where big "jumps" or small overlaps (or both) made the software ask for user input as the automatic guess had failed.
Post Reply