Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/
Handvu is the Mathias kolsch of ucsb, an open source computer vision library written by matz@cs.ucsb.edu. It uses C ++ as the basic implementation Language and opencv as the basis for image processing and partial algorithm implementation, the interface is presented in C language to facilitate Linux C programmers. The following is an annotation analysis of this interface:
Typedef struct _ hvstate {
Int obj_id; // fixed to a value of zero, indenthe the right hand.
/* Whether the object is successfully tracked and whether one of the key postures was recognized */
Bool tracked;
Bool recognized;
/* The location of the tracked object is reported in relative image coordinates, the image origin is in the left upper corner of the image */
Double center_xpos, center_ypos; // the location of the result of tracking
Double scale;
String posture; // posture that is recognized
Reftime tstamp; // time stamp
} Hvstate;
/* Finite state machines */
Enum hvaction {// specify recommendations to application:
Hv_invalid_action = 0, // invalid action
Hv_process_frame = 1, // fully process and display the frame
Hv_skip_frame = 2, // display but do not further process
Hv_drop_frame = 3 // do not display the frame
};
/* Initialize or uninitialize the interface */
Void hvinitialize (INT width, int height );
Void hvuninitialize ();
/* Load the config file or judge whether or not it is loaded correctly */
Void hvloadcondu( const string & filename );
Bool hvconductorloaded ();
/* Start or stop recongnition, default obj_id is 0 (indicates the Right Hand )*/
Void hvstartrecognition (INT obj_id = 0 );
Void hvstoprecognition (INT obj_id = 0 );
/* Process the frame, the type iplimage is belong to the opencv library */
Hvaction hvprocessframe (iplimage * inoutimage, iplimage * rightimage = NULL );
Bool hvisactive (); // judge whether the HV is active
/* Asynchronize method of processing the frame */
Void hvasyncsetup (INT num_buffers, void (* CB) (iplimage * IMG, hvaction action ));
Void hvasyncgetimagebuffer (iplimage ** pimage, int * pbufferid );
Void hvasyncprocessframe (INT bufferid );
/* Get the state of the hand which is being tracked */
Void hvgetstate (INT obj_id, hvstate & State );
/* Set the area of the hand being detected */
Void hvsetdetectionarea (INT left, int top, int right, int bottom );
/* Get the area of the hand being detected */
Void hvgetdetectionarea (int * pleft, int * pTop, int * pright, int * pbottom );
/* Recompute the latency of normal */
Void hvrecomputenormallatency ();
/* Set or get the amount and verbosity of the overlay */
/* Please refer to the page 90 of the paper */
Void hvsetoverlaylevel (INT level );
Int hvgetoverlaylevel ();
/* Some operation on correcting the distortion of camrea.
* This operation takes a considerable amount of time */
Void hvcorrectdistortion (bool enable = true );
Bool hviscorrectingdistortion ();
Bool hvcancorrectdistortion ();
/* Some operation on adjusting the exposure of camrea.
For the exposure adjustment to be possible (turned on Via setadjustexposure ),
Handvu must have been initialized with the cameracontroller! = NULL .*/
Void hvsetadjustexposure (bool enable = true );
Bool hvcanadjustexposure ();
Bool hvisadjustingexposure ();
/* Set the log file */
Void hvsetlogfile (const string & filename );
/* Save the related picture */
Void hvsavescannedarea (iplimage * pimg, string & picfile );
Void hvsaveimagearea (iplimage * pimg, int left, int top, int right, int bottom, string & picfile );
Void hvsetsavefilenameroot (const string & fname_root );
Void hvsetdotrack (bool do_track );
/* Set or start the Open Sound Control (OSC) server or gesture server defined by the author */
/* For Open Sound Control (OSC), please refer to the page 93 of the paper */
/* For the gesture server, please erfer to the page 94 of the paper */
Void hvstartgestureserver (INT port, int max_num_clients = 10 );
Void hvstartoscserver (const string & desthost, int destport );
Void hvstopgestureserver (INT port );
Void hvstoposcserver (const string & desthost, int destport );
/** Verbosity: 0 minimal, 3 maximal
*/
Void hvgetversion (string & version, int verbosity );
Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/