8000 Update ModelAligner to handle GPS and custom coords. and more by ferreram · Pull Request #1371 · colmap/colmap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update ModelAligner to handle GPS and custom coords. and more #1371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 23, 2022

Conversation

ferreram
Copy link
Contributor
@ferreram ferreram commented Jan 7, 2022
  • Adds GPS conversions to and from ENU coords. (GPS -> ENU, ECEF -> ENU, ENU -> GPS, ENU -> ECEF).

Update of ModelAligner function:

  • Now handles either GPS or custom coordinates as reference coordinates for alignment.
  • Alignment to pure ENU frame offered as an option.
  • Aligning reconstruction to ref coords. origin offered as an option.
  • Fix the alignment to plane case if no ref or database provided.
  • Documentation added for the function.

…rdinates as reference coordinates for alignment. Alignment to pure ENU frame offered as an option. Aligning reconstruction to ref coords. origin offered as an option. Fix the alignment to plane case if no ref or database provided. Documentation added for the function.
Copy link
Contributor
@ahojnnes ahojnnes left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution, I left a few comments for you.

const auto xyz = gps_tform.ENUToXYZ(enu, lat0, lon0, alt0);

for (size_t i = 0; i < ell.size(); ++i) {
BOOST_CHECK(std::abs(xyz[i](0) - ref_xyz[i](0)) < 1e-8);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be BOOST_CHECK(xyz[i].isApprox(ref_xyz[i], 1e-8))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I ended up doing this for all test functions in gps_test.cc


std::vector<Eigen::Vector3d> XYZToENU(const std::vector<Eigen::Vector3d>& xyz,
const double lat0,
const double lon0) const;
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like this should be a private method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really know here. It's not used yet anywhere else yet but might become handy for later use / applications? Also this will give me some troubles for the test functions ^^

@ferreram ferreram requested a review from ahojnnes January 23, 2022 13:48
Copy link
Contributor
@ahojnnes ahojnnes left a comment

Choose a reason for hiding this comment

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

Small comments. Maybe you can also run another clang-format before final commit, as it seems some formatting got messed up in the last changes. Thanks for your PR!

@ahojnnes ahojnnes enabled auto-merge (squash) January 23, 2022 15:39
@ahojnnes ahojnnes merged commit ce55703 into colmap:dev Jan 23, 2022
lucasthahn pushed a commit to tne-ai/colmap that referenced this pull request Aug 17, 2022
…#1371)

* Adding GPS conversions to and from ENU coords. (GPS -> ENU, ECEF -> ENU, ENU -> GPS, ENU -> ECEF).

* Update of ModelAligner function.  Now handles either GPS or custom coordinates as reference coordinates for alignment.  Alignment to pure ENU frame offered as an option.  Aligning reconstruction to ref coords. origin offered as an option.  Fix the alignment to plane case if no ref or database provided.  Documentation added for the function.

* Adding const & const ref.

* Removing begining / trailing spaces.

* Ensure that first image exists when using merge_origins option.

* Using Eigen isApprox function in the BOOST_CHECK functions instead of per vector elements checks.

* Explicitly give the ref/origin lat/lon coordinates when converting from Ell to ENU.

* Add a ConvertCameraLocations function to apply the common conversion of the ReadFileCameraLocations and ReadDatabaseCameraLocations functions.

* Directly iterate over the containers in the range-based for loops in the ReadDatabaseCameraLocations & ReadFileCameraLocations functions.

* Adding a const and turning output function parameters to pointers.
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
0