Coder Social home page Coder Social logo

object_match's Introduction

Object Matching

编译静态库:

cd src
make [MODEL="-DBNInception"] 	MODEL用来选择不同模型,默认模型速度较快模型较小,BNInception模型较大。
生成libobj.a

demo测试:

cd src
make MODE="-DJPG_DEMO"
生成demo_obj及evaluate。

src目录下使用以下命令运行:
1.特征存储 :./demo_obj 0 ${num_features} ${image1_path} ${image2_path} ...
2.识别:./demo_obj 1 ${image_path}

evaluate测试

生成图片目录:cd src && python get_images.py 

./evaluate 0 ${image_dir} 生成特征库

./evaluate 1 ${image_dir} 测试准确率

注: image_dir 格式同test_images。

库函数说明:

// 说明:从已注册的物体中识别对应的物体
// 初始化,连接sqlite,获取物体库中各个物体的特征
void DKObjectRecognizationInit();

// 计算图像中心区域(1/4原图像大小)特征,并与sqlite中特征进行对比,如果相似度大于某一阈值(在识别参数中定义),则输出null,否则输出识别出的物体的index。
int DKObjectRecognizationProcess(char * rgbfilename, int iWidth, int iHeight, DKSObjectRecognizationParam param);

// 释放物体识别资源
void DKObjectRecognizationEnd();


// 说明:录入物体,在物体学习阶段,获取至少DKMINOBJREGISTERIMGNUM张同一物体图片
// 初始化,连接sqlite,准备写入物体特征和语音,初始化学习图片次数为0
void DKObjectRegisterInit();

// 根据图像中间位置(1/4原图像大小)子图像计算特征
char * DKObjectRegisterProcess(char * yuvfilename, int iWidth, int iHeight, DKSObjectRegisterParam param);

// 将计算好的特征存入sqlite中(flag为1),或取消物体特征学习(flag为0),count表示要存储特征的序数(是否是新物体第一个特征)。
void DKObjectRegisterEnd(int flag, int count);

变量及结构体:

#ifndef DKMINOBJREGISTERIMGNUM
#define DKMINOBJREGISTERIMGNUM  5 // 人脸注册时最少需采集人脸数目

typedef struct
{

	    float threshold; // 相似度阈值,相似度超过该值认为不能认出该物体
}DKSObjectRecognizationParam;

typedef struct
{

	    int undefined; //边界框索引
}DKSObjectRegisterParam;

object_match's People

Watchers

James Cloos avatar xichao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.