FastCV主要接口分析之二

FastCV主要接口分析之二

    FastCV为计算机视觉(CV,computer vision)的应用开发者提供了两个主要功能:提供CV常用的函数库,其已经进行了优化且可以高效的运行在移动设备上;提供干净的processor-agnostic硬件加速API,基于此芯片厂商能够在其硬件上进行硬件加速FastCV函数。最新版本FastCV1.5.0支持安卓和Windows移动开发,可以从高通网站developer.qualcomm.com上免费下载,其采用二进制文件统一发布,包含两种库的实现:一种运行在ARM处理器上被称为“FastCV for ARM”,一种运行在高通Snapdragon芯片上被称为“FastCV for Snapdragon”。

    FastCV提供的接口函数(fastcv.h文件中)部分如下:

    1.基本函数

       FASTCV_API void fcvGetVersion( char* version, unsigned int versionLength ); 获取版本信息

       FASTCV_API int fcvSetOperationMode( fcvOperationMode mode ); 选择硬件运行单元实例

       FASTCV_API void fcvCleanUp( void ); 清理资源,程序退出前必须调用

    2.内存管理函数

       FASTCV_API int fcvPyramidAllocate( fcvPyramidLevel* pyr,
                    unsigned int     baseWidth,
                    unsigned int     baseHeight,
                    unsigned int     bytesPerPixel,
                    unsigned int     numLevels,
                    int              allocateBase ); 为pyramid分配内存

       FASTCV_API void fcvPyramidDelete( fcvPyramidLevel* pyr,
                   unsigned int     numLevels,
                   unsigned int     startLevel ); 为pyramid重新分配内存

       FASTCV_API void* fcvMemAlloc( unsigned int nBytes,
                   unsigned int byteAlignment );分配对齐后的内存

       FASTCV_API void fcvMemFree( void* ptr ); 释放分配的内存
       FASTCV_API void fcvMemInit(void); 初始化FastCV的内存子系统

    3.模糊化图像函数

       FASTCV_API void fcvFilterMedian_xxx( const uint8_t* __restrict srcImg,
                    unsigned int              srcWidth,
                    unsigned int              srcHeight,
                    uint8_t* __restrict       dstImg ); 基于中值滤波器模糊化图像
       FASTCV_API void fcvFilterGaussian_xxx( const uint8_t* __restrict src,
                    unsigned int              srcWidth,
                    unsigned int              srcHeight,
                    uint8_t* __restrict       dst,
                    int                       blurBorder );基于高斯滤波器模糊化图像

    4.色彩转换函数

      FASTCV_API void fcvColorYUVxxxtoRGBxxx( const uint8_t* __restrict src,
                     unsigned int              srcWidth,
                     unsigned int              srcHeight,
                     uint32_t* __restrict      dst );  转换YUV到RGB格式.

      FASTCV_API void fcvColorRGBxxxtoYUVxxx( const uint8_t* __restrict src,
                     unsigned int              srcWidth,
                     unsigned int              srcHeight,
                     uint8_t* __restrict       dst ); 转换GRB到YUV格式

    未完待续。

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值