Dewobble
Video motion stabilization with awareness of lens projection
Public Member Functions | Public Attributes | List of all members
dewobble::Camera Class Reference

#include <camera.hpp>

Public Member Functions

 Camera (Projection projection, double diagonal_field_of_view, int width, int height, double focal_point_x, double focal_point_y)
 
cv::Mat distortion_coefficients () const
 
std::vector< cv::Point2f > distortPoints (std::vector< cv::Point2f > points, cv::InputArray input_matrix=cv::noArray()) const
 
cv::Matx33d matrix () const
 
cv::Size size () const
 
std::vector< cv::Point2f > undistortPoints (std::vector< cv::Point2f > points, cv::InputArray rotation=cv::noArray(), cv::InputArray output_matrix=cv::noArray()) const
 

Public Attributes

const double m_focal_length
 
const double m_focal_point_x
 
const double m_focal_point_y
 
const int m_height
 
const Projection m_projection
 
const int m_width
 

Detailed Description

The properties of a camera which affect the mapping between pixels in images and real world coordinates. May be used to interpret an input image or to generate an output image.

Member Function Documentation

◆ size()

cv::Size dewobble::Camera::size ( ) const

Get the size of images produced by the camera

Returns
cv::Size

◆ matrix()

cv::Matx33d dewobble::Camera::matrix ( ) const

Get the camera matrix which converts image points to world points

Returns
cv::Matx33d

◆ distortion_coefficients()

cv::Mat dewobble::Camera::distortion_coefficients ( ) const

Get the distortion coefficients for the OpenCV camera model

Returns
cv::Mat

◆ undistortPoints()

std::vector<cv::Point2f> dewobble::Camera::undistortPoints ( std::vector< cv::Point2f >  points,
cv::InputArray  rotation = cv::noArray(),
cv::InputArray  output_matrix = cv::noArray() 
) const

Convert a set of points in an image generated by the camera to points in a chosen camera matrix.

Parameters
pointsThe input points projected by this camera
rotationOptional rotation to apply to the points in the world coordinate space
output_matrixOptional output camera matrix. If not given, the identity matrix is used.
Returns
std::vector<cv::Point2f> The converted points projected by the output matrix

◆ distortPoints()

std::vector<cv::Point2f> dewobble::Camera::distortPoints ( std::vector< cv::Point2f >  points,
cv::InputArray  input_matrix = cv::noArray() 
) const

Map a set of points using the specified input matrix to their location as they would gbe projected by this camera.

Parameters
pointsThe input points projected by the input matrix
input_matrixOptional input camera matrix. If not given, the identity matrix is used.
Returns
std::vector<cv::Point2f> The output points projected by this camera

Member Data Documentation

◆ m_projection

const Projection dewobble::Camera::m_projection

Projection model used for the camera

◆ m_focal_length

const double dewobble::Camera::m_focal_length

Focal length in pixels

◆ m_width

const int dewobble::Camera::m_width

Width of the image in pixels

◆ m_height

const int dewobble::Camera::m_height

Height of the image in pixels

◆ m_focal_point_x

const double dewobble::Camera::m_focal_point_x

Horizontal coordinate of the focal point, where the lens faces

◆ m_focal_point_y

const double dewobble::Camera::m_focal_point_y

Vertical coordinate of the focal point, where the lens faces


The documentation for this class was generated from the following file: