# Palmvein Recognition SDK - Server

{% hint style="info" %}
We provide customers with the Palmvein Recognition SDK for both Windows and Linux.
{% endhint %}

## Features

* [x] Hand Landmark Extraction
* [x] Hand Detection
* [x] Palmvein ROI extraction(alignment)
* [x] Palmvein Feature Extraction
* [x] Palmvein Feature Comparison, Matching
* [x] Gradio Demo For Checking API

## License

We offer `lifetime license(perpetual license)` based on `machine ID` for every server(`Windows`, `Linux`). The license is available for `one-time payment`. In other words, once you purchase license from me, you can use our `SDK` permanently.

To request a license, please contact us:

> **Email:** <contact@kby-ai.com>&#x20;

{% embed url="<https://wa.me/+19092802609>" %}

{% embed url="<https://t.me/kbyaisupport>" %}

{% embed url="<https://discord.gg/6wm383re2s>" %}

{% embed url="<https://teams.live.com/l/invite/FAAYGB1-IlXkuQM3AQ>" %}

## System Requirements

### 1. Linux

* **CPU:** 2 cores or more (Recommended: 2 cores)
* **RAM:** 4 GB or more (Recommended: 8 GB)
* HDD: 4 GB or more (Recommended: 8 GB)
* **OS:** Windows 7 or later
* **Architecture:** x64

### 2. Windows

* **CPU:** 2 cores or more (Recommended: 2 cores)
* **RAM:** 4 GB or more (Recommended: 8 GB)
* HDD: 4 GB or more (Recommended: 8 GB)
* **OS:** Ubuntu 20.04 or later
* **Architecture:** x64

## Initializing SDK

* Obtain `macihne code` to activate and request license.

```python
# Python code example
machineCode = getMachineCode()
print("\nmachineCode: ", machineCode.decode('utf-8'))
```

* Activate `SDK` using licnese key

```python
# Python code example
ret = setActivation(license.encode('utf-8'))
print("\nactivation: ", ret)
```

* Once `ret` value is zero, `SDK` can get work started.

## APIs

`ROI` Extraction The `SDK` provides a single API for detecting hands and extracting `ROI` from the whole hand image(`palmvein`).\
The function can be used as follows:

```python
# Python code example
roi, label = get_roi_image(cv2.flip(image, 1))
```

Next, Create Feature `getFeature` function returns palmvein feature against `ROI` data.

```python
# Python code example
cnt = getFeature(roi_byte, len(roi_byte), feature_array)
```

### 1. ROI Extraction

`ROI` Extraction The `SDK` provides a single API for detecting hands and extracting `ROI` from the whole hand image(`palmvein`).\
The function can be used as follows.

```python
# Python code example
roi, label = get_roi_image(cv2.flip(image, 1))
```

* `image`: input image
* `label`: `Left` hand or `Right` one
* `roi`: hand `ROI(Region Of Interest)` image to get palm feature.

### 2. Feature Extraction

Create Feature `getFeature` function returns palmvein feature against `ROI` data.&#x20;

The function can be used as follows:

```python
# Python code example
cnt = getFeature(roi_byte, len(roi_byte), feature_array)
```

* `roi_byte`: `ROI` image in byte format (image should be converted to byte format by function `mat_to_byets()`).
* `feature_array`: palmvein feature extracted from hand `ROI` data.

### 3. Similarity Evaluation

The `getScore()` function takes two palmvein `feature`s as arguments and returns `score` value to determine whether 2 input hands are from the same or different.

```python
# Python code example
score = getScore(feature_array1, cnt1, feature_array2, cnt2)
```
