OpenCV 4.10.0-dev
Open Source Computer Vision
Loading...
Searching...
No Matches
Module-wrapper for FastCV hardware accelerated functions

Detailed Description

Classes

struct  cv::fastcv::ContourData
 Structure containing additional information about found contour. More...
 

Functions

void cv::fastcv::bilateralFilter (InputArray _src, OutputArray _dst, int d, float sigmaColor, float sigmaSpace, int borderType=BORDER_DEFAULT)
 Applies Bilateral filter to an image considering d-pixel diameter of each pixel's neighborhood. This filter does not work inplace.
 
void cv::fastcv::bilateralRecursive (cv::InputArray src, cv::OutputArray dst, float sigmaColor=0.03f, float sigmaSpace=0.1f)
 Recursive Bilateral Filtering.
 
void cv::fastcv::clusterEuclidean (InputArray points, InputArray clusterCenters, OutputArray newClusterCenters, OutputArray clusterSizes, OutputArray clusterBindings, OutputArray clusterSumDists, int numPointsUsed=-1)
 Clusterizes N input points in D-dimensional space into K clusters.
 
void cv::fastcv::FAST10 (InputArray src, InputArray mask, OutputArray coords, OutputArray scores, int barrier, int border, bool nmsEnabled)
 Extracts FAST corners and scores from the image based on the mask. The mask specifies pixels to be ignored by the detector.
 
void cv::fastcv::FFT (InputArray src, OutputArray dst)
 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.
 
void cv::fastcv::fillConvexPoly (InputOutputArray img, InputArray pts, Scalar color)
 Draw convex polygon This function fills the interior of a convex polygon with the specified color.
 
void cv::fastcv::houghLines (InputArray src, OutputArray lines, double threshold=0.25)
 Performs Hough Line detection.
 
void cv::fastcv::IFFT (InputArray src, OutputArray dst)
 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.
 
void cv::fastcv::matmuls8s32 (InputArray src1, InputArray src2, OutputArray dst)
 Matrix multiplication of two int8_t type matrices.
 
int cv::fastcv::meanShift (InputArray src, Rect &rect, TermCriteria termCrit)
 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.
 
cv::Moments cv::fastcv::moments (InputArray _src, bool binary)
 Calculates all of the moments up to the third order of the image pixels' intensities The results are returned in the structure cv::Moments.
 
void cv::fastcv::MSER (InputArray src, std::vector< std::vector< Point > > &contours, std::vector< cv::Rect > &boundingBoxes, std::vector< ContourData > &contourData, unsigned int numNeighbors=4, unsigned int delta=2, unsigned int minArea=30, unsigned int maxArea=14400, float maxVariation=0.15f, float minDiversity=0.2f)
 Runs MSER blob detector on the grayscale image.
 
void cv::fastcv::MSER (InputArray src, std::vector< std::vector< Point > > &contours, std::vector< cv::Rect > &boundingBoxes, unsigned int numNeighbors=4, unsigned int delta=2, unsigned int minArea=30, unsigned int maxArea=14400, float maxVariation=0.15f, float minDiversity=0.2f)
 This is an overload for MSER() function.
 
void cv::fastcv::MSER (InputArray src, std::vector< std::vector< Point > > &contours, unsigned int numNeighbors=4, unsigned int delta=2, unsigned int minArea=30, unsigned int maxArea=14400, float maxVariation=0.15f, float minDiversity=0.2f)
 This is an overload for MSER() function.
 
void cv::fastcv::remap (InputArray src, OutputArray dst, InputArray map1, InputArray map2, int interpolation, int borderValue=0)
 Applies a generic geometrical transformation to a greyscale CV_8UC1 image.
 
void cv::fastcv::remapRGBA (InputArray src, OutputArray dst, InputArray map1, InputArray map2, int interpolation)
 Applies a generic geometrical transformation to a 4-channel CV_8UC4 image with bilinear or nearest neighbor interpolation.
 
void cv::fastcv::resizeDownBy2 (cv::InputArray _src, cv::OutputArray _dst)
 Down-scale the image by averaging each 2x2 pixel block.
 
void cv::fastcv::resizeDownBy4 (cv::InputArray _src, cv::OutputArray _dst)
 Down-scale the image by averaging each 4x4 pixel block.
 
void cv::fastcv::thresholdRange (InputArray src, OutputArray dst, uint8_t lowThresh, uint8_t highThresh, uint8_t trueValue, uint8_t falseValue)
 Binarizes a grayscale image based on a pair of threshold values. The binarized image will be in the two values selected by user.
 

Function Documentation

◆ 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
_srcIntput image with type CV_8UC1
_dstDestination image with same type as _src
dkernel size (can be 5, 7 or 9)
sigmaColorFilter 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.
sigmaSpaceFilter 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.
borderTypeborder 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

Parameters
srcInput image, should have one CV_8U channel
dstOutput array having one CV_8U channel
sigmaColorSigma in the color space, the bigger the value the more color difference is smoothed by the algorithm
sigmaSpaceSigma in the coordinate space, the bigger the value the more distant pixels are smoothed

◆ 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.

Parameters
pointsPoints array of type 8u, each row represets a point. Size is N rows by D columns, can be non-continuous.
clusterCentersInitial cluster centers array of type 32f, each row represents a center. Size is K rows by D columns, can be non-continuous.
newClusterCentersResulting cluster centers array of type 32f, each row represents found center. Size is set to be K rows by D columns.
clusterSizesResulting cluster member counts array of type uint32, size is set to be 1 row by K columns.
clusterBindingsResulting 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.
clusterSumDistsResulting 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 columns
numPointsUsedNumber of points to clusterize starting from 0 to numPointsUsed-1 inclusively. Sets to N if negative.

◆ 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 FAST corners and scores from the image based on the mask. The mask specifies pixels to be ignored by the detector.

Parameters
src8-bit grayscale image
maskOptional 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 to fcvCornerFast9InMaskScoreu8 function in FastCV
coordsOutput array of CV_32S containing interleave x, y positions of detected corners
scoresOptional 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 50
barrierFAST threshold. The threshold is used to compare difference between intensity value of the central pixel and pixels on a circle surrounding this pixel
borderNumber for pixels to ignore from top,bottom,right,left of the image. Defaults to 4 if it's below 4
nmsEnabledEnable non-maximum suppresion to prune weak key points

◆ 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.

Parameters
srcInput 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.
dstThe 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.

Parameters
imgImage to draw on. Should have up to 4 8-bit channels
ptsArray of polygon points coordinates. Should contain N two-channel or 2*N one-channel 32-bit integer elements
colorColor of drawn polygon stored as B,G,R and A(if supported)

◆ houghLines()

void cv::fastcv::houghLines ( InputArray src,
OutputArray lines,
double threshold = 0.25 )

#include <opencv2/fastcv/hough.hpp>

Performs Hough Line detection.

Parameters
srcInput 8-bit image containing binary contour. Width and step should be divisible by 8
linesOutput array containing detected lines in a form of (x1, y1, x2, y2) where all numbers are 32-bit floats
thresholdControls 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.

◆ 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
srcInput 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.
dstThe 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)

◆ matmuls8s32()

void cv::fastcv::matmuls8s32 ( InputArray src1,
InputArray src2,
OutputArray dst )

#include <opencv2/fastcv/arithm.hpp>

Matrix multiplication of two int8_t type matrices.

Parameters
src1First source matrix of type CV_8S
src2Second source matrix of type CV_8S
dstResulting 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.

Parameters
src8-bit grayscale image which is usually a probability image computed based on object histogram
rectInitial search window position which also returns the final converged window position
termCritThe 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

◆ 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.

Parameters
_srcInput image with type CV_8UC1, CV_32SC1, CV_32FC1
binaryIf 1, binary image (0x00-black, oxff-white); if 0, grayscale image

◆ MSER() [1/3]

void cv::fastcv::MSER ( InputArray src,
std::vector< std::vector< Point > > & contours,
std::vector< cv::Rect > & boundingBoxes,
std::vector< ContourData > & contourData,
unsigned int numNeighbors = 4,
unsigned int delta = 2,
unsigned int minArea = 30,
unsigned int maxArea = 14400,
float maxVariation = 0.15f,
float minDiversity = 0.2f )

#include <opencv2/fastcv/mser.hpp>

Runs MSER blob detector on the grayscale image.

Parameters
srcSource image of type CV_8UC1. Image width has to be greater than 50, and image height has to be greater than 5. Pixels at the image boundary are not processed. If boundary pixels are important for a particular application, please consider padding the input image with dummy pixels of one pixel wide.
contoursArray containing found contours
boundingBoxesArray containing bounding boxes of found contours
contourDataArray containing additional information about found contours
numNeighborsNumber of neighbors in contours, can be 4 or 8
deltaDelta to be used in MSER algorithm (the difference in grayscale values within which the region is stable ). Typical value range [0.8 8], typical value 2
minAreaMinimum area (number of pixels) of a mser contour. Typical value range [10 50], typical value 30
maxAreaMaximum area (number of pixels) of a mser contour. Typical value 14400 or 0.25*width*height
maxVariationMaximum variation in grayscale between 2 levels allowed. Typical value range [0.1 1.0], typical value 0.15
minDiversityMinimum diversity in grayscale between 2 levels allowed. Typical value range [0.1 1.0], typical value 0.2

◆ MSER() [2/3]

void cv::fastcv::MSER ( InputArray src,
std::vector< std::vector< Point > > & contours,
std::vector< cv::Rect > & boundingBoxes,
unsigned int numNeighbors = 4,
unsigned int delta = 2,
unsigned int minArea = 30,
unsigned int maxArea = 14400,
float maxVariation = 0.15f,
float minDiversity = 0.2f )

#include <opencv2/fastcv/mser.hpp>

This is an overload for MSER() function.

Parameters
srcSource image of type CV_8UC1. Image width has to be greater than 50, and image height has to be greater than 5. Pixels at the image boundary are not processed. If boundary pixels are important for a particular application, please consider padding the input image with dummy pixels of one pixel wide.
contoursArray containing found contours
boundingBoxesArray containing bounding boxes of found contours
numNeighborsNumber of neighbors in contours, can be 4 or 8
deltaDelta to be used in MSER algorithm (the difference in grayscale values within which the region is stable ). Typical value range [0.8 8], typical value 2
minAreaMinimum area (number of pixels) of a mser contour. Typical value range [10 50], typical value 30
maxAreaMaximum area (number of pixels) of a mser contour. Typical value 14400 or 0.25*width*height
maxVariationMaximum variation in grayscale between 2 levels allowed. Typical value range [0.1 1.0], typical value 0.15
minDiversityMinimum diversity in grayscale between 2 levels allowed. Typical value range [0.1 1.0], typical value 0.2

◆ MSER() [3/3]

void cv::fastcv::MSER ( InputArray src,
std::vector< std::vector< Point > > & contours,
unsigned int numNeighbors = 4,
unsigned int delta = 2,
unsigned int minArea = 30,
unsigned int maxArea = 14400,
float maxVariation = 0.15f,
float minDiversity = 0.2f )

#include <opencv2/fastcv/mser.hpp>

This is an overload for MSER() function.

Parameters
srcSource image of type CV_8UC1. Image width has to be greater than 50, and image height has to be greater than 5. Pixels at the image boundary are not processed. If boundary pixels are important for a particular application, please consider padding the input image with dummy pixels of one pixel wide.
contoursArray containing found contours
numNeighborsNumber of neighbors in contours, can be 4 or 8
deltaDelta to be used in MSER algorithm (the difference in grayscale values within which the region is stable ). Typical value range [0.8 8], typical value 2
minAreaMinimum area (number of pixels) of a mser contour. Typical value range [10 50], typical value 30
maxAreaMaximum area (number of pixels) of a mser contour. Typical value 14400 or 0.25*width*height
maxVariationMaximum variation in grayscale between 2 levels allowed. Typical value range [0.1 1.0], typical value 0.15
minDiversityMinimum diversity in grayscale between 2 levels allowed. Typical value range [0.1 1.0], typical value 0.2

◆ 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
srcThe first input image data, type CV_8UC1
dstThe output image data, type CV_8UC1
map1Floating-point CV_32FC1 matrix with each element as the column coordinate of the mapped location in the source image
map2Floating-point CV_32FC1 matrix with each element as the row coordinate of the mapped location in the source image.
interpolationOnly INTER_NEAREST and INTER_LINEAR interpolation is supported
borderValueconstant 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
srcThe first input image data, type CV_8UC4
dstThe output image data, type CV_8UC4
map1Floating-point CV_32FC1 matrix with each element as the column coordinate of the mapped location in the source image
map2Floating-point CV_32FC1 matrix with each element as the row coordinate of the mapped location in the source image.
interpolationOnly INTER_NEAREST and INTER_LINEAR interpolation is supported

◆ resizeDownBy2()

void cv::fastcv::resizeDownBy2 ( cv::InputArray _src,
cv::OutputArray _dst )

#include <opencv2/fastcv/scale.hpp>

Down-scale the image by averaging each 2x2 pixel block.

Parameters
_srcThe first input image data, type CV_8UC1, src height must be a multiple of 2
_dstThe output image data, type CV_8UC1

◆ resizeDownBy4()

void cv::fastcv::resizeDownBy4 ( cv::InputArray _src,
cv::OutputArray _dst )

#include <opencv2/fastcv/scale.hpp>

Down-scale the image by averaging each 4x4 pixel block.

Parameters
_srcThe first input image data, type CV_8UC1, src height must be a multiple of 4
_dstThe output image data, type CV_8UC1

◆ thresholdRange()

void cv::fastcv::thresholdRange ( InputArray src,
OutputArray dst,
uint8_t lowThresh,
uint8_t highThresh,
uint8_t trueValue,
uint8_t 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.

Parameters
src8-bit grayscale image
dstOutput image of the same size and type as input image, can be the same as input image
lowThreshThe lower threshold value for binarization
highThreshThe higher threshold value for binarization
trueValueThe value assigned to the destination pixel if the source is within the range inclusively defined by the pair of threshold values
falseValueThe value assigned to the destination pixel if the source is out of the range inclusively defined by the pair of threshold values