Skip to main content

Auki::Ark::CeresLighthousePoseEstimator

Estimates the pose of a lighthouse QR code given its corners in texture space. Uses Ceres Solver for the optimization, which is part of the ConjureKit Ceres module.

Inherits from Auki.Ark.IPoseEstimator

Public Classes

Name
structCornerRayDistances
This struct is used mainly internally by TryEstimatePose, to pass the initial guess and retrieve the best fit distances to each corners.
structCornerRays
Data struct representing the four corner rays of a detected QR code. Each ray starts from the camera position and goes "into the screen" towards the corner.

Public Functions

Name
voidSetInitialRayDistanceGuesser(Func< CornerRays, float, CornerRayDistances > initialRayDistanceGuesser)
Since this pose estimator uses an iterative optimization approach, the initial guess can have a big impact. The default guess function should work well, but it is possible to provide a custom function if needed.
boolTryEstimatePose(IReadOnlyList< Vector2 > corners, float physicalSizeInMeters, CoordinateEnvironment coordinateEnvironment, out Pose pose)
Tries to estimate pose for given parameters. cornersSet of corners in clockwise order starting from top left physicalSizeInMetersLength of side in meters coordinateEnvironmentCoordinate environment for pose estimation poseResulting pose. Will be Pose.identity if the estimation fails True if pose estimation was successful, false if it was not
boolTryEstimatePose(IReadOnlyList< Vector2 > corners, float physicalSizeInMeters, CoordinateEnvironment coordinateEnvironment, IPositioner positioner, out Pose pose)
Tries to estimate pose for given parameters. cornersSet of corners in clockwise order starting from top left physicalSizeInMetersLength of side in meters coordinateEnvironmentCoordinate environment for pose estimation positionerCustom positioner poseResulting pose. Will be Pose.identity if the estimation fails True if pose estimation was successful, false if it was not
CornerRayDistancesInitialGuessRayDistances(CornerRays cornerRays, float physicalSizeInMeters)
This default "initial guess" function is used in TryEstimatePose if no custom guesser is provided. It approximates how far away the QR code is based on the angle between its corner rays and the physical size. The same initial guess is used for all corners.

Public Functions Documentation

function SetInitialRayDistanceGuesser

void SetInitialRayDistanceGuesser(
Func< CornerRays, float, CornerRayDistances > initialRayDistanceGuesser
)

Since this pose estimator uses an iterative optimization approach, the initial guess can have a big impact. The default guess function should work well, but it is possible to provide a custom function if needed.

Parameters:

  • initialRayDistanceGuesser A custom function that provides an initial guess for the ray distances. Parameters: the corner rays and the physical size of the QR code (in meters). Returns: a CornerRayDistances struct with an initial guess at how far away each corner is (in world space units).

function TryEstimatePose

bool TryEstimatePose(
IReadOnlyList< Vector2 > corners,
float physicalSizeInMeters,
CoordinateEnvironment coordinateEnvironment,
out Pose pose
)

Tries to estimate pose for given parameters. cornersSet of corners in clockwise order starting from top left physicalSizeInMetersLength of side in meters coordinateEnvironmentCoordinate environment for pose estimation poseResulting pose. Will be Pose.identity if the estimation fails True if pose estimation was successful, false if it was not

Reimplements: Auki::Ark::IPoseEstimator::TryEstimatePose

function TryEstimatePose

bool TryEstimatePose(
IReadOnlyList< Vector2 > corners,
float physicalSizeInMeters,
CoordinateEnvironment coordinateEnvironment,
IPositioner positioner,
out Pose pose
)

Tries to estimate pose for given parameters. cornersSet of corners in clockwise order starting from top left physicalSizeInMetersLength of side in meters coordinateEnvironmentCoordinate environment for pose estimation positionerCustom positioner poseResulting pose. Will be Pose.identity if the estimation fails True if pose estimation was successful, false if it was not

Reimplements: Auki::Ark::IPoseEstimator::TryEstimatePose

function InitialGuessRayDistances

static CornerRayDistances InitialGuessRayDistances(
CornerRays cornerRays,
float physicalSizeInMeters
)

This default "initial guess" function is used in TryEstimatePose if no custom guesser is provided. It approximates how far away the QR code is based on the angle between its corner rays and the physical size. The same initial guess is used for all corners.

Parameters:

  • cornerRays
  • physicalSizeInMeters

Return: An initial guess for distance to each corner (same order as input CornerRays).