Skip to content

Conversation

@lpanaf
Copy link
Collaborator

@lpanaf lpanaf commented Sep 27, 2024

No description provided.

@lpanaf lpanaf requested a review from ahojnnes September 27, 2024 16:39
Eigen::Matrix3d AngleToRotUp(double angle);

// Estimate the average gravity direction from a set of gravity directions
Eigen::Vector3d AverageGravity(std::vector<Eigen::Vector3d>& gravities);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to write a few unit tests for this function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For average gravity? Or for rotation averaging? For average gravity, I think it is simply some SVD. For the rotation averaging, then I would need to design it a bit :)

bool use_stratified = true;
};

class RotationAverager {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this only solves the gravity aligned rotation averaging problem and is not a general interface for rotation averaging? Why is this a separate, new class? Otherwise, a more specific name would be preferable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the interface is for both 3DoF RA and 1DoF RA. If gravity direction is not provided, then the original 3DoF will be applied

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying. It feels odd that this is a class. Why not just make it a function?

lpanaf and others added 2 commits September 29, 2024 23:03
Co-authored-by: Johannes Schönberger <[email protected]>
// If there is no image pairs with gravity or most image pairs are with
// gravity, then just run the 3dof version
bool status = false;
status = status || grav_pairs == 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first status is always false so the or condition is superfluous.


class RotationAverager {
public:
RotationAverager(const RotationAveragerOptions& options)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RotationAverager(const RotationAveragerOptions& options)
explicit RotationAverager(const RotationAveragerOptions& options)

lpanaf and others added 2 commits September 30, 2024 16:09
@lpanaf lpanaf merged commit e44ce35 into main Mar 20, 2025
7 checks passed
uptycs-rmack pushed a commit to uptycs-rmack/glomap that referenced this pull request Jan 1, 2026
* Fix conversion of colmap pose prior

* d

* restore the pose prior after rotation averaging

* f

* f

* f

* gravity refinement tested

* add the stratified rotation averager and CLI

* f

* d

* d

* add timer

* add options for gravity refinement

* merge gravity_io to pose_io

* add readme for the rotation averager

* f

* Update glomap/math/gravity.cc

Co-authored-by: Johannes Schönberger <[email protected]>

* f

* Update glomap/controllers/rotation_averager.cc

Co-authored-by: Johannes Schönberger <[email protected]>

* Update glomap/controllers/rotation_averager.cc

Co-authored-by: Johannes Schönberger <[email protected]>

* change rotation averager from class to struct

* d

* d

* add weighting and corresponding IO. Tested

* change the writing of relative pose to be sorted

* unit test for rotation averager

* inject noise to avoid local minima for error-free case

* f

* add more points in the unit test

---------

Co-authored-by: Johannes Schönberger <[email protected]>
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.

3 participants