Skip to content

Conversation

@B1ueber2y
Copy link
Contributor

@B1ueber2y B1ueber2y commented Jul 17, 2025

log_scale spans the full space and has benefits in optimization. Storing log_scale instead of scale avoids invalid sim3d object with negative scale.

The python interfaces for sim3d.scale are kept unchanged, while the C++ interfaces change to SetScale(scale) and GetScale(). Update the cost function as well.

In preparation for removing the PositiveExponentialManifold from colmap.

Example:

In [1]: import pycolmap

In [2]: sim3 = pycolmap.Sim3d()

In [3]: sim3
Out[3]: Sim3d(scale=1, rotation_xyzw=[0, 0, 0, 1], translation=[0, 0, 0])

In [4]: sim3.scale = 2.0

In [5]: sim3
Out[5]: Sim3d(scale=2, rotation_xyzw=[0, 0, 0, 1], translation=[0, 0, 0])

In [6]: sim3.log_scale
Out[6]: array(0.69314718)

In [7]: sim3.log_scale = -1.0

In [8]: sim3
Out[8]: Sim3d(scale=0.367879, rotation_xyzw=[0, 0, 0, 1], translation=[0, 0, 0])

@B1ueber2y B1ueber2y requested review from ahojnnes and sarlinpe July 17, 2025 14:17
B1ueber2y added a commit that referenced this pull request Aug 5, 2025
… from colmap. (#3538)

Fixes: #3537
Fixes: #3485

Cherry-picked from #3494 since
there were no consensus on changing the Sim3d structure due to numerical
stability.
@B1ueber2y B1ueber2y closed this Aug 7, 2025
tavislocus pushed a commit to tavislocus/colmap_6dof that referenced this pull request Aug 19, 2025
… from colmap. (colmap#3538)

Fixes: colmap#3537
Fixes: colmap#3485

Cherry-picked from colmap#3494 since
there were no consensus on changing the Sim3d structure due to numerical
stability.
ahojnnes pushed a commit that referenced this pull request Aug 22, 2025
… from colmap. (#3538)

Fixes: #3537
Fixes: #3485

Cherry-picked from #3494 since
there were no consensus on changing the Sim3d structure due to numerical
stability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant