NVIDIA DeepStream SDK API Reference

9.2 Release
cuDCF Namespace Reference

Functions

void getDetectorBboxCorrelationResponses (const cudaStream_t &stream, const int num_of_targets, const int maxTargetsPerStream, const detectorBbox_t *detectedPts, const uint *detectedPts_size, const int detCorrRespSearchWindowSize, const float *corr_responses, const float *maxCorrResponse_ma, const int img_element_size, const int img_width, float *confidenceAtDetectedPt, float *corrRespAtDetectedPt)
 Read the correlation response near each detector bbox and write the confidence and response. More...
 
void applyFilter2D_U16 (const cudaStream_t &stream, const uint16_t *ftrs, const float *masking_window, const uint srcWidth, const uint srcPitch, const uint srcHeight, const uint2 outBatchingGrid, const uint num_of_channels, const uint num_of_targets, const bool useColorNames, const uint num_of_colorNames_channels, float *ftrs_masked)
 Multiply a 2D high-precision feature by a masking window elementwise. More...
 
void applyFilter2D_U8 (const cudaStream_t &stream, const uchar *ftrs, const float *masking_window, const uint srcWidth, const uint srcPitch, const uint srcHeight, const uint2 outBatchingGrid, const uint num_of_channels, const uint num_of_targets, const bool useColorNames, const uint num_of_colorNames_channels, float *ftrs_masked)
 Multiply a 2D low-precision feature by a masking window elementwise. More...
 
void createDcfFilter (const cudaStream_t &stream, const cufftHandle &cufft_handle_C2R, const cufftHandle &cufft_handle_R2C, const cuComplex *ftrs_F, const cuComplex *desiredResp_F, const float *masking_window_model, const int img_width, const int img_element_size, const int batch_element_size, const float lambda, const int num_of_channels, const int num_of_targets, cuComplex *work_F, float *work_I, const uint32_t *tracker_age, const bool *trackerDoProcessing_d, const float learn_rate, cuComplex *learned_filter_F, cuComplex *result_filter_F)
 Create a DCF filter and update the learned filter with an exponential moving average. More...
 
void createSegmentationFilterMask (const cudaStream_t &stream, const float *src_mask_frame_batch, const int src_frame_width, const int src_frame_element_size, const int feat_width, const int feat_element_size, const int batch_element_size, const int num_of_targets, const int num_of_channels, const float4 *src_rois, const bool *trackerDoProcessing_d, float *dst_mask_patch_batch)
 Crop and rescale each target's segmentation mask to the visual tracker region size. More...
 
void computeChannelWeights (const cudaStream_t &stream, const cufftHandle &cufft_handle_many, const cuComplex *ftrs_F, const int img_element_size, const int img_width, const int batch_element_size, const int batch_size, const int num_of_channels, const int num_of_targets, const cuComplex *new_filter_F, cuComplex *work_F, float *work_I, const uint32_t *tracker_age, const bool *trackerDoProcessing_d, const float weights_lr, float *channel_weights, float *weight_sum)
 Compute and update the channel weights via exponential moving average. More...
 
void calcuateExpectedPeakCorrelation (const cudaStream_t &stream, const int num_of_channels, const int num_of_targets, const float learn_rate, const float *channel_weights, const uint32_t *tracker_age, const bool *trackerDoProcessing_d, float *maxCorrResponse_ma)
 Compute the moving average of the max correlation response. More...
 
void calculateResponse (const cudaStream_t &stream, const cufftHandle &cufft_handle_many_small, const int img_width, const int img_element_size, const int batch_element_size, const int num_of_channels, const int num_of_targets, const cuComplex *ftrs_F, const cuComplex *result_filter_F, const float *channel_weights, cuComplex *work_F, float *corr_responses, float *maxResp, float2 *targetDisplacement)
 Given the Fourier-transformed extracted features and the learned filters, compute the correlation response. More...
 
void calculateTrackingConfidence (const cudaStream_t &stream, const int num_of_targets, const float *maxCorrResponse_ma, const float *maxCorrResponse, float *trackingConfidence)
 Calculate tracking confidence from moving-average and instantaneous peak correlation responses. More...
 

Function Documentation

◆ applyFilter2D_U16()

void cuDCF::applyFilter2D_U16 ( const cudaStream_t &  stream,
const uint16_t *  ftrs,
const float *  masking_window,
const uint  srcWidth,
const uint  srcPitch,
const uint  srcHeight,
const uint2  outBatchingGrid,
const uint  num_of_channels,
const uint  num_of_targets,
const bool  useColorNames,
const uint  num_of_colorNames_channels,
float *  ftrs_masked 
)

Multiply a 2D high-precision feature by a masking window elementwise.

Parameters
[in]streamCUDA stream.
[in]ftrsThe input high-precision feature.
[in]masking_windowThe filter multiplied with the feature.
[in]srcWidthThe width of the input feature.
[in]srcPitchThe pitch of the input feature.
[in]srcHeightThe height of the input feature.
[in]outBatchingGridThe 2D size of the VPI feature grid.
[in]num_of_channelsThe number of channels in a feature vector.
[in]num_of_targetsThe number of targets processed in this batch.
[in]useColorNamesWhether ColorNames features are included.
[in]num_of_colorNames_channelsThe number of leading ColorNames channels.
[out]ftrs_maskedThe feature after the filter is applied.

◆ applyFilter2D_U8()

void cuDCF::applyFilter2D_U8 ( const cudaStream_t &  stream,
const uchar *  ftrs,
const float *  masking_window,
const uint  srcWidth,
const uint  srcPitch,
const uint  srcHeight,
const uint2  outBatchingGrid,
const uint  num_of_channels,
const uint  num_of_targets,
const bool  useColorNames,
const uint  num_of_colorNames_channels,
float *  ftrs_masked 
)

Multiply a 2D low-precision feature by a masking window elementwise.

Parameters
[in]streamCUDA stream.
[in]ftrsThe input low-precision feature.
[in]masking_windowThe filter multiplied with the feature.
[in]srcWidthThe width of the input feature.
[in]srcPitchThe pitch of the input feature.
[in]srcHeightThe height of the input feature.
[in]outBatchingGridThe 2D size of the VPI feature grid.
[in]num_of_channelsThe number of channels in a feature vector.
[in]num_of_targetsThe number of targets processed in this batch.
[in]useColorNamesWhether ColorNames features are included.
[in]num_of_colorNames_channelsThe number of leading ColorNames channels.
[out]ftrs_maskedThe feature after the filter is applied.

◆ calcuateExpectedPeakCorrelation()

void cuDCF::calcuateExpectedPeakCorrelation ( const cudaStream_t &  stream,
const int  num_of_channels,
const int  num_of_targets,
const float  learn_rate,
const float *  channel_weights,
const uint32_t *  tracker_age,
const bool *  trackerDoProcessing_d,
float *  maxCorrResponse_ma 
)

Compute the moving average of the max correlation response.

Parameters
[in]streamCUDA stream.
[in]num_of_channelsThe number of channels in a feature vector.
[in]num_of_targetsThe number of targets processed in this batch.
[in]learn_rateThe learning rate for the moving average.
[in]channel_weightsThe adaptive filter weights for the channels.
[in]tracker_ageThe age of each tracker.
[in]trackerDoProcessing_dWhether to process each target.
[in,out]maxCorrResponse_maThe moving-averaged max correlation response.

◆ calculateResponse()

void cuDCF::calculateResponse ( const cudaStream_t &  stream,
const cufftHandle &  cufft_handle_many_small,
const int  img_width,
const int  img_element_size,
const int  batch_element_size,
const int  num_of_channels,
const int  num_of_targets,
const cuComplex *  ftrs_F,
const cuComplex *  result_filter_F,
const float *  channel_weights,
cuComplex *  work_F,
float *  corr_responses,
float *  maxResp,
float2 *  targetDisplacement 
)

Given the Fourier-transformed extracted features and the learned filters, compute the correlation response.

Parameters
[in]streamCUDA stream.
[in]cufft_handle_many_smallThe smaller cuFFT handle used for one correlation response per target.
[in]img_widthThe feature-matrix width.
[in]img_element_sizeThe number of elements in one feature matrix.
[in]batch_element_sizeThe number of feature-vector elements for all current trackers.
[in]num_of_channelsThe number of channels in a feature vector.
[in]num_of_targetsThe number of targets processed in this batch.
[in]ftrs_FThe extracted features in Fourier space.
[in]result_filter_FThe moving-averaged DCF filter in Fourier space.
[in]channel_weightsThe adaptive filter weights for the channels.
[out]work_FA temporary workspace for complex arrays.
[out]corr_responsesThe resulting correlation response in image space.
[out]maxRespThe peak response values.
[out]targetDisplacementThe target displacement from the center to the peak correlation response.

◆ calculateTrackingConfidence()

void cuDCF::calculateTrackingConfidence ( const cudaStream_t &  stream,
const int  num_of_targets,
const float *  maxCorrResponse_ma,
const float *  maxCorrResponse,
float *  trackingConfidence 
)

Calculate tracking confidence from moving-average and instantaneous peak correlation responses.

Parameters
[in]streamCUDA stream.
[in]num_of_targetsThe number of targets processed in this batch.
[in]maxCorrResponse_maThe moving-averaged max correlation response.
[in]maxCorrResponseThe instantaneous max correlation response.
[out]trackingConfidenceThe resulting tracking confidence.

◆ computeChannelWeights()

void cuDCF::computeChannelWeights ( const cudaStream_t &  stream,
const cufftHandle &  cufft_handle_many,
const cuComplex *  ftrs_F,
const int  img_element_size,
const int  img_width,
const int  batch_element_size,
const int  batch_size,
const int  num_of_channels,
const int  num_of_targets,
const cuComplex *  new_filter_F,
cuComplex *  work_F,
float *  work_I,
const uint32_t *  tracker_age,
const bool *  trackerDoProcessing_d,
const float  weights_lr,
float *  channel_weights,
float *  weight_sum 
)

Compute and update the channel weights via exponential moving average.

Parameters
[in]streamCUDA stream.
[in]cufft_handle_manyThe cuFFT handler for batch processing.
[in]ftrs_FThe extracted features in Fourier space.
[in]img_element_sizeThe number of elements in one feature matrix.
[in]img_widthThe feature-matrix width.
[in]batch_element_sizeThe number of feature-vector elements for all current trackers.
[in]batch_sizeThe number of feature matrices across channels and target trackers.
[in]num_of_channelsThe number of channels in a feature vector.
[in]num_of_targetsThe number of targets processed in this batch.
[in]new_filter_FThe newly created DCF filter in Fourier space.
[out]work_FA temporary workspace for complex arrays.
[out]work_IA temporary workspace for float arrays.
[in]tracker_ageThe age of each tracker.
[in]trackerDoProcessing_dWhether to process each target.
[in]weights_lrThe learning rate for the moving average of channel weights.
[in,out]channel_weightsThe adaptive filter weights for the channels.
[out]weight_sumFilter-weight sums used as workspace during normalization.

◆ createDcfFilter()

void cuDCF::createDcfFilter ( const cudaStream_t &  stream,
const cufftHandle &  cufft_handle_C2R,
const cufftHandle &  cufft_handle_R2C,
const cuComplex *  ftrs_F,
const cuComplex *  desiredResp_F,
const float *  masking_window_model,
const int  img_width,
const int  img_element_size,
const int  batch_element_size,
const float  lambda,
const int  num_of_channels,
const int  num_of_targets,
cuComplex *  work_F,
float *  work_I,
const uint32_t *  tracker_age,
const bool *  trackerDoProcessing_d,
const float  learn_rate,
cuComplex *  learned_filter_F,
cuComplex *  result_filter_F 
)

Create a DCF filter and update the learned filter with an exponential moving average.

Parameters
[in]streamCUDA stream.
[in]cufft_handle_C2RThe cuFFT C2R handler for batch processing.
[in]cufft_handle_R2CThe cuFFT R2C handler for batch processing.
[in]ftrs_FThe extracted features in Fourier space.
[in]desiredResp_FThe desired response in Fourier space.
[in]masking_window_modelThe masking window for focused windowing in image space.
[in]img_widthThe feature-matrix width.
[in]img_element_sizeThe number of elements in one feature matrix.
[in]batch_element_sizeThe number of feature-vector elements for all current trackers.
[in]lambdaThe regularization constant used in the ridge-regression solver.
[in]num_of_channelsThe number of channels in a feature vector.
[in]num_of_targetsThe number of targets processed in this batch.
[out]work_FA temporary workspace for complex arrays.
[out]work_IA temporary workspace for float arrays.
[in]tracker_ageThe age of each tracker.
[in]trackerDoProcessing_dWhether to process each target.
[in]learn_rateThe learning rate for the moving average of DCF filters.
[out]learned_filter_FThe newly created DCF filter.
[in,out]result_filter_FThe moving-averaged DCF filter in Fourier space.

◆ createSegmentationFilterMask()

void cuDCF::createSegmentationFilterMask ( const cudaStream_t &  stream,
const float *  src_mask_frame_batch,
const int  src_frame_width,
const int  src_frame_element_size,
const int  feat_width,
const int  feat_element_size,
const int  batch_element_size,
const int  num_of_targets,
const int  num_of_channels,
const float4 *  src_rois,
const bool *  trackerDoProcessing_d,
float *  dst_mask_patch_batch 
)

Crop and rescale each target's segmentation mask to the visual tracker region size.

Parameters
[in]streamCUDA stream.
[in]src_mask_frame_batchThe source mask from the segmenter output.
[in]src_frame_widthThe width of the source mask.
[in]src_frame_element_sizeThe number of pixels in the source mask.
[in]feat_widthThe destination filter width.
[in]feat_element_sizeThe number of elements in the destination filter.
[in]batch_element_sizeThe number of filter elements across all channels and supported targets.
[in]num_of_targetsThe number of targets processed in this batch.
[in]num_of_channelsThe number of channels in a feature vector.
[in]src_roisEach target's region in segmenter-output coordinates.
[in]trackerDoProcessing_dWhether to process each target.
[out]dst_mask_patch_batchThe cropped and rescaled destination masks.

◆ getDetectorBboxCorrelationResponses()

void cuDCF::getDetectorBboxCorrelationResponses ( const cudaStream_t &  stream,
const int  num_of_targets,
const int  maxTargetsPerStream,
const detectorBbox_t *  detectedPts,
const uint *  detectedPts_size,
const int  detCorrRespSearchWindowSize,
const float *  corr_responses,
const float *  maxCorrResponse_ma,
const int  img_element_size,
const int  img_width,
float *  confidenceAtDetectedPt,
float *  corrRespAtDetectedPt 
)

Read the correlation response near each detector bbox and write the confidence and response.

Parameters
[in]streamCUDA stream.
[in]num_of_targetsThe number of targets processed in this batch.
[in]maxTargetsPerStreamThe maximum number of targets in each stream.
[in]detectedPtsDetector bboxes in correlation-response coordinates.
[in]detectedPts_sizeThe number of detector bboxes for each target.
[in]detCorrRespSearchWindowSizeThe search radius around each detector point in the correlation response.
[in]corr_responsesThe correlation response after applying the filter.
[in]maxCorrResponse_maThe moving-averaged max correlation response.
[in]img_element_sizeThe number of elements in one feature matrix.
[in]img_widthThe feature-matrix width.
[out]confidenceAtDetectedPtThe tracking confidence at each detector bbox.
[out]corrRespAtDetectedPtThe correlation response at each detector bbox.