Compiling NIST Biometric Image Software (NBIS) for Android

One of Dev Technology’s core competencies is in biometrics capture and data integration with external US governmental organizations, such as FBI, DoD, Department of State, and others. As such, Dev Technology is working to improve end-user experience and agility in the collection of biometric data, in harsh environmental conditions, on a wide variety of platforms and devices, including mobile. One such mobile platform that Dev Technology has been focused on lately is Android. One of our internal research efforts has sought to prove that one could run the NIST Biometric Image Software (NBIS) on the Android Platform. The answer to that question initially seemed to be an obvious ‘yes’ since NBIS is written in ANSI C and easily buildable on Linux; since Android is built atop the Linux kernel, we reasoned that NBIS should be buildable for Android as well. And in fact, this is indeed true, but the process is not very straight-forward and you won’t currently find the process for doing so on the NBIS web site. This blog post, therefore, distills the lessons we’ve learned building and running NBIS on Android down to the easy-to-follow steps found below.

What is NBIS?

When working with biometrics such as fingerprints, iris and face data, it is often necessary to convert these data formats to various other formats to correctly and efficiently share this information with key US government organizations, such as FBI and DHS. NIST has provided the Biometric Image Software (NBIS) as openly-available ANSI C utilities and documentation for this very purpose. One of Dev Technology’s objectives is to be able to use these free ANSI C utilities in Government Off-The-Shelf Software (GOTS) in capturing and packaging biometric data for faster and more cost-effective data sharing with US government stakeholders. More information about NBIS can be found here.

Building NBIS for Android

When you download the latest NBIS Reference Code, the build and installation instructions will clearly walk you through how to build and install these executables for Microsoft Windows, Linux and Mac OSX. Building and installing for Android, using the provided instructions as a baseline, is also possible, but requires additional steps not currently documented by NBIS.

Assumptions

In the interest of expediency, the following instructions make the following assumptions:

You have access to a Linux environment. The instructions below were executed on an Ubuntu 16.04 Headless Server running on a Windows 10 host in Oracle Virtual Box.

Your Linux environment has the GCC toolchain installed.

You are comfortable with the Android SDK and Android Studio. The instructions below use Android Studio 2.2.1.

You have an Android Device. The instructions below use a Chuwi Hi8 Dual-Boot Tablet running Android 5.1.

You have a USB connection between your Android Device and your Desktop environment and can copy files between the two.

NBIS Compilation Steps:

Take a minute to identify the Android version and hardware architecture of your Android device. As mentioned above, the instructions from this point are geared toward a Chuwi Android 5.1 Platform running a 32-bit Intel Atom chipset. You can use ‘adb shell’ to query your device to accurately determine if it’s 32- or 64-bit.

Now, we want to start configuring the NBIS build. When we run the NBIS setup.sh script, we want to make sure that the regular Linux GCC Toolchain is on our path. This is what my setup.sh command looks like:

This script will generate the Makefile and rules.mak files used to build the code

We now want to setup and configure the Android toolchain we will use for building NBIS. To do this, navigate to the Android NDK directory created when you downloaded and uncompressed it. For me, the path is: /home/jcaple/android-ndk-r13.

Change directory to build/tools and run the ./make_standalone_toolchain.py script to see what arguments is takes.

Execute this script to generate the toolchain you will use to compile NBIS for your Android target. For my Android Tablet, I used the API version 21 for x86 architectures: