This repository provides a Python implementation of the wrist Region of Interest (ROI) extraction algorithm used in our wrist vein verification system.
wrist_roi_extraction.py- Main ROI extraction script.requirements.txt- Python 3.9.2 dependency list.
| Input Image | 1. Padding (80 px) | 2. Otsu Thresholding |
|---|---|---|
![]() |
![]() |
![]() |
| 3. Largest Contour | 4. Convex Hull | 5. Major Defects (P1 & P2) |
|---|---|---|
![]() |
![]() |
![]() |
| 6. Key Vectors & Perpendicular Line | 7. Compute P7 | 8. Compute P8 |
|---|---|---|
![]() |
![]() |
![]() |
| 9. Compute P9 | 10. Cross-Product Direction | 11. Scaled ROI |
|---|---|---|
![]() |
![]() |
![]() |
| 12. Final ROI (64×64) |
|---|
![]() |
Install required Python 3.9.2 packages:
pip install -r .\requirements.txt
Set the captured_img variable in wrist_roi_extraction.py to your test image, then run:
python .\wrist_roi_extraction.py
- Fixed wrist insertion direction
- The algorithm currently assumes the wrist enters from the opening side of the imaging device (‵ㄇ‵-shaped structure). It does not support arbitrary wrist orientations.
- Requires a completely black background
- The algorithm relies on background–foreground separation using Otsu’s thresholding. Complex or non-uniform backgrounds may cause segmentation failure.












