From metashape-mcp
Orchestrates incremental batch alignment of road corridor photos in Metashape with GPS drift detection, continuity checks, and QA gates to prevent divergence.
How this skill is triggered — by the user, by Claude, or both
Slash command
/metashape-mcp:corridor-alignment-pipelineThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
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.
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:
npx claudepluginhub jenkinsm13/claude-plugins --plugin metashape-mcpSets up Metashape photogrammetry projects: import photos from folders/globs, load GPS CSV references, configure fisheye/rolling shutter/multi-camera sensors, import EXR alpha masks, analyze image quality, disable bad frames. For new captures via MCP server.
Registers source microscope images to a full_stack coordinate system using SIFT (same-substrate) or Chamfer+DE (cross-substrate) alignment for van der Waals stack detection.
Detects buildings, cars, ships, solar panels, parking lots, agriculture fields in geospatial imagery using GeoAI models or GroundedSAM text-prompted segmentation. GPU recommended.