How does CC guess shift values ?

Feel free to ask any question here
Post Reply
feras
Posts: 2
Joined: Tue Jun 26, 2018 7:59 pm

How does CC guess shift values ?

Post by feras »

When loading a point cloud that is geo referenced, if the original coordinate system is too far from the origin, a Global Shift/Scale window will appear with estimated values. How does CC calculate the shift exactly ? I have multiple clouds that get all the same shift values (which is a good thing). I would like to replicate this in personal software.

A code/algorithm snippet or simply the reference to the source file in the repo would be greatly appreciated. I looked up the Wiki but found nothing
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How does CC guess shift values ?

Post by daniel »

CC will use the first encountered point as the origin (but it will round off the values to something like hundreds). Then CC will remember this shift vector, and whenever a new file is loaded, it will check it the previous shift vector also works with the first point of the new file. If it works, then CC will keep the previous shift vector, instead of generating a new one (which would be bothersome).
Daniel, CloudCompare admin
feras
Posts: 2
Joined: Tue Jun 26, 2018 7:59 pm

Re: How does CC guess shift values ?

Post by feras »

I see. So it is to avoid too much computation overhead when loading the cloud. I looked here and there but it did not occur to me that it simply stored the last value. Fair enough ! I will do something similar with my code. I have to compute the point cloud centroid anyway so I might just use it as my shift vector anyway.
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How does CC guess shift values ?

Post by daniel »

No the shift is necessary:
- to avoid losing accuracy when storing the coordinates as 32 bits floating point values
- to avoid issues with displaying large numbers with OpenGL
Daniel, CloudCompare admin
Post Reply