在Hi3519A上实现LBP

本文档介绍了如何在海思Hi3519A芯片上实现LBP(局部二值模式)特征提取。首先,详细阐述了LBP计算的基本原理和公式。接着,详细说明了主要的编程步骤,包括编辑sample_ive_lbp.c,修改sample_ive_main.c和sample_ive_main.h文件。最后,文档提供了编译程序、准备测试图片和在Hi3519A上运行测试的流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1 背景

LBP 计算示意图

lbp

LBP 计算公式

  • IVE_LBP_CMP_NORMAL
    1
  • IVE_LBP_CMP_ABS
    2

其中 I(x, y) 对应 pstSrc , lpb(x, y) 对应 pstDstthr 对应 pstLbpCtrl→ un8BitThr

2 主要程序

对 LBP 算子的使用主要是参考了win10下的 Hi3519A V100R001C02SPC010\SVP_PC\HiIVE_PC_V2.1.0.7_64bit\sample\LBP 目录下的程序,其实就是照葫芦画瓢咯。

编辑 sample_ive_lbp.c

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>
#include <semaphore.h>
#include <pthread.h>
#include <math.h>
#include <time.h>
#include "sample_comm_ive.h"


typedef struct hiSAMPLE_IVE_LBP_S
{
   
	IVE_SRC_IMAGE_S stSrc;       //input frame
	IVE_DST_IMAGE_S stDst;       //output frame    

    FILE* pFpSrc;   //read from pFpSrc
    FILE* pFpDst;   //write to pFpDst
}SAMPLE_IVE_LBP_S;

static SAMPLE_IVE_LBP_S s_stLbp;


static HI_VOID SAMPLE_IVE_Lbp_Uninit(SAMPLE_IVE_LBP_S *pstLbp)
{
   
    IVE_MMZ_FREE(pstLbp->stSrc.au64PhyAddr[0], pstLbp->stSrc.au64VirAddr[0]);
    IVE_MMZ_FREE(pstLbp->stDst.au64PhyAddr
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值