Skip to main content

PoseEstimator API

Source headers: raptor/guide/errors.hpp, raptor/guide/PoseEstimator.hpp

raptor::guide​

Types​

NameDescription
DebugResultResult status for debug capture operations.
EstimationOptionsPer-call options for updatePose / updatePosition.
PoseEstimationErrorError codes for pose and position estimation operations.
PoseEstimatorMain Raptor Guide class for camera pose estimation.
PoseOutputSuccessful output from pose estimation.
PositionOutputSuccessful output from position estimation.

Type Aliases​

NameDescription
ConfidenceConfidence score (0.0-1.0).

Type Alias Details​

Confidence​

using Confidence = double

Confidence score (0.0-1.0)

Primary indicator of result quality and reliability.

Quality assessment guidelines:

  • 0.95: Excellent quality - high accuracy

  • 0.85-0.95: Good quality - reliable for most applications
  • 0.7-0.85: Moderate quality - use with caution
  • < 0.7: Poor quality - recommended to reject the result
note

Always check this value before using pose data

raptor::guide::DebugResult​

enum class DebugResult : std::uint8_t

DebugResult Result status for debug capture operations.

Ok : Operation completed without errors

AlreadyActive : Debug capture is already running

NotActive : Debug capture is not running

FileExists : Target archive already exists and overwrite is disabled

InvalidPath : Target path is empty or its parent directory does not exist

ExpiredLicense : Operation could not be performed due to an expired license

InvalidLicense : Operation could not be performed due to an invalid or insufficient license

Failed : Operation failed due to errors

raptor::guide::EstimationOptions​

struct EstimationOptions

Per-call options for updatePose / updatePosition.

Variables​

NameDescription
maxTimeOptional maximum processing time.
confidenceIntervalConfidence interval driving the covariance search range (see ConfidenceInterval).
exhaustiveRangeSearchEnable exhaustive range search (default: false).
featureDensityCheckEnable feature density check before performing a ranged search.

Variable Details​

confidenceInterval​
ConfidenceInterval confidenceInterval

Confidence interval driving the covariance search range (see ConfidenceInterval).

Has no effect when no covariance is supplied.

exhaustiveRangeSearch​
bool exhaustiveRangeSearch

Enable exhaustive range search (default: false)

When enabled, performs a more thorough search which can improve accuracy in some scenarios but at a significant time cost.

warning

Enabling this option will significantly increase processing time. It is highly recommended to use the maxTime field when this option is enabled.

featureDensityCheck​
bool featureDensityCheck

Enable feature density check before performing a ranged search

If true, updatePose and updatePosition will check if the image has sufficient visual features before attempting a ranged search. Images whose feature density is too low will return PoseEstimationError::PoorFeatureDensity.

maxTime​
std::optional<std::chrono::milliseconds> maxTime

Optional maximum processing time.

The algorithm will return the best result found within this time. Not a hard limit - may exceed slightly. Not a minimum time - may return before this time. Increase pose uncertainty if you want the system to evaluate more hypotheses or use the exhaustiveRangeSearch option to do a more thorough search within the range.

raptor::guide::PoseEstimationError​

enum class PoseEstimationError : std::uint8_t

PoseEstimationError Error codes for pose and position estimation operations.

PoseEstimationFailed : No pose could be estimated

InvalidInput : Input parameter(s) contains invalid values

ExpiredLicense : Operation could not be performed due to an expired license

InvalidLicense : Operation could not be performed due to an invalid or insufficient license

InsufficientMapCoverage : Insufficient 3D map coverage at the input pose location - pose is likely outside map bounds

PoorFeatureDensity : Insufficient feature density in the input image

Failed : Operation failed due to errors

raptor::guide::PoseEstimator​

class PoseEstimator

Main Raptor Guide class for camera pose estimation

This class provides high-precision camera pose refinement using Vantor 3D maps.

USAGE: Initialize once, then call updatePose() or updatePosition() for each image.

Thread safety All member functions may be called concurrently from multiple threads. Each estimation call is independent of other calls. See raptor::Context for details.

note

See the documentation for complete working examples.

Variables​

NameDescription
_implInternal implementation (PIMPL pattern).

Functions​

NameDescription
PoseEstimatorInitialize Raptor Guide from an existing Raptor SDK context.
~PoseEstimatorDestructor - automatically cleans up all resources.
updatePoseRefine camera pose using image and 3D map matching.
updatePoseConvenience overload for Geodetic pose directly in return type.
updatePoseConvenience overload for ECEF pose directly in return type.
updatePositionRefine camera position using image and 3D map matching.
updatePositionConvenience overload for Geodetic pose directly in return type.
updatePositionConvenience overload for ECEF pose directly in return type.
approximateConfidenceApproximate the confidence score of a camera pose without refining it.
startDebugStart capturing debug data to a CanV archive.
stopDebugStop the active debug capture and finalize the CanV archive.

Variable Details​

_impl​

std::unique_ptr<PoseEstimatorImpl> _impl

Internal implementation (PIMPL pattern)

Function Details​

PoseEstimator​

Function
explicit PoseEstimator(raptor::Context& context)

Initialize Raptor Guide from an existing Raptor SDK context

Parameters:

  • context - Shared Raptor SDK context. Must outlive this PoseEstimator instance.

Throws: std::runtime_error - If initialization fails

~PoseEstimator​

Function
~PoseEstimator()

Destructor - automatically cleans up all resources

Stops any active debug capture. No manual cleanup required.

warning

Must not be called while other threads are still calling member functions of this instance.

updatePose​

Function
std::variant<PoseOutput<Pose>, PoseEstimationError> updatePose( ImageView image, const LensModel& lens, const Pose& pose, std::chrono::nanoseconds timestamp, const std::optional<PoseCovariance>& covariance = std::nullopt, const EstimationOptions& options = {}) noexcept

Refine camera pose using image and 3D map matching

This is the main SDK function. It takes an approximate camera pose and refines it by matching the input image against rendered views from the 3D map.

Parameters:

  • image - Image (see ImageView type for format details)
  • lens - Lens model parameters (see LensModel type for details)
  • pose - Initial pose estimate (see Pose type for format details).
  • covariance - Optional prior pose covariance (see PoseCovariance). Covariance values should reflect input pose uncertainty for optimal results.
  • timestamp - Timestamp identifying when the input image was captured. Must be > 0. The epoch is application-defined and must be consistent across calls. Preserved unchanged in the output timestamp field.
  • options - Per-call tuning (see EstimationOptions for details).

Returns: std::variant containing either: - PoseOutput: refined pose, uncertainty, and quality metrics on success - PoseEstimationError: error code on failure

note

This method performs comprehensive parameter validation and exception handling internally. Invalid parameters or system errors are reported via PoseEstimationError. This method does not throw exceptions during normal operation.

note

This function is computationally intensive. For real-time applications, consider using options.maxTime and monitoring the confidence score.

Function
std::variant<PoseOutput<pose::Geodetic>, PoseEstimationError> updatePose( ImageView image, const LensModel& lens, const pose::Geodetic& pose, std::chrono::nanoseconds timestamp, const std::optional<PoseCovariance>& covariance = std::nullopt, const EstimationOptions& options = {}) noexcept

Convenience overload for Geodetic pose directly in return type

Function
std::variant<PoseOutput<pose::Ecef>, PoseEstimationError> updatePose( ImageView image, const LensModel& lens, const pose::Ecef& pose, std::chrono::nanoseconds timestamp, const std::optional<PoseCovariance>& covariance = std::nullopt, const EstimationOptions& options = {}) noexcept

Convenience overload for ECEF pose directly in return type

updatePosition​

Function
std::variant<PositionOutput<Position>, PoseEstimationError> updatePosition( ImageView image, const LensModel& lens, const Pose& pose, std::chrono::nanoseconds timestamp, const std::optional<PoseCovariance>& covariance = std::nullopt, const EstimationOptions& options = {}) noexcept

Refine camera position using image and 3D map matching

Same as updatePose but without updated attitude in the output.

Function
std::variant<PositionOutput<raptor::position::Geodetic>, PoseEstimationError> updatePosition( ImageView image, const LensModel& lens, const pose::Geodetic& pose, std::chrono::nanoseconds timestamp, const std::optional<PoseCovariance>& covariance = std::nullopt, const EstimationOptions& options = {}) noexcept

Convenience overload for Geodetic pose directly in return type

Function
std::variant<PositionOutput<raptor::position::Ecef>, PoseEstimationError> updatePosition( ImageView image, const LensModel& lens, const pose::Ecef& pose, std::chrono::nanoseconds timestamp, const std::optional<PoseCovariance>& covariance = std::nullopt, const EstimationOptions& options = {}) noexcept

Convenience overload for ECEF pose directly in return type

approximateConfidence​

Function
std::variant<Confidence, OperationError> approximateConfidence(ImageView image, const LensModel& lens, const Pose& pose) noexcept

Approximate the confidence score of a camera pose without refining it

Matches the input image against the 3D map at the given pose and returns a confidence score (see Confidence type for details). The score is an approximation of the confidence updatePose would report for the same pose, not an exact reproduction of it.

Parameters:

  • image - Image (see ImageView type for format details)
  • lens - Lens model parameters (see LensModel type for details)
  • pose - Camera pose to score (see Pose type for format details).

Returns: std::variant containing either: - Confidence: approximate confidence score on success - OperationError: error code on failure

startDebug​

Function
DebugResult startDebug(const std::filesystem::path& path, bool overwrite = false) noexcept

Start capturing debug data to a CanV archive

When debug capture is active, subsequent calls to updatePose() or updatePosition() are recorded as frames in a CanV archive. Camera images are stored with their original lens calibration, and point pairs use pixel coordinates in those images. Rendered references are undistorted pinhole images with the same dimensions as the input image. The calibration used to render each reference is stored alongside it.

Frames from concurrent calls are recorded in the order the calls complete. The first recorded frame sets the archive's time origin, and frames with an earlier timestamp are dropped from the archive (the calls themselves still return normally). A call that is already running when capture starts may be recorded with incomplete debug data.

Capture applies to this instance only. To record separate archives, for example one per camera, use a separate PoseEstimator for each archive.

Parameters:

  • path - Output CanV archive path. Parent directory must exist.
  • overwrite - If true, an existing file at path is replaced. If false, returns DebugResult::FileExists when the file already exists.

Returns: DebugResult::Ok on success; another DebugResult value describing why the start request failed otherwise.

See: stopDebug

See: DebugResult

stopDebug​

Function
DebugResult stopDebug() noexcept

Stop the active debug capture and finalize the CanV archive

Closes the writer and flushes all pending frame metadata to disk. After this call, subsequent updatePose() calls no longer record frames until startDebug() is called again.

Returns: DebugResult::Ok on success; DebugResult::NotActive if no capture was active; DebugResult::Failed if capturing or finalizing the archive encountered an error.

See: startDebug

raptor::guide::PoseOutput​

template <typename PoseType> struct PoseOutput

PoseOutput Successful output from pose estimation

Contains the refined camera pose, uncertainty estimates, and quality metrics.

Variables​

NameDescription
poseRefined camera pose.
covariancePose covariance matrix (see PoseCovariance).
confidenceConfidence score (see Confidence type for details).
mapCoverageFraction of the camera's view covered by valid 3D map data (0.0-1.0).
timestampImage timestamp (same as input).

Variable Details​

confidence​
Confidence confidence

Confidence score (see Confidence type for details)

covariance​
std::optional<PoseCovariance> covariance

Pose covariance matrix (see PoseCovariance).

Set when the estimator was able to produce an uncertainty estimate; otherwise empty.

mapCoverage​
double mapCoverage

Fraction of the camera's view covered by valid 3D map data (0.0-1.0)

Indicates how much of the camera's view intersects the loaded 3D map. Low values mean large portions of the frame fall outside the map, which reduces the quality of the matching and typically degrades result quality.

pose​
PoseType pose

Refined camera pose

timestamp​
std::chrono::nanoseconds timestamp

Image timestamp (same as input)

Preserved from the input timestamp identifying when the input image was captured.

raptor::guide::PositionOutput​

template <typename PositionType> struct PositionOutput

Successful output from position estimation

Contains the refined position, uncertainty estimates, and quality metrics.

Variables​

NameDescription
positionRefined camera position.
covariancePosition covariance matrix (see PositionCovariance).
confidenceConfidence score (see Confidence type for details).
mapCoverageFraction of the camera's view covered by valid 3D map data (0.0-1.0).
timestampImage timestamp (same as input).

Variable Details​

confidence​
Confidence confidence

Confidence score (see Confidence type for details)

covariance​
std::optional<PositionCovariance> covariance

Position covariance matrix (see PositionCovariance).

Set when an uncertainty estimate is available; otherwise empty.

mapCoverage​
double mapCoverage

Fraction of the camera's view covered by valid 3D map data (0.0-1.0)

Indicates how much of the camera's view intersects the loaded 3D map. Low values mean large portions of the frame fall outside the map, which reduces the quality of the matching and typically degrades result quality.

position​
PositionType position

Refined camera position

timestamp​
std::chrono::nanoseconds timestamp

Image timestamp (same as input)

Preserved from the input timestamp identifying when the input image was captured.