Class VisualPipeline

Inheritance Relationships

Derived Types

Class Documentation

class aslam::VisualPipeline

An interface for processors that turn images into VisualFrames.

This is the abstract interface for visual processors that turn raw images into VisualFrame data. The underlying pipeline may include undistortion or rectification, image contrast enhancement, feature detection and descriptor computation, or other operations.

The class has two Camera calibration structs that represent the extrinsic calibration of the camera. The “input” calibration (getInputCamera()) represents the calibration of raw camera, before any image processing, resizing, or undistortion has taken place. The “output” calibration (getOutputCamera()) represents the calibration parameters of the images and keypoints that get set in the VisualFrame struct. These are the camera parameters after image processing, resizing, undistortion, etc.

Subclassed by aslam::BriskVisualPipeline, aslam::FreakVisualPipeline, aslam::NullVisualPipeline

Public Functions

ASLAM_POINTER_TYPEDEFS(VisualPipeline)
ASLAM_DISALLOW_EVIL_CONSTRUCTORS(VisualPipeline)
VisualPipeline(const Camera::ConstPtr &input_camera, const Camera::ConstPtr &output_camera, bool copy_images)

Construct a visual pipeline from the input and output cameras.

Parameters
  • [in] input_camera: The intrinsics associated with the raw image.

  • [in] output_camera: The intrinsics associated with the keypoints.

  • [in] copy_images: Should we copy the image before storing it in the frame?

VisualPipeline(std::unique_ptr<Undistorter> &preprocessing, bool copy_images)

Construct a visual pipeline from the input and output cameras.

Parameters
  • [in] preprocessing: Preprocessing to apply to the image before sending to the pipeline.

  • [in] copy_images: Should we copy the image before storing it in the frame?

inline virtual ~VisualPipeline()
VisualFrame::Ptr processImage(const cv::Mat &image, int64_t timestamp) const

Add an image to the visual processor.

This function is called by a user when an image is received. The processor then processes the images and constructs a VisualFrame. This method constructs a basic frame and passes it on to processFrame().

Return

The visual frame built from the image data.

Parameters
  • [in] image: The image data.

  • [in] timestamp: The time in integer nanoseconds.

inline const Camera &getInputCamera() const

Get the input camera that corresponds to the image passed in to processImage().

Because this processor may do things like image undistortion or rectification, the input and output camera may not be the same.

inline const Camera &getOutputCamera() const

Get the output camera that corresponds to the VisualFrame data that comes out.

Because this pipeline may do things like image undistortion or rectification, the input and output camera may not be the same.

inline Camera::ConstPtr getInputCameraShared() const

Get a shared pointer to the input camera that corresponds to the image passed in to processImage().

Because this processor may do things like image undistortion or rectification, the input and output camera may not be the same.

inline Camera::ConstPtr getOutputCameraShared() const

Get a shared pointer to the output camera that corresponds to the VisualFrame data that comes out.

Because this pipeline may do things like image undistortion or rectification, the input and output camera may not be the same.

Protected Functions

inline VisualPipeline()
virtual void processFrameImpl(const cv::Mat &image, VisualFrame *frame) const = 0

Process the frame and fill the results into the frame variable.

This function can be used to chain together pipelines that do different things. The top level function will already fill in the timestamps and the output camera.

Parameters
  • [in] image: The image data.

Protected Attributes

const std::unique_ptr<Undistorter> preprocessing_

Preprocessing for the image. Can be null.

std::shared_ptr<const Camera> input_camera_

The intrinsics of the raw image.

std::shared_ptr<const Camera> output_camera_

The intrinsics of the raw image.

bool copy_images_

Should we copy the image before storing it in the frame?