NFIQ2 Ubuntu编译以及使用


最近因为所做项目的关系,接触了NFIQ2,作为指纹质量中较为权威的测试软件,对其进行配置。

源码参照https://github.com/usnistgov/NFIQ2

NFIQ2.0

NIFQ 2.0是开源软件NIST Finger Image Quality NFIQ的修订版
NFIQ 2.0 provides a higher resolution quality score (in range of 0-100 according to the international biometric sample quality standard ISO/IEC 29794-1:2016 as opposed to 1-5), lower computation complexity, as well as support for quality assessment in mobile platform.
在NIFQ 2.0中集成了FDA(Frequency Domain Analysis),LCS(Local Clarity Score),OCL(Orientation Certainty Level),OF(Orientation Flow),RVU(Ridge Valley Uniformity)等很多指纹评价指标。

在这里插入图片描述

准备工作

下载源码 NFIQ2-master,解压
更新Ubuntu的gcc,g++,cmake

cmake(方法不唯一)
简易安装
sudo apt-get install cmake

下载安装
到cmake官网下载最新的cmake
https://cmake.org/download/
下载后解压,然后进入目录执行:
./bootstrap
make -j8
sudo make install
验证版本
cmake --version

gcc,g++
首先添加ppa到库:

  1. sudo add-apt-repository ppa:ubuntu-toolchain-r/test
  2. sudo apt-get update

安装新版gcc/g++
sudo apt-get install gcc-4.8 g+±4.8
sudo apt-get install gcc-4.9 g+±4.9
sudo apt-get install gcc-5 g+±5
sudo apt-get install gcc-6 g+±6
版本根据需求选择gcc-6 g+±6

安装OpenCV 2.4.2

预先安装一些软件
sudo apt-get install build-essential cmake libgtk2.0-dev pkg-config python-dev python-numpy libavcodec-dev libavformat-dev libswscale-dev

下载 opencv-2.4.2.tar.gz
github的opencv项目中,Tags版本中找到opencv-2.4.2.tar.gz,下载,解压

cd opencv-2.4.2
mkdir build
cd build
编译opencv源码
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local …
make -j7
sudo make install

编译NFIQ2.0

进入文件夹
cd NFIQ2-master
本地构建OpenCV步骤
mkdir libOpenCV && cd libOpenCV && cmake -D CMAKE_MAKE_PROGRAM=make …/OpenCV && make opencv_core opencv_ts opencv_imgproc opencv_highgui opencv_flann opencv_features2d opencv_calib3d opencv_ml opencv_video opencv_objdetect opencv_contrib opencv_nonfree opencv_gpu opencv_photo opencv_stitching opencv_videostab
sudo make install

OpenCV构建完后直接
make
sudo make install

编译通过后,NFIQ2位置在NFIQ2-master/NFIQ2/NFIQ2Algorithm/bin,注意图像调成500DPI,同时分辨率根据实际成像大小进行调节

./NFIQ2如果出错,参考备注来更新环境变量

./NFIQ2 后的使用方法

USAGE:
NFIQ2 [specific run mode arguments]
: run mode of NFIQ2 tool, possible values
SINGLE, BATCH

run mode SINGLE:

NFIQ2 SINGLE fingerprintImage imageFormat outputFeatureData outputSpeed

<fingerprintImage>: path and filename to a fingerprint image
<imageFormat>: one of following values describing the fingerprint image format
          BMP, WSQ
<outputFeatureData>: if to print computed quality feature values
         true, false
<outputSpeed>: if to print speed of quality feature computation
         true, false

run mode BATCH:

NFIQ2 BATCH fingerprintImageList imageFormat resultList outputFeatureData outputSpeed [ speedResultList ]

<fingerprintImageList>: path and filename to a list of fingerprint images
<imageFormat>: one of following values describing the fingerprint image format of all images in the input list
          BMP, WSQ
<resultList>: path and filename of the CSV output file that will contain NFIQ2 values and (optional) feature values
<outputFeatureData>: if to add computed quality feature values to the resulting CSV output file
         true, false
<outputSpeed>: if to compute the speed of NFIQ2 computation
         true, false
<speedResultList>: path and filename of another CSV output file that will contain the NFIQ2 speed values (optional argument, only applied if outputSpeed = true)

在这里插入图片描述

备注

环境变量有可能出现问题
PATH和LD_LIBRARY_PATH本质都是变量,所谓变量的意思就是由别人赋值产生的,直觉往往会让我们添加和减少这个变量本身的某些路径,实际上这是不正确的。正确的做法是我们要去修改赋予这个变量数值的那些配置文件,加一条路径或者减一条。说到底变量只关乎显示,不关乎其用于显示的内容。

修改

~/.bashrc

~/.bash_profile

或系统级别的/etc/profile
本次调试在**~/.bashrc**中添加
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
后运行source .bashrc (Source命令也称为“点命令”,也就是一个点符号(.)。source命令通常用于重新执行刚修改的初始化文件,使之立即生效,而不必注销并重新登录),调试通过

附录

放上NFIQ2.0的report

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值