← Back to Home

# Wand Calibration User Guide

This guide walks you through the camera calibration process using a calibration wand in OpenLPT. The process consists of two main stages: Point Detection and Calibration.

Note on Refracted Interfaces:

The implemented calibration model assumes a homogeneous medium without refractive interfaces. For experimental setups involving observation windows (e.g., glass or acrylic), it is critical that the cameras are oriented as close to the surface normal (perpendicular) as possible. Furthermore, it is assumed that the paraxial approximation is valid within the reconstructed volume (i.e., small-angle observation) to maintain geometric accuracy.

Hardware Setup Recommendation:

Non-coplanar Views: It is highly recommended that the viewing axes of your cameras are NOT in the same plane. Non-coplanar views significantly improve the speed and reliability of Stereo Matching and particle reconstruction.

If your cameras must be arranged in a single plane, try to adjust their angles slightly so they have an angular difference of at least 5 degrees relative to the plane.

## 1. Point Detection

First, select the Wand Calibration tab and ensure you are on the Point Detection sub-tab.

### Step 1: Configure Settings

Set the detection parameters in the Detection Settings panel on the right:

- Num Cameras: Enter the number of cameras in your setup (e.g., `2`). (Minimum required: 2)
- Wand Type: Choose Dark on Bright (dark balls on a bright background) or Bright on Dark.
- Radius Range: Adjust the slider to cover the expected radius (in pixels) of the wand balls in your images (e.g., `45` to `120`).
- Sensitivity: Set the detection sensitivity (default is around `0.85`).

### Step 2: Load Camera Images

In the Camera Images table:

1. For each Cam ID, load the corresponding folder of calibration images (click the cell or a load button if available).
2. Enter the initial Focal Length (px) (e.g., `9000`).
3. Enter the detection Width and Height (e.g., `1280` x `800`).

### Step 3: Verify and Process

1. Select a frame from the Frame List.
2. Click Test Detect (Current Frame).
   - Verification: Look at the image view on the left. You should see green circles identifying the two balls on the wand. If not, adjust the Radius Range or Sensitivity.
3. Once satisfied with the detection test, click Process All Frames / Resume to detect points in all loaded images.

## 2. Calibration

After extracting points, switch to the Calibration sub-tab.

### Step 4: Calibration Settings

Configure the physical model in Calibration Settings:

- Camera Model: Select Pinhole (standard).
- Wand Length: Enter the exact physical distance between the centers of the two wand balls (e.g., `10.00 mm`). Accurate measurement is critical.
- Dist Coeffs: Number of distortion coefficients to optimize (typically `0` for initial testing, or higher for complex lenses).

### Step 5: Precalibration & Data Cleaning

Before running the full optimization, it is crucial to clean your data to remove outliers (errors in detection).

1. Click the orange Precalibrate to Check button.
2. The system will perform a fast, global optimization to estimate the error of each frame.
3. Check the Error Analysis table usage below:
   - High Reprojection Errors (red) indicate bad detections.
   - High Length Errors indicate points that don't match the physical wand length.
4. Visual Verification:
   - Click on any cell in the table (e.g., a high error value).
   - Look at the Left View: It will show the original camera image overlaid with the detected points (green circles).
   - Check if the detection is correct. If the system detected a reflection or noise instead of a wand, click the checkbox in the Del column to mark it for removal.
5. Iterative Cleaning:
   - Use the filter buttons (e.g., "Delete when proj error > X") or manual Del checkboxes to exclude bad frames.
   - Click Precalibrate to Check AGAIN.
   - Repeat until errors are low (e.g., < 1.0 px).

### Step 6: Run Full Calibration

1. Click the blue Run Calibration button.
2. The system will perform the final Bundle Adjustment (BA) with 4-stage optimization (Geometry Init -> Intrinsics -> Triangulation -> Final Tune).
3. The 3D View on the left will visualize the optimized camera positions and wand points.

### Step 7: Final Analysis

Review the final results in the Error Analysis table:

- Reprojection Error: Should be very low (e.g., < 0.5 px).
- Length Error: Should be close to 0.

Stopping & Refining:

- If the process takes too long or results look wrong, click the Stop button to get partial results.
- If errors are still high, perform another round of cleaning (Step 5) or adjust the Wand Length setting.

### Step 8: Save Results

When the "Calibration Successful" message appears, your parameters are ready. You can save the intrinsic and extrinsic parameters to file for use in tracking.