|
bitsim
Model, simulate, estimate and control robots in C++
|
A camera on a robot that looks straight down at the floor ahead. More...
#include <downward_camera.h>
Classes | |
| struct | Config |
| The camera's mounting and image. More... | |
Public Member Functions | |
| DownwardCamera () | |
| A camera with the default Config. | |
| DownwardCamera (const Config &config) | |
| const Config & | config () const noexcept |
| cv::Mat | view (const FloorImage &floor, real_t x, real_t y, real_t yaw) const |
| What the camera sees with the robot at (x, y) heading yaw. | |
| std::array< real_t, 2 > | to_robot (real_t column, real_t row) const |
| Where a pixel of the camera's image is relative to the robot. | |
| std::vector< std::array< real_t, 2 > > | line_points (const cv::Mat &view, uint_t n_bands=4, real_t dark_ratio=0.6, real_t min_share=0.02) const |
| Where a dark line crosses the camera's image: the image is cut into n_bands bands across the robot's heading, and for each band with enough dark pixels in it, the middle of them, relative to the robot [m], forward and to its left, as to_robot gives them. | |
| std::array< std::array< real_t, 2 >, 4 > | footprint (real_t x, real_t y, real_t yaw) const |
| The corners of the floor the camera sees, in world coordinates: far left, far right, near right, near left. | |
A camera on a robot that looks straight down at the floor ahead.
The camera sees a rectangle of the floor centred offset metres ahead of the robot's reference point, usually the centre of its axle. The rows of its image run from the far edge of that rectangle, row 0, to the near edge, and the columns from the robot's left, column 0, to its right, as a camera that faces forward and tilts down would show them.
A camera with the default Config.
|
explicit |
|
inlinenoexcept |
| std::array< std::array< real_t, 2 >, 4 > bitsim::sensors::DownwardCamera::footprint | ( | real_t | x, |
| real_t | y, | ||
| real_t | yaw ) const |
The corners of the floor the camera sees, in world coordinates: far left, far right, near right, near left.
| std::vector< std::array< real_t, 2 > > bitsim::sensors::DownwardCamera::line_points | ( | const cv::Mat & | view, |
| uint_t | n_bands = 4, | ||
| real_t | dark_ratio = 0.6, | ||
| real_t | min_share = 0.02 ) const |
Where a dark line crosses the camera's image: the image is cut into n_bands bands across the robot's heading, and for each band with enough dark pixels in it, the middle of them, relative to the robot [m], forward and to its left, as to_robot gives them.
| view | What the camera sees, grey or BGR |
| n_bands | How many bands to cut the image into, along the heading |
| dark_ratio | A pixel darker than this share of the brightest pixel is line |
| min_share | A band needs this share of its pixels dark to count |
| std::array< real_t, 2 > bitsim::sensors::DownwardCamera::to_robot | ( | real_t | column, |
| real_t | row ) const |
Where a pixel of the camera's image is relative to the robot.
| cv::Mat bitsim::sensors::DownwardCamera::view | ( | const FloorImage & | floor, |
| real_t | x, | ||
| real_t | y, | ||
| real_t | yaw ) const |
What the camera sees with the robot at (x, y) heading yaw.
Floor outside the image is white