#include <assert.h>
#include <sys/time.h>
#include "CRC.hpp"
#include "CV.hpp"
#include "File.hpp"
#include "FEC.hpp"
#include "Map.hpp"
#include "String.hpp"
#include "Tag.hpp"
Go to the source code of this file.
Classes | |
struct | Fiducials__Struct |
struct | Fiducials_Create__Struct |
struct | Fiducials_Results__Struct |
Typedefs | |
typedef struct Fiducials__Struct * | Fiducials |
typedef void(* | Fiducials_Arc_Announce_Routine )(void *announce_object, int from_id, double from_x, double from_y, double from_z, int to_id, double to_x, double to_y, double to_z, double goodness, bool in_spanning_tree) |
typedef struct Fiducials_Create__Struct * | Fiducials_Create |
typedef void(* | Fiducials_Fiducial_Announce_Routine )(void *announce_object, int id, int direction, double world_diagonal, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) |
typedef void(* | Fiducials_Location_Announce_Routine )(void *announce_object, int id, double x, double y, double z, double bearing) |
typedef struct Fiducials_Results__Struct * | Fiducials_Results |
typedef void(* | Fiducials_Tag_Announce_Routine )(void *announce_object, int id, double x, double y, double z, double twist, double diagonal, double distance_per_pixel, bool visible, int hop_count) |
typedef bool | Mapping [64] |
typedef struct timeval * | Time_Value |
Functions | |
void | Fiducials__arc_announce (void *announce_object, int from_id, double from_x, double from_y, double from_z, int to_id, double to_x, double to_y, double to_z, double goodness, bool in_spanning_tree) |
Callback routine that prints a new *Arc* object when it shows up. | |
Fiducials | Fiducials__create (CV_Image original_image, Fiducials_Create fiducials_create) |
Create and return a *Fiducials* object. | |
void | Fiducials__free (Fiducials fiduicals) |
will release the storage associated with *fiducials*. | |
void | Fiducials__image_set (Fiducials fiducials, CV_Image image) |
Sets the original image for *fiducials. | |
void | Fiducials__image_show (Fiducials fiducials, bool show) |
Is a HighGUI interface to show the current image. | |
void | Fiducials__location_announce (void *object, int id, double x, double y, double z, double bearing) |
Callback routine that prints out location when it changes. | |
int | Fiducials__point_sample (Fiducials fiducials, CV_Point2D32F point) |
Helper routine to sample a point from the image in *fiducials*. | |
int | Fiducials__points_maximum (Fiducials fiducials, CV_Point2D32F_Vector points, unsigned int start_index, unsigned int end_index) |
Return the maximum value of the points in *points*. | |
int | Fiducials__points_minimum (Fiducials fiducials, CV_Point2D32F_Vector points, unsigned int start_index, unsigned int end_index) |
Return the minimum value of the points in *points*. | |
Fiducials_Results | Fiducials__process (Fiducials fiducials) |
Process the current image associated with *fiducials*. | |
CV_Point2D32F_Vector | Fiducials__references_compute (Fiducials fiducials, CV_Point2D32F_Vector corners) |
Return 8 sample locations to determine if a quadralateral is worth testing for quadralateral'ness. | |
void | Fiducials__sample_points_compute (CV_Point2D32F_Vector corners, CV_Point2D32F_Vector sample_points) |
Compute the fiducial locations to sample using *corners*. | |
void | Fiducials__sample_points_helper (String_Const label, CV_Point2D32F corner, CV_Point2D32F sample_point) |
void | Fiducials__tag_announce (void *announce_object, int id, double x, double y, double z, double twist, double diagonal, double distance_per_pixel, bool visible, int hop_count) |
Print out tag update information. | |
Fiducials_Create | Fiducials_Create__one_and_only (void) |
Returns the one and only *Fiducials_Create* object. |
typedef struct Fiducials__Struct* Fiducials |
Definition at line 6 of file Fiducials.hpp.
typedef void(* Fiducials_Arc_Announce_Routine)(void *announce_object, int from_id, double from_x, double from_y, double from_z, int to_id, double to_x, double to_y, double to_z, double goodness, bool in_spanning_tree) |
Definition at line 13 of file Fiducials.hpp.
typedef struct Fiducials_Create__Struct* Fiducials_Create |
Definition at line 7 of file Fiducials.hpp.
typedef void(* Fiducials_Fiducial_Announce_Routine)(void *announce_object, int id, int direction, double world_diagonal, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) |
Definition at line 26 of file Fiducials.hpp.
typedef void(* Fiducials_Location_Announce_Routine)(void *announce_object, int id, double x, double y, double z, double bearing) |
Definition at line 18 of file Fiducials.hpp.
typedef struct Fiducials_Results__Struct* Fiducials_Results |
Definition at line 8 of file Fiducials.hpp.
typedef void(* Fiducials_Tag_Announce_Routine)(void *announce_object, int id, double x, double y, double z, double twist, double diagonal, double distance_per_pixel, bool visible, int hop_count) |
Definition at line 21 of file Fiducials.hpp.
typedef bool Mapping[64] |
Definition at line 41 of file Fiducials.hpp.
typedef struct timeval* Time_Value |
Definition at line 44 of file Fiducials.hpp.
void Fiducials__arc_announce | ( | void * | announce_object, |
int | from_id, | ||
double | from_x, | ||
double | from_y, | ||
double | from_z, | ||
int | to_id, | ||
double | to_x, | ||
double | to_y, | ||
double | to_z, | ||
double | goodness, | ||
bool | in_spanning_tree | ||
) |
Callback routine that prints a new *Arc* object when it shows up.
announce_object | is unused (other routines might us it). |
from_id | is the tag identifier that has the lower tag id number. |
from_x | is the X coordinate of the from tag. |
from_y | is the Y coordinate of the from tag. |
from_z | is the Z coordinate of the from tag. |
to_id | is the tag identifier that has the higher tag id number. |
to_x | is the X coordinate of the to tag. |
to_y | is the Y coordinate of the to tag. |
to_z | is the Z coordinate of the to tag. |
goodness | is the distance between the arc center point and the camera. |
in_spanning_tree | is true if the arc is in the spanning tree. |
Fiducials__arc_announce*() is a callback routine that can be called whenever an arc data structure is modified. The announce routine is specified as an argument to *Map__create*().
Definition at line 414 of file Fiducials.cpp.
Fiducials Fiducials__create | ( | CV_Image | original_image, |
Fiducials_Create | fiducials_create | ||
) |
Create and return a *Fiducials* object.
original_image | is the image to start with. |
fiducials_create | is a *Fiducials_Create* object that specifies the various features to enable or disable. |
Fiducials__create*() creates and returns a *Fiducials* object using the values in *fiduicials_create*.
Definition at line 611 of file Fiducials.cpp.
void Fiducials__free | ( | Fiducials | fiducials | ) |
will release the storage associated with *fiducials*.
fiducials | is the *Fiducials* object to release. |
Fiducials__free*() releases the storage associated with *fiducials*.
Definition at line 850 of file Fiducials.cpp.
void Fiducials__image_set | ( | Fiducials | fiducials, |
CV_Image | image | ||
) |
Sets the original image for *fiducials.
fiducials | is the *Fiducials* object to use. |
image | is the new image to use as the original image. |
Fiducials__image_set*() will set the original image for *fiducials* to *image*.
Definition at line 481 of file Fiducials.cpp.
void Fiducials__image_show | ( | Fiducials | fiducials, |
bool | show | ||
) |
Is a HighGUI interface to show the current image.
fiducials | is the *Fiducials* object that contains the image. |
show | is true to force the HighGUI interface to activate. |
Fiducials__image_show*() will cause an image to be shown with at each of the various stages of the recognition cycle. This only occurs if *show* is *true*.
The character commands are:
'/033' -- Escape from program. '+' -- View next stage in processing pipeline. '-' -- View previous stage in processing pipeline. '<' -- Goto beginning of processing pipeline. 'b' -- Toggle image blur. 'f' -- Flip fiducials allong X axis
Definition at line 505 of file Fiducials.cpp.
void Fiducials__location_announce | ( | void * | announce_object, |
int | id, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double | bearing | ||
) |
Callback routine that prints out location when it changes.
announce_object | is unused. |
id | is ??? |
x | is the X location of the robot. |
y | is the Y location of the robot. |
z | is the Y location of the robot (currently ignored.) |
bearing | is the robot bearin in radians. |
Fiducials__location_announce*() is a callback routine that can be calld to print out the location information. The location announce routine is a field of the *Fiducials_Create__Struct*.
Definition at line 439 of file Fiducials.cpp.
int Fiducials__point_sample | ( | Fiducials | fiducials, |
CV_Point2D32F | point | ||
) |
Helper routine to sample a point from the image in *fiducials*.
fiducials | is the *Fiducials* object that contains the image. |
point | is the point location to sample. |
Fiducials__point_sample*() will return a weighted sample value for point* in the image associated with *fiducials*. The weight algorithm is controlled by the *weights_index* field of *fiducials*. The returned value is between 0 (black) to 255 (white).
Definition at line 1541 of file Fiducials.cpp.
int Fiducials__points_maximum | ( | Fiducials | fiducials, |
CV_Point2D32F_Vector | points, | ||
unsigned int | start_index, | ||
unsigned int | end_index | ||
) |
Return the maximum value of the points in *points*.
fiducials | is the *Fiducials* object that contains the image. |
points | is the vector of points to sample. |
start_index | is the first index to start with. |
end_index | is the last index to end with. |
Fiducials__points_maximum*() will sweep from *start_index* to end_index* through *points*. Using each selected point in *points*}, the corresponding value in *image* is sampled. The minimum of the sampled point is returned.
Definition at line 1782 of file Fiducials.cpp.
int Fiducials__points_minimum | ( | Fiducials | fiducials, |
CV_Point2D32F_Vector | points, | ||
unsigned int | start_index, | ||
unsigned int | end_index | ||
) |
Return the minimum value of the points in *points*.
fiducials | is the *Fiducials* object that contains the image. |
points | is the vector of points to sample. |
start_index | is the first index to start with. |
end_index | is the last index to end with. |
Fiducials__points_minimum*() will sweep from *start_index* to end_index* through *points*. Using each selected point in *points*}, the corresponding value in *image* is sampled. The minimum of the sampled point is returned.
Definition at line 1814 of file Fiducials.cpp.
Fiducials_Results Fiducials__process | ( | Fiducials | fiducials | ) |
Process the current image associated with *fiducials*.
fiducials | is the *Fiducials* object to use. |
Fiducials__process*() will process *fiducials* to determine the robot location.
Definition at line 910 of file Fiducials.cpp.
CV_Point2D32F_Vector Fiducials__references_compute | ( | Fiducials | fiducials, |
CV_Point2D32F_Vector | corners | ||
) |
Return 8 sample locations to determine if a quadralateral is worth testing for quadralateral'ness.
fiducials | is the *Fiducals* object that contains the image. |
corners | is the 4 potential fiducial corners. |
Fiducials__references_compute*() 4 corner points in *corners* to compute 8 reference points that are returned. The first 4 reference points will be just outside of the quadrateral formed by *corners* (i.e. the white bounding box) and the last 4 reference points are on the inside (i.e. the black bounding box). The returned vector is perminately allocated in *fiducials*, so it does not need to have it storage released.
Definition at line 1691 of file Fiducials.cpp.
void Fiducials__sample_points_compute | ( | CV_Point2D32F_Vector | corners, |
CV_Point2D32F_Vector | sample_points | ||
) |
Compute the fiducial locations to sample using *corners*.
corners | is the the 4 of the fiducials. |
sample_points | is the 64 vector of points that are computed. |
Fiducials__sample_points_compute*() will use the 4 corners in corners* as a quadralateral to compute an 8 by 8 grid of tag bit sample points and store the results into the the 64 preallocated *CV_Point2D32F* objects in *sample_points*. The quadralateral must be convex and in the counter-clockwise direction. Bit 0 will be closest to corners[1], bit 7 will be closest to corners[0], bit 56 closest to corners[2] and bit 63 closest to corners[3].
Definition at line 1848 of file Fiducials.cpp.
void Fiducials__sample_points_helper | ( | String_Const | label, |
CV_Point2D32F | corner, | ||
CV_Point2D32F | sample_point | ||
) |
void Fiducials__tag_announce | ( | void * | announce_object, |
int | id, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double | twist, | ||
double | diagonal, | ||
double | distance_per_pixel, | ||
bool | visible, | ||
int | hop_count | ||
) |
Print out tag update information.
announce_object | is an opaque object from *Map*->*announce_object*. |
id | is the tag id. |
x | is the tag X location. |
y | is the tag Y location. |
z | is the tag Z location. |
twist | is the tag twist in radians. |
diagonal | is the tag diagonal distance. |
distance_per_pixel | is the distance per pixel. |
visible | is (*bool*)1 if the tag is currently in camera field of view, and (*bool*)0 otherwise. |
hop_count | is the hop count along the spanning tree to the origin. |
Fiducials_tag_announce*() is a tag announce routine that can be fed into *Fiducials__create*() as a routine to call each time a tag is updated.
Definition at line 1979 of file Fiducials.cpp.
Returns the one and only *Fiducials_Create* object.
Fiducials_Create__one_and_only*() will return the one and only Fiducials_Create* object. This object needs to be initalized prior to calling *Fiduciasl__create*().
Definition at line 2011 of file Fiducials.cpp.