Difference between revisions of "Function:GoodFeaturesToTrack"
From CUVI Wiki
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
Detecting interesting parts of an image is an important step in most computer vision applications. Itserves as the first low-level processing step in applications like image segmentation, object recognition, object tracking and motion estimation. CUVI offers feature detectors including KLT, Harris and Peter in a single function | Detecting interesting parts of an image is an important step in most computer vision applications. Itserves as the first low-level processing step in applications like image segmentation, object recognition, object tracking and motion estimation. CUVI offers feature detectors including KLT, Harris and Peter in a single function | ||
===Function=== | ====Function==== | ||
{| | {| | ||
|style="font-size: | |style="font-size:100%;"| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
CuviStatus goodFeaturesToTrack(CuviImage | CuviStatus goodFeaturesToTrack(const CuviImage& src, | ||
const CuviRect& roi, | |||
CuviPointValue2D* | CuviPointValue2D<Cuvi32f,Cuvi32f>*& output, | ||
Cuvi32s | Cuvi32s& maxFeatures, | ||
CuviFeaturesCriteria criteria, | const CuviFeaturesCriteria criteria = CuviFeaturesCriteria(), | ||
CuviStream | const CuviStream& stream = CuviStream()); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
===Parameters=== | ====Parameters==== | ||
{| | |||
|style="font-size:75%;"| | |||
{|class="wikitable" | {|class="wikitable" | ||
|- | |- | ||
Line 21: | Line 23: | ||
! Description | ! Description | ||
|- | |- | ||
| | | src | ||
| CuviImage | | const CuviImage& | ||
| Input 8 bit Gray Scale Image. | | Input 8 bit Gray Scale Image. | ||
|- | |- | ||
| roi | | roi | ||
| | | const CuviRect& | ||
| Desired region of interest of input image. The function will return features from only that region of the image | | Desired region of interest of input image. The function will return features from only that region of the image | ||
|- | |- | ||
| | | output | ||
| CuviPointValue2D* | | CuviPointValue2D<Cuvi32f,Cuvi32f>*& | ||
| Output feature list that contains the coordinates & values of features/corners. | | Output feature list that contains the coordinates & values of features/corners. | ||
|- | |- | ||
| maxFeatures | | maxFeatures | ||
| Cuvi32s | | Cuvi32s& | ||
| Desired number of features. If the total features detected in the image or ROI are less than maxFeatures its value is updated to that number | | Desired number of features. If the total features detected in the image or ROI are less than maxFeatures its value is updated to that number | ||
|- | |- | ||
| criteria | | criteria | ||
| CuviFeaturesCriteria | | const CuviFeaturesCriteria | ||
| A structure containing various parameters that affect feature selection behavior | | A structure containing various parameters that affect feature selection behavior | ||
|- | |- | ||
| stream | | stream | ||
| CuviStream | | const CuviStream& | ||
| GPU stream ID for execution | | GPU stream ID for execution | ||
|} | |||
|} | |} | ||
====Image Type Support==== | |||
===Image Type Support=== | {| | ||
|style="font-size:75%;"| | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 56: | Line 58: | ||
|- | |- | ||
| 8uC1 | | 8uC1 | ||
| CuviPointValue2D | | CuviPointValue2D<Cuvi32f,Cuvi32f> | ||
|} | |} | ||
|} | |} | ||
====Samples=== | |||
[[File:Window.jpg|none|frame|Input Image]] | |||
<br/> | |||
[[File:Features.jpg|none|frame| Selected Features]] | |||
<br/> | |||
====Example==== | |||
===Example=== | |||
{| | {| | ||
|style="font-size: | |style="font-size:100%;"| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
//Create an 8-bit Grays-scale CuviImage | //Create an 8-bit Grays-scale CuviImage | ||
CuviImage | CuviImage gpu_image = cuvi::io::loadImage(path,CUVI_LOAD_IMAGE_GRAYSCALE); | ||
CuviPointValue2D *features; | CuviPointValue2D<Cuvi32f,Cuvi32f> *features; | ||
//Desired number of features | //Desired number of features | ||
Line 87: | Line 82: | ||
//Selecting complete image for the process | //Selecting complete image for the process | ||
CuviRect roi(0,0,img.width(),img.height()); | |||
//Setting Feature selection parameters | //Setting Feature selection parameters | ||
CuviFeaturesCriteria criteria | CuviFeaturesCriteria criteria(CUVI_FEATURES_HARRIS_PETER,0.006f,15,3,-2.0f); | ||
//Calling GoodFeaturesToTrack | //Calling GoodFeaturesToTrack | ||
cuvi::computerVision::goodFeaturesToTrack( | cuvi::computerVision::goodFeaturesToTrack(gimg,roi,features,featureCount,criteria); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} |
Latest revision as of 22:13, 18 October 2022
Detecting interesting parts of an image is an important step in most computer vision applications. Itserves as the first low-level processing step in applications like image segmentation, object recognition, object tracking and motion estimation. CUVI offers feature detectors including KLT, Harris and Peter in a single function
Function
|
Parameters
|
Image Type Support
|
=Samples
Error creating thumbnail: Unable to save thumbnail to destination
Error creating thumbnail: Unable to save thumbnail to destination
Example
|