BruteForceMatcher#
Functions#
- NVCVStatus pvaBruteForceMatcherCreate(NVCVOperatorHandle *handle)
Constructs an instance of the Brute Force Matcher operator.
- NVCVStatus pvaBruteForceMatcherSubmit(NVCVOperatorHandle handle, cupvaStream_t stream, PvaBriefDescriptor *query, int32_t queryCount, PvaBriefDescriptor *reference, int32_t referenceCount, int32_t maxMatchesPerQuery, PvaBFMatchesType *matches, uint8_t enableCrossCheck)
Executes the Brute Force Matcher operation.
Functions#
-
NVCVStatus pvaBruteForceMatcherCreate(NVCVOperatorHandle *handle)#
Constructs an instance of the Brute Force Matcher operator.
The Brute Force Matcher finds optimal matches between two sets of BRIEF (Binary Robust Independent Elementary Features) descriptors. Each descriptor is 256 bits (32 bytes) in length.
The matching process computes the Hamming distance between each query descriptor and all reference descriptors. For each query descriptor, it can return up to MAX_BF_MATCHES_PER_DESCRIPTOR best matches, sorted by ascending Hamming distance.
Operating Modes:
Standard Mode (Cross Check Disabled):
Returns up to MAX_BF_MATCHES_PER_DESCRIPTOR best matches per query descriptor
Cross Check Mode (Cross Check Enabled):
Returns exactly one match per query descriptor
A match is valid only if the query descriptor is also the best match for the reference descriptor
Invalid matches are indicated by a reference index of -1
Requires maxMatchesPerQuery to be set to 1
Limitations: The number of either query or reference descriptors should not be larger than MAX_BF_DESCRIPTOR_COUNT.
- Parameters:
handle – [out] Where the operator instance handle will be written to.
Must not be NULL.
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – Handle is null.
NVCV_ERROR_OUT_OF_MEMORY – Failed to allocate memory for the operator.
NVCV_SUCCESS – Operation executed successfully.
- NVCVStatus pvaBruteForceMatcherSubmit(
- NVCVOperatorHandle handle,
- cupvaStream_t stream,
- PvaBriefDescriptor *query,
- int32_t queryCount,
- PvaBriefDescriptor *reference,
- int32_t referenceCount,
- int32_t maxMatchesPerQuery,
- PvaBFMatchesType *matches,
- uint8_t enableCrossCheck,
Executes the Brute Force Matcher operation.
- Parameters:
handle – [in] Handle to the operator.
Must not be NULL.
stream – [in] Handle to a valid CUPVA stream.
Must not be NULL.
query – [in] Pointer to the query descriptors. PvaBriefDescriptor.
Should point to a buffer that is accessible by PVA engine.
The size of the buffer should be at least queryCount * sizeof(PvaBriefDescriptor).
queryCount – [in] Number of query descriptors.
Must be larger than 0 and less than or equal to MAX_BF_DESCRIPTOR_COUNT.
reference – [in] Pointer to the reference descriptors. PvaBriefDescriptor.
Should point to a buffer that is accessible by PVA engine.
The size of the buffer should be at least referenceCount * sizeof(PvaBriefDescriptor).
referenceCount – [in] Number of reference descriptors.
Must be larger than 0 and less than or equal to MAX_BF_DESCRIPTOR_COUNT.
maxMatchesPerQuery – [in] Maximum number of matches per query.
Must be larger than 0 and less than or equal to MAX_BF_MATCHES_PER_DESCRIPTOR.
If enableCrossCheck is 1, maxMatchesPerQuery must be 1.
matches – [out] Pointer to the matches. PvaBFMatchesType.
Should point to a buffer that is accessible by PVA engine.
The size of the buffer should be at least queryCount * sizeof(PvaBFMatchesType).
enableCrossCheck – [in] Whether to enable cross check.
Must be 0 or 1.
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – The possible cases might be the following: 1) The handle or stream or query or reference is either NULL or points to an invalid address. 2) The queryCount or referenceCount is not larger than 0 or larger than MAX_BF_DESCRIPTOR_COUNT. 3) The maxMatchesPerQuery is not larger than 0 or less than or equal to MAX_BF_MATCHES_PER_DESCRIPTOR. 4) The enableCrossCheck is not 0 or 1. 5) The enableCrossCheck is 1 and maxMatchesPerQuery is not 1.
NVCV_SUCCESS – Operation executed successfully.