24#ifndef _FIREVISION_MODELS_MIRROR_BULB_H_
25#define _FIREVISION_MODELS_MIRROR_BULB_H_
27#include <fvmodels/mirror/mirrormodel.h>
33class SharedMemoryLookupTable;
42 Bulb(
const char *filename);
43 Bulb(
const char *filename,
const char *lut_id,
bool destroy_on_delete =
false);
45 Bulb(
unsigned int width,
unsigned int height);
46 Bulb(
unsigned int width,
unsigned int height,
const char *lut_id,
bool destroy_on_delete =
false);
56 unsigned int *unwarp_x,
57 unsigned int *unwarp_y);
59 unsigned int unwarp_y,
61 unsigned int *warp_y);
68 setWorldPoint(
unsigned int image_x,
unsigned int image_y,
float world_r,
float world_phi);
71 unsigned int image_y)
const;
77 float pose_ori)
const;
82 virtual void setCenter(
unsigned int image_x,
unsigned int image_y);
86 virtual bool isValidPoint(
unsigned int image_x,
unsigned int image_y)
const;
88 bool isNonZero(
unsigned int image_x,
unsigned int image_y)
const;
92 float getAngle(
unsigned int image_x,
unsigned int image_y)
const;
95 unsigned int image_p1_y,
96 unsigned int image_p2_x,
97 unsigned int image_p2_y);
101 void load(
const char *filename);
102 void save(
const char *filename);
130 unsigned int bytes_per_sample;
133 unsigned int image_center_x;
134 unsigned int image_center_y;
147 unsigned int lut_bytes;
148 bool destroy_on_delete;
Bulb mirror lookup table.
Bulb & operator=(const Bulb &bulb)
Assignment operator.
virtual fawkes::cart_coord_2d_t getWorldPointGlobal(unsigned int image_x, unsigned int image_y, float pose_x, float pose_y, float pose_ori) const
Get global coordinate based on image coordinates.
virtual bool isValidPoint(unsigned int image_x, unsigned int image_y) const
Check if the given point is valid.
virtual float getOrientation() const
Get orientation of the omni-camera.
static std::string composeFilename(const char *format)
Compose a filename matching the given format.
unsigned int numNonZero() const
Get number of non-zero entries.
float getDistanceInImage(unsigned int image_p1_x, unsigned int image_p1_y, unsigned int image_p2_x, unsigned int image_p2_y)
Euklidean distance between to image points.
void load(const char *filename)
Load LUT from file.
virtual fawkes::polar_coord_2d_t getWorldPointRelative(unsigned int image_x, unsigned int image_y) const
Get relative coordinate based on image coordinates.
virtual void setWorldPoint(unsigned int image_x, unsigned int image_y, float world_r, float world_phi)
Set a world point mapping.
Bulb(const char *filename)
Constructor.
float getAngle(unsigned int image_x, unsigned int image_y) const
Angle between direction to point and "to the right".
virtual fawkes::upoint_t getCenter() const
Get the image pixel that is the center of the omni-camera.
virtual ~Bulb()
Destructor.
void save(const char *filename)
Save LUT from file.
virtual void setOrientation(float angle)
Set orientation of the omni-camera device.
float convertAngleI2W(float angle_in_image) const
convertAngleI2W
virtual void setCenter(unsigned int image_x, unsigned int image_y)
Set center of omni-camera to given image pixel.
const fawkes::polar_coord_2d_t * get_lut() const
Get the raw lookup table.
virtual void unwarp2warp(unsigned int unwarp_x, unsigned int unwarp_y, unsigned int *warp_x, unsigned int *warp_y)
Transform unwarped to warped point.
virtual void reset()
Reset model.
virtual void warp2unwarp(unsigned int warp_x, unsigned int warp_y, unsigned int *unwarp_x, unsigned int *unwarp_y)
Transform warped to unwarped point.
virtual const char * getName()
Get name of model.
bool isNonZero(unsigned int image_x, unsigned int image_y) const
Check if pixel maps to valid world point.
virtual bool isValid()
Check if a valid LUT has been loaded.
Shared memory lookup table.
Cartesian coordinates (2D).
Point with cartesian coordinates as unsigned integers.