├── .gitignore
├── LICENSE
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── seamfix
│ │ └── calculatenfiq
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ ├── cpp
│ │ └── nfiq
│ │ │ ├── CMakeLists.txt
│ │ │ ├── bin
│ │ │ ├── fing2pat
│ │ │ ├── nfiq
│ │ │ ├── znormdat
│ │ │ └── znormpat
│ │ │ ├── include
│ │ │ ├── an2k.h
│ │ │ ├── defs.h
│ │ │ ├── f2c.h
│ │ │ ├── lfs.h
│ │ │ ├── log.h
│ │ │ ├── memalloc.h
│ │ │ ├── mlp.h
│ │ │ ├── mlpcla.h
│ │ │ ├── morph.h
│ │ │ ├── mytime.h
│ │ │ ├── nfiq.h
│ │ │ ├── swap.h
│ │ │ ├── usebsd.h
│ │ │ └── util.h
│ │ │ ├── lib
│ │ │ └── libnfiq.a
│ │ │ ├── native_lib.c
│ │ │ ├── obj
│ │ │ └── src
│ │ │ │ ├── bin
│ │ │ │ ├── fing2pat
│ │ │ │ │ ├── fing2pat.d
│ │ │ │ │ └── fing2pat.o
│ │ │ │ ├── nfiq
│ │ │ │ │ ├── nfiq.d
│ │ │ │ │ └── nfiq.o
│ │ │ │ ├── znormdat
│ │ │ │ │ ├── znormdat.d
│ │ │ │ │ └── znormdat.o
│ │ │ │ └── znormpat
│ │ │ │ │ ├── znormpat.d
│ │ │ │ │ └── znormpat.o
│ │ │ │ └── lib
│ │ │ │ └── nfiq
│ │ │ │ ├── nfiq.d
│ │ │ │ ├── nfiq.o
│ │ │ │ ├── nfiqgbls.d
│ │ │ │ ├── nfiqgbls.o
│ │ │ │ ├── nfiqread.d
│ │ │ │ ├── nfiqread.o
│ │ │ │ ├── znorm.d
│ │ │ │ └── znorm.o
│ │ │ ├── runtimedata
│ │ │ ├── spec
│ │ │ └── znorm.dat
│ │ │ └── src
│ │ │ ├── Makefile
│ │ │ ├── bin
│ │ │ ├── Makefile
│ │ │ ├── fing2pat
│ │ │ │ ├── Makefile
│ │ │ │ ├── catalog_fing2pat.txt
│ │ │ │ └── fing2pat.c
│ │ │ ├── nfiq
│ │ │ │ ├── Makefile
│ │ │ │ ├── catalog_nfiq.txt
│ │ │ │ └── nfiq.c
│ │ │ ├── znormdat
│ │ │ │ ├── Makefile
│ │ │ │ ├── catalog_znormdat.txt
│ │ │ │ └── znormdat.c
│ │ │ └── znormpat
│ │ │ │ ├── Makefile
│ │ │ │ ├── catalog_znormpat.txt
│ │ │ │ └── znormpat.c
│ │ │ ├── lib
│ │ │ ├── Makefile
│ │ │ └── nfiq
│ │ │ │ ├── Makefile
│ │ │ │ ├── acs.c
│ │ │ │ ├── binar.c
│ │ │ │ ├── block.c
│ │ │ │ ├── chaincod.c
│ │ │ │ ├── contour.c
│ │ │ │ ├── detect.c
│ │ │ │ ├── dft.c
│ │ │ │ ├── fatalerr.c
│ │ │ │ ├── free.c
│ │ │ │ ├── getmin.c
│ │ │ │ ├── globals.c
│ │ │ │ ├── imgutil.c
│ │ │ │ ├── init.c
│ │ │ │ ├── libnfiq.txt
│ │ │ │ ├── line.c
│ │ │ │ ├── link.c
│ │ │ │ ├── log.c
│ │ │ │ ├── loop.c
│ │ │ │ ├── lsame.c
│ │ │ │ ├── maps.c
│ │ │ │ ├── matchpat.c
│ │ │ │ ├── memalloc.c
│ │ │ │ ├── minutia.c
│ │ │ │ ├── mlpcla.c
│ │ │ │ ├── morph.c
│ │ │ │ ├── nfiq.c
│ │ │ │ ├── nfiqgbls.c
│ │ │ │ ├── nfiqread.c
│ │ │ │ ├── quality.c
│ │ │ │ ├── remove.c
│ │ │ │ ├── ridges.c
│ │ │ │ ├── runmlp.c
│ │ │ │ ├── saxpy.c
│ │ │ │ ├── sdot.c
│ │ │ │ ├── sgemv.c
│ │ │ │ ├── shape.c
│ │ │ │ ├── snrm2.c
│ │ │ │ ├── sort.c
│ │ │ │ ├── sscal.c
│ │ │ │ ├── ssxstats.c
│ │ │ │ ├── syserr.c
│ │ │ │ ├── util.c
│ │ │ │ ├── xerbla.c
│ │ │ │ ├── xytreps.c
│ │ │ │ └── znorm.c
│ │ │ └── s_rules.mak
│ └── java
│ │ └── com
│ │ └── seamfix
│ │ └── calculatenfiq
│ │ └── NFIQUtil.kt
│ └── test
│ └── java
│ └── com
│ └── seamfix
│ └── calculatenfiq
│ └── ExampleUnitTest.kt
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/libraries
5 | /.idea/modules.xml
6 | /.idea/workspace.xml
7 | .DS_Store
8 | /build
9 | /captures
10 | .externalNativeBuild
11 | .idea
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://jitpack.io/#seamfixng/android-nfiq-calc)
2 |
3 |
4 | # android-nfiq-calc
5 | Seamfix Android SDK that is used to calculate the NFIQ of a captured fingerprint image. Project is an Android (Kotlin) implementation of a C-based NFIQ calculator found here https://github.com/lessandro/nbis
6 |
7 | ## Usage
8 | ```kotlin
9 | NFIQUtil.calculateNFIQUsingBitmap(context: Context, bitmap: Bitmap)
10 | ```
11 | or
12 |
13 | ```kotlin
14 | NFIQUtil.calculateNFIQUsingRawBytes(rawBytes: ByteArray, imageWidth: Int, imageHeight: Int)
15 |
16 | ```
17 |
18 | ## Install
19 |
20 | This repository can be found on JitPack:
21 |
22 | https://jitpack.io/#seamfix11/android-nfiq-calc
23 |
24 | Add it in your root build.gradle at the end of repositories:
25 | ```
26 | allprojects {
27 | repositories {
28 | ...
29 | maven { url "https://jitpack.io" }
30 | }
31 | }
32 | ```
33 |
34 | Add the dependency:
35 | ```
36 | dependencies {
37 | compile 'com.github.seamfix11:android-nfiq-calc:1.0.1'
38 | }
39 | ```
40 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | apply plugin: 'kotlin-android'
4 |
5 | apply plugin: 'kotlin-android-extensions'
6 |
7 | android {
8 | compileSdkVersion 27
9 | defaultConfig {
10 | minSdkVersion 16
11 | targetSdkVersion 27
12 | versionCode 1
13 | versionName "1.0.1"
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 | externalNativeBuild {
16 | cmake {
17 | cppFlags ""
18 | }
19 | }
20 | }
21 | buildTypes {
22 | release {
23 | minifyEnabled false
24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
25 | }
26 | }
27 | externalNativeBuild {
28 | cmake {
29 | path "src/main/cpp/nfiq/CMakeLists.txt"
30 | }
31 | }
32 |
33 |
34 | libraryVariants.all { variant ->
35 | variant.outputs.all { output ->
36 | if (outputFile != null && outputFileName.endsWith('.aar')) {
37 | outputFileName = "calcnfiq-${defaultConfig.versionName}.aar"
38 | }
39 | }
40 | }
41 | }
42 |
43 | dependencies {
44 | implementation fileTree(dir: 'libs', include: ['*.jar'])
45 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
46 | implementation 'com.github.mhshams:jnbis:2.0.0'
47 |
48 | testImplementation 'junit:junit:4.12'
49 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
50 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
51 | }
52 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/seamfix/calculatenfiq/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.seamfix.calculatenfiq
2 |
3 | import android.support.test.InstrumentationRegistry
4 | import android.support.test.runner.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getTargetContext()
22 | assertEquals("com.seamfix.calculatenfiq", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2016 The Android Open Source Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "ASacs.c IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | # Build one shared lib. When we build, we set the bin to $user/tmp, and
18 | # remove it after build complete, so only the distribution place could be
19 | # used for application linking.
20 |
21 | cmake_minimum_required(VERSION 3.4.1)
22 |
23 | set(CMAKE_VERBOSE_MAKEFILE on)
24 |
25 | add_library(loop STATIC src/lib/nfiq/loop.c)
26 | target_include_directories(loop PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
27 |
28 | add_library(znorm SHARED src/lib/nfiq/znorm.c)
29 | target_include_directories(znorm PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
30 |
31 | add_library(ridges SHARED src/lib/nfiq/ridges.c)
32 | target_include_directories(ridges PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
33 |
34 | add_library(ssxstats SHARED src/lib/nfiq/ssxstats.c)
35 | target_include_directories(ssxstats PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
36 |
37 | add_library(acs SHARED src/lib/nfiq/acs.c)
38 | target_include_directories(acs PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
39 |
40 | add_library(remove SHARED src/lib/nfiq/remove.c)
41 | target_include_directories(remove PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
42 |
43 | add_library(runmlp SHARED src/lib/nfiq/runmlp.c)
44 | target_include_directories(runmlp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
45 |
46 | add_library(memalloc SHARED src/lib/nfiq/memalloc.c)
47 | target_include_directories(memalloc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
48 |
49 | add_library(syserr SHARED src/lib/nfiq/syserr.c)
50 | target_include_directories(syserr PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
51 |
52 | add_library(chaincod SHARED src/lib/nfiq/chaincod.c)
53 | target_include_directories(chaincod PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
54 |
55 | add_library(shape SHARED src/lib/nfiq/shape.c)
56 | target_include_directories(shape PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
57 |
58 | add_library(link SHARED src/lib/nfiq/link.c)
59 | target_include_directories(link PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
60 |
61 | add_library(matchpat SHARED src/lib/nfiq/matchpat.c)
62 | target_include_directories(matchpat PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
63 |
64 | add_library(binar SHARED src/lib/nfiq/binar.c)
65 | target_include_directories(binar PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
66 |
67 | add_library(morph SHARED src/lib/nfiq/morph.c)
68 | target_include_directories(morph PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
69 |
70 | add_library(sort SHARED src/lib/nfiq/sort.c)
71 | target_include_directories(sort PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
72 |
73 | add_library(dft SHARED src/lib/nfiq/dft.c)
74 | target_include_directories(dft PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
75 |
76 | add_library(globals SHARED src/lib/nfiq/globals.c)
77 | target_include_directories(globals PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
78 |
79 | add_library(util SHARED src/lib/nfiq/util.c)
80 | target_include_directories(util PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
81 |
82 | add_library(fatalerr SHARED src/lib/nfiq/fatalerr.c)
83 | target_include_directories(fatalerr PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
84 |
85 | add_library(contour SHARED src/lib/nfiq/contour.c)
86 | target_include_directories(contour PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
87 |
88 | add_library(line SHARED src/lib/nfiq/line.c)
89 | target_include_directories(line PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
90 |
91 | add_library(imgutil SHARED src/lib/nfiq/imgutil.c)
92 | target_include_directories(imgutil PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
93 |
94 | add_library(free SHARED src/lib/nfiq/free.c)
95 | target_include_directories(free PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
96 |
97 | add_library(init SHARED src/lib/nfiq/init.c)
98 | target_include_directories(init PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
99 |
100 | add_library(block SHARED src/lib/nfiq/block.c)
101 | target_include_directories(block PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
102 |
103 | add_library(mlpcla SHARED src/lib/nfiq/mlpcla.c)
104 | target_include_directories(mlpcla PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
105 |
106 | add_library(maps SHARED src/lib/nfiq/maps.c)
107 | target_include_directories(maps PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
108 |
109 | add_library(log SHARED src/lib/nfiq/log.c)
110 | target_include_directories(log PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
111 |
112 | add_library(quality SHARED src/lib/nfiq/quality.c)
113 | target_include_directories(quality PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
114 |
115 | add_library(detect SHARED src/lib/nfiq/detect.c)
116 | target_include_directories(detect PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
117 |
118 | add_library(sgemv SHARED src/lib/nfiq/sgemv.c)
119 | target_include_directories(sgemv PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
120 |
121 | add_library(getmin SHARED src/lib/nfiq/getmin.c)
122 | target_include_directories(getmin PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
123 |
124 |
125 | add_library(minutia STATIC src/lib/nfiq/minutia.c)
126 | target_include_directories(minutia PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
127 |
128 | add_library(xytreps SHARED src/lib/nfiq/xytreps.c)
129 | target_include_directories(xytreps PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
130 |
131 | add_library(sscal SHARED src/lib/nfiq/sscal.c)
132 | target_include_directories(sscal PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
133 |
134 | add_library(saxpy SHARED src/lib/nfiq/saxpy.c)
135 | target_include_directories(saxpy PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
136 |
137 | add_library(snrm2 SHARED src/lib/nfiq/snrm2.c)
138 | target_include_directories(snrm2 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
139 |
140 | add_library(sdot SHARED src/lib/nfiq/sdot.c)
141 | target_include_directories(sdot PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
142 |
143 | add_library(lsame SHARED src/lib/nfiq/lsame.c)
144 | target_include_directories(lsame PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
145 |
146 |
147 | add_library(xerbla SHARED src/lib/nfiq/xerbla.c)
148 | target_include_directories(xerbla PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
149 |
150 | add_library(nfiqgbls SHARED src/lib/nfiq/nfiqgbls.c)
151 | target_include_directories(nfiqgbls PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
152 |
153 | add_library(nfiq SHARED src/lib/nfiq/nfiq.c)
154 | target_include_directories(nfiq PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
155 |
156 | add_library(nativelib SHARED native_lib.c)
157 | target_include_directories(nativelib PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
158 |
159 |
160 |
161 | #TARGET LINK SECTION
162 | target_link_libraries(quality maps)
163 |
164 | target_link_libraries(link log loop imgutil)
165 |
166 | target_link_libraries(chaincod globals)
167 |
168 | target_link_libraries(shape contour sort)
169 |
170 | target_link_libraries(loop minutia chaincod shape)
171 |
172 | target_link_libraries(remove minutia link)
173 |
174 | target_link_libraries(minutia maps matchpat contour line loop)
175 |
176 | target_link_libraries(contour util globals)
177 |
178 | target_link_libraries(imgutil line contour)
179 |
180 | target_link_libraries(getmin detect quality)
181 |
182 | target_link_libraries(dft sort)
183 |
184 | target_link_libraries(matchpat globals)
185 |
186 | target_link_libraries(binar imgutil)
187 |
188 | target_link_libraries(ridges log sort imgutil line contour minutia)
189 |
190 | target_link_libraries(detect log init free imgutil maps binar minutia remove ridges)
191 |
192 | target_link_libraries(maps block log init free dft morph util)
193 |
194 | target_link_libraries(znorm ssxstats)
195 |
196 | target_link_libraries(sgemv lsame xerbla)
197 |
198 | target_link_libraries(mlpcla sgemv sscal saxpy sdot snrm2)
199 |
200 | target_link_libraries(runmlp memalloc fatalerr acs mlpcla)
201 |
202 | target_link_libraries(memalloc syserr)
203 |
204 | target_link_libraries(nfiq znorm nfiqgbls minutia getmin runmlp)
205 |
206 | target_link_libraries(nativelib nfiq)
207 |
208 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/bin/fing2pat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/app/src/main/cpp/nfiq/bin/fing2pat
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/bin/nfiq:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/app/src/main/cpp/nfiq/bin/nfiq
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/bin/znormdat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/app/src/main/cpp/nfiq/bin/znormdat
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/bin/znormpat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/app/src/main/cpp/nfiq/bin/znormpat
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/include/defs.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 | #ifndef _DEFS_H
45 | #define _DEFS_H
46 |
47 | /*********************************************************************/
48 | /* General Purpose Defines */
49 | /*********************************************************************/
50 | #ifndef True
51 | #define True 1
52 | #define False 0
53 | #endif
54 | #ifndef TRUE
55 | #define TRUE True
56 | #define FALSE False
57 | #endif
58 | #define Yes True
59 | #define No False
60 | #define Empty NULL
61 | #ifndef None
62 | #define None -1
63 | #endif
64 | #ifndef FOUND
65 | #define FOUND 1
66 | #endif
67 | #define NOT_FOUND_NEG -1
68 | #define EOL EOF
69 | #ifndef DEG2RAD
70 | #define DEG2RAD (double)(57.29578)
71 | #endif
72 | #define max(a, b) ((a) > (b) ? (a) : (b))
73 | #define min(a, b) ((a) < (b) ? (a) : (b))
74 | #define sround(x) ((int) (((x)<0) ? (x)-0.5 : (x)+0.5))
75 | #define sround_uint(x) ((unsigned int) (((x)<0) ? (x)-0.5 : (x)+0.5))
76 | #define align_to_16(_v_) ((((_v_)+15)>>4)<<4)
77 | #define align_to_32(_v_) ((((_v_)+31)>>5)<<5)
78 | #ifndef CHUNKS
79 | #define CHUNKS 100
80 | #endif
81 |
82 | #endif /* !_DEFS_H */
83 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/include/f2c.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /***********************************************************************
46 | f2c.h -- Standard Fortran to C header file
47 |
48 | barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
49 |
50 | - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition)
51 |
52 | UPDATED: 12/11/2008 (Kenneth Ko) - Modified integer from long int
53 | to int, due to 32-bit and 64-bit
54 | support. On a 32-bit machine a
55 | long int is a 4 bytes; however,
56 | on a 64-bit machine a long in is
57 | a 8 bytes, which causing
58 | compatibility issues. On both
59 | 32-bit and 64-bit machines, a int
60 | is a 4 bytes.
61 | UPDATED: 02/11/2009 (Greg Fiumara) - Removed integer typedef
62 |
63 |
64 | ***********************************************************************/
65 | #ifndef F2C_INCLUDE
66 | #define F2C_INCLUDE
67 |
68 | typedef char *address;
69 | typedef short int shortint;
70 | typedef float real;
71 | typedef double doublereal;
72 | typedef struct { real r, i; } complex;
73 | typedef struct { doublereal r, i; } doublecomplex;
74 | typedef int logical;
75 | typedef short int shortlogical;
76 | typedef char logical1;
77 | typedef char integer1;
78 | /* typedef long long longint; */ /* system-dependent */
79 |
80 | #define TRUE_ (1)
81 | #define FALSE_ (0)
82 |
83 | /* Extern is for use with -E */
84 | #ifndef Extern
85 | #define Extern extern
86 | #endif
87 |
88 | /* I/O stuff */
89 |
90 | #ifdef f2c_i2
91 | /* for -i2 */
92 | typedef short flag;
93 | typedef short ftnlen;
94 | typedef short ftnint;
95 | #else
96 | typedef int flag;
97 | typedef int ftnlen;
98 | typedef int ftnint;
99 | #endif
100 |
101 | /*external read, write*/
102 | typedef struct
103 | { flag cierr;
104 | ftnint ciunit;
105 | flag ciend;
106 | char *cifmt;
107 | ftnint cirec;
108 | } cilist;
109 |
110 | /*internal read, write*/
111 | typedef struct
112 | { flag icierr;
113 | char *iciunit;
114 | flag iciend;
115 | char *icifmt;
116 | ftnint icirlen;
117 | ftnint icirnum;
118 | } icilist;
119 |
120 | /*open*/
121 | typedef struct
122 | { flag oerr;
123 | ftnint ounit;
124 | char *ofnm;
125 | ftnlen ofnmlen;
126 | char *osta;
127 | char *oacc;
128 | char *ofm;
129 | ftnint orl;
130 | char *oblnk;
131 | } olist;
132 |
133 | /*close*/
134 | typedef struct
135 | { flag cerr;
136 | ftnint cunit;
137 | char *csta;
138 | } cllist;
139 |
140 | /*rewind, backspace, endfile*/
141 | typedef struct
142 | { flag aerr;
143 | ftnint aunit;
144 | } alist;
145 |
146 | /* inquire */
147 | typedef struct
148 | { flag inerr;
149 | ftnint inunit;
150 | char *infile;
151 | ftnlen infilen;
152 | ftnint *inex; /*parameters in standard's order*/
153 | ftnint *inopen;
154 | ftnint *innum;
155 | ftnint *innamed;
156 | char *inname;
157 | ftnlen innamlen;
158 | char *inacc;
159 | ftnlen inacclen;
160 | char *inseq;
161 | ftnlen inseqlen;
162 | char *indir;
163 | ftnlen indirlen;
164 | char *infmt;
165 | ftnlen infmtlen;
166 | char *inform;
167 | ftnint informlen;
168 | char *inunf;
169 | ftnlen inunflen;
170 | ftnint *inrecl;
171 | ftnint *innrec;
172 | char *inblank;
173 | ftnlen inblanklen;
174 | } inlist;
175 |
176 | #define VOID void
177 |
178 | union Multitype { /* for multiple entry points */
179 | integer1 g;
180 | shortint h;
181 | int i;
182 | /* longint j; */
183 | real r;
184 | doublereal d;
185 | complex c;
186 | doublecomplex z;
187 | };
188 |
189 | typedef union Multitype Multitype;
190 |
191 | typedef long Long; /* No longer used; formerly in Namelist */
192 |
193 | struct Vardesc { /* for Namelist */
194 | char *name;
195 | char *addr;
196 | ftnlen *dims;
197 | int type;
198 | };
199 | typedef struct Vardesc Vardesc;
200 |
201 | struct Namelist {
202 | char *name;
203 | Vardesc **vars;
204 | int nvars;
205 | };
206 | typedef struct Namelist Namelist;
207 |
208 | #define abs(x) ((x) >= 0 ? (x) : -(x))
209 | #define dabs(x) (doublereal)abs(x)
210 | #define min(a,b) ((a) <= (b) ? (a) : (b))
211 | #define max(a,b) ((a) >= (b) ? (a) : (b))
212 | #define dmin(a,b) (doublereal)min(a,b)
213 | #define dmax(a,b) (doublereal)max(a,b)
214 |
215 | /* procedure parameter types for -A and -C++ */
216 |
217 | #define F2C_proc_par_types 1
218 | #ifdef __cplusplus
219 | typedef int /* Unknown procedure type */ (*U_fp)(...);
220 | typedef shortint (*J_fp)(...);
221 | typedef int (*I_fp)(...);
222 | typedef real (*R_fp)(...);
223 | typedef doublereal (*D_fp)(...), (*E_fp)(...);
224 | typedef /* Complex */ VOID (*C_fp)(...);
225 | typedef /* Double Complex */ VOID (*Z_fp)(...);
226 | typedef logical (*L_fp)(...);
227 | typedef shortlogical (*K_fp)(...);
228 | typedef /* Character */ VOID (*H_fp)(...);
229 | typedef /* Subroutine */ int (*S_fp)(...);
230 | #else
231 | typedef int /* Unknown procedure type */ (*U_fp)();
232 | typedef shortint (*J_fp)();
233 | typedef int (*I_fp)();
234 | typedef real (*R_fp)();
235 | typedef doublereal (*D_fp)(), (*E_fp)();
236 | typedef /* Complex */ VOID (*C_fp)();
237 | typedef /* Double Complex */ VOID (*Z_fp)();
238 | typedef logical (*L_fp)();
239 | typedef shortlogical (*K_fp)();
240 | typedef /* Character */ VOID (*H_fp)();
241 | typedef /* Subroutine */ int (*S_fp)();
242 | #endif
243 | /* E_fp is for real functions when -R is not specified */
244 | typedef VOID C_f; /* complex function */
245 | typedef VOID H_f; /* character function */
246 | typedef VOID Z_f; /* double complex function */
247 | typedef doublereal E_f; /* real function with -R not specified */
248 |
249 | /* undef any lower-case symbols that your C compiler predefines, e.g.: */
250 |
251 | #ifndef Skip_f2c_Undefs
252 | #undef cray
253 | #undef gcos
254 | #undef mc68010
255 | #undef mc68020
256 | #undef mips
257 | #undef pdp11
258 | #undef sgi
259 | #undef sparc
260 | #undef sun
261 | #undef sun2
262 | #undef sun3
263 | #undef sun4
264 | #undef u370
265 | #undef u3b
266 | #undef u3b2
267 | #undef u3b5
268 | #undef unix
269 | #undef vax
270 | #endif
271 | #endif
272 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/include/log.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | #ifndef _LOG_H
46 | #define _LOG_H
47 |
48 | /* Definitions and references to support log report files. */
49 | /* UPDATED: 03/16/2005 by MDG */
50 |
51 | #include
52 | #include
53 | #include
54 |
55 | #ifdef LOG_REPORT
56 | /* Uncomment the following line to enable logging. */
57 | #define LOG_FILE "log.txt"
58 | #endif
59 |
60 | extern FILE *logfp;
61 | extern int avrdir;
62 | extern float dir_strength;
63 | extern int nvalid;
64 |
65 | extern int open_logfile(void);
66 | extern int close_logfile(void);
67 | extern void print2log(char *, ...);
68 |
69 | #endif
70 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/include/memalloc.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | #ifndef _MEMALLOC_H
46 | #define _MEMALLOC_H
47 |
48 | /* UPDATED: 03/15/2005 by MDG */
49 |
50 | extern int malloc_char_ret(char **, const int, char *);
51 | extern int malloc_uchar_ret(unsigned char **, const int, char *);
52 | extern int malloc_int_ret(int **, const int, char *);
53 | extern int calloc_int_ret(int **, const int, char *);
54 | extern int realloc_int_ret(int **, const int, char *);
55 |
56 | extern void *datadup(void *, int, char *);
57 | extern void malloc_char(char **, int, char *);
58 | extern void malloc_uchar(unsigned char **, int, char *);
59 | extern void malloc_shrt(short **, int, char *);
60 | extern void malloc_int(int **, int, char *);
61 | extern void malloc_flt(float **, int, char *);
62 | extern void calloc_char(char **, int, char *);
63 | extern void calloc_uchar(unsigned char **, int, char *);
64 | extern void calloc_shrt(short **, int, char *);
65 | extern void calloc_int(int **, int, char *);
66 | extern void calloc_flt(float **, int, char *);
67 | extern void malloc_dbl_char_l1(char ***, int, char *);
68 | extern void malloc_dbl_uchar_l1(unsigned char ***, int, char *);
69 | extern void malloc_dbl_shrt_l1(short ***, int, char *);
70 | extern void malloc_dbl_int_l1(int ***, int, char *);
71 | extern void malloc_dbl_flt_l1(float ***, int, char *);
72 | extern void realloc_char(char **, int, char *);
73 | extern void realloc_uchar(unsigned char **, int, char *);
74 | extern void realloc_shrt(short **, int, char *);
75 | extern void realloc_int(int **, int, char *);
76 | extern void realloc_flt(float **, int, char *);
77 | extern void realloc_dbl_int_l1(int ***, int, char *);
78 | extern void realloc_dbl_char_l1(char ***, int, char *);
79 | extern void realloc_dbl_uchar_l1(unsigned char ***, int, char *);
80 | extern void realloc_dbl_flt_l1(float ***, int, char *);
81 | extern void free_dbl_char(char **, const int);
82 | extern void free_dbl_uchar(unsigned char **, const int);
83 | extern void free_dbl_flt(float **, const int);
84 | extern void malloc_dbl_char(char ***, const int, const int, char *);
85 | extern void malloc_dbl_uchar(unsigned char ***, const int, const int, char *);
86 | extern void malloc_dbl_flt(float ***, const int, const int, char *);
87 |
88 | #endif /* !_MEMALLOC_H */
89 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/include/mlpcla.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | #ifndef _MLPCLA_H
46 | #define _MLPCLA_H
47 |
48 | /*****************************************************************/
49 | /* Author: Michael D. Garris */
50 | /* Date: 03/17/2005 */
51 | /* */
52 | /* To handle proper prototyping and argument passing to CLAPCK */
53 | /* routines used by MLP library codes. E.g. MLP codes are */
54 | /* written in single percision integer while the CBLAS routines */
55 | /* are written using long ints. */
56 | /*****************************************************************/
57 |
58 | #include
59 |
60 | /* Cblas library routines used by MLP library codes */
61 | extern int sgemv_(char *, int *, int *, real *,
62 | real *, int *, real *, int *, real *, real *, int *);
63 | extern int sscal_(int *, real *, real *, int *);
64 | extern int saxpy_(int *, real *, real *, int *, real *, int *);
65 | extern doublereal sdot_(int *, real *, int *, real *, int *);
66 | extern doublereal snrm2_(int *, real *, int *);
67 |
68 | /* mlpcla.c */
69 | extern int mlp_sgemv(char, int, int, float, float *, int, float *,
70 | int, float, float *, int);
71 | extern int mlp_sscal(int, float, float *, int);
72 | extern int mlp_saxpy(int, float, float *, int, float *, int);
73 | extern float mlp_sdot(int, float *, int, float *, int);
74 | extern float mlp_snrm2(int, float *, int);
75 |
76 |
77 | #endif /* !_MLPCLA_H */
78 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/include/morph.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | #ifndef __MORPH_H__
46 | #define __MORPH_H__
47 |
48 | /* Modified 10/26/1999 by MDG to avoid indisciminate erosion of pixels */
49 | /* along the edge of the binary image. */
50 |
51 | extern void erode_charimage_2(unsigned char *, unsigned char *,
52 | const int, const int);
53 | extern void dilate_charimage_2(unsigned char *, unsigned char *,
54 | const int, const int);
55 | extern char get_south8_2(char *, const int, const int, const int, const int);
56 | extern char get_north8_2(char *, const int, const int, const int);
57 | extern char get_east8_2(char *, const int, const int, const int);
58 | extern char get_west8_2(char *, const int, const int);
59 |
60 | #endif /* !__MORPH_H__ */
61 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/include/mytime.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | #ifndef _MYTIME_H
46 | #define _MYTIME_H
47 |
48 | /* this file needed to support timer and ticks */
49 | /* UPDATED: 03/16/2005 by MDG */
50 |
51 | #ifdef TIMER
52 | #include
53 | #endif
54 |
55 | #ifdef __MSYS__
56 | #include
57 | #else
58 | #include
59 | #endif
60 |
61 | #ifdef TIMER
62 | #define set_timer(_timer_); \
63 | { \
64 | _timer_ = ticks();
65 | #else
66 | #define set_timer(_timer_);
67 | #endif
68 |
69 | #ifdef TIMER
70 | #define time_accum(_timer_, _var_); \
71 | _var_ += (ticks() - _timer_)/(float)ticksPerSec(); \
72 | }
73 | #else
74 | #define time_accum(_timer_, _var_);
75 | #endif
76 |
77 | #ifdef TIMER
78 | #define print_time(_fp_, _fmt_, _var_); \
79 | fprintf(_fp_, _fmt_, _var_);
80 | #else
81 | #define print_time(_fp_, _fmt_, _var_);
82 | #endif
83 |
84 | extern clock_t ticks(void);
85 | extern int ticksPerSec(void);
86 |
87 | extern clock_t total_timer;
88 | extern float total_time;
89 |
90 | extern clock_t imap_timer;
91 | extern float imap_time;
92 |
93 | extern clock_t bin_timer;
94 | extern float bin_time;
95 |
96 | extern clock_t minutia_timer;
97 | extern float minutia_time;
98 |
99 | extern clock_t rm_minutia_timer;
100 | extern float rm_minutia_time;
101 |
102 | extern clock_t ridge_count_timer;
103 | extern float ridge_count_time;
104 |
105 | #endif
106 |
107 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/include/nfiq.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | #ifndef _NFIQ_H
46 | #define _NFIQ_H
47 |
48 | /* UPDATED: 11/21/2006 by KKO */
49 |
50 | #include
51 | #include
52 | #include
53 |
54 | #ifndef DEFAULT_PPI
55 | #define DEFAULT_PPI 500
56 | #endif
57 |
58 | #define NFIQ_VCTRLEN 11
59 | #define NFIQ_NUM_CLASSES 5
60 | #define EMPTY_IMG 1
61 | #define EMPTY_IMG_QUAL 5
62 | #define TOO_FEW_MINUTIAE 2
63 | #define MIN_MINUTIAE 5
64 | #define MIN_MINUTIAE_QUAL 5
65 |
66 | /***********************************************************************/
67 | /* NFIQ.C : NFIQ supporting routines */
68 | extern int comp_nfiq_featvctr(float *, const int, MINUTIAE *,
69 | int *, const int, const int, int *);
70 | int comp_nfiq(int *, float *, unsigned char *,
71 | const int, const int, const int, const int, int *);
72 | int comp_nfiq_flex(int *, float *, unsigned char *,
73 | const int, const int, const int, const int,
74 | float *, float *, const int, const int, const int,
75 | const char, const char, float *, int *);
76 |
77 | /***********************************************************************/
78 | /* ZNORM.C : Routines supporting Z-Normalization */
79 | extern void znorm_fniq_featvctr(float *, float *, float *, const int);
80 | extern int comp_znorm_stats(float **, float **, float *,
81 | const int, const int);
82 |
83 | /***********************************************************************/
84 | /* NFIQGBLS.C : Global variables supporting NFIQ */
85 | extern float dflt_znorm_means[];
86 | extern float dflt_znorm_stds[];
87 | extern char dflt_purpose;
88 | extern int dflt_nInps;
89 | extern int dflt_nHids;
90 | extern int dflt_nOuts;
91 | extern char dflt_acfunc_hids;
92 | extern char dflt_acfunc_outs;
93 | extern float dflt_wts[];
94 |
95 | /***********************************************************************/
96 | /* NFIQREAD.C */
97 | extern int read_imgcls_file(char *, char ***, char ***, int *);
98 | extern int read_znorm_file(char *, float *, float *, const int);
99 |
100 | #endif /* !_NFIQ_H */
101 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/include/swap.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | #ifndef _SWAP_H
46 | #define _SWAP_H
47 |
48 | #define swap_uint_bytes(_ui_) \
49 | { \
50 | unsigned int _b_ = _ui_; \
51 | unsigned char *_f_ = (unsigned char *)&(_b_); \
52 | unsigned char *_t_ = (unsigned char *)&(_ui_); \
53 | _t_[3] = _f_[0]; \
54 | _t_[2] = _f_[1]; \
55 | _t_[1] = _f_[2]; \
56 | _t_[0] = _f_[3]; \
57 | }
58 |
59 | #define swap_int_bytes(_ui_) \
60 | { \
61 | int _b_ = _ui_; \
62 | unsigned char *_f_ = (unsigned char *)&(_b_); \
63 | unsigned char *_t_ = (unsigned char *)&(_ui_); \
64 | _t_[3] = _f_[0]; \
65 | _t_[2] = _f_[1]; \
66 | _t_[1] = _f_[2]; \
67 | _t_[0] = _f_[3]; \
68 | }
69 |
70 | #define swap_ushort_bytes(_us_) \
71 | { \
72 | unsigned short _b_ = _us_; \
73 | unsigned char *_f_ = (unsigned char *)&(_b_); \
74 | unsigned char *_t_ = (unsigned char *)&(_us_); \
75 | _t_[1] = _f_[0]; \
76 | _t_[0] = _f_[1]; \
77 | }
78 |
79 | #define swap_short_bytes(_a_) \
80 | { \
81 | short _b_ = _a_; \
82 | char *_f_ = (char *) &_b_; \
83 | char *_t_ = (char *) &_a_; \
84 | _t_[1] = _f_[0]; \
85 | _t_[0] = _f_[1]; \
86 | }
87 |
88 | #define swap_float_bytes(_flt_) \
89 | { \
90 | float _b_ = _flt_; \
91 | unsigned char *_f_ = (unsigned char *)&(_b_); \
92 | unsigned char *_t_ = (unsigned char *)&(_flt_); \
93 | _t_[3] = _f_[0]; \
94 | _t_[2] = _f_[1]; \
95 | _t_[1] = _f_[2]; \
96 | _t_[0] = _f_[3]; \
97 | }
98 |
99 | #define swap_short(_a_) \
100 | { \
101 | short _b_ = _a_; \
102 | char *_f_ = (char *) &_b_; \
103 | char *_t_ = (char *) &_a_; \
104 | _t_[1] = _f_[0]; \
105 | _t_[0] = _f_[1]; \
106 | }
107 |
108 | #define swap_image_shorts(_data,_swidth,_sheight) \
109 | { \
110 | unsigned short *_sdata = (unsigned short *)_data; \
111 | int _i,_wdlen=16; \
112 | for (_i = 0;_i<(int)((_swidth/_wdlen)*_sheight);_i++) \
113 | swap_short(_sdata[_i]);\
114 | }
115 |
116 | #define swap_int(_a_, _b_) \
117 | { \
118 | int _t_ = _a_; \
119 | _a_ = _b_; \
120 | _b_ = _t_; \
121 | }
122 |
123 | #define swap_float(_a_, _b_) \
124 | { \
125 | float _t_ = _a_; \
126 | _a_ = _b_; \
127 | _b_ = _t_; \
128 | }
129 |
130 | #define swap_string(_a_, _b_) \
131 | { \
132 | char *_t_ = _a_; \
133 | _a_ = _b_; \
134 | _b_ = _t_; \
135 | }
136 |
137 | #endif /* !_SWAP_H */
138 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/include/usebsd.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /***********************************************************************
46 | FILE: USEBSD.H
47 | AUTHOR: Michael Garris
48 | DATE: 06/09/2005
49 |
50 | Controls definitions to facilitate the portable use of
51 | BSD-based library routines on both Linux and Cygwin platforms.
52 | This file must be included when code is calling for example:
53 |
54 | strdup()
55 | rindex()
56 | setlinebuf()
57 |
58 | and the strict ANSI flag "-ansi" is used. The including of
59 | this file is intended to have no effect when the "-ansi"
60 | compiler flag is not in use.
61 |
62 | ***********************************************************************/
63 | #ifndef _USEBSD_H
64 | #define _USEBSD_H
65 |
66 | #if defined(__linux__) && !defined(_BSD_SOURCE)
67 | #define _BSD_SOURCE
68 | #elif defined(__CYGWIN__) && defined(__STRICT_ANSI__)
69 | #undef __STRICT_ANSI__
70 | #endif
71 |
72 | /* The setting of _BSD_SOURCE under Linux sets up subsequent */
73 | /* definitions in . Therefore this file should be */
74 | /* included first, so to help ensure this, is */
75 | /* included here at the end of this file */
76 | #include
77 |
78 | #endif /* !_USEBSD_H */
79 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/include/util.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | #ifndef _UTIL_H
46 | #define _UTIL_H
47 |
48 | /* UPDATED: 03/15/2005 by MDG */
49 | #ifdef __MSYS__
50 | #include
51 | #else
52 | #include
53 | #endif
54 |
55 | #ifndef True
56 | #define True 1
57 | #define False 0
58 | #endif
59 |
60 | /* bres.c */
61 | extern int bres_line_alloc(const int, const int, const int, const int, int **,
62 | int **, int *, int *);
63 |
64 | /* bubble.c */
65 | extern void bubble_sort_int(int *, const int);
66 |
67 | /* fatalerr.c */
68 | extern void fatalerr(char *, char *, char *);
69 |
70 | /* invbytes.h */
71 | extern void inv_bytes(unsigned char *, int);
72 |
73 | /* ssxstats.c */
74 | extern double ssx_stddev(const double, const double, const int);
75 | extern double ssx_variance(const double, const double, const int);
76 | extern double ssx(const double, const double, const int);
77 |
78 | /* syserr.c.c */
79 | extern void syserr(char *, char *, char *);
80 |
81 | /* ticks.c */
82 | extern clock_t ticks(void);
83 | extern int ticksPerSec(void);
84 |
85 | /* time.c */
86 | extern char *current_time(void);
87 |
88 | /* fixup.c */
89 | /*
90 | #ifdef __MSYS__
91 | extern void __assert(const char *, int, const char *);
92 |
93 | extern char *index(const char *, int);
94 |
95 | extern void sleep (const int);
96 | #endif
97 | */
98 | #endif /* !_UTIL_H */
99 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/lib/libnfiq.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/app/src/main/cpp/nfiq/lib/libnfiq.a
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/native_lib.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | /**
4 | * @author Ben Daniel.
5 | *
6 | * This is the JNI bridge that computes the NFIQ of a given image using the open source C library: https://github.com/lessandro/nbis
7 | */
8 |
9 |
10 | unsigned char *as_unsigned_char_array(JNIEnv *env, jbyteArray array) {
11 | int len = (*env)->GetArrayLength(env, array);
12 | unsigned char *buf[len];
13 | (*env)->GetByteArrayRegion(env, array, 0, len, (jbyte *) (buf));
14 | return buf;
15 | }
16 |
17 | JNIEXPORT int JNICALL
18 | Java_com_seamfix_calculatenfiq_NFIQUtil_calculateNFIQ(
19 | JNIEnv *env,
20 | jobject callingObject,
21 | jbyteArray data, jint imageWidth,
22 | jint imageHeight) {
23 |
24 |
25 | unsigned char *idata = as_unsigned_char_array(env, data);
26 | int computedNfiq = -2;
27 | float oConfig = 1;
28 | int optFlag = 1;
29 |
30 | comp_nfiq(&computedNfiq, &oConfig, idata, (int) imageWidth, (int) imageHeight, 8, -1, &optFlag);
31 |
32 | return computedNfiq;
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/obj/src/bin/fing2pat/fing2pat.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/app/src/main/cpp/nfiq/obj/src/bin/fing2pat/fing2pat.o
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/obj/src/bin/nfiq/nfiq.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/app/src/main/cpp/nfiq/obj/src/bin/nfiq/nfiq.o
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/obj/src/bin/znormdat/znormdat.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/app/src/main/cpp/nfiq/obj/src/bin/znormdat/znormdat.o
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/obj/src/bin/znormpat/znormpat.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/app/src/main/cpp/nfiq/obj/src/bin/znormpat/znormpat.o
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/obj/src/lib/nfiq/nfiq.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/app/src/main/cpp/nfiq/obj/src/lib/nfiq/nfiq.o
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/obj/src/lib/nfiq/nfiqgbls.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/app/src/main/cpp/nfiq/obj/src/lib/nfiq/nfiqgbls.o
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/obj/src/lib/nfiq/nfiqread.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/app/src/main/cpp/nfiq/obj/src/lib/nfiq/nfiqread.o
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/obj/src/lib/nfiq/znorm.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/app/src/main/cpp/nfiq/obj/src/lib/nfiq/znorm.o
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/runtimedata/znorm.dat:
--------------------------------------------------------------------------------
1 | 2881.918457 1.522167e+03
2 | 119.406013 6.759113e+01
3 | 42.890446 2.685183e+01
4 | 42.011002 2.699416e+01
5 | 33.318542 2.686451e+01
6 | 18.573952 2.199553e+01
7 | 5.602001 1.067551e+01
8 | 0.122406 5.670758e-02
9 | 0.206616 9.548551e-02
10 | 0.223217 7.412220e-02
11 | 0.447761 1.551811e-01
12 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/Makefile:
--------------------------------------------------------------------------------
1 | #*******************************************************************************
2 | #
3 | # License:
4 | # This software and/or related materials was developed at the National Institute
5 | # of Standards and Technology (NIST) by employees of the Federal Government
6 | # in the course of their official duties. Pursuant to title 17 Section 105
7 | # of the United States Code, this software is not subject to copyright
8 | # protection and is in the public domain.
9 | #
10 | # This software and/or related materials have been determined to be not subject
11 | # to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | # a publicly available technology and software, and is freely distributed
13 | # to any interested party with no licensing requirements. Therefore, it is
14 | # permissible to distribute this software as a free download from the internet.
15 | #
16 | # Disclaimer:
17 | # This software and/or related materials was developed to promote biometric
18 | # standards and biometric technology testing for the Federal Government
19 | # in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | # and Visa Entry Reform Act. Specific hardware and software products identified
21 | # in this software were used in order to perform the software development.
22 | # In no case does such identification imply recommendation or endorsement
23 | # by the National Institute of Standards and Technology, nor does it imply that
24 | # the products and equipment identified are necessarily the best available
25 | # for the purpose.
26 | #
27 | # This software and/or related materials are provided "AS-IS" without warranty
28 | # of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | # NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | # or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | # licensed product, however used. In no event shall NIST be liable for any
32 | # damages and/or costs, including but not limited to incidental or consequential
33 | # damages of any kind, including economic damage or injury to property and lost
34 | # profits, regardless of whether NIST shall be advised, have reason to know,
35 | # or in fact shall know of the possibility.
36 | #
37 | # By using this software, you agree to bear all risk relating to quality,
38 | # use and performance of the software and/or related materials. You agree
39 | # to hold the Government harmless from any claim arising from your use
40 | # of the software.
41 | #
42 | #*******************************************************************************
43 |
44 | # SubTree: /NBIS/Main/nfiq/src
45 | # Filename: Makefile
46 | # Integrators: Kenneth Ko
47 | # Organization: NIST/ITL
48 | # Host System: GNU GCC/GMAKE GENERIC (UNIX)
49 | # Date Created: 08/20/2006
50 | #
51 | # ******************************************************************************
52 | #
53 | # Makefile for "nfiq" src directory.
54 | #
55 | # ******************************************************************************
56 | include ./s_rules.mak
57 | include ../p_rules.mak
58 | include $(DIR_ROOT_BUILDUTIL)/src.mak
59 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/bin/Makefile:
--------------------------------------------------------------------------------
1 | #*******************************************************************************
2 | #
3 | # License:
4 | # This software and/or related materials was developed at the National Institute
5 | # of Standards and Technology (NIST) by employees of the Federal Government
6 | # in the course of their official duties. Pursuant to title 17 Section 105
7 | # of the United States Code, this software is not subject to copyright
8 | # protection and is in the public domain.
9 | #
10 | # This software and/or related materials have been determined to be not subject
11 | # to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | # a publicly available technology and software, and is freely distributed
13 | # to any interested party with no licensing requirements. Therefore, it is
14 | # permissible to distribute this software as a free download from the internet.
15 | #
16 | # Disclaimer:
17 | # This software and/or related materials was developed to promote biometric
18 | # standards and biometric technology testing for the Federal Government
19 | # in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | # and Visa Entry Reform Act. Specific hardware and software products identified
21 | # in this software were used in order to perform the software development.
22 | # In no case does such identification imply recommendation or endorsement
23 | # by the National Institute of Standards and Technology, nor does it imply that
24 | # the products and equipment identified are necessarily the best available
25 | # for the purpose.
26 | #
27 | # This software and/or related materials are provided "AS-IS" without warranty
28 | # of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | # NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | # or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | # licensed product, however used. In no event shall NIST be liable for any
32 | # damages and/or costs, including but not limited to incidental or consequential
33 | # damages of any kind, including economic damage or injury to property and lost
34 | # profits, regardless of whether NIST shall be advised, have reason to know,
35 | # or in fact shall know of the possibility.
36 | #
37 | # By using this software, you agree to bear all risk relating to quality,
38 | # use and performance of the software and/or related materials. You agree
39 | # to hold the Government harmless from any claim arising from your use
40 | # of the software.
41 | #
42 | #*******************************************************************************
43 |
44 | # SubTree: /NBIS/Main/nfiq/src/bin
45 | # Filename: Makefile
46 | # Integrators: Kenneth Ko
47 | # Organization: NIST/ITL
48 | # Host System: GNU GCC/GMAKE GENERIC (UNIX)
49 | # Date Created: 08/20/2006
50 | #
51 | # ******************************************************************************
52 | #
53 | # Makefile for "nfiq" bin directory.
54 | #
55 | # ******************************************************************************
56 | include ../../p_rules.mak
57 | include $(DIR_ROOT_BUILDUTIL)/bins.mak
58 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/bin/fing2pat/Makefile:
--------------------------------------------------------------------------------
1 | #*******************************************************************************
2 | #
3 | # License:
4 | # This software and/or related materials was developed at the National Institute
5 | # of Standards and Technology (NIST) by employees of the Federal Government
6 | # in the course of their official duties. Pursuant to title 17 Section 105
7 | # of the United States Code, this software is not subject to copyright
8 | # protection and is in the public domain.
9 | #
10 | # This software and/or related materials have been determined to be not subject
11 | # to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | # a publicly available technology and software, and is freely distributed
13 | # to any interested party with no licensing requirements. Therefore, it is
14 | # permissible to distribute this software as a free download from the internet.
15 | #
16 | # Disclaimer:
17 | # This software and/or related materials was developed to promote biometric
18 | # standards and biometric technology testing for the Federal Government
19 | # in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | # and Visa Entry Reform Act. Specific hardware and software products identified
21 | # in this software were used in order to perform the software development.
22 | # In no case does such identification imply recommendation or endorsement
23 | # by the National Institute of Standards and Technology, nor does it imply that
24 | # the products and equipment identified are necessarily the best available
25 | # for the purpose.
26 | #
27 | # This software and/or related materials are provided "AS-IS" without warranty
28 | # of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | # NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | # or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | # licensed product, however used. In no event shall NIST be liable for any
32 | # damages and/or costs, including but not limited to incidental or consequential
33 | # damages of any kind, including economic damage or injury to property and lost
34 | # profits, regardless of whether NIST shall be advised, have reason to know,
35 | # or in fact shall know of the possibility.
36 | #
37 | # By using this software, you agree to bear all risk relating to quality,
38 | # use and performance of the software and/or related materials. You agree
39 | # to hold the Government harmless from any claim arising from your use
40 | # of the software.
41 | #
42 | #*******************************************************************************
43 |
44 | # SubTree: /NBIS/Main/nfiq/src/bin/fing2pat
45 | # Filename: Makefile
46 | # Integrators: Kenneth Ko
47 | # Organization: NIST/ITL
48 | # Host System: GNU GCC/GMAKE GENERIC (UNIX)
49 | # Date Created: 08/20/2006
50 | # Date Updated: 01/31/2008 (Kenneth Ko)
51 | # Date Updated: 09/03/2008 (Kenneth Ko)
52 | # Date Updated: 10/31/2008 (Kenneth Ko)
53 | # Date Updated: 01/06/2009 (Kenneth Ko) - add support for HPUX compile
54 | # Date Updated: 08/19/2014 (Kenneth Ko) - add OpenJPEG2 support
55 | # 02/25/2015 (Kenneth Ko) - Renamed OPENJPEG to OPENJP2
56 | #
57 | # ******************************************************************************
58 | #
59 | # Makefile contains the variables to build binary - "fing2pat".
60 | #
61 | # ******************************************************************************
62 | include ../../../p_rules.mak
63 | #
64 | PROGRAM := fing2pat
65 | #
66 | SRC := fing2pat.c
67 | #
68 | LIBS := \
69 | $(EXPORTS_LIB_DIR)/libnfiq.a \
70 | $(EXPORTS_LIB_DIR)/libmindtct.a \
71 | $(EXPORTS_LIB_DIR)/libimage.a \
72 | $(EXPORTS_LIB_DIR)/liban2k.a \
73 | $(EXPORTS_LIB_DIR)/libihead.a \
74 | $(EXPORTS_LIB_DIR)/libwsq.a \
75 | $(EXPORTS_LIB_DIR)/libjpegl.a \
76 | $(EXPORTS_LIB_DIR)/libjpegb.a \
77 | $(EXPORTS_LIB_DIR)/libfet.a \
78 | $(EXPORTS_LIB_DIR)/libmlp.a \
79 | $(EXPORTS_LIB_DIR)/libcblas.a \
80 | $(EXPORTS_LIB_DIR)/libioutil.a \
81 | $(EXPORTS_LIB_DIR)/libpcautil.a \
82 | $(EXPORTS_LIB_DIR)/libutil.a
83 | #
84 | ifeq ($(NBIS_JASPER_FLAG),-D__NBIS_JASPER__)
85 | LIBS := \
86 | $(LIBS) \
87 | $(EXPORTS_LIB_DIR)/libjasper.a
88 | endif
89 | #
90 | ifeq ($(NBIS_OPENJP2_FLAG),-D__NBIS_OPENJP2__)
91 | LIBS := \
92 | $(LIBS) \
93 | $(EXPORTS_LIB_DIR)/libopenjp2.a
94 | endif
95 |
96 | #
97 | ifeq ($(NBIS_PNG_FLAG),-D__NBIS_PNG__)
98 | LIBS := \
99 | $(LIBS) \
100 | $(EXPORTS_LIB_DIR)/libpng.a \
101 | $(EXPORTS_LIB_DIR)/libz.a
102 | endif
103 | #
104 | EXT_INCS := -I$(EXPORTS_INC_DIR)
105 | #
106 | EXT_LIBS := -lm
107 | #
108 | include $(DIR_ROOT_BUILDUTIL)/bin.mak
109 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/bin/fing2pat/catalog_fing2pat.txt:
--------------------------------------------------------------------------------
1 | fing2pat - Takes a list of grayscale fingerprint images, and for
2 | each image, computes a feature vector for use by the
3 | NFIQ algorithm for MLP training. If the optional file
4 | is passed using the "-z" flag, then the output feature
5 | vectors are ZNormalized.
6 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/bin/nfiq/Makefile:
--------------------------------------------------------------------------------
1 | #*******************************************************************************
2 | #
3 | # License:
4 | # This software and/or related materials was developed at the National Institute
5 | # of Standards and Technology (NIST) by employees of the Federal Government
6 | # in the course of their official duties. Pursuant to title 17 Section 105
7 | # of the United States Code, this software is not subject to copyright
8 | # protection and is in the public domain.
9 | #
10 | # This software and/or related materials have been determined to be not subject
11 | # to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | # a publicly available technology and software, and is freely distributed
13 | # to any interested party with no licensing requirements. Therefore, it is
14 | # permissible to distribute this software as a free download from the internet.
15 | #
16 | # Disclaimer:
17 | # This software and/or related materials was developed to promote biometric
18 | # standards and biometric technology testing for the Federal Government
19 | # in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | # and Visa Entry Reform Act. Specific hardware and software products identified
21 | # in this software were used in order to perform the software development.
22 | # In no case does such identification imply recommendation or endorsement
23 | # by the National Institute of Standards and Technology, nor does it imply that
24 | # the products and equipment identified are necessarily the best available
25 | # for the purpose.
26 | #
27 | # This software and/or related materials are provided "AS-IS" without warranty
28 | # of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | # NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | # or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | # licensed product, however used. In no event shall NIST be liable for any
32 | # damages and/or costs, including but not limited to incidental or consequential
33 | # damages of any kind, including economic damage or injury to property and lost
34 | # profits, regardless of whether NIST shall be advised, have reason to know,
35 | # or in fact shall know of the possibility.
36 | #
37 | # By using this software, you agree to bear all risk relating to quality,
38 | # use and performance of the software and/or related materials. You agree
39 | # to hold the Government harmless from any claim arising from your use
40 | # of the software.
41 | #
42 | #*******************************************************************************
43 |
44 | # SubTree: /NBIS/Main/nfiq/src/bin/nfiq
45 | # Filename: Makefile
46 | # Integrators: Kenneth Ko
47 | # Organization: NIST/ITL
48 | # Host System: GNU GCC/GMAKE GENERIC (UNIX)
49 | # Date Created: 08/20/2006
50 | # Date Updated: 01/31/2008 (Kenneth Ko)
51 | # Date Updated: 09/03/2008 (Kenneth Ko)
52 | # Date Updated: 01/06/2009 (Kenneth Ko) - add support for HPUX compile
53 | # Date Updated: 08/19/2014 (Kenneth Ko) - add OpenJPEG2 support
54 | # 02/25/2015 (Kenneth Ko) - Renamed OPENJPEG to OPENJP2
55 | #
56 | # ******************************************************************************
57 | #
58 | # Makefile contains the variables to build binary - "nfiq".
59 | #
60 | # ******************************************************************************
61 | include ../../../p_rules.mak
62 | #
63 | PROGRAM := nfiq
64 | #
65 | SRC := nfiq.c
66 | #
67 | LIBS := \
68 | $(EXPORTS_LIB_DIR)/libnfiq.a \
69 | $(EXPORTS_LIB_DIR)/libmindtct.a \
70 | $(EXPORTS_LIB_DIR)/libimage.a \
71 | $(EXPORTS_LIB_DIR)/liban2k.a \
72 | $(EXPORTS_LIB_DIR)/libihead.a \
73 | $(EXPORTS_LIB_DIR)/libwsq.a \
74 | $(EXPORTS_LIB_DIR)/libjpegl.a \
75 | $(EXPORTS_LIB_DIR)/libjpegb.a \
76 | $(EXPORTS_LIB_DIR)/libfet.a \
77 | $(EXPORTS_LIB_DIR)/libmlp.a \
78 | $(EXPORTS_LIB_DIR)/libcblas.a \
79 | $(EXPORTS_LIB_DIR)/libioutil.a \
80 | $(EXPORTS_LIB_DIR)/libutil.a
81 | #
82 | ifeq ($(NBIS_JASPER_FLAG),-D__NBIS_JASPER__)
83 | LIBS := \
84 | $(LIBS) \
85 | $(EXPORTS_LIB_DIR)/libjasper.a
86 | endif
87 | #
88 | ifeq ($(NBIS_OPENJP2_FLAG),-D__NBIS_OPENJP2__)
89 | LIBS := \
90 | $(LIBS) \
91 | $(EXPORTS_LIB_DIR)/libopenjp2.a
92 | endif
93 | #
94 | ifeq ($(NBIS_PNG_FLAG),-D__NBIS_PNG__)
95 | LIBS := \
96 | $(LIBS) \
97 | $(EXPORTS_LIB_DIR)/libpng.a \
98 | $(EXPORTS_LIB_DIR)/libz.a
99 | endif
100 | #
101 | EXT_INCS := -I$(EXPORTS_INC_DIR)
102 | #
103 | EXT_LIBS := -lm
104 | #
105 | include $(DIR_ROOT_BUILDUTIL)/bin.mak
106 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/bin/nfiq/catalog_nfiq.txt:
--------------------------------------------------------------------------------
1 | nfiq - Takes a grayscale fingerprint image and computes an
2 | image quality value based on the NFIQ algorithm.
3 | This program will automatically process
4 | ANSI/NIST, WSQ, JPEGB, JPEGL, IHead and raw image formats
5 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/bin/znormdat/Makefile:
--------------------------------------------------------------------------------
1 | #*******************************************************************************
2 | #
3 | # License:
4 | # This software and/or related materials was developed at the National Institute
5 | # of Standards and Technology (NIST) by employees of the Federal Government
6 | # in the course of their official duties. Pursuant to title 17 Section 105
7 | # of the United States Code, this software is not subject to copyright
8 | # protection and is in the public domain.
9 | #
10 | # This software and/or related materials have been determined to be not subject
11 | # to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | # a publicly available technology and software, and is freely distributed
13 | # to any interested party with no licensing requirements. Therefore, it is
14 | # permissible to distribute this software as a free download from the internet.
15 | #
16 | # Disclaimer:
17 | # This software and/or related materials was developed to promote biometric
18 | # standards and biometric technology testing for the Federal Government
19 | # in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | # and Visa Entry Reform Act. Specific hardware and software products identified
21 | # in this software were used in order to perform the software development.
22 | # In no case does such identification imply recommendation or endorsement
23 | # by the National Institute of Standards and Technology, nor does it imply that
24 | # the products and equipment identified are necessarily the best available
25 | # for the purpose.
26 | #
27 | # This software and/or related materials are provided "AS-IS" without warranty
28 | # of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | # NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | # or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | # licensed product, however used. In no event shall NIST be liable for any
32 | # damages and/or costs, including but not limited to incidental or consequential
33 | # damages of any kind, including economic damage or injury to property and lost
34 | # profits, regardless of whether NIST shall be advised, have reason to know,
35 | # or in fact shall know of the possibility.
36 | #
37 | # By using this software, you agree to bear all risk relating to quality,
38 | # use and performance of the software and/or related materials. You agree
39 | # to hold the Government harmless from any claim arising from your use
40 | # of the software.
41 | #
42 | #*******************************************************************************
43 |
44 | # SubTree: /NBIS/Main/nfiq/src/bin/znormdat
45 | # Filename: Makefile
46 | # Integrators: Kenneth Ko
47 | # Organization: NIST/ITL
48 | # Host System: GNU GCC/GMAKE GENERIC (UNIX)
49 | # Date Created: 08/20/2006
50 | # Date Updated: 10/31/2008 (Kenneth Ko)
51 | #
52 | # ******************************************************************************
53 | #
54 | # Makefile contains the variables to build binary - "znormdat".
55 | #
56 | # ******************************************************************************
57 | include ../../../p_rules.mak
58 | #
59 | PROGRAM := znormdat
60 | #
61 | SRC := znormdat.c
62 | #
63 | LIBS := $(EXPORTS_LIB_DIR)/libnfiq.a \
64 | $(EXPORTS_LIB_DIR)/libmlp.a \
65 | $(EXPORTS_LIB_DIR)/libioutil.a \
66 | $(EXPORTS_LIB_DIR)/libpcautil.a \
67 | $(EXPORTS_LIB_DIR)/libutil.a
68 | #
69 | EXT_INCS := -I$(EXPORTS_INC_DIR)
70 | #
71 | EXT_LIBS := -lm
72 | #
73 | include $(DIR_ROOT_BUILDUTIL)/bin.mak
74 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/bin/znormdat/catalog_znormdat.txt:
--------------------------------------------------------------------------------
1 | znormdat - Takes patterns file of (un-normalized) feature vectors,
2 | and foreach coefficient position across the vectors,
3 | computes the mean and stddev, writing these statistics
4 | out to support ZNormalization.
5 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/bin/znormdat/znormdat.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /***********************************************************************
46 | PACKAGE: NIST Fingerprint Image Quality (NFIQ)
47 |
48 | FILE: ZNORMDAT.C
49 |
50 | ALGORITHM:
51 | Elham Tabassi
52 | Charles L. Wilson
53 | Criag I. Watson
54 |
55 | IMPLEMENTATION:
56 | Michael D. Garris
57 |
58 | DATE: 09/13/2004
59 | UPDATED: 05/10/2005 by MDG
60 | UPDATED: 09/30/2008 by Kenenth Ko - add version option.
61 |
62 | #cat: znormdat - Takes patterns file of (un-normalized) feature vectors,
63 | #cat: and foreach coefficient position across the vectors,
64 | #cat: computes the mean and stddev, writing these statistics
65 | #cat: out to support ZNormalization.
66 |
67 | ***********************************************************************/
68 | #include
69 | #include
70 | #include
71 | #include
72 |
73 | extern void procargs(int, char **, char **);
74 |
75 | int debug = 0;
76 |
77 | /*************************************************************************
78 | **************************************************************************/
79 | int main(int argc, char *argv[])
80 | {
81 | int ret, i;
82 | char *ipatsfile;
83 | float *feats, *targs;
84 | char **class_set;
85 | int *classes;
86 | int nPats, nInps, nOuts;
87 | float *means, *stddevs;
88 |
89 | /* Process the command line arguments */
90 | procargs(argc, argv, &ipatsfile);
91 |
92 | /* Read in the input feature vector file */
93 | if((ret = read_bin_nnpats(ipatsfile, &feats, &targs, &classes,
94 | &class_set, &nPats, &nInps, &nOuts))){
95 | exit(ret);
96 | }
97 |
98 | /* Do not need target vectors and class information to */
99 | /* compute global statistics across feature vector coef, */
100 | /* so deallocate these other resources. */
101 | free(targs);
102 | free(classes);
103 | for(i = 0; i < nOuts; i++)
104 | free(class_set[i]);
105 | free(class_set);
106 |
107 | /* Compute the mean and stddev for each feature vector coef */
108 | if((ret = comp_znorm_stats(&means, &stddevs, feats, nPats, nInps))){
109 | free(feats);
110 | exit(ret);
111 | }
112 |
113 | /* Report the resulting statistics to stdout */
114 | for(i = 0; i < nInps; i++){
115 | printf("%f\t%e\n", means[i], stddevs[i]);
116 | }
117 |
118 | /* Deallocate remaining resources */
119 | free(feats);
120 | free(means);
121 | free(stddevs);
122 |
123 | /* Exit successful */
124 | exit(0);
125 | }
126 |
127 | /*************************************************************************
128 | **************************************************************************
129 | PROCARGS - Process command line arguments
130 | Input:
131 | argc - system provided number of arguments on the command line
132 | argv - system provided list of command line argument strings
133 | Output:
134 | ipatsfile - input patterns file containing the list of feature
135 | vectors across which ZNormalization statics are to
136 | be computed
137 | **************************************************************************/
138 | void procargs(int argc, char **argv, char **ipatsfile)
139 | {
140 | if ((argc == 2) && (strcmp(argv[1], "-version") == 0)) {
141 | getVersion();
142 | exit(0);
143 | }
144 |
145 | if(argc != 2){
146 | fprintf(stderr,
147 | "Usage : %s \n",
148 | argv[0]);
149 | exit(1);
150 | }
151 |
152 | *ipatsfile = argv[1];
153 | }
154 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/bin/znormpat/Makefile:
--------------------------------------------------------------------------------
1 | #*******************************************************************************
2 | #
3 | # License:
4 | # This software and/or related materials was developed at the National Institute
5 | # of Standards and Technology (NIST) by employees of the Federal Government
6 | # in the course of their official duties. Pursuant to title 17 Section 105
7 | # of the United States Code, this software is not subject to copyright
8 | # protection and is in the public domain.
9 | #
10 | # This software and/or related materials have been determined to be not subject
11 | # to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | # a publicly available technology and software, and is freely distributed
13 | # to any interested party with no licensing requirements. Therefore, it is
14 | # permissible to distribute this software as a free download from the internet.
15 | #
16 | # Disclaimer:
17 | # This software and/or related materials was developed to promote biometric
18 | # standards and biometric technology testing for the Federal Government
19 | # in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | # and Visa Entry Reform Act. Specific hardware and software products identified
21 | # in this software were used in order to perform the software development.
22 | # In no case does such identification imply recommendation or endorsement
23 | # by the National Institute of Standards and Technology, nor does it imply that
24 | # the products and equipment identified are necessarily the best available
25 | # for the purpose.
26 | #
27 | # This software and/or related materials are provided "AS-IS" without warranty
28 | # of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | # NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | # or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | # licensed product, however used. In no event shall NIST be liable for any
32 | # damages and/or costs, including but not limited to incidental or consequential
33 | # damages of any kind, including economic damage or injury to property and lost
34 | # profits, regardless of whether NIST shall be advised, have reason to know,
35 | # or in fact shall know of the possibility.
36 | #
37 | # By using this software, you agree to bear all risk relating to quality,
38 | # use and performance of the software and/or related materials. You agree
39 | # to hold the Government harmless from any claim arising from your use
40 | # of the software.
41 | #
42 | #*******************************************************************************
43 |
44 | # SubTree: /NBIS/Main/nfiq/src/bin/znormpat
45 | # Filename: Makefile
46 | # Integrators: Kenneth Ko
47 | # Organization: NIST/ITL
48 | # Host System: GNU GCC/GMAKE GENERIC (UNIX)
49 | # Date Created: 08/20/2006
50 | # Date Updated: 10/31/2008 (Kenneth Ko)
51 | #
52 | # ******************************************************************************
53 | #
54 | # Makefile contains the variables to build binary - "znormpat".
55 | #
56 | # ******************************************************************************
57 | include ../../../p_rules.mak
58 | #
59 | PROGRAM := znormpat
60 | #
61 | SRC := znormpat.c
62 | #
63 | LIBS := $(EXPORTS_LIB_DIR)/libnfiq.a \
64 | $(EXPORTS_LIB_DIR)/libmlp.a \
65 | $(EXPORTS_LIB_DIR)/libioutil.a \
66 | $(EXPORTS_LIB_DIR)/libpcautil.a \
67 | $(EXPORTS_LIB_DIR)/libutil.a
68 | #
69 | EXT_INCS := -I$(EXPORTS_INC_DIR)
70 | #
71 | EXT_LIBS := -lm
72 | #
73 | include $(DIR_ROOT_BUILDUTIL)/bin.mak
74 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/bin/znormpat/catalog_znormpat.txt:
--------------------------------------------------------------------------------
1 | znormpat - Takes A patterns file of (un-normalized) feature vectors,
2 | and ZNormalizes its feature vectors based on global statistics
3 | provided.
4 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/bin/znormpat/znormpat.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /***********************************************************************
46 | PACKAGE: NIST Fingerprint Image Quality (NFIQ)
47 |
48 | FILE: ZNORMPAT.C
49 |
50 | ALGORITHM:
51 | Elham Tabassi
52 | Charles L. Wilson
53 | Criag I. Watson
54 |
55 | IMPLEMENTATION:
56 | Michael D. Garris
57 |
58 | DATE: 09/13/2004
59 | UPDATED: 05/10/2005 by MDG
60 | UPDATED: 09/30/2008 by Kenenth Ko - add version option.
61 |
62 | #cat: znormpat - Takes A patterns file of (un-normalized) feature vectors,
63 | #cat: and ZNormalizes its feature vectors based on global statistics
64 | #cat: provided.
65 |
66 | ***********************************************************************/
67 | #include
68 | #include
69 | #include
70 | #include
71 |
72 | extern void procargs(int, char **, char **, char **, char **);
73 |
74 | int debug = 0;
75 |
76 | /*************************************************************************
77 | **************************************************************************/
78 | int main(int argc, char *argv[])
79 | {
80 | int ret, i, j;
81 | char *ipatsfile, *opatsfile, *znormfile;
82 | float *feats, *featptr, *targs;
83 | char **class_set;
84 | int *classes;
85 | int nPats, nInps, nOuts;
86 | float znorm_means[NFIQ_VCTRLEN], znorm_stds[NFIQ_VCTRLEN];
87 |
88 | /* Process the command line arguments */
89 | procargs(argc, argv, &znormfile, &ipatsfile, &opatsfile);
90 |
91 | /* Read in the global statistics for ZNormalization */
92 | if((ret = read_znorm_file(znormfile, znorm_means, znorm_stds,
93 | NFIQ_VCTRLEN))){
94 | exit(ret);
95 | }
96 |
97 | /* Read in the input feature vectors */
98 | if((ret = read_bin_nnpats(ipatsfile, &feats, &targs, &classes,
99 | &class_set, &nPats, &nInps, &nOuts))){
100 | exit(ret);
101 | }
102 |
103 | /* Foreach input feature vector ... */
104 | featptr = feats;
105 | for(i = 0; i < nPats; i++){
106 | /* Normalize the current feature vector's coefs in place */
107 | znorm_fniq_featvctr(featptr, znorm_means, znorm_stds, nInps);
108 | /* Bump to the next input feature vector */
109 | featptr += nInps;
110 | }
111 |
112 | /* Write out the normalized feature vectors */
113 | if((ret = write_bin_nnpats(opatsfile, feats, targs, class_set,
114 | nPats, NFIQ_VCTRLEN, NFIQ_NUM_CLASSES))){
115 | free(feats);
116 | free(targs);
117 | free(classes);
118 | for(j = 0; j < nOuts; j++)
119 | free(class_set[j]);
120 | free(class_set);
121 | exit(ret);
122 | }
123 |
124 | /* Free allocated resources */
125 | free(feats);
126 | free(targs);
127 | free(classes);
128 | for(j = 0; j < nOuts; j++)
129 | free(class_set[j]);
130 | free(class_set);
131 |
132 | /* Exit successfully */
133 | exit(0);
134 | }
135 |
136 | /*************************************************************************
137 | **************************************************************************
138 | PROCARGS - Process command line arguments
139 | Input:
140 | argc - system provided number of arguments on the command line
141 | argv - system provided list of command line argument strings
142 | Output:
143 | znormfile - file containing global means and stddevs for computing
144 | ZNormalization
145 | ipatsfile - input patterns file containing the list of feature
146 | vectors to be ZNormalized
147 | opatfile - output patters file containing the normalized feature
148 | vectors
149 | **************************************************************************/
150 | void procargs(int argc, char **argv,
151 | char **znormfile, char **ipatsfile, char **opatsfile)
152 | {
153 | if ((argc == 2) && (strcmp(argv[1], "-version") == 0)) {
154 | getVersion();
155 | exit(0);
156 | }
157 |
158 | if(argc != 4){
159 | fprintf(stderr,
160 | "Usage : %s \n",
161 | argv[0]);
162 | exit(1);
163 | }
164 |
165 | *znormfile = argv[1];
166 | *ipatsfile = argv[2];
167 | *opatsfile = argv[3];
168 | }
169 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/Makefile:
--------------------------------------------------------------------------------
1 | #*******************************************************************************
2 | #
3 | # License:
4 | # This software and/or related materials was developed at the National Institute
5 | # of Standards and Technology (NIST) by employees of the Federal Government
6 | # in the course of their official duties. Pursuant to title 17 Section 105
7 | # of the United States Code, this software is not subject to copyright
8 | # protection and is in the public domain.
9 | #
10 | # This software and/or related materials have been determined to be not subject
11 | # to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | # a publicly available technology and software, and is freely distributed
13 | # to any interested party with no licensing requirements. Therefore, it is
14 | # permissible to distribute this software as a free download from the internet.
15 | #
16 | # Disclaimer:
17 | # This software and/or related materials was developed to promote biometric
18 | # standards and biometric technology testing for the Federal Government
19 | # in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | # and Visa Entry Reform Act. Specific hardware and software products identified
21 | # in this software were used in order to perform the software development.
22 | # In no case does such identification imply recommendation or endorsement
23 | # by the National Institute of Standards and Technology, nor does it imply that
24 | # the products and equipment identified are necessarily the best available
25 | # for the purpose.
26 | #
27 | # This software and/or related materials are provided "AS-IS" without warranty
28 | # of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | # NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | # or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | # licensed product, however used. In no event shall NIST be liable for any
32 | # damages and/or costs, including but not limited to incidental or consequential
33 | # damages of any kind, including economic damage or injury to property and lost
34 | # profits, regardless of whether NIST shall be advised, have reason to know,
35 | # or in fact shall know of the possibility.
36 | #
37 | # By using this software, you agree to bear all risk relating to quality,
38 | # use and performance of the software and/or related materials. You agree
39 | # to hold the Government harmless from any claim arising from your use
40 | # of the software.
41 | #
42 | #*******************************************************************************
43 |
44 | # SubTree: /NBIS/Main/nfiq/src/lib
45 | # Filename: Makefile
46 | # Integrators: Kenneth Ko
47 | # Organization: NIST/ITL
48 | # Host System: GNU GCC/GMAKE GENERIC (UNIX)
49 | # Date Created: 08/20/2006
50 | #
51 | # ******************************************************************************
52 | #
53 | # Makefile for "nfiq" lib directory.
54 | #
55 | # ******************************************************************************
56 | include ../../p_rules.mak
57 | include $(DIR_ROOT_BUILDUTIL)/libs.mak
58 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/Makefile:
--------------------------------------------------------------------------------
1 | #*******************************************************************************
2 | #
3 | # License:
4 | # This software and/or related materials was developed at the National Institute
5 | # of Standards and Technology (NIST) by employees of the Federal Government
6 | # in the course of their official duties. Pursuant to title 17 Section 105
7 | # of the United States Code, this software is not subject to copyright
8 | # protection and is in the public domain.
9 | #
10 | # This software and/or related materials have been determined to be not subject
11 | # to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | # a publicly available technology and software, and is freely distributed
13 | # to any interested party with no licensing requirements. Therefore, it is
14 | # permissible to distribute this software as a free download from the internet.
15 | #
16 | # Disclaimer:
17 | # This software and/or related materials was developed to promote biometric
18 | # standards and biometric technology testing for the Federal Government
19 | # in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | # and Visa Entry Reform Act. Specific hardware and software products identified
21 | # in this software were used in order to perform the software development.
22 | # In no case does such identification imply recommendation or endorsement
23 | # by the National Institute of Standards and Technology, nor does it imply that
24 | # the products and equipment identified are necessarily the best available
25 | # for the purpose.
26 | #
27 | # This software and/or related materials are provided "AS-IS" without warranty
28 | # of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | # NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | # or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | # licensed product, however used. In no event shall NIST be liable for any
32 | # damages and/or costs, including but not limited to incidental or consequential
33 | # damages of any kind, including economic damage or injury to property and lost
34 | # profits, regardless of whether NIST shall be advised, have reason to know,
35 | # or in fact shall know of the possibility.
36 | #
37 | # By using this software, you agree to bear all risk relating to quality,
38 | # use and performance of the software and/or related materials. You agree
39 | # to hold the Government harmless from any claim arising from your use
40 | # of the software.
41 | #
42 | #*******************************************************************************
43 |
44 | # SubTree: /NBIS/Main/nfiq/src/lib/nfiq
45 | # Filename: Makefile
46 | # Integrators: Kenneth Ko
47 | # Organization: NIST/ITL
48 | # Host System: GNU GCC/GMAKE GENERIC (UNIX)
49 | # Date Created: 08/20/2006
50 | #
51 | # ******************************************************************************
52 | #
53 | # Makefile contains the variables to build library - "libnfiq".
54 | #
55 | # ******************************************************************************
56 | include ../../../p_rules.mak
57 | #
58 | LIBRARY := libnfiq
59 | #
60 | SRC := nfiq.c \
61 | nfiqgbls.c \
62 | nfiqread.c \
63 | znorm.c
64 | #
65 | EXT_INCS := -I$(EXPORTS_INC_DIR)
66 | #
67 | include $(DIR_ROOT_BUILDUTIL)/lib.mak
68 | #
69 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/acs.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /***********************************************************************
46 | LIBRARY: MLP - Multi-Layer Perceptron Neural Network
47 |
48 | FILE: ACS.C
49 | AUTHORS: Charles Wilson
50 | G. T. Candela
51 | DATE: 1992
52 | UPDATED: 03/16/2005 by MDG
53 |
54 | Some activation functions suitable for use by e_and_g. Each must
55 | have the following form: return value is void, and function takes
56 | three args, the first arg being the input value (float) and the
57 | second and third being the output function value and output
58 | derivative value (float pointers).
59 |
60 | The functions implemented here so far, all have the same
61 | derivative at zero, namely 1/4. This is a normalization that
62 | makes for better comparison tests between nets using the various
63 | functions.
64 |
65 | ROUTINES:
66 | #cat: ac_sinusoid - MLP sinusoid activation function (returns derivative).
67 | #cat: ac_v_sinusoid - MLP sinusoid activation function (activation only).
68 | #cat: ac_sigmoid - MLP sigmoid (logistic) activation function (returns
69 | #cat: derivative).
70 | #cat: ac_v_sigmoid - MLP sigmoid (logistic) activation function (activation
71 | #cat: only).
72 | #cat: ac_linear - MLP linear activaiton function (returns derivative).
73 | #cat: ac_v_linear - MLP linear activaiton function (activation only).
74 |
75 | ***********************************************************************/
76 |
77 | #include
78 |
79 | /*******************************************************************/
80 |
81 | /* Sinusoid activation function and its derivative. The scaling by .5
82 | before taking the sine, and the adding of 1 and scaling by .5 after
83 | taking the sine, cause this function to have the following desirable
84 | properties: range is [0, 1] (almost same as range of sigmoid, which is
85 | (0,1)); value at 0 is 1/2 (like sigmoid); and derivative at 0 is 1/4
86 | (like sigmoid). */
87 |
88 | void ac_sinusoid(float x, float *val, float *deriv)
89 | {
90 | double a;
91 |
92 | #ifndef HAVE_SINCOS
93 | *val = .5 * (1. + (float)sin(a = .5 * x));
94 | *deriv = .25 * (float)cos(a);
95 | #else
96 | /* If sincos exists, using it is presumably going to be faster than
97 | calling sin and cos. */
98 | sincos(.5 * x, &s, &c);
99 | *val = .5 * (1. + (float)s);
100 | *deriv = .25 * (float)c;
101 | #endif
102 | }
103 |
104 | /*******************************************************************/
105 |
106 | /* Sinusoid activation function, value only.
107 |
108 | Input/output arg:
109 | p: The address for input of the value, and for output of the
110 | result of applying the activation function to this value.
111 | */
112 |
113 | void ac_v_sinusoid(float *p)
114 | {
115 | *p = .5 * (1. + (float)sin((double)(.5 * *p)));
116 | }
117 |
118 | /*******************************************************************/
119 |
120 | /* Sigmoid activation function (also called the logistic function) and
121 | its derivative. (The idea with SMIN is that it is a large-magnitude
122 | negative number, such that exp(-SMIN), a large positive number, just
123 | barely avoids overflow.) */
124 |
125 | #define SMIN -1.e6 /* ok for now */
126 |
127 | void ac_sigmoid(float x, float *val, float *deriv)
128 | {
129 | float v;
130 |
131 | *val = v = (x >= SMIN ? 1. / (1. + (float)exp(-x)) : 0.);
132 | *deriv = v * (1. - v);
133 | }
134 |
135 | /*******************************************************************/
136 |
137 | /* Sigmoid (also called logistic) activation function, value only.
138 |
139 | Input/output arg:
140 | p: The address for input of the value, and for output of the
141 | result of applying the activation function to this value.
142 | */
143 |
144 |
145 | void ac_v_sigmoid(float *p)
146 | {
147 | *p = (*p >= SMIN ? 1. / (1. + (float)exp(-*p)) : 0.);
148 | }
149 | /*******************************************************************/
150 |
151 | /* A linear activation function and its derivative. */
152 |
153 | void ac_linear(float x, float *val, float *deriv)
154 | {
155 | *val = .25 * (float)x;
156 | *deriv = .25;
157 | }
158 |
159 | /*******************************************************************/
160 | /* Linear activation function, value only.
161 |
162 | Input/output arg:
163 | p: The address for input of the value, and for output of the
164 | result of applying the activation function to this value.
165 | */
166 |
167 | void ac_v_linear(float *p)
168 | {
169 | *p = .25 * (float)*p;
170 | }
171 |
172 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/fatalerr.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /***********************************************************************
46 | LIBRARY: UTIL - General Purpose Utility Routines
47 |
48 | FILE: FATALERR.C
49 | AUTHOR: Michael Garris
50 | DATE: 12/19/1990
51 | UPDATED: 04/25/2005 by MDG
52 |
53 | Contains routines responsible for exiting upon an application error.
54 |
55 | ROUTINES:
56 | #cat: fatalerr - generic application error handler that prints a specified
57 | #cat: message to stderr and exits with a status of 1.
58 |
59 | ***********************************************************************/
60 |
61 | /* LINTLIBRARY */
62 |
63 | #include
64 | #include
65 |
66 | void fatalerr(char *s1, char *s2, char *s3)
67 | {
68 |
69 | (void) fflush(stdout);
70 | if (s2 == (char *) NULL)
71 | (void) fprintf(stderr,"ERROR: %s\n",s1);
72 | else if (s3 == (char *) NULL)
73 | (void) fprintf(stderr,"ERROR: %s: %s\n",s1,s2);
74 | else
75 | (void) fprintf(stderr,"ERROR: %s: %s: %s\n",s1,s2,s3);
76 | (void) fflush(stderr);
77 |
78 | exit(1);
79 | }
80 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/free.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /***********************************************************************
46 | LIBRARY: LFS - NIST Latent Fingerprint System
47 |
48 | FILE: FREE.C
49 | AUTHOR: Michael D. Garris
50 | DATE: 03/16/1999
51 |
52 | Contains routines responsible for deallocating
53 | memories required by the NIST Latent Fingerprint System (LFS).
54 |
55 | ***********************************************************************
56 | ROUTINES:
57 | free_dir2rad()
58 | free_dftwaves()
59 | free_rotgrids()
60 | free_dir_powers()
61 | ***********************************************************************/
62 |
63 | #include
64 | #include
65 |
66 | /*************************************************************************
67 | **************************************************************************
68 | #cat: free_dir2rad - Deallocates memory associated with a DIR2RAD structure
69 |
70 | Input:
71 | dir2rad - pointer to memory to be freed
72 | *************************************************************************/
73 | void free_dir2rad(DIR2RAD *dir2rad)
74 | {
75 | free(dir2rad->cos);
76 | free(dir2rad->sin);
77 | free(dir2rad);
78 | }
79 |
80 | /*************************************************************************
81 | **************************************************************************
82 | #cat: free_dftwaves - Deallocates the memory associated with a DFTWAVES
83 | #cat: structure
84 |
85 | Input:
86 | dftwaves - pointer to memory to be freed
87 | **************************************************************************/
88 | void free_dftwaves(DFTWAVES *dftwaves)
89 | {
90 | int i;
91 |
92 | for(i = 0; i < dftwaves->nwaves; i++){
93 | free(dftwaves->waves[i]->cos);
94 | free(dftwaves->waves[i]->sin);
95 | free(dftwaves->waves[i]);
96 | }
97 | free(dftwaves->waves);
98 | free(dftwaves);
99 | }
100 |
101 | /*************************************************************************
102 | **************************************************************************
103 | #cat: free_rotgrids - Deallocates the memory associated with a ROTGRIDS
104 | #cat: structure
105 |
106 | Input:
107 | rotgrids - pointer to memory to be freed
108 | **************************************************************************/
109 | void free_rotgrids(ROTGRIDS *rotgrids)
110 | {
111 | int i;
112 |
113 | for(i = 0; i < rotgrids->ngrids; i++)
114 | free(rotgrids->grids[i]);
115 | free(rotgrids->grids);
116 | free(rotgrids);
117 | }
118 |
119 | /*************************************************************************
120 | **************************************************************************
121 | #cat: free_dir_powers - Deallocate memory associated with DFT power vectors
122 |
123 | Input:
124 | powers - vectors of DFT power values (N Waves X M Directions)
125 | nwaves - number of DFT wave forms used
126 | **************************************************************************/
127 | void free_dir_powers(double **powers, const int nwaves)
128 | {
129 | int w;
130 |
131 | for(w = 0; w < nwaves; w++)
132 | free(powers[w]);
133 |
134 | free(powers);
135 | }
136 |
137 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/getmin.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /***********************************************************************
46 | LIBRARY: LFS - NIST Latent Fingerprint System
47 |
48 | FILE: GETMIN.C
49 | AUTHOR: Michael D. Garris
50 | DATE: 09/10/2004
51 | UPDATED: 03/16/2005 by MDG
52 |
53 | Takes an 8-bit grayscale fingerpinrt image and detects minutiae
54 | as part of the NIST Latent Fingerprint System (LFS), returning
55 | minutiae with final reliabilities and maps including a merged
56 | quality map.
57 |
58 | ***********************************************************************
59 | ROUTINES:
60 | get_minutiae()
61 |
62 | ***********************************************************************/
63 |
64 | #include
65 | #include
66 |
67 | /*************************************************************************
68 | **************************************************************************
69 | #cat: get_minutiae - Takes a grayscale fingerprint image, binarizes the input
70 | #cat: image, and detects minutiae points using LFS Version 2.
71 | #cat: The routine passes back the detected minutiae, the
72 | #cat: binarized image, and a set of image quality maps.
73 |
74 | Input:
75 | idata - grayscale fingerprint image data
76 | iw - width (in pixels) of the grayscale image
77 | ih - height (in pixels) of the grayscale image
78 | id - pixel depth (in bits) of the grayscale image
79 | ppmm - the scan resolution (in pixels/mm) of the grayscale image
80 | lfsparms - parameters and thresholds for controlling LFS
81 | Output:
82 | ominutiae - points to a structure containing the
83 | detected minutiae
84 | oquality_map - resulting integrated image quality map
85 | odirection_map - resulting direction map
86 | olow_contrast_map - resulting low contrast map
87 | olow_flow_map - resulting low ridge flow map
88 | ohigh_curve_map - resulting high curvature map
89 | omap_w - width (in blocks) of image maps
90 | omap_h - height (in blocks) of image maps
91 | obdata - points to binarized image data
92 | obw - width (in pixels) of binarized image
93 | obh - height (in pixels) of binarized image
94 | obd - pixel depth (in bits) of binarized image
95 | Return Code:
96 | Zero - successful completion
97 | Negative - system error
98 | **************************************************************************/
99 | int get_minutiae(MINUTIAE **ominutiae, int **oquality_map,
100 | int **odirection_map, int **olow_contrast_map,
101 | int **olow_flow_map, int **ohigh_curve_map,
102 | int *omap_w, int *omap_h,
103 | unsigned char **obdata, int *obw, int *obh, int *obd,
104 | unsigned char *idata, const int iw, const int ih,
105 | const int id, const double ppmm, const LFSPARMS *lfsparms)
106 | {
107 | int ret;
108 | MINUTIAE *minutiae;
109 | int *direction_map, *low_contrast_map, *low_flow_map;
110 | int *high_curve_map, *quality_map;
111 | int map_w, map_h;
112 | unsigned char *bdata;
113 | int bw, bh;
114 |
115 | /* If input image is not 8-bit grayscale ... */
116 | if(id != 8){
117 | fprintf(stderr, "ERROR : get_minutiae : input image pixel ");
118 | fprintf(stderr, "depth = %d != 8.\n", id);
119 | return(-2);
120 | }
121 |
122 | /* Detect minutiae in grayscale fingerpeint image. */
123 | if((ret = lfs_detect_minutiae_V2(&minutiae,
124 | &direction_map, &low_contrast_map,
125 | &low_flow_map, &high_curve_map,
126 | &map_w, &map_h,
127 | &bdata, &bw, &bh,
128 | idata, iw, ih, lfsparms))){
129 | return(ret);
130 | }
131 |
132 | /* Build integrated quality map. */
133 | if((ret = gen_quality_map(&quality_map,
134 | direction_map, low_contrast_map,
135 | low_flow_map, high_curve_map, map_w, map_h))){
136 | free_minutiae(minutiae);
137 | free(direction_map);
138 | free(low_contrast_map);
139 | free(low_flow_map);
140 | free(high_curve_map);
141 | free(bdata);
142 | return(ret);
143 | }
144 |
145 | /* Assign reliability from quality map. */
146 | if((ret = combined_minutia_quality(minutiae, quality_map, map_w, map_h,
147 | lfsparms->blocksize,
148 | idata, iw, ih, id, ppmm))){
149 | free_minutiae(minutiae);
150 | free(direction_map);
151 | free(low_contrast_map);
152 | free(low_flow_map);
153 | free(high_curve_map);
154 | free(quality_map);
155 | free(bdata);
156 | return(ret);
157 | }
158 |
159 | /* Set output pointers. */
160 | *ominutiae = minutiae;
161 | *oquality_map = quality_map;
162 | *odirection_map = direction_map;
163 | *olow_contrast_map = low_contrast_map;
164 | *olow_flow_map = low_flow_map;
165 | *ohigh_curve_map = high_curve_map;
166 | *omap_w = map_w;
167 | *omap_h = map_h;
168 | *obdata = bdata;
169 | *obw = bw;
170 | *obh = bh;
171 | *obd = id;
172 |
173 | /* Return normally. */
174 | return(0);
175 | }
176 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/libnfiq.txt:
--------------------------------------------------------------------------------
1 | comp_nfiq_featvctr - Routine takes results from NIST's Mindtct and
2 | computes a feature vector for computing NFIQ
3 | comp_nfiq - Routine computes NFIQ given an input image.
4 | This routine uses default statistics for Z-Normalization
5 | and default weights for MLP classification.
6 | comp_nfiq_flex - Routine computes NFIQ given an input image.
7 | This routine requires statistics for Z-Normalization
8 | and weights for MLP classification.
9 | read_imgcls_file - Routine opens a column-formatted text file
10 | parsing in the first column of filenames as a
11 | list of strings and the second column of
12 | target image qualities as a list of strings.
13 | read_znorm_file - Routine opens a column-formatted text file
14 | parsing in the first column of mean values as a
15 | list of floats and the second column of stddev
16 | values as a list of floats.
17 | znorm_fniq_featvctr - Routine Z-Normalized an NFIQ feature vector
18 | comp_znorm_stats - Routine takes a list of feature vectors
19 | (a matrix) and computes the mean and stddev for each
20 | column of features coefs in the matrix.
21 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/log.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /***********************************************************************
46 | LIBRARY: LFS - NIST Latent Fingerprint System
47 |
48 | FILE: LOG.C
49 | AUTHOR: Michael D. Garris
50 | DATE: 08/02/1999
51 |
52 | Contains routines responsible for dynamically updating a log file
53 | during the execution of the NIST Latent Fingerprint System (LFS).
54 |
55 | ***********************************************************************
56 | ROUTINES:
57 | open_logfile()
58 | print2log()
59 | close_logfile()
60 | ***********************************************************************/
61 |
62 | #include
63 |
64 | /* If logging is on, declare global file pointer and supporting */
65 | /* global variable for logging intermediate results. */
66 | FILE *logfp;
67 | int avrdir;
68 | float dir_strength;
69 | int nvalid;
70 |
71 | /***************************************************************************/
72 | /***************************************************************************/
73 | int open_logfile()
74 | {
75 | #ifdef LOG_REPORT
76 | if((logfp = fopen(LOG_FILE, "wb")) == NULL){
77 | fprintf(stderr, "ERROR : open_logfile : fopen : %s\n", LOG_FILE);
78 | return(-1);
79 | }
80 | #endif
81 |
82 | return(0);
83 | }
84 |
85 | /***************************************************************************/
86 | /***************************************************************************/
87 | void print2log(char *fmt, ...)
88 | {
89 | #ifdef LOG_REPORT
90 | va_list ap;
91 |
92 | va_start(ap, fmt);
93 | vfprintf(logfp, fmt, ap);
94 | va_end(ap);
95 | #endif
96 | }
97 |
98 | /***************************************************************************/
99 | /***************************************************************************/
100 | int close_logfile()
101 | {
102 | #ifdef LOG_REPORT
103 | if(fclose(logfp)){
104 | fprintf(stderr, "ERROR : close_logfile : fclose : %s\n", LOG_FILE);
105 | return(-1);
106 | }
107 | #endif
108 |
109 | return(0);
110 | }
111 |
112 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/lsame.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /*
46 | * ======================================================================
47 | * NIST Guide to Available Math Software.
48 | * Fullsource for module SSYR2.C from package CBLAS.
49 | * Retrieved from NETLIB on Tue Mar 14 10:28:02 2000.
50 | *
51 | * UPDATED: 03/09/2005 by MDG
52 | * ======================================================================
53 | */
54 |
55 | /* -- translated by f2c (version 19940927).
56 | You must link the resulting object file with the libraries:
57 | -lf2c -lm (in that order)
58 | */
59 |
60 | #include
61 |
62 | logical lsame_(char *ca, char *cb)
63 | {
64 |
65 |
66 | /* System generated locals */
67 | logical ret_val;
68 |
69 | /* Local variables */
70 | static int inta, intb, zcode;
71 |
72 |
73 | /* -- LAPACK auxiliary routine (version 2.0) --
74 | Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
75 | Courant Institute, Argonne National Lab, and Rice University
76 | January 31, 1994
77 |
78 |
79 | Purpose
80 | =======
81 |
82 | LSAME returns .TRUE. if CA is the same letter as CB regardless of
83 | case.
84 |
85 | Arguments
86 | =========
87 |
88 | CA (input) CHARACTER*1
89 | CB (input) CHARACTER*1
90 | CA and CB specify the single characters to be compared.
91 |
92 | =====================================================================
93 |
94 |
95 |
96 | Test if the characters are equal */
97 |
98 | ret_val = *(unsigned char *)ca == *(unsigned char *)cb;
99 | if (ret_val) {
100 | return ret_val;
101 | }
102 |
103 | /* Now test for equivalence if both characters are alphabetic. */
104 |
105 | zcode = 'Z';
106 |
107 | /* Use 'Z' rather than 'A' so that ASCII can be detected on Prime
108 | machines, on which ICHAR returns a value with bit 8 set.
109 | ICHAR('A') on Prime machines returns 193 which is the same as
110 | ICHAR('A') on an EBCDIC machine. */
111 |
112 | inta = *(unsigned char *)ca;
113 | intb = *(unsigned char *)cb;
114 |
115 | if (zcode == 90 || zcode == 122) {
116 |
117 | /* ASCII is assumed - ZCODE is the ASCII code of either lower o
118 | r
119 | upper case 'Z'. */
120 |
121 | if (inta >= 97 && inta <= 122) {
122 | inta += -32;
123 | }
124 | if (intb >= 97 && intb <= 122) {
125 | intb += -32;
126 | }
127 |
128 | } else if (zcode == 233 || zcode == 169) {
129 |
130 | /* EBCDIC is assumed - ZCODE is the EBCDIC code of either lower
131 | or
132 | upper case 'Z'. */
133 |
134 | /*
135 | if (inta >= 129 && inta <= 137 || inta >= 145 && inta <= 153 || inta
136 | >= 162 && inta <= 169) {
137 | inta += 64;
138 | }
139 | if (intb >= 129 && intb <= 137 || intb >= 145 && intb <= 153 || intb
140 | >= 162 && intb <= 169) {
141 | intb += 64;
142 | }
143 | */
144 | /* Parenteses added by MDG on 03-09-05 */
145 | if ((inta >= 129 && inta <= 137) || (inta >= 145 && inta <= 153) ||
146 | (inta >= 162 && inta <= 169)) {
147 | inta += 64;
148 | }
149 | if ((intb >= 129 && intb <= 137) || (intb >= 145 && intb <= 153) ||
150 | (intb >= 162 && intb <= 169)) {
151 | intb += 64;
152 | }
153 |
154 | } else if (zcode == 218 || zcode == 250) {
155 |
156 | /* ASCII is assumed, on Prime machines - ZCODE is the ASCII cod
157 | e
158 | plus 128 of either lower or upper case 'Z'. */
159 |
160 | if (inta >= 225 && inta <= 250) {
161 | inta += -32;
162 | }
163 | if (intb >= 225 && intb <= 250) {
164 | intb += -32;
165 | }
166 | }
167 | ret_val = inta == intb;
168 |
169 | /* RETURN
170 |
171 | End of LSAME */
172 |
173 | return ret_val;
174 | } /* lsame_ */
175 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/mlpcla.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /*****************************************************************/
46 | /* File: mlpcla.c */
47 | /* Author: Michael D. Garris */
48 | /* Date: 03/17/2005 */
49 | /* */
50 | /* To handle proper prototyping and argument passing to CLAPCK */
51 | /* routines used by MLP library codes. E.g. MLP codes are */
52 | /* written in single percision integer while the CBLAS routines */
53 | /* are written using long ints. */
54 | /*****************************************************************/
55 |
56 | #include
57 |
58 |
59 | /*****************************************************************/
60 | int mlp_sgemv(char trans, int m, int n, float alpha,
61 | float *a, int lda, float *x, int incx, float beta, float *y,
62 | int incy)
63 | {
64 | int ret;
65 | int t_m, t_n, t_lda, t_incx, t_incy;
66 |
67 | t_m = m;
68 | t_n = n;
69 | t_lda = lda;
70 | t_incx = incx;
71 | t_incy = incy;
72 |
73 | ret = sgemv_(&trans, &t_m, &t_n, &alpha, a, &t_lda, x, &t_incx,
74 | &beta, y, &t_incy);
75 |
76 | return(ret);
77 | }
78 |
79 | /*****************************************************************/
80 | int mlp_sscal(int n, float sa, float *sx, int incx)
81 | {
82 | int ret;
83 | int t_n, t_incx;
84 |
85 | t_n = n;
86 | t_incx = incx;
87 |
88 | ret = sscal_(&t_n, &sa, sx, &t_incx);
89 |
90 | return(ret);
91 | }
92 |
93 | /*****************************************************************/
94 | int mlp_saxpy(int n, float sa, float *sx, int incx, float *sy, int incy)
95 | {
96 | int ret;
97 | int t_n, t_incx, t_incy;
98 |
99 | t_n = n;
100 | t_incx = incx;
101 | t_incy = incy;
102 |
103 | ret = saxpy_(&t_n, &sa, sx, &t_incx, sy, &t_incy);
104 |
105 | return(ret);
106 | }
107 |
108 | /*****************************************************************/
109 | float mlp_sdot(int n, float *sx, int incx, float *sy, int incy)
110 | {
111 | double dret;
112 | float fret;
113 | int t_n, t_incx, t_incy;
114 |
115 | t_n = n;
116 | t_incx = incx;
117 | t_incy = incy;
118 |
119 | dret = sdot_(&t_n, sx, &t_incx, sy, &t_incy);
120 |
121 | fret = (float)dret;
122 |
123 | return(fret);
124 | }
125 |
126 | /*****************************************************************/
127 | float mlp_snrm2(int n, float *x, int incx)
128 | {
129 | double dret;
130 | float fret;
131 | int t_n, t_incx;
132 |
133 | t_n = n;
134 | t_incx = incx;
135 |
136 | dret = snrm2_(&t_n, x, &t_incx);
137 |
138 | fret = (float)dret;
139 |
140 | return(fret);
141 | }
142 |
143 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/nfiqread.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /************************************************************************/
46 | /***********************************************************************
47 | LIBRARY: FING - NIST Fingerprint Systems Utilities
48 |
49 | FILE: NFIQREAD.C
50 | IMPLEMENTATION: Michael D. Garris
51 | ALGORITHM: Elham Tabassi
52 | Charles L. Wilson
53 | Craig I. Watson
54 | DATE: 09/09/2004
55 |
56 | Contains read routines for various files supporting
57 | NFIQ (NIST Fingerprint Image Quality)
58 |
59 | ***********************************************************************
60 | ROUTINES:
61 | read_imgcls_file()
62 | read_znorm_file()
63 |
64 | ***********************************************************************/
65 |
66 | #include
67 | #include
68 |
69 | /***********************************************************************
70 | ************************************************************************
71 | #cat: read_imgcls_file - Routine opens a column-formatted text file
72 | #cat: parsing in the first column of filenames as a
73 | #cat: list of strings and the second column of
74 | #cat: target image qualities as a list of strings.
75 |
76 | Input:
77 | imgclsfilep - input file name to be read
78 | Output:
79 | oimglist - allocated list of file names read
80 | oclslist - allocated list of target image qualities read
81 | onum_ims - number of images read
82 | Return Code:
83 | Zero - successful completion
84 | Negative - system error
85 | ************************************************************************/
86 | int read_imgcls_file(char *imgclsfile, char ***oimglist, char ***oclslist,
87 | int *onum_imgs)
88 | {
89 | int ret, alloc_flag;
90 |
91 | alloc_flag = TRUE;
92 | ret = read_strstr_file(imgclsfile, oimglist, oclslist, onum_imgs,
93 | alloc_flag);
94 |
95 | return(ret);
96 | }
97 |
98 | /***********************************************************************
99 | ************************************************************************
100 | #cat: read_znorm_file - Routine opens a column-formatted text file
101 | #cat: parsing in the first column of mean values as a
102 | #cat: list of floats and the second column of stddev
103 | #cat: values as a list of floats.
104 |
105 | Input:
106 | znormfile - input file name to be read
107 | Output:
108 | znorm_means - preallocated list of mean values read
109 | znorm_stds - preallocated list of stddev values read
110 | num_znorms - allocated length of output vectors
111 | Return Code:
112 | Zero - successful completion
113 | Negative - system error
114 | ************************************************************************/
115 | int read_znorm_file(char *znormfile,
116 | float *znorm_means, float *znorm_stds, const int num_znorms)
117 | {
118 | int ret, tnum_znorms, alloc_flag;
119 |
120 | tnum_znorms = num_znorms;
121 | alloc_flag = FALSE;
122 | ret = read_fltflt_file(znormfile, &znorm_means, &znorm_stds, &tnum_znorms,
123 | alloc_flag);
124 | return(ret);
125 | }
126 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/saxpy.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /*
46 | * ======================================================================
47 | * NIST Guide to Available Math Software.
48 | * Source for module SAXPY.C from package CBLAS.
49 | * Retrieved from NETLIB on Tue Mar 14 10:55:47 2000.
50 | * ======================================================================
51 | */
52 |
53 | /* -- translated by f2c (version 19940927).
54 | You must link the resulting object file with the libraries:
55 | -lf2c -lm (in that order)
56 | */
57 |
58 | #include
59 |
60 | /* Subroutine */ int saxpy_(int *n, real *sa, real *sx, int *incx,
61 | real *sy, int *incy)
62 | {
63 |
64 |
65 | /* System generated locals */
66 | int i__1;
67 |
68 | /* Local variables */
69 | static int i, m, ix, iy, mp1;
70 |
71 |
72 | /* constant times a vector plus a vector.
73 | uses unrolled loop for increments equal to one.
74 | jack dongarra, linpack, 3/11/78.
75 | modified 12/3/93, array(1) declarations changed to array(*)
76 |
77 |
78 |
79 | Parameter adjustments
80 | Function Body */
81 | #define SY(I) sy[(I)-1]
82 | #define SX(I) sx[(I)-1]
83 |
84 |
85 | if (*n <= 0) {
86 | return 0;
87 | }
88 | if (*sa == 0.f) {
89 | return 0;
90 | }
91 | if (*incx == 1 && *incy == 1) {
92 | goto L20;
93 | }
94 |
95 | /* code for unequal increments or equal increments
96 | not equal to 1 */
97 |
98 | ix = 1;
99 | iy = 1;
100 | if (*incx < 0) {
101 | ix = (-(*n) + 1) * *incx + 1;
102 | }
103 | if (*incy < 0) {
104 | iy = (-(*n) + 1) * *incy + 1;
105 | }
106 | i__1 = *n;
107 | for (i = 1; i <= *n; ++i) {
108 | SY(iy) += *sa * SX(ix);
109 | ix += *incx;
110 | iy += *incy;
111 | /* L10: */
112 | }
113 | return 0;
114 |
115 | /* code for both increments equal to 1
116 |
117 |
118 | clean-up loop */
119 |
120 | L20:
121 | m = *n % 4;
122 | if (m == 0) {
123 | goto L40;
124 | }
125 | i__1 = m;
126 | for (i = 1; i <= m; ++i) {
127 | SY(i) += *sa * SX(i);
128 | /* L30: */
129 | }
130 | if (*n < 4) {
131 | return 0;
132 | }
133 | L40:
134 | mp1 = m + 1;
135 | i__1 = *n;
136 | for (i = mp1; i <= *n; i += 4) {
137 | SY(i) += *sa * SX(i);
138 | SY(i + 1) += *sa * SX(i + 1);
139 | SY(i + 2) += *sa * SX(i + 2);
140 | SY(i + 3) += *sa * SX(i + 3);
141 | /* L50: */
142 | }
143 | return 0;
144 | } /* saxpy_ */
145 |
146 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/sdot.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /*
46 | * ======================================================================
47 | * NIST Guide to Available Math Software.
48 | * Source for module SDOT.C from package CBLAS.
49 | * Retrieved from NETLIB on Tue Mar 14 10:55:27 2000.
50 | * ======================================================================
51 | */
52 |
53 | /* -- translated by f2c (version 19940927).
54 | You must link the resulting object file with the libraries:
55 | -lf2c -lm (in that order)
56 | */
57 |
58 | #include
59 |
60 | doublereal sdot_(int *n, real *sx, int *incx, real *sy, int *incy)
61 | {
62 |
63 |
64 | /* System generated locals */
65 | int i__1;
66 | real ret_val;
67 |
68 | /* Local variables */
69 | static int i, m;
70 | static real stemp;
71 | static int ix, iy, mp1;
72 |
73 |
74 | /* forms the dot product of two vectors.
75 | uses unrolled loops for increments equal to one.
76 | jack dongarra, linpack, 3/11/78.
77 | modified 12/3/93, array(1) declarations changed to array(*)
78 |
79 |
80 |
81 | Parameter adjustments
82 | Function Body */
83 | #define SY(I) sy[(I)-1]
84 | #define SX(I) sx[(I)-1]
85 |
86 |
87 | stemp = 0.f;
88 | ret_val = 0.f;
89 | if (*n <= 0) {
90 | return ret_val;
91 | }
92 | if (*incx == 1 && *incy == 1) {
93 | goto L20;
94 | }
95 |
96 | /* code for unequal increments or equal increments
97 | not equal to 1 */
98 |
99 | ix = 1;
100 | iy = 1;
101 | if (*incx < 0) {
102 | ix = (-(*n) + 1) * *incx + 1;
103 | }
104 | if (*incy < 0) {
105 | iy = (-(*n) + 1) * *incy + 1;
106 | }
107 | i__1 = *n;
108 | for (i = 1; i <= *n; ++i) {
109 | stemp += SX(ix) * SY(iy);
110 | ix += *incx;
111 | iy += *incy;
112 | /* L10: */
113 | }
114 | ret_val = stemp;
115 | return ret_val;
116 |
117 | /* code for both increments equal to 1
118 |
119 |
120 | clean-up loop */
121 |
122 | L20:
123 | m = *n % 5;
124 | if (m == 0) {
125 | goto L40;
126 | }
127 | i__1 = m;
128 | for (i = 1; i <= m; ++i) {
129 | stemp += SX(i) * SY(i);
130 | /* L30: */
131 | }
132 | if (*n < 5) {
133 | goto L60;
134 | }
135 | L40:
136 | mp1 = m + 1;
137 | i__1 = *n;
138 | for (i = mp1; i <= *n; i += 5) {
139 | stemp = stemp + SX(i) * SY(i) + SX(i + 1) * SY(i + 1) + SX(i + 2) *
140 | SY(i + 2) + SX(i + 3) * SY(i + 3) + SX(i + 4) * SY(i + 4);
141 | /* L50: */
142 | }
143 | L60:
144 | ret_val = stemp;
145 | return ret_val;
146 | } /* sdot_ */
147 |
148 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/snrm2.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /*
46 | * ======================================================================
47 | * NIST Guide to Available Math Software.
48 | * Source for module SNRM2.C from package CBLAS.
49 | * Retrieved from NETLIB on Tue Mar 14 10:54:20 2000.
50 | * ======================================================================
51 | */
52 |
53 | /* -- translated by f2c (version 19940927).
54 | You must link the resulting object file with the libraries:
55 | -lf2c -lm (in that order)
56 | */
57 |
58 | #include
59 |
60 | doublereal snrm2_(int *n, real *x, int *incx)
61 | {
62 |
63 |
64 | /* System generated locals */
65 | int i__1, i__2;
66 | real ret_val, r__1;
67 |
68 | double sqrt(doublereal);
69 |
70 | /* Local variables */
71 | static real norm, scale, absxi;
72 | static int ix;
73 | static real ssq;
74 |
75 |
76 | /* SNRM2 returns the euclidean norm of a vector via the function
77 | name, so that
78 |
79 | SNRM2 := sqrt( x'*x )
80 |
81 |
82 |
83 | -- This version written on 25-October-1982.
84 | Modified on 14-October-1993 to inline the call to SLASSQ.
85 | Sven Hammarling, Nag Ltd.
86 |
87 |
88 |
89 | Parameter adjustments
90 | Function Body */
91 | #define X(I) x[(I)-1]
92 |
93 |
94 | if (*n < 1 || *incx < 1) {
95 | norm = 0.f;
96 | } else if (*n == 1) {
97 | norm = dabs(X(1));
98 | } else {
99 | scale = 0.f;
100 | ssq = 1.f;
101 | /* The following loop is equivalent to this call to the LAPACK
102 |
103 | auxiliary routine:
104 | CALL SLASSQ( N, X, INCX, SCALE, SSQ ) */
105 |
106 | i__1 = (*n - 1) * *incx + 1;
107 | i__2 = *incx;
108 | for (ix = 1; *incx < 0 ? ix >= (*n-1)**incx+1 : ix <= (*n-1)**incx+1; ix += *incx) {
109 | if (X(ix) != 0.f) {
110 | absxi = (r__1 = X(ix), dabs(r__1));
111 | if (scale < absxi) {
112 | /* Computing 2nd power */
113 | r__1 = scale / absxi;
114 | ssq = ssq * (r__1 * r__1) + 1.f;
115 | scale = absxi;
116 | } else {
117 | /* Computing 2nd power */
118 | r__1 = absxi / scale;
119 | ssq += r__1 * r__1;
120 | }
121 | }
122 | /* L10: */
123 | }
124 | norm = scale * sqrt(ssq);
125 | }
126 |
127 | ret_val = norm;
128 | return ret_val;
129 |
130 | /* End of SNRM2. */
131 |
132 | } /* snrm2_ */
133 |
134 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/sscal.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /*
46 | * ======================================================================
47 | * NIST Guide to Available Math Software.
48 | * Fullsource for module SSCAL.C from package CBLAS.
49 | * Retrieved from NETLIB on Tue Mar 14 10:51:13 2000.
50 | * ======================================================================
51 | */
52 |
53 | /* -- translated by f2c (version 19940927).
54 | You must link the resulting object file with the libraries:
55 | -lf2c -lm (in that order)
56 | */
57 |
58 | #include
59 |
60 | /* Subroutine */ int sscal_(int *n, real *sa, real *sx, int *incx)
61 | {
62 |
63 |
64 | /* System generated locals */
65 | int i__1, i__2;
66 |
67 | /* Local variables */
68 | static int i, m, nincx, mp1;
69 |
70 |
71 | /* scales a vector by a constant.
72 | uses unrolled loops for increment equal to 1.
73 | jack dongarra, linpack, 3/11/78.
74 | modified 3/93 to return if incx .le. 0.
75 | modified 12/3/93, array(1) declarations changed to array(*)
76 |
77 |
78 |
79 | Parameter adjustments
80 | Function Body */
81 | #define SX(I) sx[(I)-1]
82 |
83 |
84 | if (*n <= 0 || *incx <= 0) {
85 | return 0;
86 | }
87 | if (*incx == 1) {
88 | goto L20;
89 | }
90 |
91 | /* code for increment not equal to 1 */
92 |
93 | nincx = *n * *incx;
94 | i__1 = nincx;
95 | i__2 = *incx;
96 | for (i = 1; *incx < 0 ? i >= nincx : i <= nincx; i += *incx) {
97 | SX(i) = *sa * SX(i);
98 | /* L10: */
99 | }
100 | return 0;
101 |
102 | /* code for increment equal to 1
103 |
104 |
105 | clean-up loop */
106 |
107 | L20:
108 | m = *n % 5;
109 | if (m == 0) {
110 | goto L40;
111 | }
112 | i__2 = m;
113 | for (i = 1; i <= m; ++i) {
114 | SX(i) = *sa * SX(i);
115 | /* L30: */
116 | }
117 | if (*n < 5) {
118 | return 0;
119 | }
120 | L40:
121 | mp1 = m + 1;
122 | i__2 = *n;
123 | for (i = mp1; i <= *n; i += 5) {
124 | SX(i) = *sa * SX(i);
125 | SX(i + 1) = *sa * SX(i + 1);
126 | SX(i + 2) = *sa * SX(i + 2);
127 | SX(i + 3) = *sa * SX(i + 3);
128 | SX(i + 4) = *sa * SX(i + 4);
129 | /* L50: */
130 | }
131 | return 0;
132 | } /* sscal_ */
133 |
134 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/ssxstats.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /***********************************************************************
46 | LIBRARY: UTIL - General Purpose Utility Routines
47 |
48 | FILE: SSXSTATS.C
49 | AUTHOR: Darrin Dimmick
50 | DATE: 04/25/90
51 |
52 | Contains general purpose routines for computing variance
53 | based statistics using simple numerical methods.
54 |
55 | ROUTINES:
56 | #cat: ssx_stddev - computes standard deviation based on sum of samples
57 | #cat: and sum of the square of samples
58 | #cat: ssx_variance - comptues variance based on sum of samples
59 | #cat: and sum of the square of samples
60 | #cat: ssx - fundamental computation to support variance and stddev
61 | #cat:
62 |
63 | ***********************************************************************/
64 |
65 | #include
66 | #include
67 | #include
68 |
69 | /*****************************************************/
70 | /* Routine: Standard_deviation */
71 | /* Author: Darrin L. Dimmick */
72 | /* Date: 4/25/90 */
73 | /*****************************************************/
74 | /*****************************************************
75 | ssx_stddev() accepts the sum of the
76 | values, the sum of the squares of the values, and
77 | the number of values contained in the sum and
78 | returns the standard deviation of the data.
79 |
80 | double sum_x; # sum of the x values
81 | double sum_x2; # sum of the squares of the x values
82 | int count; # number of items sumed
83 | ******************************************************/
84 | double ssx_stddev(const double sum_x, const double sum_x2,
85 | const int count)
86 | {
87 | double var = 0;
88 |
89 | var = ssx_variance(sum_x,sum_x2,count);
90 | if (var >= 0.0)
91 | return (sqrt(var));
92 | else
93 | /* otherwise error code */
94 | return(var);
95 | }
96 |
97 | /*****************************************************/
98 | /* Routine: Variance */
99 | /* Author: Darrin L. Dimmick */
100 | /* Date: 4/25/90 */
101 | /*****************************************************/
102 | /*****************************************************
103 | ssx_variance() accepts the sum of the values, the sum
104 | of the squares of the values, and the number of
105 | values contained in the sum and returns the
106 | variance of the data.
107 |
108 | double sum_x; # sum of the x values
109 | double sum_x2; # sum of the squares of the values x
110 | int count; # number of items that were sumed
111 | ******************************************************/
112 | double ssx_variance(const double sum_x, const double sum_x2, const int count)
113 | {
114 | double ssxval; /* holds value from SSx() */
115 | double variance;
116 |
117 | if (count < 2){
118 | fprintf(stderr,"ERROR : ssx_variance : invalid count : %d < 2\n", count);
119 | return(-2.0);
120 | }
121 | ssxval = ssx(sum_x,sum_x2,count);
122 | variance = ssxval/(count-1);
123 |
124 | return(variance);
125 | }
126 |
127 | /*****************************************************/
128 | /* Routine: SSx */
129 | /* Author: Darrin L. Dimmick */
130 | /* Date: 4/25/90 */
131 | /*****************************************************/
132 | /*****************************************************
133 | ssx() accepts the sum of the values, sum_x, the
134 | sum of the squares of the values, sum_x2 and the
135 | number of values contained in the sums, count and
136 | returns the value of the sum of the squares
137 | calculation, SS(x).
138 |
139 | double sum_x; # sum of x values
140 | double sum_x2; # sum of the squares of the x values
141 | int count; # number of values sumed
142 | ******************************************************/
143 | double ssx(const double sum_x, const double sum_x2, const int count)
144 | { /* SS(x) SS(y) */
145 | /* SS(x) = (sum_x2 - ((sum_x * sum_x)/count)) */
146 | double ssx;
147 |
148 | ssx = sum_x * sum_x;
149 | ssx = ssx/count;
150 | ssx = sum_x2 - ssx;
151 |
152 | return (ssx);
153 | }
154 |
155 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/syserr.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /***********************************************************************
46 | LIBRARY: UTIL - General Purpose Utility Routines
47 |
48 | FILE: SYSERR.C
49 | AUTHOR: Michael Garris
50 | DATE: 12/19/1990
51 | UPDATED: 04/25/2005 by MDG
52 |
53 | Contains routines responsible for exiting upon an system error.
54 |
55 | ROUTINES:
56 | #cat: syserr - exits on error with a status of -1, printing to stderr a
57 | #cat: caller-defined message.
58 |
59 | ***********************************************************************/
60 |
61 | /* LINTLIBRARY */
62 |
63 | #include
64 | #include
65 |
66 | void syserr(char *funcname, char *syscall, char *msg)
67 | {
68 |
69 | (void) fflush(stdout);
70 | if(msg == NULL)
71 | (void) fprintf(stderr,"ERROR: %s: %s\n",funcname,syscall);
72 | else
73 | (void) fprintf(stderr,"ERROR: %s: %s: %s\n",funcname,syscall,msg);
74 | (void) fflush(stderr);
75 |
76 | exit(-1);
77 | }
78 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/xerbla.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /*
46 | * ======================================================================
47 | * NIST Guide to Available Math Software.
48 | * Fullsource for module SSYR2.C from package CBLAS.
49 | * Retrieved from NETLIB on Tue Mar 14 10:28:02 2000.
50 | *
51 | * UPDATED: 03/09/2005 by MDG
52 | * ======================================================================
53 | */
54 |
55 | #include
56 | #include /* Added by MDG on 03-09-05 */
57 |
58 | /* Subroutine */ int xerbla_(char *srname, int *info)
59 | {
60 | /* -- LAPACK auxiliary routine (version 2.0) --
61 | Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
62 | Courant Institute, Argonne National Lab, and Rice University
63 | September 30, 1994
64 |
65 |
66 | Purpose
67 | =======
68 |
69 | XERBLA is an error handler for the LAPACK routines.
70 | It is called by an LAPACK routine if an input parameter has an
71 | invalid value. A message is printed and execution stops.
72 |
73 | Installers may consider modifying the STOP statement in order to
74 | call system-specific exception-handling facilities.
75 |
76 | Arguments
77 | =========
78 |
79 | SRNAME (input) CHARACTER*6
80 | The name of the routine which called XERBLA.
81 |
82 | INFO (input) INTEGER
83 | The position of the invalid parameter in the parameter list
84 |
85 | of the calling routine.
86 |
87 | =====================================================================
88 | */
89 |
90 | /*
91 | printf("** On entry to %6s, parameter number %2i had an illegal value\n",
92 | srname, *info);
93 | */
94 |
95 | /* %2ld added by MDG on 03-09-05
96 | changed to %2d by JCK on 2009-02-02 because of change in f2c.h */
97 | printf("** On entry to %6s, parameter number %2d had an illegal value\n",
98 | srname, *info);
99 |
100 |
101 | /* End of XERBLA */
102 |
103 | return 0;
104 | } /* xerbla_ */
105 |
106 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/xytreps.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /***********************************************************************
46 | LIBRARY: LFS - NIST Latent Fingerprint System
47 |
48 | FILE: XYTREPS.C
49 | AUTHOR: Michael D. Garris
50 | DATE: 09/16/2004
51 | UPDATED: 01/11/2012
52 |
53 | Contains routines useful in converting minutiae in LFS "native"
54 | representation into other representations, such as
55 | M1 (ANSI INCITS 378-2004) & NIST internal representations.
56 |
57 | ***********************************************************************
58 | ROUTINES:
59 | lfs2nist_minutia_XTY()
60 | lfs2m1_minutia_XTY()
61 | lfs2nist_format()
62 |
63 | ***********************************************************************/
64 |
65 | #include
66 | #include
67 |
68 | /*************************************************************************
69 | **************************************************************************
70 | #cat: lfs2nist_minutia_XYT - Converts XYT minutiae attributes in LFS native
71 | #cat: representation to NIST internal representation
72 |
73 | Input:
74 | minutia - LFS minutia structure containing attributes to be converted
75 | Output:
76 | ox - NIST internal based x-pixel coordinate
77 | oy - NIST internal based y-pixel coordinate
78 | ot - NIST internal based minutia direction/orientation
79 | **************************************************************************/
80 | void lfs2nist_minutia_XYT(int *ox, int *oy, int *ot,
81 | const MINUTIA *minutia, const int iw, const int ih)
82 | {
83 | int x, y, t;
84 | float degrees_per_unit;
85 |
86 | /* XYT's according to NIST internal rep: */
87 | /* 1. pixel coordinates with origin bottom-left */
88 | /* 2. orientation in degrees on range [0..360] */
89 | /* with 0 pointing east and increasing counter */
90 | /* clockwise (same as M1) */
91 | /* 3. direction pointing out and away from the */
92 | /* ridge ending or bifurcation valley */
93 | /* (opposite direction from M1) */
94 |
95 | x = minutia->x;
96 | y = ih - minutia->y;
97 |
98 | degrees_per_unit = 180 / (float)NUM_DIRECTIONS;
99 |
100 | t = (270 - sround(minutia->direction * degrees_per_unit)) % 360;
101 | if(t < 0){
102 | t += 360;
103 | }
104 |
105 | *ox = x;
106 | *oy = y;
107 | *ot = t;
108 | }
109 |
110 | /*************************************************************************
111 | **************************************************************************
112 | #cat: lfs2m1_minutia_XYT - Converts XYT minutiae attributes in LFS native
113 | #cat: representation to M1 (ANSI INCITS 378-2004) representation
114 |
115 | Input:
116 | minutia - LFS minutia structure containing attributes to be converted
117 | Output:
118 | ox - M1 based x-pixel coordinate
119 | oy - M1 based y-pixel coordinate
120 | ot - M1 based minutia direction/orientation
121 | **************************************************************************/
122 | void lfs2m1_minutia_XYT(int *ox, int *oy, int *ot, const MINUTIA *minutia)
123 | {
124 | int x, y, t;
125 | float degrees_per_unit;
126 |
127 | /* XYT's according to M1 (ANSI INCITS 378-2004): */
128 | /* 1. pixel coordinates with origin top-left */
129 | /* 2. orientation in degrees on range [0..179] */
130 | /* with 0 pointing east and increasing counter */
131 | /* clockwise */
132 | /* 3. direction pointing up the ridge ending or */
133 | /* bifurcaiton valley */
134 |
135 | x = minutia->x;
136 | y = minutia->y;
137 |
138 | degrees_per_unit = 180 / (float)NUM_DIRECTIONS;
139 | t = (90 - sround(minutia->direction * degrees_per_unit)) % 360;
140 | if(t < 0){
141 | t += 360;
142 | }
143 |
144 | /* range of theta is 0..179 because angles are in units of 2 degress */
145 | t = t / 2;
146 |
147 | *ox = x;
148 | *oy = y;
149 | *ot = t;
150 | }
151 |
152 | /*************************************************************************
153 | **************************************************************************
154 | #cat: lfs2nist_format - Takes a minutiae data structure and converts
155 | #cat: the XYT minutiae attributes in LFS native
156 | #cat: representation to NIST internal representation
157 | Input:
158 | iminutiae - minutiae data structure
159 | iw - width (in pixels) of the grayscale image
160 | ih - height (in pixels) of the grayscale image
161 | Output:
162 | iminutiae - overwrite each minutia element in the minutiae data
163 | sturcture convernt to nist internal minutiae format
164 | **************************************************************************/
165 | void lfs2nist_format(MINUTIAE *iminutiae, int iw, int ih)
166 | {
167 | int i, ox, oy, ot, oq;
168 | MINUTIA *minutia;
169 |
170 | for (i = 0; i < iminutiae->num; i++)
171 | {
172 | minutia = iminutiae->list[i];
173 | lfs2nist_minutia_XYT(&ox, &oy, &ot, minutia, iw, ih);
174 | oq = sround(minutia->reliability * 100.0);
175 | minutia->x = ox;
176 | minutia->y = oy;
177 | minutia->direction = ot;
178 | minutia->reliability = (double)oq;
179 | }
180 | }
181 |
182 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/lib/nfiq/znorm.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 |
3 | License:
4 | This software and/or related materials was developed at the National Institute
5 | of Standards and Technology (NIST) by employees of the Federal Government
6 | in the course of their official duties. Pursuant to title 17 Section 105
7 | of the United States Code, this software is not subject to copyright
8 | protection and is in the public domain.
9 |
10 | This software and/or related materials have been determined to be not subject
11 | to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 | a publicly available technology and software, and is freely distributed
13 | to any interested party with no licensing requirements. Therefore, it is
14 | permissible to distribute this software as a free download from the internet.
15 |
16 | Disclaimer:
17 | This software and/or related materials was developed to promote biometric
18 | standards and biometric technology testing for the Federal Government
19 | in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 | and Visa Entry Reform Act. Specific hardware and software products identified
21 | in this software were used in order to perform the software development.
22 | In no case does such identification imply recommendation or endorsement
23 | by the National Institute of Standards and Technology, nor does it imply that
24 | the products and equipment identified are necessarily the best available
25 | for the purpose.
26 |
27 | This software and/or related materials are provided "AS-IS" without warranty
28 | of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 | NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 | or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 | licensed product, however used. In no event shall NIST be liable for any
32 | damages and/or costs, including but not limited to incidental or consequential
33 | damages of any kind, including economic damage or injury to property and lost
34 | profits, regardless of whether NIST shall be advised, have reason to know,
35 | or in fact shall know of the possibility.
36 |
37 | By using this software, you agree to bear all risk relating to quality,
38 | use and performance of the software and/or related materials. You agree
39 | to hold the Government harmless from any claim arising from your use
40 | of the software.
41 |
42 | *******************************************************************************/
43 |
44 |
45 | /************************************************************************/
46 | /***********************************************************************
47 | LIBRARY: FING - NIST Fingerprint Systems Utilities
48 |
49 | FILE: ZNORM.C
50 | IMPLEMENTATION: Michael D. Garris
51 | ALGORITHM: Elham Tabassi
52 | Charles L. Wilson
53 | Craig I. Watson
54 | DATE: 09/09/2004
55 |
56 | Contains routines responsible for supporting
57 | Z-Normalization of feature vectors used by
58 | NFIQ (NIST Fingerprint Image Quality) algorithm
59 |
60 | ***********************************************************************
61 | ROUTINES:
62 | znorm_fniq_fetvctr()
63 | comp_znorm_stats()
64 |
65 | ***********************************************************************/
66 |
67 | #include
68 | #include
69 | #include
70 |
71 | /***********************************************************************
72 | ************************************************************************
73 | #cat: znorm_fniq_featvctr - Routine Z-Normalized an NFIQ feature vector
74 |
75 | Input:
76 | featvctr - NFIQ feature vector
77 | znorm_means - global means for each coef in the feature vector
78 | znorm_stds - global stddev for each coef in the feature vector
79 | vctrlen - allocated length of feature vector
80 | Output:
81 | featvctr - resulting normalized feature vector values
82 | ************************************************************************/
83 | void znorm_fniq_featvctr(float *featvctr,
84 | float *znorm_means, float *znorm_stds, const int vctrlen)
85 | {
86 | int i;
87 |
88 | for(i = 0; i < vctrlen; i++)
89 | featvctr[i] = (featvctr[i] - znorm_means[i])/znorm_stds[i];
90 | }
91 |
92 | /***********************************************************************
93 | ************************************************************************
94 | #cat: comp_znorm_stats - Routine takes a list of feature vectors
95 | #cat: (a matrix) and computes the mean and stddev for each
96 | #cat: column of features coefs in the matrix.
97 |
98 | Input:
99 | feats - list of input feature vectors
100 | nfeatvctrs - number of vectors in the list
101 | nfeats - number of coefs in each vector
102 | Output:
103 | omeans - resulting allocated list of coef means
104 | ostddevs - resulting allocated list of coef stddevs
105 | Return Code:
106 | Zero - successful completion
107 | Negative - system error
108 | ************************************************************************/
109 | int comp_znorm_stats(float **omeans, float **ostddevs,
110 | float *feats,
111 | const int nfeatvctrs, const int nfeats)
112 | {
113 | int f, v;
114 | float fret;
115 | float *means, *stddevs;
116 | float *mptr, *sdptr;
117 | float *sfeatptr, *featptr;
118 | float sum_x, sum_x2;
119 |
120 | means = (float *)malloc(nfeats * sizeof(float));
121 | if(means == (float *)NULL){
122 | fprintf(stderr, "ERROR : comp_znorm_stats : malloc : means\n");
123 | return(-2);
124 | }
125 |
126 | stddevs = (float *)malloc(nfeats * sizeof(float));
127 | if(stddevs == (float *)NULL){
128 | fprintf(stderr, "ERROR : comp_znorm_stats : malloc : stddevs\n");
129 | free(means);
130 | return(-3);
131 | }
132 |
133 | /* foreach column of feature vector matrix */
134 | sfeatptr = feats;
135 | mptr = means;
136 | sdptr = stddevs;
137 | for(f = 0; f < nfeats; f++){
138 | featptr = sfeatptr;
139 | /* sum_x column of features */
140 | sum_x = 0.0;
141 | sum_x2 = 0.0;
142 | for(v = 0; v < nfeatvctrs; v++){
143 | sum_x += *featptr;
144 | sum_x2 += (*featptr) * (*featptr);
145 | featptr += nfeats;
146 | }
147 | /* compute mean of column features */
148 | *mptr++ = sum_x / nfeatvctrs;
149 | fret = (float)ssx_stddev(sum_x, sum_x2, nfeatvctrs);
150 | if(fret < 0){
151 | free(means);
152 | free(stddevs);
153 | return(-4);
154 | }
155 | *sdptr++ = fret;
156 |
157 | /* bump to next column in feature vector matrix */
158 | sfeatptr++;
159 | }
160 |
161 | *omeans = means;
162 | *ostddevs = stddevs;
163 |
164 | return(0);
165 | }
166 |
--------------------------------------------------------------------------------
/app/src/main/cpp/nfiq/src/s_rules.mak:
--------------------------------------------------------------------------------
1 | # ******************************************************************************
2 | # License:
3 | # This software was developed at the National Institute of Standards and
4 | # Technology (NIST) by employees of the Federal Government in the course
5 | # of their official duties. Pursuant to title 17 Section 105 of the
6 | # United States Code, this software is not subject to copyright protection
7 | # and is in the public domain. NIST assumes no responsibility whatsoever for
8 | # its use by other parties, and makes no guarantees, expressed or implied,
9 | # about its quality, reliability, or any other characteristic.
10 | #
11 | # Disclaimer:
12 | # This software was developed to promote biometric standards and biometric
13 | # technology testing for the Federal Government in accordance with the USA
14 | # PATRIOT Act and the Enhanced Border Security and Visa Entry Reform Act.
15 | # Specific hardware and software products identified in this software were used
16 | # in order to perform the software development. In no case does such
17 | # identification imply recommendation or endorsement by the National Institute
18 | # of Standards and Technology, nor does it imply that the products and equipment
19 | # identified are necessarily the best available for the purpose.
20 | #
21 | # ******************************************************************************
22 | # Project: NIST Fingerprint Software
23 | # SubTree: /NBIS/Main/nfiq/src
24 | # Filename: s_rules.mak
25 | # Integrators: Kenneth Ko
26 | # Organization: NIST/ITL
27 | # Host System: GNU GCC/GMAKE GENERIC (UNIX)
28 | # Date Created: 08/20/2006
29 | #
30 | # ******************************************************************************
31 | #
32 | # This rules file contains the sub-directories variable to build "nfiq".
33 | #
34 | # ******************************************************************************
35 | SUBDIRS := lib bin
36 | #
37 |
--------------------------------------------------------------------------------
/app/src/main/java/com/seamfix/calculatenfiq/NFIQUtil.kt:
--------------------------------------------------------------------------------
1 | package com.seamfix.calculatenfiq
2 |
3 | import android.content.Context
4 | import android.graphics.Bitmap
5 | import android.graphics.BitmapFactory
6 | import android.graphics.ColorMatrix
7 | import android.graphics.ColorMatrixColorFilter
8 | import android.graphics.drawable.BitmapDrawable
9 | import android.graphics.drawable.Drawable
10 | import org.jnbis.api.Jnbis
11 | import java.io.ByteArrayOutputStream
12 |
13 |
14 | /**
15 | * @author Ben Daniel.
16 | * Util class that is used to calculate the NFIQ of a captured fingerprint.
17 | */
18 | class NFIQUtil {
19 |
20 | companion object {
21 |
22 | //Loads the required native libraries.
23 | init {
24 | System.loadLibrary("log")
25 | System.loadLibrary("nativelib")
26 | }
27 |
28 | @JvmStatic
29 | private val nfiqUtil = NFIQUtil()
30 |
31 | /**
32 | * This method calculates the nfiq of a fingerprint.
33 | *
34 | * This method should be called in an async manner since it might take a few seconds to return
35 | *
36 | * @param rawBytes The byte array that contains the captured fingerprint.
37 | * @param imageWidth The width of the captured finger print image.
38 | * @param imageHeight The height of the captured finger print image.
39 | *
40 | * @return the NFIQ for the supplied fingerprint.
41 | */
42 | @JvmStatic
43 | fun calculateNFIQUsingRawBytes(rawBytes: ByteArray, imageWidth: Int, imageHeight: Int): Int {
44 |
45 | return nfiqUtil.calculateNFIQ(rawBytes, imageWidth, imageHeight)
46 |
47 | }
48 |
49 | /**
50 | * This method calculates the nfiq of a fingerprint.
51 | *
52 | * This method should be called in an async manner since it might take a few seconds to return
53 | *
54 | * @param wsqBytes The byte array that contains the captured fingerprint.
55 | * @param context Android context.
56 | * @return the NFIQ for the supplied fingerprint.
57 | */
58 | @JvmStatic
59 | @Deprecated(message = "Deprecated until the an alternative to converting wsq to byte array is found. The current implementation makes use of a class in the java.awt package which is not available on Android.")
60 | fun calculateNFIQUsingWSQ(context: Context, wsqBytes: ByteArray): Int {
61 |
62 | val pngByteArray = Jnbis.wsq()
63 | .decode(wsqBytes.inputStream())
64 | .toPng()
65 | .asByteArray()
66 |
67 | //Convert byte array to bitmap drawable to get dimensions.
68 | val image = BitmapDrawable(context.resources, BitmapFactory.decodeByteArray(pngByteArray, 0, pngByteArray.size))
69 | val width = image.intrinsicWidth
70 | val height = image.intrinsicHeight
71 |
72 | //Convert to grayscale
73 | val grayScaleImage = convertToGrayscale(image) as BitmapDrawable
74 |
75 | //convert grayscale image to byte array to feed to nfiq algorithm
76 | val grayScaleBytes = convertBitmapToByteArray(grayScaleImage.bitmap)
77 |
78 | return nfiqUtil.calculateNFIQ(grayScaleBytes, width, height)
79 |
80 | }
81 |
82 | /**
83 | * This method calculates the nfiq of a fingerprint.
84 | *
85 | * This method should be called in an async manner since it might take a few seconds to return
86 | *
87 | * @param bitmap The bitmap image of the fingerprint.
88 | * @param context Android context.
89 | * @return the NFIQ for the supplied fingerprint.
90 | */
91 | @JvmStatic
92 | fun calculateNFIQUsingBitmap(context: Context, bitmap: Bitmap): Int {
93 |
94 | //Convert bitmap to bitmap drawable to get dimensions.
95 | val image = BitmapDrawable(context.resources, bitmap)
96 | val width = image.intrinsicWidth
97 | val height = image.intrinsicHeight
98 |
99 | //Convert to grayscale
100 | val grayScaleImage = convertToGrayscale(image) as BitmapDrawable
101 |
102 | //convert grayscale image to byte array to feed to nfiq algorithm
103 | val grayScaleBytes = convertBitmapToByteArray(grayScaleImage.bitmap)
104 |
105 | return nfiqUtil.calculateNFIQ(grayScaleBytes, width, height)
106 |
107 | }
108 |
109 | @JvmStatic
110 | private fun convertToGrayscale(drawable: Drawable): Drawable {
111 | val matrix = ColorMatrix()
112 | matrix.setSaturation(0f)
113 |
114 | val filter = ColorMatrixColorFilter(matrix)
115 |
116 | drawable.setColorFilter(filter)
117 |
118 | return drawable
119 | }
120 |
121 | @JvmStatic
122 | private fun convertBitmapToByteArray(bitmap: Bitmap): ByteArray {
123 |
124 | val stream = ByteArrayOutputStream()
125 | bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream)
126 |
127 | return stream.toByteArray()
128 |
129 | }
130 |
131 | }
132 |
133 | private external fun calculateNFIQ(imageData: ByteArray, imageWidth: Int, imageHeight: Int): Int
134 |
135 |
136 | }
--------------------------------------------------------------------------------
/app/src/test/java/com/seamfix/calculatenfiq/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.seamfix.calculatenfiq
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.2.31'
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.1.0'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seamfix/android-nfiq-calc/1198c9fba026bf6186e2ea034034f4ca4b446a1f/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 04 12:04:31 WAT 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------