Defines 2D-based feature detection.
Data Structures | |
struct | dwFeature2DDetectorConfig |
Holds configuration parameters for a feature detector. More... | |
Typedefs | |
typedef struct dwFeature2DDetectorObject * | dwFeature2DDetectorHandle_t |
Handle representing a feature detector. More... | |
typedef struct dwFeature2DDetectorObject const * | dwConstFeature2DDetectorHandle_t |
Handle representing a const feature detector. More... | |
typedef enum dwFeature2DDetectorType | dwFeature2DDetectorType |
Defines different KLT tracking algorithms. More... | |
typedef struct dwFeature2DDetectorConfig | dwFeature2DDetectorConfig |
Holds configuration parameters for a feature detector. More... | |
Enumerations | |
enum | dwFeature2DDetectorType { DW_FEATURE2D_DETECTOR_TYPE_STD = 0, DW_FEATURE2D_DETECTOR_TYPE_EX, DW_FEATURE2D_DETECTOR_TYPE_FAST9, DW_FEATURE2D_DETECTOR_TYPE_COUNT } |
Defines different KLT tracking algorithms. More... | |
enum | dwFeature2DSelectionMaskType { DW_FEATURE2D_SELECTION_MASK_TYPE_UNIFORM = 0, DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSIAN, DW_FEATURE2D_SELECTION_MASK_TYPE_COUNT } |
Feature distribution mask for extended detector. More... | |
typedef struct dwFeature2DDetectorObject const* dwConstFeature2DDetectorHandle_t |
Handle representing a const feature detector.
Definition at line 49 of file FeatureDetector.h.
typedef struct dwFeature2DDetectorConfig dwFeature2DDetectorConfig |
Holds configuration parameters for a feature detector.
typedef struct dwFeature2DDetectorObject* dwFeature2DDetectorHandle_t |
Handle representing a feature detector.
Definition at line 46 of file FeatureDetector.h.
typedef enum dwFeature2DDetectorStage dwFeature2DDetectorStage |
Defines 2D-based feature detection.
The stage of feature tracker Pipeline running order is either 0), or 1). 1) 0 which runs feature detector for image on GPU 1) 100->101->102->103->104 which runs feature detector for image on a combination of processors, mainly on PVA.
typedef enum dwFeature2DDetectorType dwFeature2DDetectorType |
Defines different KLT tracking algorithms.
Defines 2D-based feature detection.
The stage of feature tracker Pipeline running order is either 0), or 1). 1) 0 which runs feature detector for image on GPU 1) 100->101->102->103->104 which runs feature detector for image on a combination of processors, mainly on PVA.
Definition at line 43 of file FeatureDetector_processpipeline.h.
Defines different KLT tracking algorithms.
Definition at line 54 of file FeatureDetector.h.
Feature distribution mask for extended detector.
Definition at line 70 of file FeatureDetector.h.
Defines internal functions of 2D-based feature detection.
Feature distribution mask for extended detector
Definition at line 38 of file FeatureDetectorExtra.h.
DW_API_PUBLIC dwStatus dwFeature2DDetector_bindInputImage | ( | dwImageHandle_t | image, |
dwFeatureArray * | preTrackedFeatures, | ||
const float32_t * | d_normalizedCrossCorrelation, | ||
dwFeature2DDetectorHandle_t | obj | ||
) |
Bind input parameters to detector object.
[in] | image | Specifies the image on which feature detection takes place, must be a CUDA image. |
[in,out] | preTrackedFeatures | Previous tracked features, if detector type is DW_FEATURE2D_DETECTOR_TYPE_EX , some of old features will be marked as DW_FEATURE2D_STATUS_INVALID during detection. The dwFeatureArray can either be an empty array allocated by dwFeatureArray_createNew or a slice from feature history by dwFeatureHistoryArray_getXXX |
[in] | d_normalizedCrossCorrelation | GPU pointer to nccScores of each feature, will be ignored if it's NULL. If the feature detector is connected to a tracker, d_normalizedCrossCorrelation can be filled by dwFeature2DTracker_trackFeatures . |
[in] | obj | Specifies the feature detector handle. |
dwFeature2DDetector_bindInputImage
must be called at least once before dwFeature2DDetector_processImage
. DW_API_PUBLIC dwStatus dwFeature2DDetector_bindInputPyramid | ( | const dwPyramidImage * | pyramid, |
dwFeatureArray * | preTrackedFeatures, | ||
const float32_t * | d_normalizedCrossCorrelation, | ||
dwFeature2DDetectorHandle_t | obj | ||
) |
Bind input parameters to detector object.
[in] | pyramid | Specifies the pyramid on which feature detection takes place. |
[in,out] | preTrackedFeatures | Previous tracked features, if detector type is DW_FEATURE2D_DETECTOR_TYPE_EX , some of old features will be marked as DW_FEATURE2D_STATUS_INVALID during detection. The dwFeatureArray can either be an empty array allocated by dwFeatureArray_createNew or a slice from feature history by dwFeatureHistoryArray_getXXX * |
[in] | d_normalizedCrossCorrelation | GPU pointer to nccScores of each feature, will be ignored if it's NULL. If the feature detector is connected to a tracker, d_normalizedCrossCorrelation can be filled by dwFeature2DTracker_trackFeatures . |
[in] | obj | Specifies the feature detector handle. |
dwFeature2DDetector_bindInputPyramid
must be called at least once before dwFeature2DDetector_processPyramid
. DW_API_PUBLIC dwStatus dwFeature2DDetector_bindOutput | ( | dwFeatureArray * | outputDetections, |
dwFeature2DDetectorHandle_t | obj | ||
) |
Bind output dwFeatureArray to detector object.
[out] | outputDetections | Detected features, composed of old tracked features and new detections, new detections are appended after old features. Must be created by dwFeatureArray_createNew() with DW_PROCESSOR_TYPE_GPU flag and the same maxFeatureCount when initializing detector |
[in] | obj | Specifies the feature detector handle. |
dwFeature2DDetector_bindOutput
to set output feature array. DW_API_PUBLIC dwStatus dwFeature2DDetector_detectFromImage | ( | dwFeatureArray * | outputDetections, |
dwImageHandle_t | image, | ||
dwFeatureArray * | preTrackedFeatures, | ||
const float32_t * | d_normalizedCrossCorrelation, | ||
dwFeature2DDetectorHandle_t | obj | ||
) |
Detects new features and append them after old tracked features.
Features are added only in areas where the mask == 0xff means valid area, any pixel whose mask value != 0xff will be ignored during tracking.
[out] | outputDetections | Detected features, composed of old tracked features and new detections, new detections are appended after old features. Must be created by dwFeatureArray_createNew() with DW_PROCESSOR_TYPE_GPU flag and the same maxFeatureCount when initializing detector |
[in] | image | Specifies the image on which feature detection takes place, must be a CUDA image. |
[in,out] | preTrackedFeatures | Previous tracked features, if detector type is DW_FEATURE2D_DETECTOR_TYPE_EX , some of old features will be marked as DW_FEATURE2D_STATUS_INVALID during detection. The dwFeatureArray can either be an empty array allocated by dwFeatureArray_createNew or a slice from feature history by dwFeatureHistoryArray_getXXX |
[in] | d_normalizedCrossCorrelation | GPU pointer to nccScores of each feature, will be ignored if it's NULL. If the feature detector is connected to a tracker, d_normalizedCrossCorrelation can be filled by dwFeature2DTracker_trackFeatures . |
[in] | obj | Specifies the feature detector handle. |
If there're N features in preTrackedFeatures, for DW_FEATURE2D_DETECTOR_TYPE_STD, the first N features in detectedFeatures are from preTrackedFeaturs, new detections are appended after old ones. for DW_FEATURE2D_DETECTOR_TYPE_EX, the first M(M <= N) features in detectedFeatures are from preTrackedFeaturs new detections are appended after old ones. The reason that M <= N is that some features in preTrackedFeatures will be marked as invalid to meet the restriction of uniform/gaussian distribution.
DW_API_PUBLIC dwStatus dwFeature2DDetector_detectFromPyramid | ( | dwFeatureArray * | outputDetections, |
const dwPyramidImage * | pyramid, | ||
dwFeatureArray * | preTrackedFeatures, | ||
const float32_t * | d_normalizedCrossCorrelation, | ||
dwFeature2DDetectorHandle_t | obj | ||
) |
Detects new features and append them after old tracked features.
Features are added only in areas where the mask == 0xff means valid area, any pixel whose mask value != 0xff will be ignored during tracking.
[out] | outputDetections | Detected features, composed of old tracked features and new detections, new detections are appended after old features. Must be created by dwFeatureArray_createNew() with DW_PROCESSOR_TYPE_GPU flag and the same maxFeatureCount when initializing detector |
[in] | pyramid | Specifies the pyramid on which feature detection takes place. |
[in,out] | preTrackedFeatures | Previous tracked features, if detector type is DW_FEATURE2D_DETECTOR_TYPE_EX , some of old features will be marked as DW_FEATURE2D_STATUS_INVALID during detection. The dwFeatureArray can either be an empty array allocated by dwFeatureArray_createNew or a slice from feature history by dwFeatureHistoryArray_getXXX * |
[in] | d_normalizedCrossCorrelation | GPU pointer to nccScores of each feature, will be ignored if it's NULL. If the feature detector is connected to a tracker, d_normalizedCrossCorrelation can be filled by dwFeature2DTracker_trackFeatures . |
[in] | obj | Specifies the feature detector handle. |
If there're N features in preTrackedFeatures, for DW_FEATURE2D_DETECTOR_TYPE_STD, the first N features in detectedFeatures are from preTrackedFeaturs, new detections are appended after old ones. for DW_FEATURE2D_DETECTOR_TYPE_EX, the first M(M <= N) features in detectedFeatures are from preTrackedFeaturs new detections are appended after old ones. The reason that M <= N is that some features in preTrackedFeatures will be marked as invalid to meet the restriction of uniform/gaussian distribution.
DW_API_PUBLIC dwStatus dwFeature2DDetector_dryrunDetectionImage | ( | dwFeatureArray * | outputDetections, |
dwFeatureArray * | preTrackedFeatures, | ||
const float32_t * | d_normalizedCrossCorrelation, | ||
dwFeature2DDetectorHandle_t | obj | ||
) |
Dryrun the detection to record a CUDA graph.
[out] | outputDetections | Detected features, composed of old tracked features and new detections, new detections are appended after old features. Must be created by dwFeatureArray_createNew() with DW_PROCESSOR_TYPE_GPU flag and the same maxFeatureCount when initializing detector |
[in,out] | preTrackedFeatures | Previous tracked features, if detector type is DW_FEATURE2D_DETECTOR_TYPE_EX , some of old features will be marked as DW_FEATURE2D_STATUS_INVALID during detection. The dwFeatureArray can either be an empty array allocated by dwFeatureArray_createNew or a slice from feature history by dwFeatureHistoryArray_getXXX |
[in] | d_normalizedCrossCorrelation | GPU pointer to nccScores of each feature, will be ignored if it's NULL. If the feature detector is connected to a tracker, d_normalizedCrossCorrelation can be filled by dwFeature2DTracker_trackFeatures . |
[in] | obj | Specifies the feature detector handle. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_dryrunDetectionPyramid | ( | dwFeatureArray * | outputDetections, |
dwFeatureArray * | preTrackedFeatures, | ||
const float32_t * | d_normalizedCrossCorrelation, | ||
dwFeature2DDetectorHandle_t | obj | ||
) |
Dryrun the detection to record a CUDA graph.
[out] | outputDetections | Detected features, composed of old tracked features and new detections, new detections are appended after old features. Must be created by dwFeatureArray_createNew() with DW_PROCESSOR_TYPE_GPU flag and the same maxFeatureCount when initializing detector |
[in,out] | preTrackedFeatures | Previous tracked features, if detector type is DW_FEATURE2D_DETECTOR_TYPE_EX , some of old features will be marked as DW_FEATURE2D_STATUS_INVALID during detection. The dwFeatureArray can either be an empty array allocated by dwFeatureArray_createNew or a slice from feature history by dwFeatureHistoryArray_getXXX * |
[in] | d_normalizedCrossCorrelation | GPU pointer to nccScores of each feature, will be ignored if it's NULL. If the feature detector is connected to a tracker, d_normalizedCrossCorrelation can be filled by dwFeature2DTracker_trackFeatures . |
[in] | obj | Specifies the feature detector handle. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_getCUDAStream | ( | cudaStream_t * | stream, |
dwFeature2DDetectorHandle_t | obj | ||
) |
Gets the CUDA stream used by the feature Detector.
[out] | stream | The CUDA stream currently used. |
[in] | obj | A handle to the feature Detector module. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_getPVAStream | ( | cupvaStream_t * | stream, |
dwFeature2DDetectorHandle_t | obj | ||
) |
Gets the CUPVA stream used by the feature Detector.
[out] | stream | The CUPVA stream currently used. |
[in] | obj | A handle to the feature Detector module. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_getScoreThreshold | ( | float32_t * | scoreThreshold, |
dwFeature2DDetectorHandle_t | obj | ||
) |
Get the current score threshold used in Harris detector.
[out] | scoreThreshold | Current score threshold used |
[in] | obj | A handle to the feature Detector module. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_getValidTrackedCount | ( | const uint32_t ** | d_validTrackedCount, |
dwFeature2DDetectorHandle_t | obj | ||
) |
dwFeature2DDetector_getValidTrackedCount
d_validTrackedCount | |
obj |
DW_API_PUBLIC dwStatus dwFeature2DDetector_initDefaultParams | ( | dwFeature2DDetectorConfig * | params | ) |
Initializes dwFeature2DDetector parameters with default values.
[in,out] | params | dwFeature2DDetector parameters; user can optionally set imageWidth/imageHeight before the API call to obtain the default parameters for the resolution |
DW_API_PUBLIC dwStatus dwFeature2DDetector_initDefaultParamsExtra | ( | dwFeature2DDetectorConfigExtra * | params | ) |
Initializes dwFeature2DDetector parameters with default values.
[out] | params | dwFeature2DDetector parameters |
DW_API_PUBLIC dwStatus dwFeature2DDetector_initDefaultParamsForCamera | ( | dwFeature2DDetectorConfig * | params, |
const dwTransformation3f * | cameraToRig, | ||
dwConstCameraModelHandle_t | cameraHandle | ||
) |
Initializes dwFeature2DDetector parameters with values best suited for the given camera using camera extrinsic (dwTransformation3f* cameraToRig) and camera intrinsic (dwConstCameraModelHandle_t cameraHandle)
[out] | params | dwFeature2DDetector parameters |
[in] | cameraToRig | transformed camera extrinsic parameters with respect to rig |
[in] | cameraHandle | holds camera intrinsic information |
DW_API_PUBLIC dwStatus dwFeature2DDetector_initDefaultParamsForCameraExtra | ( | dwFeature2DDetectorConfigExtra * | params, |
const dwTransformation3f * | cameraToRig, | ||
dwConstCameraModelHandle_t | cameraHandle | ||
) |
Initializes dwFeature2DDetector parameters with values best suited for the given camera using camera extrinsic (dwTransformation3f* cameraToRig) and camera intrinsic (dwConstCameraModelHandle_t cameraHandle)
[out] | params | dwFeature2DDetector parameters |
[in] | cameraToRig | transformed camera extrinsic parameters with respect to rig |
[in] | cameraHandle | holds camera intrinsic information |
DW_API_PUBLIC dwStatus dwFeature2DDetector_initialize | ( | dwFeature2DDetectorHandle_t * | obj, |
const dwFeature2DDetectorConfig * | config, | ||
cudaStream_t | cudaStream, | ||
dwContextHandle_t | context | ||
) |
Creates and initializes a feature Detector.
[out] | obj | A pointer to the feature Detector handle is returned here. |
[in] | config | Specifies the configuration parameters. |
[in] | cudaStream | Specifies the CUDA stream to use for Detector operations. |
[in] | context | Specifies the handle to the context under which it is created. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_initializeExtra | ( | dwFeature2DDetectorHandle_t * | obj, |
const dwFeature2DDetectorConfigExtra * | config, | ||
cudaStream_t | cudaStream, | ||
dwContextHandle_t | context | ||
) |
Creates and initializes a feature Detector.
[out] | obj | A pointer to the feature Detector handle is returned here. |
[in] | config | Specifies the configuration parameters. |
[in] | cudaStream | Specifies the CUDA stream to use for Detector operations. |
[in] | context | Specifies the handle to the context under which it is created. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_processImage | ( | dwFeature2DDetectorStage | stage, |
dwFeature2DDetectorHandle_t | obj | ||
) |
Do detections on the image bound by dwFeature2DDetector_bindInputImage
, output will be written to dwFeatureArray
bound by dwFeature2DDetector_bindOutput
.
Features are added only in areas where the mask == 0xff means valid area, any pixel whose mask value != 0xff will be ignored during tracking.
[in] | stage | Speicifies the detecting stage |
[in] | obj | Specifies the feature detector handle. |
If there're N features in preTrackedFeatures, for DW_FEATURE2D_DETECTOR_TYPE_STD, the first N features in detectedFeatures are from preTrackedFeaturs, new detections are appended after old ones. for DW_FEATURE2D_DETECTOR_TYPE_EX, the first M(M <= N) features in detectedFeatures are from preTrackedFeaturs new detections are appended after old ones. The reason that M <= N is that some features in preTrackedFeatures will be marked as invalid to meet the restriction of uniform/gaussian distribution.
DW_API_PUBLIC dwStatus dwFeature2DDetector_processPyramid | ( | dwFeature2DDetectorStage | stage, |
dwFeature2DDetectorHandle_t | obj | ||
) |
Do detections on the pyramid bound by dwFeature2DDetector_bindInputPyramid
, output will be written to dwFeatureArray
bound by dwFeature2DDetector_bindOutput
.
Features are added only in areas where the mask == 0xff means valid area, any pixel whose mask value != 0xff will be ignored during tracking.
[in] | stage | Speicifies the detecting stage |
[in] | obj | Specifies the feature detector handle. |
If there're N features in preTrackedFeatures, for DW_FEATURE2D_DETECTOR_TYPE_STD, the first N features in detectedFeatures are from preTrackedFeaturs, new detections are appended after old ones. for DW_FEATURE2D_DETECTOR_TYPE_EX, the first M(M <= N) features in detectedFeatures are from preTrackedFeaturs new detections are appended after old ones. The reason that M <= N is that some features in preTrackedFeatures will be marked as invalid to meet the restriction of uniform/gaussian distribution.
DW_API_PUBLIC dwStatus dwFeature2DDetector_registerFeatureArray | ( | dwFeatureArray * | inFeatures, |
dwFeature2DDetectorHandle_t | obj | ||
) |
Binds feature Array.
Internally the cuda pointer to featureArray is mapped to pva address space using the cupva cuda interop api
[in] | inFeatures | cuda pointer to Feature Array |
[in] | obj | A handle to the feature detector module. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_registerHistoryArray | ( | dwFeatureHistoryArray * | historyArray, |
dwFeature2DDetectorHandle_t | obj | ||
) |
Binds feature HistoryArray.
Internally, this function maps the feature history array to the PVA address space using the cupva cuda interop API.
[in] | historyArray | cuda pointer to Complete feature History Array |
[in] | obj | A handle to the feature tracker module. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_registerInputNccScore | ( | float32_t * | nccScore, |
uint32_t | nccScoreArraySize, | ||
dwFeature2DDetectorHandle_t | obj | ||
) |
Binds input ncc Score.
Internally the cuda pointer to nccScore is mapped to pva address space using the cupva cuda interop api
[in] | nccScore | cuda pointer to Input NccScore |
[in] | obj | A handle to the feature detector module. |
[in] | nccScoreArraySize | Number of elements in the ncc Score Array. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_release | ( | dwFeature2DDetectorHandle_t | obj | ) |
Releases the feature Detector.
This method releases all resources associated with a feature Detector.
[in] | obj | The feature detector handle to be released. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_reset | ( | dwFeature2DDetectorHandle_t | obj | ) |
Resets a feature Detector.
[in] | obj | Specifies the feature Detector handle to be reset. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_setCUDAStream | ( | cudaStream_t | stream, |
dwFeature2DDetectorHandle_t | obj | ||
) |
Sets the CUDA stream for CUDA related operations.
[in] | stream | The CUDA stream to be used. Default is the one passed during dwFeature2DDetector_initialize. |
[in] | obj | A handle to the feature Detector module to set CUDA stream for. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_setMask | ( | const uint8_t * | d_mask, |
const uint32_t | maskStrideBytes, | ||
const uint32_t | maskWidth, | ||
const uint32_t | maskHeight, | ||
dwFeature2DDetectorHandle_t | obj | ||
) |
Sets a mask to ignore areas of the image.
Areas where mask != 0xff will not produce new features when detectNewFeatures()
is called. The size of the mask must be the same as the image.
dwFeature2DDetector_initialize()
, it must be called with the same input parameters after dwFeature2DDetector_reset
because reset()
function will clear the existing mask.[in] | d_mask | A GPU pointer to the mask data. The data is copied. |
[in] | maskStrideBytes | Specifies the stride, in bytes, for each row of the mask. |
[in] | maskWidth | Specifies the width of the mask. |
[in] | maskHeight | Specifies the height of the mask. |
[in] | obj | Specifies the feature detector handle. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_setPVAStream | ( | cupvaStream_t | stream, |
dwFeature2DDetectorHandle_t | obj | ||
) |
Sets the CUPVA stream for PVA related operations.
[in] | stream | The CUPVA stream to be used. Default is the one passed during dwFeature2DDetector_initialize. |
[in] | obj | A handle to the feature Detector module to set CUPVA stream for. |
DW_API_PUBLIC dwStatus dwFeature2DDetector_setScoreThreshold | ( | float32_t | scoreThreshold, |
dwFeature2DDetectorHandle_t | obj | ||
) |
Set Harris detector's score threshold.
It's similar to dwFeature2DDetectorConfig::scoreThreshold, but this API allows setting the values in runtime.
[in] | scoreThreshold | Threshold to filter out low frequency points. All points whose scores are less than scoreThreshold will be considered as a non-feature point. Lower value will output more features, higher value will only keep the high frequency points. |
[in] | obj | A handle to the feature Detector module. |
const uint32_t DW_FEATURES2D_DETECTOR_MAX_CELL_SIZE = 128 |
Definition at line 231 of file FeatureDetector.h.