24 #ifndef __FIREVISION_MODELS_MIRROR_BULB_H_ 25 #define __FIREVISION_MODELS_MIRROR_BULB_H_ 27 #include <fvmodels/mirror/mirrormodel.h> 36 class SharedMemoryLookupTable;
40 friend class BulbGenerator;
44 Bulb(
const char *filename);
45 Bulb(
const char *filename,
46 const char *lut_id,
bool destroy_on_delete =
false);
48 Bulb(
unsigned int width,
unsigned int height);
49 Bulb(
unsigned int width,
unsigned int height,
50 const char *lut_id,
bool destroy_on_delete =
false);
56 virtual void warp2unwarp(
unsigned int warp_x,
unsigned int warp_y,
57 unsigned int *unwarp_x,
unsigned int *unwarp_y);
58 virtual void unwarp2warp(
unsigned int unwarp_x,
unsigned int unwarp_y,
59 unsigned int *warp_x,
unsigned int *warp_y );
73 unsigned int image_y )
const;
77 float pose_x,
float pose_y,
78 float pose_ori )
const;
83 virtual void setCenter(
unsigned int image_x,
84 unsigned int image_y );
88 virtual bool isValidPoint(
unsigned int image_x,
unsigned int image_y )
const;
92 unsigned int image_y )
const;
98 unsigned int image_y )
const;
101 unsigned int image_p2_x,
unsigned int image_p2_y );
106 void load(
const char * filename);
107 void save(
const char * filename);
137 unsigned int bytes_per_sample;
140 unsigned int image_center_x;
141 unsigned int image_center_y;
154 unsigned int lut_bytes;
155 bool destroy_on_delete;
virtual fawkes::upoint_t getCenter() const
Get the image pixel that is the center of the omni-camera.
Cartesian coordinates (2D).
virtual void reset()
Reset model.
Bulb(const char *filename)
Constructor.
virtual fawkes::polar_coord_2d_t getWorldPointRelative(unsigned int image_x, unsigned int image_y) const
Get relative coordinate based on image coordinates.
virtual bool isValid()
Check if a valid LUT has been loaded.
virtual bool isValidPoint(unsigned int image_x, unsigned int image_y) const
Check if the given point is valid.
virtual void warp2unwarp(unsigned int warp_x, unsigned int warp_y, unsigned int *unwarp_x, unsigned int *unwarp_y)
Transform warped to unwarped point.
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.
unsigned int numNonZero() const
Get number of non-zero entries.
bool isNonZero(unsigned int image_x, unsigned int image_y) const
Check if pixel maps to valid world point.
static std::string composeFilename(const char *format)
Compose a filename matching the given format.
virtual float getOrientation() const
Get orientation of the omni-camera.
Bulb mirror lookup table.
virtual void setOrientation(float angle)
Set orientation of the omni-camera device.
Point with cartesian coordinates as unsigned integers.
virtual ~Bulb()
Destructor.
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 setCenter(unsigned int image_x, unsigned int image_y)
Set center of omni-camera to given image pixel.
virtual const char * getName()
Get name of model.
void save(const char *filename)
Save LUT from file.
virtual void setWorldPoint(unsigned int image_x, unsigned int image_y, float world_r, float world_phi)
Set a world point mapping.
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.
float getAngle(unsigned int image_x, unsigned int image_y) const
Angle between direction to point and "to the right".
float convertAngleI2W(float angle_in_image) const
convertAngleI2W
Shared memory lookup table.