Program Listing for File undistorter.h

Return to documentation for file (aslam_cv2/aslam_cv_pipeline/include/aslam/pipeline/undistorter.h)

#ifndef ASLAM_UNDISTORTER_H_
#define ASLAM_UNDISTORTER_H_

#include <aslam/cameras/camera.h>
#include <aslam/common/macros.h>

// Forward declarations.
namespace cv { class Mat; };

namespace aslam {

class Undistorter {
public:
  ASLAM_POINTER_TYPEDEFS(Undistorter);
  ASLAM_DISALLOW_EVIL_CONSTRUCTORS(Undistorter);

protected:
  Undistorter() {};

public:
  Undistorter(Camera::Ptr input_camera, Camera::Ptr output_camera);

  virtual ~Undistorter() {};

  virtual void processImage(const cv::Mat& input_image, cv::Mat* output_image) const = 0;

  const Camera& getInputCamera() const { return *CHECK_NOTNULL(input_camera_.get()); };

  Camera::Ptr getInputCameraShared() { return input_camera_; };

  Camera::ConstPtr getInputCameraShared() const { return input_camera_; };

  const Camera& getOutputCamera() const { return *CHECK_NOTNULL(output_camera_.get()); };

  Camera::Ptr getOutputCameraShared() { return output_camera_; };

  Camera::ConstPtr getOutputCameraShared() const { return output_camera_; };

protected:
  Camera::Ptr input_camera_;
  Camera::Ptr output_camera_;
};

} // namespace aslam

#endif // ASLAM_UNDISTORTER_H_