kpm
IntroductionlibKPM NFT image recognition and tracking initialisation routines. DiscussionThis header declares types and API for an NFT tracker, in particular those routines involved in recognising a texture page and initialising the tracking for use by the texture tracker. Functions
kpmChangePageNoOfRefDataSetint kpmChangePageNoOfRefDataSet ( KpmRefDataSet *refDataSet, int oldPageNo, int newPageNo ); ParameterskpmCreateHandleAllocate and initialise essential structures for KPM tracking, using full six degree-of-freedom tracking. KpmHandle *kpmCreateHandle ( ARParamLT *cparamLT, AR_PIXEL_FORMAT pixFormat ); Parameters
Return ValuePointer to a newly-allocated KpmHandle structure. This structure must be deallocated via a call to kpmDeleteHandle() when no longer needed. See Also kpmCreateHandleHomographyAllocate and initialise essential structures for KPM tracking, using homography-only tracking. KpmHandle *kpmCreateHandleHomography( int xsize, int ysize, AR_PIXEL_FORMAT pixFormat ); ParametersReturn ValuePointer to a newly-allocated KpmHandle structure. This structure must be deallocated via a call to kpmDeleteHandle() when no longer needed. DiscussionHomography tracking assumes that the camera has zero lens-distortion, and this does not depend on camera parameters. It is therefore unable to provide correctly calibrated position measurements, but the resulting pose is suitable for visual overlay purposes. See Also kpmDeleteHandleFinalise and dispose of structures for KPM tracking. int kpmDeleteHandle( KpmHandle **kpmHandle ); ParametersReturn Value0 if successful, or value <0 in case of error. DiscussionOnce KPM processing has completed, this routine should be called to dispose of memory allocated. See Also kpmDeleteRefDataSetDispose of a reference data set and its allocated memory. int kpmDeleteRefDataSet ( KpmRefDataSet **refDataSetPtr ); ParametersReturn Value0 if the delete succeeded, or a value < 0 in case of error. DiscussionOnce a data set has been loaded into a KPM handle, or is otherwise no longer required to be held in memory, it should be deleted (i.e. disposed) from memory by calling this function. See Also kpmLoadRefDataSetLoad a reference data set from the filesystem into memory. int kpmLoadRefDataSet ( const char *filename, const char *ext, KpmRefDataSet **refDataSetPtr ); Parameters
Return Value0 if the load succeeded, or a value < 0 in case of error. DiscussionThis does not set the reference data as the current tracking set. To do that, call kpmSetRefDataSet after this load completes. Alternately, the loaded set can be merged with another loaded set by calling kpmMergeRefDataSet. To dispose of the loaded dataset, call kpmDeleteRefDataSet. See Also kpmMatchingPerform key-point matching on an image. int kpmMatching( KpmHandle *kpmHandle, ARUint8 *inImage ); ParametersReturn Value0 if successful, or value <0 in case of error. See Also kpmMergeRefDataSetMerge a second KPM dataset into the first, and dispose of second. int kpmMergeRefDataSet ( KpmRefDataSet **refDataSetPtr1, KpmRefDataSet **refDataSetPtr2 ); Parameters
Return Value0 if the merge succeeded, or a value < 0 in case of error. DiscussionThis function merges two KPM datasets by adding the reference points in the second into the first (allocating a new set if the location pointed to by refDataSetPtr1 is NULL) and then deleting the second set. kpmSaveRefDataSetint kpmSaveRefDataSet ( const char *filename, const char *ext, KpmRefDataSet *refDataSet ); ParameterskpmSetRefDataSetLoad a reference data set into the key point matcher for tracking. int kpmSetRefDataSet( KpmHandle *kpmHandle, KpmRefDataSet *refDataSet ); Parameters
Return Value0 if successful, or value <0 in case of error. DiscussionThis function takes a reference data set already in memory and makes it the current dataset for key point matching. See Also kpmSetRefDataSetFileLoads a reference data set from a file into the KPM tracker. int kpmSetRefDataSetFile( KpmHandle *kpmHandle, const char *filename, const char *ext ); Parameters
Return ValueReturns 0 if successful, or value <0 in case of error. DiscussionThis is a convenience method which performs a sequence of kpmLoadRefDataSet, followed by kpmSetRefDataSet and finally kpmDeleteRefDataSet. When tracking from a single reference dataset file, this is the simplest means to start. See Also kpmUtilGenBWImageARUint8 *kpmUtilGenBWImage( ARUint8 *image, AR_PIXEL_FORMAT pixFormat, int xsize, int ysize, int procMode, int *newXsize, int *newYsize ); ParametersTypedefs
KpmInputDataSetData describing the number and location of keypoints in an input image to be matched against a loaded data set. typedef struct { KpmCoord2D *coord; int num; } KpmInputDataSet; FieldsDiscussionKey point matching occurs between a loaded data set and a set of keypoints extracted from an input image. This structure holds the number and pixel location of keypoints in the input image. The keypoints themselves are an array of 'num' KpmRefData structures. KpmRefDataSetA loaded dataset for KPM tracking. typedef struct { KpmRefData *refPoint; int num; KpmPageInfo *pageInfo; int pageNum; } KpmRefDataSet; FieldsDiscussionKey point matching takes as input a reference data set of points. This structure holds a set of points in memory prior to loading into the tracker. |