68 lines
3.4 KiB
Markdown
68 lines
3.4 KiB
Markdown
# Calibration guide
|
|
|
|
The menu hand-cursor is the one thing tuned to a specific camera and body. A real Kinect and
|
|
MediaPipe disagree on how far the hand reaches relative to the shoulder, and that reach depends on
|
|
your camera's field of view and where you stand. The guided cursor calibration measures your own
|
|
arm reach and writes per-camera gains, so the cursor covers the whole screen on your setup instead
|
|
of only the author's.
|
|
|
|
The calibration logic lives in `core/calibration/` (`calibration.h` / `calibration.cpp`). The
|
|
native tracker runs it from the **Calibrate cursor** button and the `Kinect10.dll` shim reads the
|
|
result, so you calibrate once in the tracker and the game picks it up.
|
|
|
|
## Run it
|
|
|
|
1. Start capture in the tracker (pick your camera and a 4:3 resolution, click **Start**).
|
|
2. Stand at your normal playing distance with your whole body in frame.
|
|
3. Click **Calibrate cursor** and **raise your right arm up and out toward the top corner of the
|
|
screen** - hand clearly above your shoulder and out to the side - for about two seconds, as the
|
|
status line prompts.
|
|
|
|
The tracker averages the raised-arm hold, derives the arm-reach gains (`derive_arm_gains`), and
|
|
saves them. The status line reports the gains it wrote, or a clear error if it didn't see a
|
|
detected, fully-extended arm, so you can retry.
|
|
|
|
## Where it's saved and who reads it
|
|
|
|
Both programs share one config path so they always agree:
|
|
|
|
- Default: `%LOCALAPPDATA%\VirtualKinect\calibration.cfg`.
|
|
- Override: set `KINECT_SHIM_CONFIG` to a file path, in both the tracker and the shim's
|
|
environment, to use a different location.
|
|
|
|
The shim resolves the arm gains with this precedence:
|
|
|
|
1. `KINECT_SHIM_ARM_GAIN_X` / `KINECT_SHIM_ARM_GAIN_Y` environment variables (if set),
|
|
2. the calibrated values in the config file,
|
|
3. the built-in defaults, `3.2` (X) and `2.6` (Y).
|
|
|
|
So a fresh install with no calibration already works at the default gains; calibrating replaces
|
|
them with values measured on your camera, and the env variables are an escape hatch for manual
|
|
tuning.
|
|
|
|
## When to re-run
|
|
|
|
Re-calibrate when you move the camera, change your playing distance, switch rooms, or whenever the
|
|
cursor doesn't reach a corner or feels over- or under-sensitive. The gains are measured from your
|
|
live pose, so calibrate in the lighting and at the distance you'll actually play in.
|
|
|
|
**Restart DEA after saving a new calibration.** The shim reads the calibration once, at startup,
|
|
so a game that's already running keeps the old gains. After you save a replacement calibration,
|
|
close and relaunch DanceEvolution Arcade for the new gains to take effect (restart the tracker too
|
|
if it wasn't running when you calibrated).
|
|
|
|
## Scale and mirror
|
|
|
|
`core/calibration/` also carries the scale (T-pose shoulder span to player-space metres) and
|
|
mirror-orientation math used to keep your skeleton Kinect-sized and your left/right correct. On the
|
|
native tracker, the mirror is handled at capture (selfie view, matching a real Kinect's mirrored
|
|
depth image) and the shim swaps MediaPipe's L/R labels back so your right hand drives the right-hand
|
|
cursor. If moves still invert after a clean calibration, see
|
|
[docs/troubleshooting.md](troubleshooting.md).
|
|
|
|
## Tips
|
|
|
|
- Calibrate in the lighting you'll play in; poor light degrades the pose the gains are derived from.
|
|
- Keep your whole body in frame and extend the arm fully; a short or cropped reach skews the gains.
|
|
- Centre yourself and face the camera straight on.
|