struct sophus::ImageSize

Overview

Image size, hence its width and height. More…

#include <image_size.h>

struct ImageSize {
    // fields

    int width = 0;
    int height = 0;

    // construction

    ImageSize();

    ImageSize(
        int width,
        int height
        );

    // methods

    int area() const;
    bool contains(Eigen::Vector2i const& obs, int border = 0) const;

    bool contains(
        Eigen::Vector2f const& obs,
        float border = 0.f
        ) const;

    bool contains(
        Eigen::Vector2d const& obs,
        double border = 0.0
        ) const;

    bool isEmpty() const;
    Eigen::Array2<int> array() const;
    static ImageSize from(Eigen::Array2<int> const& arr);
};

Detailed Documentation

Image size, hence its width and height.

Fields

int width = 0

Horizontal width of images, i.e. number of columns.

int height = 0

Vertical height of images, i.e. number of rows.

Methods

bool contains(Eigen::Vector2i const& obs, int border = 0) const

Returns true if obs is within image.

Positive border makes the image frame smaller.