Go to the documentation of this file.
17 template <
class TScalar>
22 template <
class TScalar>
41 Eigen::Array<TScalar, 2, 1>
const range = bounding_box.range();
42 Eigen::Array<TScalar, 2, 1>
const scale =
43 Eigen::Array<TScalar, 2, 1>(image_size.width, image_size.height) / range;
44 Eigen::Array<TScalar, 2, 1>
const offset =
45 -(0.5 + bounding_box.min().array() * scale);
47 Eigen::Matrix<TScalar, 4, 1>
const params(
48 scale.x(), scale.y(), offset.x(), offset.y());
55 template <
class TScalar>
58 Eigen::Vector<TScalar, 2>
min = (-ortho_cam.principalPoint().array() - 0.5) /
59 ortho_cam.focalLength().array();
62 min.array() + ortho_cam.imageSize().array().template cast<TScalar>() /
63 ortho_cam.focalLength().array());
Camera model class template for pinhole-like camera projections.
Definition: camera_model.h:83
auto orthoCamFromBoundingBox(Region2< TScalar > const &bounding_box, ImageSize image_size) -> OrthographicModelT< TScalar >
Returns orthographic camera model given bounding box and image size.
Definition: orthographic.h:23
Image MutImage, owning images types.
Definition: num_diff.h:20
auto min(TPoint const &a, TPoint const &b) -> TPoint
Definition: vector_space.h:104
static auto fromMinMax(TPoint const &min, TPoint const &max) noexcept -> Region< TPoint >
Creates Region from two points, min and max.
Definition: region.h:104
auto boundingBoxFromOrthoCam(OrthographicModelT< TScalar > const &ortho_cam) -> Region2< TScalar >
Returns 2d bounding box corresponding the the given orthographic camera model.
Definition: orthographic.h:56
CameraModelT< TScalar, AffineTransform, ProjectionOrtho > OrthographicModelT
Definition: orthographic.h:19
Image size, hence its width and height.
Definition: image_size.h:21
A region is a closed interval [a, b] with a being the lower bound (=min) and b being the upper bound ...
Definition: region.h:19