Qualcomm FastCV Library
1.7.1
|
Functions | |
FASTCV_API void | fcvUpdateMotionHistoryu8s32 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int32_t *__restrict dst, uint32_t dstStride, int32_t timeStamp, int32_t maxHistory) |
This function calculates the motion history image. | |
FASTCV_API uint32_t | fcvMeanShiftu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, fcvRectangleInt *window, fcvTermCriteria criteria) |
Applies the meanshift procedure and obtains the final converged position. | |
FASTCV_API uint32_t | fcvMeanShifts32 (const int32_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, fcvRectangleInt *window, fcvTermCriteria criteria) |
Applies the meanshift procedure and obtains the final converged position. | |
FASTCV_API uint32_t | fcvMeanShiftf32 (const float32_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, fcvRectangleInt *window, fcvTermCriteria criteria) |
Applies the meanshift procedure and obtains the final converged position. | |
FASTCV_API uint32_t | fcvConAdaTracku8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, fcvRectangleInt *window, fcvTermCriteria criteria, fcvBox2D *circuBox) |
Applies the ConAdaTrack procedure and find the object center, size and orientation. | |
FASTCV_API uint32_t | fcvConAdaTracks32 (const int32_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, fcvRectangleInt *window, fcvTermCriteria criteria, fcvBox2D *circuBox) |
Applies the ConAdaTrack procedure and find the object center, size and orientation. | |
FASTCV_API uint32_t | fcvConAdaTrackf32 (const float32_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, fcvRectangleInt *window, fcvTermCriteria criteria, fcvBox2D *circuBox) |
Applies the ConAdaTrack procedure and find the object center, size and orientation. | |
FASTCV_API fcvBGCodeWord ** | fcvCreateBGCodeBookModel (uint32_t srcWidth, uint32_t srcHeight, void **__restrict cbmodel) |
Creates codebook model according to the image size. | |
FASTCV_API void | fcvReleaseBGCodeBookModel (void **cbmodel) |
Releases codebook model and codebook map. | |
FASTCV_API void | fcvConfigBGCodeBookModel (void *cbmodel, uint8_t cbBound[3], uint8_t minMod[3], uint8_t maxMod[3]) |
configure codebook model | |
FASTCV_API void | fcvBGCodeBookUpdateu8 (void *__restrict cbmodel, const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, const uint8_t *__restrict fgMask, uint32_t fgMaskStride, fcvBGCodeWord **__restrict cbMap, int32_t *__restrict updateTime) |
Updates codebook map according to input image. fgMask can be a reference. | |
FASTCV_API void | fcvBGCodeBookDiffu8 (void *__restrict cbmodel, const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict fgMask, uint32_t fgMaskStride, fcvBGCodeWord **__restrict cbMap, int32_t *__restrict numFgMask) |
Generates differential mask of input frame according to background codebook map. | |
FASTCV_API void | fcvBGCodeBookClearStaleu8 (void *__restrict cbmodel, int32_t staleThresh, const uint8_t *__restrict fgMask, uint32_t fgMaskWidth, uint32_t fgMaskHeight, uint32_t fgMaskStride, fcvBGCodeWord **__restrict cbMap) |
Removes stale element in codebook according to foreground mask. |
Supports and tracking functions
FASTCV_API void fcvBGCodeBookClearStaleu8 | ( | void *__restrict | cbmodel, |
int32_t | staleThresh, | ||
const uint8_t *__restrict | fgMask, | ||
uint32_t | fgMaskWidth, | ||
uint32_t | fgMaskHeight, | ||
uint32_t | fgMaskStride, | ||
fcvBGCodeWord **__restrict | cbMap | ||
) |
Removes stale element in codebook according to foreground mask.
This function removes stale element in codebook according to foreground mask. Threshold is defined in staleThresh. Codebook functions are useful in background subtraction in many use cases, such as video surveillance.
cbmodel | Pointer to codebook model Codebook model contains parameters for generating and maintaining codebook model |
staleThresh | Threshold of stale element |
fgMask | Pointer to the foreground mask image in ROI. Use NULL as default NOTE: should be 128-bit aligned. must be a 1-channel image. |
fgMaskWidth | Width of the mask in pixel, which is the same as input image NOTE: should be multiple of 8. |
fgMaskHeight | Height of the mask in pixel, which is the same as input image |
fgMaskStride | Stride of the foreground mask image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 fgMaskStride is default to fgMaskWidth. NOTE: should be multiple of 8. |
cbMap | Pointer to code book map Codebook map is a pointer map consisting of code word for each pixel of input image. |
FASTCV_API void fcvBGCodeBookDiffu8 | ( | void *__restrict | cbmodel, |
const uint8_t *__restrict | src, | ||
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | fgMask, | ||
uint32_t | fgMaskStride, | ||
fcvBGCodeWord **__restrict | cbMap, | ||
int32_t *__restrict | numFgMask | ||
) |
Generates differential mask of input frame according to background codebook map.
This function generates differential mask of input frame according to background codebook map. Codebook functions are useful in background subtraction in many use cases, such as video surveillance.
cbmodel | Pointer to codebook model Codebook model contains parameters for generating and maintaining codebook model |
src | Pointer to the input image WARNING: should be 128-bit aligned. must be a 3-channel image. |
srcWidth | Width of the image in pixel. The number of pixels in a row. NOTE: should be multiple of 8. |
srcHeight | Height of the image in pixel |
srcStride | Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth*3. NOTE: should be multiple of 8. |
fgMask | Pointer to the returned foreground mask image. WARNING: should be 128-bit aligned. must be a 1-channel image, same width & height as src. |
fgMaskStride | Stride of the foreground mask image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 fgMaskStride is default to srcWidth. NOTE: should be multiple of 8. |
cbMap | Pointer to code book map. Codebook map is a pointer map consisting of code word for each pixel of input image. |
numFgMask | Number of foreground pixels in the mask numFgMask is a return value. |
FASTCV_API void fcvBGCodeBookUpdateu8 | ( | void *__restrict | cbmodel, |
const uint8_t *__restrict | src, | ||
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
const uint8_t *__restrict | fgMask, | ||
uint32_t | fgMaskStride, | ||
fcvBGCodeWord **__restrict | cbMap, | ||
int32_t *__restrict | updateTime | ||
) |
Updates codebook map according to input image. fgMask can be a reference.
This function updates codebook map according to input image. fgMask is generated by fcvBGCodeBookDiffu8() and can be a reference in this function. Therefore, fgMask is NULL at the first time. Codebook functions are useful in background subtraction in many use cases, such as video surveillance.
cbmodel | Pointer to codebook model Codebook model contains parameters for generating and maintaining codebook model |
src | Pointer to the input image WARNING: should be 128-bit aligned. must be a 3-channel image. |
srcWidth | Width of the image in pixel. The number of pixels in a row. NOTE: should be multiple of 8. |
srcHeight | Height of the image in pixel |
srcStride | Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth*3. NOTE: should be multiple of 8. |
fgMask | Pointer to the returned foreground mask image. Use NULL as default WARNING: should be 128-bit aligned. must be a 1-channel image, same width & height as src. |
fgMaskStride | Stride of the foreground mask image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 fgMaskStride is default to srcWidth. NOTE: should be multiple of 8. |
cbMap | Pointer to codebook map Codebook map is a pointer map consisting of code word for each pixel of input image. |
updateTime | Update time. updateTime is a return value. |
FASTCV_API uint32_t fcvConAdaTrackf32 | ( | const float32_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
fcvRectangleInt * | window, | ||
fcvTermCriteria | criteria, | ||
fcvBox2D * | circuBox | ||
) |
Applies the ConAdaTrack procedure and find the object center, size and orientation.
This function applies the ConAdaTrack procedure to an original image (usually a probability image) and obtains the final converged object. The optimal object search will stop either it has reached the required accuracy or the maximum number of iterations.
src | Pointer to the original image which is usually a probability image computed based on object histogram. Must be float 32bit grayscale image. Size of buffer is srcStride*srcHeight bytes. NOTE: should be 128-bit aligned. |
srcWidth | The width of the input source image. NOTE: should be a multiple of 8. |
srcHeight | The height of the input source image. |
srcStride | Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth*4. NOTE: should be a multiple of 8. |
window | Pointer to the initial search window position which also returns the final converged window position. |
criteria | The criteria used to finish the object search which consists of two termination criteria: 1) epsilon: required accuracy; 2) max_iter: maximum number of iterations |
circuBox | The circumscribed box around the object |
FASTCV_API uint32_t fcvConAdaTracks32 | ( | const int32_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
fcvRectangleInt * | window, | ||
fcvTermCriteria | criteria, | ||
fcvBox2D * | circuBox | ||
) |
Applies the ConAdaTrack procedure and find the object center, size and orientation.
This function applies the ConAdaTrack procedure to an original image (usually a probability image) and obtains the final converged object. The optimal object search will stop either it has reached the required accuracy or the maximum number of iterations.
src | Pointer to the original image which is usually a probability image computed based on object histogram. Must be int 32bit grayscale image. Size of buffer is srcStride*srcHeight bytes. NOTE: should be 128-bit aligned. |
srcWidth | The width of the input source image. NOTE: should be a multiple of 8. |
srcHeight | The height of the input source image. |
srcStride | Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth*4. NOTE: should be a multiple of 8. |
window | Pointer to the initial search window position which also returns the final converged window position. |
criteria | The criteria used to finish the object search which consists of two termination criteria: 1) epsilon: required accuracy; 2) max_iter: maximum number of iterations |
circuBox | The circumscribed box around the object |
FASTCV_API uint32_t fcvConAdaTracku8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
fcvRectangleInt * | window, | ||
fcvTermCriteria | criteria, | ||
fcvBox2D * | circuBox | ||
) |
Applies the ConAdaTrack procedure and find the object center, size and orientation.
This function applies the ConAdaTrack procedure to an original image (usually a probability image) and obtains the final converged object. The optimal object search will stop either it has reached the required accuracy or the maximum number of iterations.
src | Pointer to the original image which is usually a probability image computed based on object histogram. Must be 8bit grayscale image. Size of buffer is srcStride*srcHeight bytes. NOTE: should be 128-bit aligned. |
srcWidth | The width of the input source image. NOTE: should be a multiple of 8. |
srcHeight | The height of the input source image. |
srcStride | Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. NOTE: should be a multiple of 8. |
window | Pointer to the initial search window position which also returns the final converged window position. |
criteria | The criteria used to finish the object search which consists of two termination criteria: 1) epsilon: required accuracy; 2) max_iter: maximum number of iterations |
circuBox | The circumscribed box around the object |
FASTCV_API void fcvConfigBGCodeBookModel | ( | void * | cbmodel, |
uint8_t | cbBound[3], | ||
uint8_t | minMod[3], | ||
uint8_t | maxMod[3] | ||
) |
configure codebook model
This function configure codebook model. It takes three parameters. They are codebook boundary, minimum and maximum mode for each channel (generally 3). These three parameters are firstly configured in fcvCreateBGCodeBookModel, and the values are (10,10,10), (3,1,1) and (10,1,1) respectively.
cbmodel | Pointer to codebook model |
cbBound | Pointer to uint8_t array that should be of 3 elements. This parameter is for updating codebook model in fcvBGCodeBookUpdateu8 that specifies the boundary of each channel. |
minMod | Pointer to uint8_t array that should be of 3 elements. This parameter is for generating the mask in fcvBGCodeBookDiffu8 that specifies the minimum mode of each channel of the code word. |
maxMod | Pointer to uint8_t array that should be of 3 elements. This parameter is for generating the mask in fcvBGCodeBookDiffu8 that specifies the maximum mode of each channel of the code word. |
FASTCV_API fcvBGCodeWord** fcvCreateBGCodeBookModel | ( | uint32_t | srcWidth, |
uint32_t | srcHeight, | ||
void **__restrict | cbmodel | ||
) |
Creates codebook model according to the image size.
This function creates codebook model and returns codebook map. These 2 parameters will be used in fcvBGCodeBookUpdateu8(), fcvBGCodeBookDiffu8() and fcvBGCodeBookClearStaleu8(). Codebook functions are useful in background subtraction in many use cases, such as video surveillance.
srcWidth | Width of the input image. NOTE: should be multiple of 8. The number of pixels in a row. |
srcHeight | Height of the input image. |
cbmodel | Double pointer to codebook model. Codebook model contains parameters for generating and maintaining codebook model. |
FASTCV_API uint32_t fcvMeanShiftf32 | ( | const float32_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
fcvRectangleInt * | window, | ||
fcvTermCriteria | criteria | ||
) |
Applies the meanshift procedure and obtains the final converged position.
This function applies the meanshift procedure to an original image (usually a probability image) and obtains the final converged position. The converged position search will stop either it has reached the required accuracy or the maximum number of iterations.
src | Pointer to the original image which is usually a probability image computed based on object histogram. Must be float 32bit grayscale image. Size of buffer is srcStride*srcHeight bytes. NOTE: should be 128-bit aligned. |
srcWidth | The width of the input source image. NOTE: should be a multiple of 8. |
srcHeight | The height of the input source image. |
srcStride | Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth*4. NOTE: should be a multiple of 8. |
window | Pointer to the initial search window position which also returns the final converged window position. |
criteria | The criteria used to finish the MeanShift which consists of two termination criteria: 1) epsilon: required accuracy; 2) max_iter: maximum number of iterations |
FASTCV_API uint32_t fcvMeanShifts32 | ( | const int32_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
fcvRectangleInt * | window, | ||
fcvTermCriteria | criteria | ||
) |
Applies the meanshift procedure and obtains the final converged position.
This function applies the meanshift procedure to an original image (usually a probability image) and obtains the final converged position. The converged position search will stop either it has reached the required accuracy or the maximum number of iterations.
src | Pointer to the original image which is usually a probability image computed based on object histogram. Must be int 32bit grayscale image. Size of buffer is srcStride*srcHeight bytes. NOTE: should be 128-bit aligned. |
srcWidth | The width of the input source image. NOTE: should be a multiple of 8. |
srcHeight | The height of the input source image. |
srcStride | Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth*4. NOTE: should be a multiple of 8. |
window | Pointer to the initial search window position which also returns the final converged window position. |
criteria | The criteria used to finish the MeanShift which consists of two termination criteria: 1) epsilon: required accuracy; 2) max_iter: maximum number of iterations |
FASTCV_API uint32_t fcvMeanShiftu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
fcvRectangleInt * | window, | ||
fcvTermCriteria | criteria | ||
) |
Applies the meanshift procedure and obtains the final converged position.
This function applies the meanshift procedure to an original image (usually a probability image) and obtains the final converged position. The converged position search will stop either it has reached the required accuracy or the maximum number of iterations.
src | Pointer to the original image which is usually a probability image computed based on object histogram. Must be 8 bit grayscale image. Size of buffer is srcStride*srcHeight bytes. NOTE: should be 128-bit aligned. |
srcWidth | The width of the input source image. NOTE: should be a multiple of 8. |
srcHeight | The height of the input source image. |
srcStride | Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. NOTE: should be a multiple of 8. |
window | Pointer to the initial search window position which also returns the final converged window position. |
criteria | The criteria used to finish the MeanShift which consists of two termination criteria: 1) epsilon: required accuracy; 2) max_iter: maximum number of iterations |
FASTCV_API void fcvReleaseBGCodeBookModel | ( | void ** | cbmodel | ) |
Releases codebook model and codebook map.
This function release codebook model and codebook map. Codebook map is referred in codebook model.
cbmodel | Double pointer to codebook model |
FASTCV_API void fcvUpdateMotionHistoryu8s32 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
int32_t *__restrict | dst, | ||
uint32_t | dstStride, | ||
int32_t | timeStamp, | ||
int32_t | maxHistory | ||
) |
This function calculates the motion history image.
This function updates the motion history image based on the input motion image. src is a motion image where pixelvalue!=0 indicates a moving pixel. The function go through all the pixels in the src image. If the value is non zero, it sets the corresponding value of the dst image as the timestamp value. If the value is zero, it compares the corresponding value at the dst image with the timestamp value, if the difference is larger than the
src | The input image/patch. Must be 8 bit grayscale image. Size of buffer is srcStride*srcHeight bytes. NOTE:should be 128-bit aligned. |
srcWidth | Image width, the number of pixels in a row NOTE: should be a multiple of 8. |
srcHeight | Image height. |
srcStride | Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. NOTE: should be a multiple of 8. |
dst | The input image/patch. Must be 8 bit grayscale image. Size of buffer is dstStride*srcHeight bytes. NOTE:should be 128-bit aligned. |
dstStride | Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. NOTE: should be a multiple of 8. |
timeStamp | The timestamp value of the current frame that's being updated. |
maxHistory | The maximum window size that the motion history image will keep. |