From metashape-mcp
Orchestrates incremental alignment of road corridor photo batches in Metashape with automatic GPS drift detection, gradient checks, and continuity QA gates.
npx claudepluginhub jenkinsm13/claude-plugins --plugin metashape-mcpThis skill uses the workspace's default tool permissions.
Align large road corridor captures incrementally in batches, with automatic drift detection between every batch. The pipeline stops if alignment diverges from GPS, preventing hours of wasted processing.
Sets up Metashape photogrammetry projects from scratch: imports photos/GPS/EXR masks, configures fisheye/rolling shutter/multi-camera sensors, runs image quality analysis via MCP server. For new captures.
Aligns source microscope images like bottom_part or top_part to full_stack reference using SIFT (same-substrate) or Chamfer+DE (cross-substrate) for van der Waals stack detection.
Geolocates street-level photos to sub-50m GPS coordinates using Netryx open-source engine with CosPlace embeddings, ALIKED/DISK features, and LightGlue matching. Builds local Street View indexes for offline searches.
Share bugs, ideas, or general feedback.
Align large road corridor captures incrementally in batches, with automatic drift detection between every batch. The pipeline stops if alignment diverges from GPS, preventing hours of wasted processing.
metashape-alignment skillset_gpu_config(cpu_enable=True) for alignmentFor each batch of cameras (recommended ~200 per batch):
enable_cameras(labels=batch_labels, enable=True)
match_photos(
generic_preselection=True,
reference_preselection=True,
keep_keypoints=True, # ALWAYS True for incremental
reset_matches=False # True only for very first batch
)
align_cameras(
reset_alignment=False # True only for very first batch
)
save_project()
get_camera_spatial_stats()
Evaluate the error_gradient_per_100m field:
| Gradient | Assessment | Action |
|---|---|---|
| < 0.5 m/100m | PASS | Continue to next batch |
| 0.5 - 2.0 m/100m | WARN | Alert user. Suggest placing GCPs in the drifting region before continuing. |
| > 2.0 m/100m | FAIL | STOP. Report the problem. Do NOT continue alignment. |
check_alignment_continuity(new_camera_labels=batch_labels)
If continuous is False:
After all batches:
get_corridor_drift_report(num_segments=10)
Review the segment-by-segment breakdown. If error increases along the corridor, GCPs should be placed in the high-error region.
compare_alignment_to_dem(camera_height_offset=2.0)
This gives ground-truth vertical drift independent of GPS noise.
generate_virtual_checkpoints(spacing_meters=200.0, camera_height_offset=2.0)
Creates evenly-spaced markers from DEM to measure alignment quality along the corridor. These are check points (for reporting), NOT control points (for optimization).
Only after drift assessment passes. See metashape-alignment skill for the filtering workflow.
After each batch:
├── error_gradient < 0.5 AND continuous → next batch
├── error_gradient 0.5-2.0 → WARN user
│ ├── User says continue → next batch (with note)
│ └── User says stop → place GCPs, re-evaluate
├── error_gradient > 2.0 → STOP
│ └── Recommend: place GCPs, possibly re-align last batch
└── discontinuity detected → STOP
└── Recommend: check camera labels, matching settings
These defaults work for vehicle-mounted cameras with consumer GPS (~3m accuracy):
| Parameter | Default | Description |
|---|---|---|
error_gradient PASS | < 0.5 m/100m | Normal GPS noise |
error_gradient WARN | 0.5 - 2.0 m/100m | Possible drift starting |
error_gradient FAIL | > 2.0 m/100m | Alignment is diverging |
max_position_jump | 5.0 m | Continuity check for position |
max_rotation_jump | 15.0 degrees | Continuity check for rotation |
For RTK GPS (~2cm accuracy), tighten thresholds by 10x.
guided_matching=TrueUser: "Align these 2000 Z9 cameras in batches of 200"
Agent workflow: