FastCV主要接口分析之三

FastCV主要接口分析之三

    5. 點積相關函數

        FASTCV_API uint32_t fcvDotProductxxxx( xxx, ...... );

        此是一些列相關的函數,主要進行各種各種情況下的點積運算;

        形參是各種維度的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);
       }


發佈了25 篇原創文章 · 獲贊 4 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章