Skip to content
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

Ground level alignment based on sfm point cloud #1438

Merged
merged 4 commits into from
Jun 3, 2023
Merged

Conversation

servantftechnicolor
Copy link
Contributor

@servantftechnicolor servantftechnicolor commented May 22, 2023

Simple Ground level alignment.

Objective : make sure the lower geometric structure is at Y=0
Assumes the Y axis is the true vertical axis

Remove all points which are not "under" one camera which observes it.
Remove all points which are not observed correctly
Remove statistical noise. Takes the lower point as the ground.

@fabiencastan fabiencastan added this to the 3.1.0 milestone May 23, 2023
@@ -1026,6 +1026,62 @@ void computeCentersVarCov(const sfmData::SfMData& sfmData, const Vec3 & mean, Ei
}
}

void computeNewCoordinateSystemGroundAuto(const sfmData::SfMData& sfmData, Vec3& out_t)
Copy link
Member

Choose a reason for hiding this comment

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

wouldn't be better to have the point returned instead as an out param?

Suggested change
void computeNewCoordinateSystemGroundAuto(const sfmData::SfMData& sfmData, Vec3& out_t)
Vec3 computeNewCoordinateSystemGroundAuto(const sfmData::SfMData& sfmData)

@simogasp
Copy link
Member

simogasp commented May 24, 2023

I wonder what happens in the case of UAV drones, for which the Y axis of the camera is parallel to the ground.

Comment on lines +1048 to +1058
for (const auto & pObs : plandmark.second.observations)
{
const IndexT viewId = pObs.first;
const Vec3 camCenter = sfmData.getPose(sfmData.getView(viewId)).getTransform().center();

if (X(1) > camCenter(1))
{
foundUnder = true;
break;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Why not just look globally for the lowest camera and filter out all the points above?

And to avoid a problem with one failed solved cameras far away underground, check the bbox of landmarks and bbox of camera centers, to ignore cameras below the landmarks' bbox.

Copy link
Member

@fabiencastan fabiencastan left a comment

Choose a reason for hiding this comment

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

Put the ground alignment as a new mode, in addition to using it in the AUTO mode.

@servantftechnicolor
Copy link
Contributor Author

Put the ground alignment as a new mode, in addition to using it in the AUTO mode.

Ground alignment is only possible when the vertical axis is aligned with gravity ? What do you want exactly.

@fabiencastan fabiencastan changed the title Ground level alignment using heuristic algorithm Ground level alignment based on sfm point cloud Jun 3, 2023
@fabiencastan fabiencastan merged commit afcd397 into develop Jun 3, 2023
@fabiencastan fabiencastan deleted the dev/ground branch June 3, 2023 13:26
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.

4 participants