Difference between revisions of "Function:TrackFeatures"
From CUVI Wiki
| Line 84: | Line 84: | ||
CuviSize size = cuviSize(img1->width,img1->height); | CuviSize size = cuviSize(img1->width,img1->height); | ||
//Create two 8-bit Grays-scale CuviImage | //Create two 8-bit Grays-scale CuviImage objects | ||
CuviImage* gimg1 = new CuviImage(size,img1->depth,img1->nChannels); | CuviImage* gimg1 = new CuviImage(size,img1->depth,img1->nChannels); | ||
CuviImage* gimg2 = new CuviImage(size,img1->depth,img1->nChannels); | CuviImage* gimg2 = new CuviImage(size,img1->depth,img1->nChannels); | ||
| Line 104: | Line 104: | ||
//Select Features | //Select Features | ||
cuvi:: | cuvi::computerVision::goodFeaturesToTrack(gimg1,roi,&features1,&featureCount,fc); | ||
//Track the selected features from first frame onto second frame | //Track the selected features from first frame onto second frame | ||
cuvi:: | cuvi::computerVision::trackFeatures(gimg1,gimg2,features1,&features2,featureCount,tc); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
Revision as of 05:38, 14 May 2012
CUVI Feature tracker tracks input features from frame 1 onto frame 2. The function is ideal for tracking selected number of features through an image sequence or a video stream. This is a custom algorithm and does not use optical flows to estimate motion. Check out Motion Estimate section for more details on Optical Flow based motion tracking.
Function
|
Parameters
| Name | Type | Description |
|---|---|---|
| previousImage | CuviImage* | The first image whose features are to be tracked |
| nextImage | CuviImage* | Second image, in which to look for features of first image |
| inputFeatures | CuviPointValue2D* | Feature of first image |
| trackedFeatures | CuviPointValue2D** | Output feature list containing the location of tracked features from first image onto second image |
| featureCount | Cuvi32s | Number of features to track |
| criteria | CuviFeaturesCriteria | A structure containing various parameters that affect feature tracking behavior |
| stream | CuviStream* | GPU stream ID for execution |
Image Type Support
| Input | Output |
|---|---|
| 8uC1 | CuviPointValue2D |
Samples
Example
|

