<h1id="user-manual-for-fingerprint-image-filtering-and-model-generating-application">User Manual for fingerprint image filtering and model generating application</h1>
<h2id="introduction">Introduction</h2>
<p>This project has been developed as a part of bachelor’s thesis at Brno University of Technology - Faculty of Information Technology. The topic of this thesis was Generating a 3D Fingerprint Model from input fingerprint image.</p>
<p>This application consists of two main parts.The first part of the application uses image filters to enhance fingerprint images. Application also implements a custom filter library, which consists of several filters imported from image processing modules.</p>
<p>The second part uses the processed image to make a 3D model of the fingerprint. The model can then be used to print an accurate representation of human fingerprint using a 3D printer.</p>
<h2id="getting-started">Getting started</h2>
<p>The application has only been tested on Ubuntu gnu/linux machines. It should however be possible to use it in on most linux distributions, WSLs and also virtual machines of most linux distributions.</p>
<p>To start off, you need these to succesfully use the application.</p>
<ul>
<li><p><strong>python</strong> version 3.10 is a requirement might work on earlier python 3 versions:</p>
<p>This will install the application and its components into the Documents directory. It will also install several required python packages, including venv, which is used to create a virtual enviroment.</p>
<oltype="1">
<li><p>Go to a suitable installation folder, for example <strong>Documents</strong>:</p>
<li><p>Now, you are all set to run the application. Examples of how to do this are listedin the section bellow.</p></li>
</ol>
<h1id="filtering-images">Filtering images</h1>
<p>Once all the requirements are installed, the application is ready to use. Fingerprint sample is located in res/examples, its name is Palec_P4.tif.</p>
<ul>
<li><p>You will need to enter the virtual enviroment every time you want to use the application.</p>
<li><p>The application requires <strong>input</strong> and <strong>output filenames</strong> including path from the root project directory, <strong>dpi</strong> and <strong>filter list</strong> as shown bellow.</p>
<li><p>manually list all filter names and their parameters on the <strong>command line</strong>:</p>
<pre><code>python3 src/main.py res/examples/Palec_P4.tif res/examples/Palec_P4_from_cline.png 600 total_variation weight=0.15 median ksize=5</code></pre></li>
<li><p>load them from preset in a JSON <strong>configuration file</strong>, that can be used to tune and modify existing presets, or create new ones:</p>
<h2id="configuration-and-presets">Configuration and presets</h2>
<h1id="section"></h1>
<p>There is an option to input the filter series as a preset from JSON configuration file. Here the presets are stored and are ready to be used whenever needed. You can usehow many filters you need as long as you like the output. It is therefore highly recommended to check the output after every preset change.</p>
<p>Filter used in the example above is listed bellow, along with the general form of configuration file.</p>
<style>
table {
border-collapse: collapse;
width: 100%;
}
th, td {
padding: 8px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background-color: #f2f2f2;
}
.code {
font-family: 'Courier New', monospace;
background-color: #f5f5f5;
padding: 8px;
}
.language-json {
color: #333;
}
</style>
<table>
<thead>
<tr>
<th>
General format
</th>
<th>
Woking example
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<pre><codeclass="language-json">
{
"preset": [
{
"name": "filter_name",
"parameter": value,
"parameter": value
},
{
"name": "filter_name",
"parameter": value
}
],
"preset": [
...
]
...
}
</code></pre>
</td>
<td>
<pre><codeclass="language-json">
{
"git_example": [
{
"name": "denoise_tv_chambolle",
"weight": 0.01,
"iterations": 1
},
{
"name": "median",
"ksize": 3
}
]
}
</code></pre>
</td>
</tr>
</tbody>
</table>
<p>To avoid accidental loss of information caused by modifying presets that have been used to generate stl files, these presets are stored inside a JSON file db.json.</p>
<p>This file serves as a simple database for storing presets, stored presets are modified by adding generated hash of all the filters in that preset. There is also an option to save current command line setting as a preset using -d switch and it’s new name:</p>
<h2id="available-filters-with-parameters">Available filters with parameters</h2>
<h1id="section-1"></h1>
<p>Overview of all implemented filters and their parameters with descriptions is listed below.</p>
<ul>
<li><p>median blur</p>
<ul>
<li>ksize (int) - Kernel size, determines how large of an area the filter processes.</li>
</ul></li>
<li><p>gaussian blur</p>
<ul>
<li>sigma (int) - Gaussian kernel standart deviation, determines the weight of further pixels on the currently processed pixel.</li>
</ul></li>
<li><p>bilateral blur</p>
<ul>
<li>diameter (int) - Diameter of pixel neighborhood used for filtering.</li>
<li>sigmaColor (int) - Determines the weight of pixels of different color.</li>
<li>sigmaSpace (int) - Determines the weight of further pixels.</li>
</ul></li>
<li><p>bilateral_scikit</p>
<ul>
<li>sigmaColor (float) - Determines the weight of pixels of different color.</li>
<li>sigmaSpace (float) - Determines the weight of further pixels.</li>
</ul></li>
<li><p>nlmeans (non-local means)</p>
<ul>
<li>patch_size (int) - Size of patches used for denoising.</li>
<li>patch_distance (int) - Distance in pixels where to search for patches.</li>
<li>h (float) - Cut-off distance, higher means more smoothed image.</li>
</ul></li>
<li><p>total_variation</p>
<ul>
<li>weight (float) - Denoising weight, determines how much the image will be denoised.</li>
</ul></li>
<li><p>block_match</p>
<ul>
<li>sigma (float)- Standart deviation</li>
</ul></li>
<li><p>unsharp mask scikit</p>
<ul>
<li>radius (int) - Radius of the gaussian filter.</li>
<li>amount (float) - Strength of the unsharp mask, determines how much of the mask will be used for filtering.</li>
</ul></li>
<li><p>farid</p></li>
<li><p>meijering</p></li>
<li><p>sato</p></li>
<li><p>hessian</p>
<ul>
<li>sigmas (float) - Standart deviations</li>
</ul></li>
<li><p>invert</p></li>
<li><p>scale_values</p></li>
<li><p>binarize</p>
<ul>
<li>threshold (int) - Value to cut differentiate pixels.</li>
</ul></li>
<li><p>binarize_otsu</p></li>
<li><p>add_margin</p>
<ul>
<li>margin (int) - Number of pixels to add to the sides of the image.</li>
<li>color (int) - Color value of newly added pixels.</li>
</ul></li>
<li><p>erode</p>
<ul>
<li>kernel (numpy matrix) - Shape of the kernel used to erode image.</li>
</ul></li>
<li><p>dilate</p>
<ul>
<li>kernel (numpy matrix)- Shape of the kernel used to dilate image.</li>
<p>It is possible to generate stl model using the <code>--stl</code> switch. This requires more parameters, first of which is the type of generated fingerprint.</p>
<p>If the mode is set to <code>c</code>, the output model will be a curved finger model, with optional parameters following the filename controlling its shape.</p>
<p>First optional parameter is papilar line height <code>height_line</code>, second is thickness of the model <code>height_base</code>, third the rate of curvature along x axis <code>curv_rate_x</code> and the third is the rate of curvature along y axis <code>curv_rate_y</code>.</p>
<ul>
<li><p>General form for curved stl generation:</p>
<p>Using <code>m</code> mode modifies the preexisting finger model to contain fingerprint. First optional parameter is papilar line height <code>height_line</code>, second is the number of iterations <code>iter</code> to make the finger mesh denser. Higher number of itertions results in denser finger mesh and better result. The last three parameters are axis offsets for the finger, <code>finger_x</code>, <code>finger_y</code>, <code>finger_z</code>. These control the location of the finger. They need to be set only if the user wants to move core of the print closer to the center of the finger.</p>