https://github.com/davidpl1/human_hand_calibration
OpenCV based calibration tool to generate a user-specific human_hand configuration
https://github.com/davidpl1/human_hand_calibration
Last synced: 10 months ago
JSON representation
OpenCV based calibration tool to generate a user-specific human_hand configuration
- Host: GitHub
- URL: https://github.com/davidpl1/human_hand_calibration
- Owner: DavidPL1
- License: other
- Created: 2023-02-05T16:30:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-16T12:28:57.000Z (about 3 years ago)
- Last Synced: 2025-04-10T21:36:05.941Z (about 1 year ago)
- Language: Python
- Size: 11.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hand Calibration
## Setup
We provide scripts for Linux/MacOS (\*.sh) and Windows (\*.bat). Use the ones according to your OS.
1. Set up camera rig and place chessboard
2. Install given conda environment using `conda env create -f environment.yaml`
3. Calibrate the camera using `scripts/calibrate_camera.sh --device --width --height --corner_length `
* camera_index: webcam has index 0, additional cameras have indices 1, 2, ...
* width: width of the calibration chessboard
* height: height of the calibration chessboard
* corner_length: distance between squares of chessboard pattern
Every time the camera setup changes you need to perform the calibration again. If the setup persists, you don't need to calibrate again. The calibration is saved in file `calibration.npy`.
## Execute
1. Place hand on top of camera rig
2. Execute the hand calibration using `scripts/execute.sh --device --calibration ` (alternatively use `--image ` instead of `--device` to load an image file)
* Follow instructions
* Presse Q to quit
## Test
You can also test this tool using script `scripts/show.sh` to view a camera image or script `scripts/test_distance.sh` to test the distance estimation.
## Dev instructions
### Distance Estimation
``` python
from src.camera.distance_estimation import estimate_distance
point_a = ...
point_b = ...
distance = estimate_distance(point_a, point_b)
```
### Grab Image
``` python
from src.camera.grab_image import grab_image
image = grab_image(camera_index)
```