Functions | Variables
Fiducials.cpp File Reference
#include <assert.h>
#include <sys/time.h>
#include <angles/angles.h>
#include <opencv2/highgui/highgui_c.h>
#include "CRC.hpp"
#include "CV.hpp"
#include "File.hpp"
#include "FEC.hpp"
#include "Fiducials.hpp"
#include "String.hpp"
#include "Location.hpp"
Include dependency graph for Fiducials.cpp:

Go to the source code of this file.

Functions

void CV_Point2D32F_Vector__corners_normalize (CV_Point2D32F_Vector corners)
 Force corners to be counter-clockwise. More...
 
bool CV_Point2D32F_Vector__is_clockwise (CV_Point2D32F_Vector corners)
 Return true if corners is in a clockwise direction. More...
 
Fiducials Fiducials__create (CV_Image original_image, Fiducials_Create fiducials_create)
 Create and return a Fiducials object. More...
 
void Fiducials__fiducial_announce (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)
 Callback routine tthat prints out the fidicial information. More...
 
void Fiducials__free (Fiducials fiducials)
 will release the storage associated with fiducials. More...
 
void Fiducials__image_set (Fiducials fiducials, CV_Image image)
 Sets the original image for *fiducials. More...
 
void Fiducials__image_show (Fiducials fiducials, bool show)
 Is a HighGUI interface to show the current image. More...
 
void Fiducials__map_save (Fiducials fiducials)
 Force the map associated with fiducials to be saved. More...
 
int Fiducials__point_sample (Fiducials fiducials, CV_Point2D32F point)
 Helper routine to sample a point from the image in fiducials. More...
 
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. More...
 
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. More...
 
Fiducials_Results Fiducials__process (Fiducials fiducials)
 Process the current image associated with fiducials. More...
 
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. More...
 
void Fiducials__sample_points_compute (CV_Point2D32F_Vector corners, CV_Point2D32F_Vector sample_points)
 Compute the fiducial locations to sample using corners More...
 
Fiducials_Create Fiducials_Create__one_and_only (void)
 Returns the one and only Fiducials_Create object. More...
 

Variables

static struct Fiducials_Create__Struct fiducials_create_struct
 

Function Documentation

void CV_Point2D32F_Vector__corners_normalize ( CV_Point2D32F_Vector  corners)

Force corners to be counter-clockwise.

Parameters
cornersis the list of 4 fiducial corners.

CV_Point2D32F_Vector__corners_normalize() will force corners to be counter-clockwise. Note there is no check to ensure that corners actually has 4 values in it.

Definition at line 1223 of file Fiducials.cpp.

bool CV_Point2D32F_Vector__is_clockwise ( CV_Point2D32F_Vector  corners)

Return true if corners is in a clockwise direction.

Parameters
cornersis a vector of 4 fiducials corners to test.
Returns
true if the corners are clockwiase and false otherwise.

CV_Point2D32F_Vector__is_clockwise() will return true if the 4 fiducial corners in corners are clockwise and false otherwise.

Definition at line 1253 of file Fiducials.cpp.

Fiducials Fiducials__create ( CV_Image  original_image,
Fiducials_Create  fiducials_create 
)

Create and return a Fiducials object.

Parameters
original_imageis the image to start with.
fiducials_createis 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 556 of file Fiducials.cpp.

void Fiducials__fiducial_announce ( 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 
)

Callback routine tthat prints out the fidicial information.

Parameters
announce_objectis unused.
idis the tag id.
directionspecifies (0-3) which of the 4 possible fiducial orientations matched.
world_diagonalis the diagonal measured in world coordinate.
x1is the X coordinate of corner1 in camera coordinates.
y1is the y coordinate of corner1 in camera coordinates.
x2is the X coordinate of corner2 in camera coordinates.
y2is the y coordinate of corner2 in camera coordinates.
x3is the X coordinate of corner3 in camera coordinates.
y3is the y coordinate of corner3 in camera coordinates.
x4is the X coordinate of corner4 in camera coordinates.
y4is the y coordinate of corner4 in camera coordinates.

Fiducials__fiducial_announce() will announce finding a fiducial in a camera image. This callback routine is supplied as an argument to Fiducials__create().

Definition at line 410 of file Fiducials.cpp.

void Fiducials__free ( Fiducials  fiducials)

will release the storage associated with fiducials.

Parameters
fiducialsis the Fiducials object to release.

Fiducials__free() releases the storage associated with fiducials.

Definition at line 713 of file Fiducials.cpp.

void Fiducials__image_set ( Fiducials  fiducials,
CV_Image  image 
)

Sets the original image for *fiducials.

Parameters
fiducialsis the Fiducials object to use.
imageis the new image to use as the original image.

Fiducials__image_set() will set the original image for fiducials to image.

Definition at line 427 of file Fiducials.cpp.

void Fiducials__image_show ( Fiducials  fiducials,
bool  show 
)

Is a HighGUI interface to show the current image.

Parameters
fiducialsis the Fiducials object that contains the image.
showis 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 451 of file Fiducials.cpp.

void Fiducials__map_save ( Fiducials  fiducials)

Force the map associated with fiducials to be saved.

Parameters
fiducialsis the Fiducials object to save the map of.

Fiducials__map_save() will cause the map associated with fiducials to be saved.

Definition at line 737 of file Fiducials.cpp.

int Fiducials__point_sample ( Fiducials  fiducials,
CV_Point2D32F  point 
)

Helper routine to sample a point from the image in fiducials.

Parameters
fiducialsis the Fiducials object that contains the image.
pointis the point location to sample.
Returns
weighted sample value.

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 1145 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.

Parameters
fiducialsis the Fiducials object that contains the image.
pointsis the vector of points to sample.
start_indexis the first index to start with.
end_indexis the last index to end with.
Returns
the maximum sampled value.

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 1386 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.

Parameters
fiducialsis the Fiducials object that contains the image.
pointsis the vector of points to sample.
start_indexis the first index to start with.
end_indexis the last index to end with.
Returns
the minimum sampled value.

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 1418 of file Fiducials.cpp.

Fiducials_Results Fiducials__process ( Fiducials  fiducials)

Process the current image associated with fiducials.

Parameters
fiducialsis the Fiducials object to use.
Returns
a Fiducials_Results that contains information about how the processing worked.

Fiducials__process() will process fiducials to determine the robot location.

Definition at line 748 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.

Parameters
fiducialsis the Fiducals object that contains the image.
cornersis the 4 potential fiducial corners.
Returns
a vector 8 places to test for ficial'ness.

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 1295 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

Parameters
cornersis the the 4 of the fiducials.
sample_pointsis 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 1452 of file Fiducials.cpp.

Fiducials_Create Fiducials_Create__one_and_only ( void  )

Returns the one and only Fiducials_Create object.

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 1572 of file Fiducials.cpp.

Variable Documentation

struct Fiducials_Create__Struct fiducials_create_struct
static
Initial value:
=
{
(void *)0,
}
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: Fiducials.hpp:13
const char * String_Const
Definition: String.hpp:9

Definition at line 1557 of file Fiducials.cpp.



fiducial_lib
Author(s): Wayne Gramlich
autogenerated on Thu Dec 28 2017 04:06:53