Defined in File camera.h
This struct is returned by the camera projection methods and holds the result state of the projection operation.
Possible projection state.
Keypoint is visible and projection was successful.
Keypoint is NOT visible but projection was successful.
The projected point lies behind the camera plane.
The projection was unsuccessful.
Default value after construction.
- enumerator KEYPOINT_VISIBLE¶
inline constexpr ProjectionResult()¶
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 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.
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
- friend friend std::ostream & operator<< (std::ostream &out, const ProjectionResult &state)
Convenience function to print the state using streams.
- enum Status¶