#include <gandalf/vision/edge_disp.h>
There are functions to display both whole edge maps and individual edges,
the latter being used, for instance, to highlight edges in a different colour.
The functions invoke OpenGL routines, and the OpenGL display window must be
set up beforehand. Also you will need to set up some colours as single
precision floating point RGB pixel structures.
For instance the following will create primary colours for you:
Gan_RGBPixel_f blue = {0.0F, 0.0F, 1.0F}, green = {0.0F, 1.0F, 0.0F},
yellow = {1.0F, 1.0F, 0.0F}, red = {1.0F, 0.0F, 0.0F};
Once this is done, an example call to display an edge map is
/* display a whole edge map using OpenGL */
gan_edge_feature_map_display ( &EdgeMap, 0.0F /* displayed size of each edge */,
NULL, /* affine transformation of coordinates */
&red, /* colour of below-threshold edges */
&green, /* colour of edge strings */
&blue, /* colour of first edge in string */
&yellow, /* colour of last edge in string */
&green ); /* colour of bounding box */
The second argument is the size of the square box used to display each
edge point. If it is passed as zero, as is the case here, a single point is
drawn on the image. The third argument is an affine transformation
of coordinates that allows additional freedom in positioning and scaling
the edge map on the display window.vision_test.c has some example code
using this routine.
To highlight a single edgel, use instead
Gan_EdgeFeature *pEdge;
/* ... set pEdge to point to a Gan_EdgeFeature structure ... */
/* display a single edgel using OpenGL */
gan_edge_feature_display ( pEdge, 0.0F /* displayed size of each edge */,
NULL, /* affine transformation of coordinates */
&yellow ); /* colour to highlight edgel */
Note that the NULL passed for the affine coordinate transformation
indicates an identity transformation.