An image of the floor, centred on the world origin.
More...
#include <downward_camera.h>
|
| | FloorImage (const cv::Mat &image, real_t width) |
| | Constructor.
|
| void | write_texture (const std::string &path) const |
| | Write the image as a colour PNG, for a texture: Irrlicht reads colour pictures more reliably than grey ones. Throws if the file cannot be written.
|
| const cv::Mat & | image () const noexcept |
| real_t | width () const noexcept |
| | The width of the floor, along x [m].
|
| real_t | height () const noexcept |
| | The height of the floor, along y [m].
|
| real_t | metres_per_pixel () const noexcept |
| | The size of a pixel [m].
|
| cv::Point2d | to_pixel (real_t x, real_t y) const |
| | The pixel, with fractions, at the given point of the floor.
|
| std::array< real_t, 2 > | to_world (const cv::Point2d &pixel) const |
| | The point of the floor at the given pixel, with fractions.
|
| real_t | reflectance (real_t x, real_t y) const |
| | How bright the floor is at a point, from 0 for black to 1 for white: the brightness of the pixel there. Outside the image the floor is white. An infrared element looking at the floor reads this, see backends::CHRONO_InfraredBackend.
|
An image of the floor, centred on the world origin.
The image covers width() x height() metres of the floor. Its centre is at the origin, its columns grow with x and its rows grow against y, so the top of the image is the side of the floor with the largest y.
◆ FloorImage()
| bitsim::sensors::FloorImage::FloorImage |
( |
const cv::Mat & | image, |
|
|
real_t | width ) |
Constructor.
- Parameters
-
| image | The image of the floor |
| width | The width of the floor the image covers, along x [m] |
◆ draw()
Draw a floor: a grey picture of width x height metres of paper, with ink wherever is_ink(x, y) is true.
- Parameters
-
| width | The width of the floor, along x [m] |
| height | The height of the floor, along y [m] |
| metres_per_pixel | The size of a pixel [m] |
| is_ink | Whether the point (x, y) of the floor is inked |
| paper | The brightness of the paper, 0 to 255 |
| ink | The brightness of the ink |
◆ height()
| real_t bitsim::sensors::FloorImage::height |
( |
| ) |
const |
|
inlinenoexcept |
The height of the floor, along y [m].
◆ image()
| const cv::Mat & bitsim::sensors::FloorImage::image |
( |
| ) |
const |
|
inlinenoexcept |
◆ metres_per_pixel()
| real_t bitsim::sensors::FloorImage::metres_per_pixel |
( |
| ) |
const |
|
inlinenoexcept |
◆ reflectance()
How bright the floor is at a point, from 0 for black to 1 for white: the brightness of the pixel there. Outside the image the floor is white. An infrared element looking at the floor reads this, see backends::CHRONO_InfraredBackend.
◆ to_pixel()
| cv::Point2d bitsim::sensors::FloorImage::to_pixel |
( |
real_t | x, |
|
|
real_t | y ) const |
The pixel, with fractions, at the given point of the floor.
◆ to_world()
| std::array< real_t, 2 > bitsim::sensors::FloorImage::to_world |
( |
const cv::Point2d & | pixel | ) |
const |
The point of the floor at the given pixel, with fractions.
◆ width()
| real_t bitsim::sensors::FloorImage::width |
( |
| ) |
const |
|
inlinenoexcept |
The width of the floor, along x [m].
◆ write_texture()
| void bitsim::sensors::FloorImage::write_texture |
( |
const std::string & | path | ) |
const |
Write the image as a colour PNG, for a texture: Irrlicht reads colour pictures more reliably than grey ones. Throws if the file cannot be written.
The documentation for this class was generated from the following files: