FastCV主要接口分析之三
5. 点积相关函数
此是一些列相关的函数,主要进行各种各种情况下的点积运算;
形参是各种维度的vector,返回的是点积值。比如:
FASTCV_API int32_t fcvDotProduct36x1s8( const int8_t* __restrict a, const int8_t* __restrict b );
a和b是36-byte的vector;
FASTCV_API int32_t fcvDotProduct64x1s8( const int8_t* __restrict a, const int8_t* __restrict b );
a和b是64-byte的vector;
6.过滤器函数
FASTCV_API void fcvFilterSobel3x3u8( const uint8_t* __restrict src,
unsigned int srcWidth,
unsigned int srcHeight,
uint8_t* __restrict dst );
3x3 Sobel边缘过滤器函数:此函数主要计算带有3x3内核的导数卷积图像;
FASTCV_API void fcvFilterCanny3x3u8( const uint8_t* __restrict src,
unsigned int srcWidth,
unsigned int srcHeight,
uint8_t* __restrict dst,
int lowThresh,
int highThresh );
Canny边缘过滤器函数:此函数应用于8位灰度图像,最小阈值设置为0和最大阈值设置为15,
使用的光圈大小设置为3。
7.图片比较函数
FASTCV_API void fcvImageDiffxx( const uint8_t* __restrict src1,
const uint8_t* __restrict src2,
unsigned int srcWidth,
unsigned int srcHeight,
uint8_t* __restrict dst );
此函数是一些列函数,主要是演示图像差异通过计算src1和src2的差值(dst=src1-src2),
dst[i,j] = (uint8_t) max( min((short)(src1[i,j]-src2[i,j]), 255), 0 );
8.2D梯度创建函数
FASTCV_API void fcvImageGradientInterleaveds16( const uint8_t* __restrict src,
unsigned int srcWidth,
unsigned int srcHeight,
unsigned int srcStride,
int16_t* __restrict gradients);
此函数是一系列函数,主要是由源光照度数据创建2D梯度:主要只用左右相邻的作为x轴梯度和
上下相邻的作为y调梯度。
9.MSER算法函数
MSER:最大稳定极值区域(Maximally Stable Extremal Regions),此算法提出一种对图像的尺度、旋转、
仿射变换更加稳定的区域不变量提取的算法。调用此MSER功能,以下三个函数必须使用:
FASTCV_API int fcvMserInit(const unsigned int width,
const unsigned int height,
unsigned int delta,
unsigned int minArea,
unsigned int maxArea,
float maxVariation,
float minDiversity,
void ** mserHandle ); 初始化MSER
FASTCV_API void fcvMseru8( void *mserHandle,
const uint8_t* __restrict srcPtr,
unsigned int srcWidth,
unsigned int srcHeight,
unsigned int srcStride,
unsigned int maxContours,
unsigned int * __restrict numContours,
unsigned int * __restrict numPointsInContour,
unsigned int pointsArraySize,
unsigned int * __restrict pointsArray);调用MSER算法
FASTCV_API void fcvMserRelease(void *mserHandle); 释放MSER资源
典型的使用方法如下:
void *mserHandle;
if (fcvMserInit (width,........,&mserHandle))
{
fcvMseru8 (mserHandle,...);
fcvMserRelease(mserHandle);
}