Struct ProjectionResult

Struct Documentation

struct aslam::ProjectionResult

This struct is returned by the camera projection methods and holds the result state of the projection operation.

Public Types

enum Status

Possible projection state.

Values:

enumerator KEYPOINT_VISIBLE

Keypoint is visible and projection was successful.

enumerator KEYPOINT_OUTSIDE_IMAGE_BOX

Keypoint is NOT visible but projection was successful.

enumerator POINT_BEHIND_CAMERA

The projected point lies behind the camera plane.

enumerator PROJECTION_INVALID

The projection was unsuccessful.

enumerator UNINITIALIZED

Default value after construction.

Public Functions

inline constexpr ProjectionResult()
inline constexpr ProjectionResult(Status status)
inline explicit operator bool() const

ProjectionResult can be typecasted to bool and is true if the projected keypoint is visible.

Simplifies the check for a successful projection. Example usage:

aslam::ProjectionResult ret =
camera_->project3(Eigen::Vector3d(0, 0, -10), &keypoint); if(ret)
std::cout << "Projection was successful!\n";

inline bool operator==(const ProjectionResult &other) const

Compare objects.

inline bool operator==(const ProjectionResult::Status &other) const

Compare projection status.

inline bool isKeypointVisible() const

Check whether the projection was successful and the point is visible in the image.

inline Status getDetailedStatus() const

Returns the exact state of the projection operation.

Example usage:

aslam::ProjectionResult ret =
camera_->project3(Eigen::Vector3d(0, 0, -1), &keypoint);
if(ret.getDetailedStatus() ==
aslam::ProjectionResult::Status::KEYPOINT_OUTSIDE_IMAGE_BOX)
  std::cout << "Point behind camera! Lets do something...\n";

Public Static Attributes

static Status KEYPOINT_VISIBLE
static Status KEYPOINT_OUTSIDE_IMAGE_BOX
static Status POINT_BEHIND_CAMERA
static Status PROJECTION_INVALID
static Status UNINITIALIZED

Friends

friend friend std::ostream & operator<< (std::ostream &out, const ProjectionResult &state)

Convenience function to print the state using streams.