Module-wrapper for FastCV hardware accelerated functions#
Detailed Description#
Classes#
Name |
Description |
|---|---|
|
MSER blob detector for grayscale images. View details |
|
Qualcomm’s custom allocator. This allocator uses Qualcomm’s memory management functions. View details |
Resource manager for FastCV allocations. This class manages active allocations. View details |
Function Documentation#
arithmetic_op()#
void cv::fastcv::arithmetic_op(
InputArray src1,
InputArray src2,
OutputArray dst,
int op )
#include <opencv2/fastcv/arithm.hpp>
Arithmetic add and subtract operations for two matrices It is optimized for Qualcomm’s processors.
Parameters
src1— First source matrix, can be of type CV_8U, CV_16S, CV_32F. Note: CV_32F not supported for subtractsrc2— Second source matrix of same type and size as src1dst— Resulting matrix of type as src matsop— type of operation - 0 for add and 1 for subtract
bilateralFilter()#
void cv::fastcv::bilateralFilter(
InputArray _src,
OutputArray _dst,
int d,
float sigmaColor,
float sigmaSpace,
int borderType = BORDER_DEFAULT )
#include <opencv2/fastcv/bilateralFilter.hpp>
Applies Bilateral filter to an image considering d-pixel diameter of each pixel’s neighborhood. This filter does not work inplace.
Parameters
_src— Intput image with type CV_8UC1_dst— Destination image with same type as _srcd— kernel size (can be 5, 7 or 9)sigmaColor— Filter sigma in the color space. Typical value is 50.0f. Increasing this value means increasing the influence of the neighboring pixels of more different color to the smoothing result.sigmaSpace— Filter sigma in the coordinate space. Typical value is 1.0f. Increasing this value means increasing the influence of farther neighboring pixels within the kernel size distance to the smoothing result.borderType— border mode used to extrapolate pixels outside of the image
bilateralRecursive()#
void cv::fastcv::bilateralRecursive(
cv::InputArray src,
cv::OutputArray dst,
float sigmaColor = 0.03f,
float sigmaSpace = 0.1f )
#include <opencv2/fastcv/smooth.hpp>
Recursive Bilateral Filtering.
Different from traditional bilateral filtering, here the smoothing is actually performed in gradient domain. The algorithm claims that it’s more efficient than the original bilateral filtering in both image quality and computation. See algorithm description in the paper Recursive Bilateral Filtering, ECCV2012 by Prof Yang Qingxiong This function isn’t bit-exact with cv::bilateralFilter but provides improved latency on Snapdragon processors.
Parameters
src— Input image, should have one CV_8U channeldst— Output array having one CV_8U channelsigmaColor— Sigma in the color space, the bigger the value the more color difference is smoothed by the algorithmsigmaSpace— Sigma in the coordinate space, the bigger the value the more distant pixels are smoothed
buildPyramid()#
void cv::fastcv::buildPyramid(
InputArray src,
OutputArrayOfArrays pyr,
int nLevels,
bool scaleBy2 = true,
int borderType = cv::BORDER_REFLECT,
uint8_t borderValue = 0 )
#include <opencv2/fastcv/pyramid.hpp>
Builds an image pyramid of float32 arising from a single original image - that are successively downscaled w.r.t. the pre-set levels. This API supports both ORB scaling and scale down by half.
Parameters
src— Input single-channel image of type 8U or 32Fpyr— Output array containing nLevels downscaled image copiesnLevels— Number of pyramid levels to producescaleBy2— to scale images 2x down or by a factor of 1/(2)^(1/4) which is approximated as 0.8408964 (ORB downscaling), ORB scaling is not supported for float point imagesborderType— how to process border, the options are BORDER_REFLECT (maps to FASTCV_BORDER_REFLECT), BORDER_REFLECT_101 (maps to FASTCV_BORDER_REFLECT_V2) and BORDER_REPLICATE (maps to FASTCV_BORDER_REPLICATE). Other border types are mapped to FASTCV_BORDER_UNDEFINED(border pixels are ignored). Currently, borders only supported for downscaling by half, ignored for ORB scaling. Also ignored for float point imagesborderValue— what value should be used to fill border, ignored for float point images
calcHist()#
void cv::fastcv::calcHist(
InputArray _src,
OutputArray _hist )
#include <opencv2/fastcv/histogram.hpp>
Calculates histogram of input image. This function implements specific use case of 256-bin histogram calculation for 8u single channel images in an optimized way.
Parameters
_src— Intput image with type CV_8UC1_hist— Output histogram of type int of 256 bins
Canny()#
void cv::fastcv::dsp::Canny(
InputArray _src,
OutputArray _dst,
int lowThreshold,
int highThreshold,
int apertureSize = 3,
bool L2gradient = false )
#include <opencv2/fastcv/edges_dsp.hpp>
Canny edge detector applied to a 8 bit grayscale image.
Parameters
clusterEuclidean()#
void cv::fastcv::clusterEuclidean(
InputArray points,
InputArray clusterCenters,
OutputArray newClusterCenters,
OutputArray clusterSizes,
OutputArray clusterBindings,
OutputArray clusterSumDists,
int numPointsUsed = -1 )
#include <opencv2/fastcv/cluster.hpp>
Clusterizes N input points in D-dimensional space into K clusters Accepts 8-bit unsigned integer points Provides faster execution time than cv::kmeans on Qualcomm’s processors.
Parameters
points— Points array of type 8u, each row represets a point. Size is N rows by D columns, can be non-continuous.clusterCenters— Initial cluster centers array of type 32f, each row represents a center. Size is K rows by D columns, can be non-continuous.newClusterCenters— Resulting cluster centers array of type 32f, each row represents found center. Size is set to be K rows by D columns.clusterSizes— Resulting cluster member counts array of type uint32, size is set to be 1 row by K columns.clusterBindings— Resulting points indices array of type uint32, each index tells to which cluster the corresponding point belongs to. Size is set to be 1 row by numPointsUsed columns.clusterSumDists— Resulting distance sums array of type 32f, each number is a sum of distances between each cluster center to its belonging points. Size is set to be 1 row by K columnsnumPointsUsed— Number of points to clusterize starting from 0 to numPointsUsed-1 inclusively. Sets to N if negative.
DCT()#
void cv::fastcv::DCT(
InputArray src,
OutputArray dst )
#include <opencv2/fastcv/ipptransform.hpp>
This function performs 8x8 forward discrete Cosine transform on input image accepts input of type 8-bit unsigned integer and produces output of type 16-bit signed integer provides faster execution time than cv::dct on Qualcomm’s processor.
Parameters
src— Input image of type CV_8UC1dst— Output image of type CV_16SC1
FAST10()#
void cv::fastcv::FAST10(
InputArray src,
InputArray mask,
OutputArray coords,
OutputArray scores,
int barrier,
int border,
bool nmsEnabled )
#include <opencv2/fastcv/fast10.hpp>
Extracts FAST10 corners and scores from the image based on the mask. The mask specifies pixels to be ignored by the detector designed for corner detection on Qualcomm’s processors, provides enhanced speed.
Parameters
src— 8-bit grayscale imagemask— Optional mask indicating which pixels should be omited from corner dection. Its size should be k times image width and height, where k = 1/2, 1/4 , 1/8 , 1, 2, 4 and 8 For more details see documentation tofcvCornerFast9InMaskScoreu8function in FastCVcoords— Output array of CV_32S containing interleave x, y positions of detected cornersscores— Optional output array containing the scores of the detected corners. The score is the highest threshold that can still validate the detected corner. A higher score value indicates a stronger corner feature. For example, a corner of score 108 is stronger than a corner of score 50barrier— FAST threshold. The threshold is used to compare difference between intensity value of the central pixel and pixels on a circle surrounding this pixelborder— Number for pixels to ignore from top,bottom,right,left of the image. Defaults to 4 if it’s below 4nmsEnabled— Enable non-maximum suppresion to prune weak key points
fcvdspdeinit()#
void cv::fastcv::dsp::fcvdspdeinit()
#include <opencv2/fastcv/dsp_init.hpp>
Deinitializes the FastCV DSP environment.
This function releases the resources and environment set up by the ‘fcvdspinit’ function. It should be called before the use case or program exits to ensure that all DSP resources are properly cleaned up and no memory leaks occur.
Note
This function must be called at the end of the use case or program, after all DSP-related operations are complete.
fcvdspinit()#
int cv::fastcv::dsp::fcvdspinit()
#include <opencv2/fastcv/dsp_init.hpp>
Initializes the FastCV DSP environment.
This function sets up the necessary environment and resources for the DSP to operate. It must be called once at the very beginning of the use case or program to ensure that the DSP is properly initialized before any DSP-related operations are performed.
Note
This function must be called at the start of the use case or program, before any DSP-related operations.
Returns
int Returns 0 on success, and a non-zero value on failure.
FFT()#
void cv::fastcv::dsp::FFT(
InputArray src,
OutputArray dst )
#include <opencv2/fastcv/fft_dsp.hpp>
Computes the 1D or 2D Fast Fourier Transform of a real valued matrix. For the 2D case, the width and height of the input and output matrix must be powers of 2. For the 1D case, the height of the matrices must be 1, while the width must be a power of 2.
Parameters
src— Input array of CV_8UC1. The dimensions of the matrix must be powers of 2 for the 2D case, and in the 1D case, the height must be 1, while the width must be a power of 2.dst— The computed FFT matrix of type CV_32FC2. The FFT Re and Im coefficients are stored in different channels. Hence the dimensions of the dst are (srcWidth, srcHeight)
FFT()#
void cv::fastcv::FFT(
InputArray src,
OutputArray dst )
#include <opencv2/fastcv/fft.hpp>
Computes the 1D or 2D Fast Fourier Transform of a real valued matrix. For the 2D case, the width and height of the input and output matrix must be powers of 2. For the 1D case, the height of the matrices must be 1, while the width must be a power of 2. Accepts 8-bit unsigned integer array, whereas cv::dft accepts floating-point or complex array.
Parameters
src— Input array of CV_8UC1. The dimensions of the matrix must be powers of 2 for the 2D case, and in the 1D case, the height must be 1, while the width must be a power of 2.dst— The computed FFT matrix of type CV_32FC2. The FFT Re and Im coefficients are stored in different channels. Hence the dimensions of the dst are (srcWidth, srcHeight)
fillConvexPoly()#
void cv::fastcv::fillConvexPoly(
InputOutputArray img,
InputArray pts,
Scalar color )
#include <opencv2/fastcv/draw.hpp>
Draw convex polygon This function fills the interior of a convex polygon with the specified color. Requires the width and stride to be multple of 8.
Parameters
img— Image to draw on. Should have up to 4 8-bit channelspts— Array of polygon points coordinates. Should contain N two-channel or 2*N one-channel 32-bit integer elementscolor— Color of drawn polygon stored as B,G,R and A(if supported)
filter2D()#
void cv::fastcv::dsp::filter2D(
InputArray _src,
OutputArray _dst,
int ddepth,
InputArray _kernel )
#include <opencv2/fastcv/blur_dsp.hpp>
Filter an image with non-separable kernel.
Parameters
_src— Intput image with type CV_8UC1, src size should be greater than 176*144_dst— Output image with type CV_8UC1, CV_16SC1 or CV_32FC1ddepth— The depth of output image_kernel— Filer kernel data
filter2D()#
void cv::fastcv::filter2D(
InputArray _src,
OutputArray _dst,
int ddepth,
InputArray _kernel )
#include <opencv2/fastcv/blur.hpp>
NxN correlation with non-separable kernel. Borders up to half-kernel width are ignored.
See also
Filter2D
Parameters
_src— Intput image with type CV_8UC1_dst— Output image with type CV_8UC1, CV_16SC1 or CV_32FC1ddepth— The depth of output image_kernel— Filer kernel data
gaussianBlur()#
void cv::fastcv::gaussianBlur(
InputArray _src,
OutputArray _dst,
int kernel_size = 3,
bool blur_border = true )
#include <opencv2/fastcv/blur.hpp>
Gaussian blur with sigma = 0 and square kernel size. The way of handling borders is different with cv::GaussianBlur, leading to slight variations in the output.
See also
Parameters
_src— Intput image with type CV_8UC1_dst— Output image with type CV_8UC1kernel_size— Filer kernel size. One of 3, 5, 11blur_border— If set to true, border is blurred by 0-padding adjacent values.(A variant of the constant border) If set to false, borders up to half-kernel width are ignored (e.g. 1 pixel in the 3x3 case).
gemm()#
void cv::fastcv::gemm(
InputArray src1,
InputArray src2,
OutputArray dst,
float alpha = 1.0,
InputArray src3 = noArray(),
float beta = 0.0 )
#include <opencv2/fastcv/arithm.hpp>
Matrix multiplication of two float type matrices R = aAB + b*C where A,B,C,R are matrices and a,b are constants It is optimized for Qualcomm’s processors.
Parameters
src1— First source matrix of type CV_32Fsrc2— Second source matrix of type CV_32F with same rows as src1 colsdst— Resulting matrix of type CV_32Falpha— multiplying factor for src1 and src2src3— Optional third matrix of type CV_32F to be added to matrix productbeta— multiplying factor for src3
getQcAllocator()#
cv::MatAllocator * cv::fastcv::getQcAllocator()
#include <opencv2/fastcv/allocator.hpp>
Gets the default Qualcomm’s allocator. This function returns a pointer to the default Qualcomm’s allocator, which is optimized for use with DSP.
Returns
Pointer to the default FastCV allocator.
houghLines()#
void cv::fastcv::houghLines(
InputArray src,
OutputArray lines,
double threshold = 0.25 )
#include <opencv2/fastcv/hough.hpp>
Performs Hough Line detection.
Parameters
src— Input 8-bit image containing binary contour. Width and step should be divisible by 8lines— Output array containing detected lines in a form of (x1, y1, x2, y2) where all numbers are 32-bit floatsthreshold— Controls the minimal length of a detected line. Value must be between 0.0 and 1.0 Values close to 1.0 reduces the number of detected lines. Values close to 0.0 detect more lines, but may be noisy. Recommended value is 0.25.
IDCT()#
void cv::fastcv::IDCT(
InputArray src,
OutputArray dst )
#include <opencv2/fastcv/ipptransform.hpp>
This function performs 8x8 inverse discrete Cosine transform on input image provides faster execution time than cv::dct in inverse case on Qualcomm’s processor.
Parameters
src— Input image of type CV_16SC1dst— Output image of type CV_8UC1
IFFT()#
void cv::fastcv::dsp::IFFT(
InputArray src,
OutputArray dst )
#include <opencv2/fastcv/fft_dsp.hpp>
Computes the 1D or 2D Inverse Fast Fourier Transform of a complex valued matrix. For the 2D case, The width and height of the input and output matrix must be powers of 2. For the 1D case, the height of the matrices must be 1, while the width must be a power of 2.
Parameters
src— Input array of type CV_32FC2 containing FFT Re and Im coefficients stored in separate channels. The dimensions of the matrix must be powers of 2 for the 2D case, and in the 1D case, the height must be 1, while the width must be a power of 2.dst— The computed IFFT matrix of type CV_8U. The matrix is real valued and has no imaginary components. Hence the dimensions of the dst are (srcWidth , srcHeight)
IFFT()#
void cv::fastcv::IFFT(
InputArray src,
OutputArray dst )
#include <opencv2/fastcv/fft.hpp>
Computes the 1D or 2D Inverse Fast Fourier Transform of a complex valued matrix. For the 2D case, The width and height of the input and output matrix must be powers of 2. For the 1D case, the height of the matrices must be 1, while the width must be a power of 2.
Parameters
src— Input array of type CV_32FC2 containing FFT Re and Im coefficients stored in separate channels. The dimensions of the matrix must be powers of 2 for the 2D case, and in the 1D case, the height must be 1, while the width must be a power of 2.dst— The computed IFFT matrix of type CV_8U. The matrix is real valued and has no imaginary components. Hence the dimensions of the dst are (srcWidth , srcHeight)
integrateYUV()#
void cv::fastcv::integrateYUV(
InputArray Y,
InputArray CbCr,
OutputArray IY,
OutputArray ICb,
OutputArray ICr )
#include <opencv2/fastcv/arithm.hpp>
Integral of a YCbCr420 image. Note: Input height should be multiple of 2. Input width and stride should be multiple of 16. Output stride should be multiple of 8. It is optimized for Qualcomm’s processors.
Parameters
Y— Input Y component of 8UC1 YCbCr420 image.CbCr— Input CbCr component(interleaved) of 8UC1 YCbCr420 image.IY— Output Y integral of CV_32S one channel, size (Y height + 1)*(Y width + 1)ICb— Output Cb integral of CV_32S one channel, size (Y height/2 + 1)*(Y width/2 + 1)ICr— Output Cr integral of CV_32S one channel, size (Y height/2 + 1)*(Y width/2 + 1)
matmuls8s32()#
void cv::fastcv::matmuls8s32(
InputArray src1,
InputArray src2,
OutputArray dst )
#include <opencv2/fastcv/arithm.hpp>
Matrix multiplication of two int8_t type matrices uses signed integer input/output whereas cv::gemm uses floating point input/output matmuls8s32 provides enhanced speed on Qualcomm’s processors.
Parameters
src1— First source matrix of type CV_8Ssrc2— Second source matrix of type CV_8Sdst— Resulting matrix of type CV_32S
meanShift()#
int cv::fastcv::meanShift(
InputArray src,
Rect & rect,
TermCriteria termCrit )
#include <opencv2/fastcv/shift.hpp>
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. Moments used in the algorithm are calculated in floating point. This function isn’t bit-exact with cv::meanShift but provides improved latency on Snapdragon processors.
Parameters
src— 8-bit, 32-bit int or 32-bit float grayscale image which is usually a probability image computed based on object histogramrect— Initial search window position which also returns the final converged window positiontermCrit— The criteria used to finish the MeanShift which consists of two termination criteria: 1) epsilon: required accuracy; 2) max_iter: maximum number of iterations
Returns
Iteration number at which the loop stopped
merge()#
void cv::fastcv::merge(
InputArrayOfArrays mv,
OutputArray dst )
#include <opencv2/fastcv/channel.hpp>
Creates one multi-channel mat out of several single-channel CV_8U mats. Optimized for Qualcomm’s processors.
Parameters
mv— input vector of matrices to be merged; all the matrices in mv must be of CV_8UC1 and have the same size Note: numbers of mats can be 2,3 or 4.dst— output array of depth CV_8U and same size as mv[0]; The number of channels will be the total number of matrices in the matrix array
moments()#
cv::Moments cv::fastcv::moments(
InputArray _src,
bool binary )
#include <opencv2/fastcv/moments.hpp>
Calculates all of the moments up to the third order of the image pixels’ intensities The results are returned in the structure cv::Moments. This function cv::fastcv::moments() calculate the moments using floating point calculations whereas cv::moments() calculate moments using double.
Parameters
_src— Input image with type CV_8UC1, CV_32SC1, CV_32FC1binary— If true, assumes the image to be binary (0x00 for black, 0xff for white), otherwise assumes the image to be grayscale.
normalizeLocalBox()#
void cv::fastcv::normalizeLocalBox(
InputArray _src,
OutputArray _dst,
Size pSize,
bool useStdDev )
#include <opencv2/fastcv/blur.hpp>
Calculates the local subtractive and contrastive normalization of the image. Each pixel of the image is normalized by the mean and standard deviation of the patch centred at the pixel. It is optimized for Qualcomm’s processors.
Parameters
_src— Input image, should have one channel CV_8U or CV_32F_dst— Output array, should be one channel, CV_8S if src of type CV_8U, or CV_32F if src of CV_32FpSize— Patch size for mean and std dev calculationuseStdDev— If 1, bot mean and std dev will be used for normalization, if 0, only mean used
remap()#
void cv::fastcv::remap(
InputArray src,
OutputArray dst,
InputArray map1,
InputArray map2,
int interpolation,
int borderValue = 0 )
#include <opencv2/fastcv/remap.hpp>
Applies a generic geometrical transformation to a greyscale CV_8UC1 image.
Parameters
src— The first input image data, type CV_8UC1dst— The output image data, type CV_8UC1map1— Floating-point CV_32FC1 matrix with each element as the column coordinate of the mapped location in the source imagemap2— Floating-point CV_32FC1 matrix with each element as the row coordinate of the mapped location in the source image.interpolation— Only INTER_NEAREST and INTER_LINEAR interpolation is supportedborderValue— constant pixel value
remapRGBA()#
void cv::fastcv::remapRGBA(
InputArray src,
OutputArray dst,
InputArray map1,
InputArray map2,
int interpolation )
#include <opencv2/fastcv/remap.hpp>
Applies a generic geometrical transformation to a 4-channel CV_8UC4 image with bilinear or nearest neighbor interpolation.
Parameters
src— The first input image data, type CV_8UC4dst— The output image data, type CV_8UC4map1— Floating-point CV_32FC1 matrix with each element as the column coordinate of the mapped location in the source imagemap2— Floating-point CV_32FC1 matrix with each element as the row coordinate of the mapped location in the source image.interpolation— Only INTER_NEAREST and INTER_LINEAR interpolation is supported
resizeDown()#
void cv::fastcv::resizeDown(
cv::InputArray _src,
cv::OutputArray _dst,
Size dsize,
double inv_scale_x,
double inv_scale_y )
#include <opencv2/fastcv/scale.hpp>
Down-scales the image using specified scaling factors or dimensions. This function supports both single-channel (CV_8UC1) and two-channel (CV_8UC2) images.
Note
If dsize is not specified, inv_scale_x and inv_scale_y must be strictly positive.
Parameters
_src— The input image data, type CV_8UC1 or CV_8UC2._dst— The output image data, type CV_8UC1 or CV_8UC2.dsize— The desired size of the output image. If empty, it is calculated using inv_scale_x and inv_scale_y.inv_scale_x— The inverse scaling factor for the width. If dsize is provided, this parameter is ignored.inv_scale_y— The inverse scaling factor for the height. If dsize is provided, this parameter is ignored.
sepFilter2D()#
void cv::fastcv::sepFilter2D(
InputArray _src,
OutputArray _dst,
int ddepth,
InputArray _kernelX,
InputArray _kernelY )
#include <opencv2/fastcv/blur.hpp>
NxN correlation with separable kernel. If srcImg and dstImg point to the same address and srcStride equals to dstStride, it will do in-place. Borders up to half-kernel width are ignored. The way of handling overflow is different with OpenCV, this function will do right shift for the intermediate results and final result.
See also
Parameters
_src— Intput image with type CV_8UC1_dst— Output image with type CV_8UC1, CV_16SC1ddepth— The depth of output image_kernelX— Filer kernel data in x direction_kernelY— Filer kernel data in Y direction (For CV_16SC1, the kernelX and kernelY should be same)
sobel()#
void cv::fastcv::sobel(
InputArray _src,
OutputArray _dx,
OutputArray _dy,
int kernel_size,
int borderType,
int borderValue )
#include <opencv2/fastcv/edges.hpp>
Creates a 2D gradient image from source luminance data without normalization. Calculate X direction 1 order derivative or Y direction 1 order derivative or both at the same time, .
Parameters
_src— Input image with type CV_8UC1_dx— Buffer to store horizontal gradient. Must be (dxyStride)*(height) bytes in size. If NULL, the horizontal gradient will not be calculated._dy— Buffer to store vertical gradient. Must be (dxyStride)*(height) bytes in size. If NULL, the vertical gradient will not be calculatedkernel_size— Sobel kernel size, support 3x3, 5x5, 7x7borderType— Border type, support BORDER_CONSTANT, BORDER_REPLICATEborderValue— Border value for constant border
sobel3x3u8()#
void cv::fastcv::sobel3x3u8(
InputArray _src,
OutputArray _dst,
OutputArray _dsty = noArray(),
int ddepth = CV_8U,
bool normalization = false )
#include <opencv2/fastcv/edges.hpp>
Creates a 2D gradient image from source luminance data without normalization. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel, borders up to half-kernel width are ignored.
Parameters
_src— Input image with type CV_8UC1_dst— If _dsty is given, buffer to store horizontal gradient, otherwise, output 8-bit image of |dx|+|dy|. Size of buffer is (srcwidth)*(srcheight) bytes_dsty— (Optional)Buffer to store vertical gradient. Must be (srcwidth)*(srcheight) in size.ddepth— The depth of output image CV_8SC1,CV_16SC1,CV_32FC1,normalization— If do normalization for the result
sobelPyramid()#
void cv::fastcv::sobelPyramid(
InputArrayOfArrays pyr,
OutputArrayOfArrays dx,
OutputArrayOfArrays dy,
int outType = CV_8S )
#include <opencv2/fastcv/pyramid.hpp>
Creates a gradient pyramid from an image pyramid Note: The borders are ignored during gradient calculation.
Parameters
pyr— Input pyramid of 1-channel 8-bit images. Only continuous images are supported.dx— Horizontal Sobel gradient pyramid of the same size as pyrdy— Verical Sobel gradient pyramid of the same size as pyroutType— Type of output data, can be CV_8S, CV_16S or CV_32F
split()#
void cv::fastcv::split(
InputArray src,
OutputArrayOfArrays mv )
#include <opencv2/fastcv/channel.hpp>
Splits an CV_8U multi-channel mat into several CV_8UC1 mats Optimized for Qualcomm’s processors.
Parameters
src— input 2,3 or 4 channel mat of depth CV_8Umv— output vector of size src.channels() of CV_8UC1 mats
sumOfAbsoluteDiffs()#
void cv::fastcv::dsp::sumOfAbsoluteDiffs(
cv::InputArray _patch,
cv::InputArray _src,
cv::OutputArray _dst )
#include <opencv2/fastcv/sad_dsp.hpp>
Sum of absolute differences of an image against an 8x8 template.
Parameters
_patch— The first input image data, type CV_8UC1_src— The input image data, type CV_8UC1_dst— The output image data, type CV_16UC1
thresholdOtsu()#
void cv::fastcv::dsp::thresholdOtsu(
InputArray _src,
OutputArray _dst,
bool type )
#include <opencv2/fastcv/thresh_dsp.hpp>
Binarizes a grayscale image using Otsu’s method. Sets the pixel to max(255) if it’s value is greater than the threshold; else, set the pixel to min(0). The threshold is searched that minimizes the intra-class variance (the variance within the class).
Parameters
_src— Input 8-bit grayscale image. Size of buffer is srcStride*srcHeight bytes._dst— Output 8-bit binarized image. Size of buffer is dstStride*srcHeight bytes.type— Threshold type that can be either 0 or 1. NOTE: For threshold type=0, the pixel is set as maxValue if it’s value is greater than the threshold; else, it is set as zero. For threshold type=1, the pixel is set as zero if it’s value is greater than the threshold; else, it is set as maxValue.
thresholdRange()#
void cv::fastcv::thresholdRange(
InputArray src,
OutputArray dst,
int lowThresh,
int highThresh,
int trueValue,
int falseValue )
#include <opencv2/fastcv/thresh.hpp>
Binarizes a grayscale image based on a pair of threshold values. The binarized image will be in the two values selected by user this function provides improved latency on Snapdragon processor.
Parameters
src— 8-bit grayscale imagedst— Output image of the same size and type as input image, can be the same as input imagelowThresh— The lower threshold value for binarizationhighThresh— The higher threshold value for binarizationtrueValue— The value assigned to the destination pixel if the source is within the range inclusively defined by the pair of threshold valuesfalseValue— The value assigned to the destination pixel if the source is out of the range inclusively defined by the pair of threshold values
trackOpticalFlowLK()#
void cv::fastcv::trackOpticalFlowLK(
InputArray src,
InputArray dst,
InputArrayOfArrays srcPyr,
InputArrayOfArrays dstPyr,
InputArray ptsIn,
OutputArray ptsOut,
InputArray ptsEst,
OutputArray statusVec,
cv::Size winSize = cv::Size(7, 7),
cv::TermCriteria termCriteria = cv::TermCriteria(cv::TermCriteria::MAX_ITER|cv::TermCriteria::EPS, 7, 0.03f *0.03f) )
#include <opencv2/fastcv/tracking.hpp>
Calculates sparse optical flow using Lucas-Kanade algorithm accepts 8-bit unsigned integer image Provides faster execution time on Qualcomm’s processor.
Parameters
src— Input single-channel image of type 8U, initial motion framedst— Input single-channel image of type 8U, final motion frame, should have the same size and stride as initial framesrcPyr— Pyramid built from intial motion framedstPyr— Pyramid built from final motion frameptsIn— Array of initial subpixel coordinates of starting points, should contain 32F 2D elementsptsOut— Output array of calculated final points, should contain 32F 2D elementsptsEst— Input array of estimations for final points, should contain 32F 2D elements, can be emptystatusVec— Output array of int32 values indicating status of each feature, can be emptywinSize— Size of window for optical flow searching. Width and height ust be odd numbers. Suggested values are 5, 7 or 9termCriteria— Termination criteria containing max number of iterations, max epsilon and stop condition
trackOpticalFlowLK()#
void cv::fastcv::trackOpticalFlowLK(
InputArray src,
InputArray dst,
InputArrayOfArrays srcPyr,
InputArrayOfArrays dstPyr,
InputArrayOfArrays srcDxPyr,
InputArrayOfArrays srcDyPyr,
InputArray ptsIn,
OutputArray ptsOut,
OutputArray statusVec,
cv::Size winSize = cv::Size(7, 7),
int maxIterations = 7 )
#include <opencv2/fastcv/tracking.hpp>
Overload for v1 of the LK tracking function.
Parameters
src— Input single-channel image of type 8U, initial motion framedst— Input single-channel image of type 8U, final motion frame, should have the same size and stride as initial framesrcPyr— Pyramid built from intial motion framedstPyr— Pyramid built from final motion framesrcDxPyr— Pyramid of Sobel derivative by X of srcPyrsrcDyPyr— Pyramid of Sobel derivative by Y of srcPyrptsIn— Array of initial subpixel coordinates of starting points, should contain 32F 2D elementsptsOut— Output array of calculated final points, should contain 32F 2D elementsstatusVec— Output array of int32 values indicating status of each feature, can be emptywinSize— Size of window for optical flow searching. Width and height ust be odd numbers. Suggested values are 5, 7 or 9maxIterations— Maximum number of iterations to try
warpAffine()#
void cv::fastcv::warpAffine(
InputArray _src,
OutputArray _dst,
InputArray _M,
Size dsize,
int interpolation = INTER_LINEAR,
int borderValue = 0 )
#include <opencv2/fastcv/warp.hpp>
Performs an affine transformation on an input image using a provided transformation matrix.
This function performs two types of operations based on the transformation matrix:
Standard Affine Transformation (2x3 matrix):
Transforms the entire input image using the affine matrix
Supports both CV_8UC1 and CV_8UC3 types
Patch Extraction with Transformation (2x2 matrix):
Extracts and transforms a patch from the input image
Only supports CV_8UC1 type
If input is a ROI: patch is extracted from ROI center in the original image
If input is full image: patch is extracted from image center
Note
The affine matrix follows the inverse mapping convention, applied to destination coordinates to produce corresponding source coordinates.
The function uses ‘FASTCV_BORDER_CONSTANT’ for border handling, with the specified ‘borderValue’.
Parameters
_src— Input image. Supported formats:CV_8UC1: 8-bit single-channel
CV_8UC3: 8-bit three-channel - only for 2x3 matrix
_dst— Output image. Will have the same type as src and size specified by dsize_M— 2x2/2x3 affine transformation matrix (inversed map)dsize— Output size:For 2x3 matrix: Size of the output image
For 2x2 matrix: Size of the extracted patch
interpolation— Interpolation method. Only applicable for 2x3 transformation with CV_8UC1 input. Options:INTER_NEAREST: Nearest-neighbor interpolation
INTER_LINEAR: Bilinear interpolation (default)
INTER_AREA: Area-based interpolation
INTER_CUBIC: Bicubic interpolation Note: CV_8UC3 input always use bicubic interpolation internally
borderValue— Constant pixel value for border pixels. Only applicable for 2x3 transformations with single-channel input.
warpPerspective()#
void cv::fastcv::warpPerspective(
InputArray _src,
OutputArray _dst,
InputArray _M0,
Size dsize,
int interpolation,
int borderType,
const Scalar & borderValue )
#include <opencv2/fastcv/warp.hpp>
Transform an image using perspective transformation, same as cv::warpPerspective but not bit-exact.
Parameters
_src— Input 8-bit image._dst— Output 8-bit image._M0— 3x3 perspective transformation matrix.dsize— Size of the output image.interpolation— Interpolation method. Only cv::INTER_NEAREST, cv::INTER_LINEAR and cv::INTER_AREA are supported.borderType— Pixel extrapolation method. Only cv::BORDER_CONSTANT, cv::BORDER_REPLICATE and cv::BORDER_TRANSPARENT are supported.borderValue— Value used in case of a constant border.
warpPerspective2Plane()#
void cv::fastcv::warpPerspective2Plane(
InputArray _src1,
InputArray _src2,
OutputArray _dst1,
OutputArray _dst2,
InputArray _M0,
Size dsize )
#include <opencv2/fastcv/warp.hpp>
Perspective warp two images using the same transformation. Bi-linear interpolation is used where applicable. For example, to warp a grayscale image and an alpha image at the same time, or warp two color channels.
Parameters
_src1— First input 8-bit image. Size of buffer is src1Stride*srcHeight bytes._src2— Second input 8-bit image. Size of buffer is src2Stride*srcHeight bytes._dst1— First warped output image (correspond to src1). Size of buffer is dst1Stride*dstHeight bytes, type CV_8UC1_dst2— Second warped output image (correspond to src2). Size of buffer is dst2Stride*dstHeight bytes, type CV_8UC1_M0— The 3x3 perspective transformation matrix (inversed map)dsize— The output image size