Image Registration Diagnostics
Purpose
Image Registration Diagnostics extracts and matches robust image features (corners, edges, keypoints) across multiple images to facilitate registration, tie-point generation, and multi-temporal alignment without explicit ground control.
Typical Questions This Tool Helps Answer
- Is this image pair geometrically aligned well enough to support meaningful change analysis without ground control points?
- Where are spatial registration errors largest, and which areas should be excluded or flagged for downstream interpretation?
- Can adequate tie-point coverage be achieved automatically, or does the image geometry require manual GCP support?
Background
Background sections in this workflow family should make explicit how signal change can be confounded by acquisition geometry, atmosphere, calibration drift, and georegistration error. A reliable interpretation pipeline therefore separates physical signal change from acquisition artifacts through normalization, alignment, and uncertainty-aware thresholds.
Operationally, users should treat these tools as evidence-weighting systems rather than single-threshold detectors. The most robust workflows combine pre-processing diagnostics, method-specific quality indicators, and post-run plausibility checks before decisions are escalated.
Feature-oriented registration relies on stable keypoints, robust correspondence filtering, and outlier rejection (for example RANSAC) to estimate transforms. Registration confidence should be interpreted with both residual statistics and spatial distribution of tie points.
Methodological Considerations
- Ensure geometric alignment is within the tolerance required by the downstream metric (pixel-level for many raster differences, sub-pixel for interferometric phase workflows).
- Separate radiometric normalization from change inference so threshold choices reflect physical behavior rather than acquisition artifacts.
- Prefer multi-run sensitivity checks on normalization and detection thresholds when decisions depend on marginal signal differences.
Practical Interpretation Pitfalls
Common failure modes include treating sensor noise as change signal, over-trusting single-date anomalies, and ignoring confidence/context layers when operational prioritization is made.
Inputs
| Argument | Type | Required | Geometry / Type Constraints | Description |
|---|---|---|---|---|
| mode | String | No | Must be set or pair. Default is set. | Chooses directory-based pair planning or one explicit pair. |
| images_dir | Directory path | Conditional | Required when mode=set. Must exist and contain supported image types: jpg, jpeg, tif, tiff, png. | Directory used for set-mode candidate planning. |
| left_image | Image path | Conditional | Required when mode=pair. File must exist. | Left image in pair mode. |
| right_image | Image path | Conditional | Required when mode=pair. File must exist. | Right image in pair mode. |
Parameters
| Argument | Type | Required | Default | Description |
|---|---|---|---|---|
| max_pairs | Integer | No | 24 | Maximum number of ranked pairs kept in set mode. Must be greater than 0. |
| max_features_per_image | Integer | No | 500 | Maximum keypoints extracted per image. Must be in [50, 5000]. |
| ratio_test | Float | No | 0.80 | Descriptor ratio-test threshold in [0.5, 0.99). |
| min_matches | Integer | No | 24 | Minimum accepted match count per pair. This is the main QA gate. |
| min_match_count | Integer | No | 24 | Pair-level QC threshold for minimum accepted match count. Must be at least 1. |
| min_inlier_ratio | Float | No | 0.18 | Pair-level QC threshold for minimum accepted inlier proxy ratio. Must be in [0, 1]. |
| qc_policy | String | No | balanced | QC policy preset. Must be one of strict, balanced, permissive. |
| output_prefix | String | No | registration_workflow | Prefix used to derive all output files. |
| emit_pair_match_viz | Boolean | No | false | Enables side-by-side PNG visualizations with tie-point lines. |
| max_pair_visualizations | Integer | No | 8 | Maximum visualization PNGs to write. Must be in [1, 200]. |
| max_lines_per_pair | Integer | No | 150 | Maximum tie-point lines drawn per PNG. Must be in [1, 5000]. |
| viz_scale | Float | No | 0.5 | Visualization downscale factor in [0.05, 1.0]. |
The runtime also accepts output as an alias for output_prefix.
Outputs
Output artifact keys below are runtime outputs, not input parameters.
| Artifact | Runtime Output Key | Type | What It Contains |
|---|---|---|---|
Pair diagnostics (${prefix}_pair_diagnostics.json) | pair_diagnostics | JSON | Pair-by-pair diagnostics including image names, candidate score, keypoint counts, matches, inlier proxy, mean confidence, fallback flag, and attempt trace. |
Match summary (${prefix}_match_summary.json) | match_summary | JSON | Run summary with status, pair counts, match totals, fallback counts, fallback policy, visualization settings, and output paths. |
Summary alias (${prefix}_match_summary.json) | summary | JSON | Alias key to the same JSON file as match_summary. |
Tie points (${prefix}_tie_points.csv) | tie_points | CSV | Header is exactly pair_id,left_x,left_y,right_x,right_y,confidence. |
Pair QC table (${prefix}_pair_qc_table.csv) | pair_qc_table | CSV | Header is exactly pair_id,left_image,right_image,matches,inlier_proxy,qc_status,fallback_recommended,reason_codes. One row per successful pair with reason codes such as LOW_MATCH_COUNT and LOW_INLIER_RATIO. |
QC summary (${prefix}_qc_summary.json) | qc_summary | JSON | Pair-level QC counts/fractions by policy and thresholds. |
Pair visualization directory (${prefix}_pair_match_viz/) | pair_match_viz_dir | Directory of PNGs | Optional visualization directory, written only when emit_pair_match_viz=true. |
Optional report (${prefix}_report.html) | html_report | HTML | HTML rendering of the match summary. |
Important summary fields
| Key | Meaning |
|---|---|
status | pass, review, or fail. |
pair_count | Number of successful pairs included in the run. |
total_matches | Total tie-point matches across successful pairs. |
mean_inlier_proxy | Mean match quality proxy across successful pairs. |
low_quality_pairs | Number of successful pairs that still fell below min_matches. |
pairs_requiring_fallback | Number of pairs that needed fallback strategy selection. |
failed_pair_count | Number of pair computations that failed outright. |
qc | Pair-level QC object with policy, thresholds, counts, and fractions. |
fallback_policy | Thresholds and deltas used by the fallback logic. |
visualization | Visualization settings and output counts. |
outputs | Paths to diagnostics, summary, tie points, pair QC artifacts, and optional visualization directory. |
Returned payload keys
The workflow returns these output keys:
pair_diagnosticsmatch_summarysummary(same file asmatch_summary)tie_pointspair_qc_tableqc_summaryhtml_reportpair_match_viz_dirwhen visualization is enabled
Example
import whitebox_workflows as wbw
env = wbw.WbEnvironment()
env.registration_oriented_feature_workflow(
mode="pair",
left_image="frame_001.jpg",
right_image="frame_002.jpg",
max_features_per_image=750,
ratio_test=0.80,
min_matches=24,
emit_pair_match_viz=True,
max_pair_visualizations=4,
max_lines_per_pair=120,
viz_scale=0.5,
output_prefix="registration_pair_a",
)
-
Which image pairings in this stack provide robust tie-point support for stable geometric registration?
-
Which image pairs have too few matches or low inlier quality, and do those fall below the minimum match threshold requiring fallback strategies or manual intervention?
-
Are registration residuals and inlier ratios within acceptable thresholds for reliable change analysis?
-
Lowe, D. G. (2004). Distinctive image features from scale-invariant keypoints. IJCV.
-
Bay, H., Tuytelaars, T., & Van Gool, L. (2006). "SURF: Speeded Up Robust Features." ECCV, 404-417.
Parameter Interaction Notes
min_matchesis the strongest QA threshold. It affects fallback acceptance and the finalstatus.min_match_countandmin_inlier_ratiodefine pair-level QC gate criteria and drivepair_qc_table.csvandqc_summary.jsonstatus counts.qc_policyscales pair-level QC thresholds (stricttightens,permissiverelaxes) and should be recorded with each production run.ratio_testandmax_features_per_imageinteract: one changes descriptor strictness and the other changes feature yield.- In set mode,
max_pairslimits the ranked output list, not necessarily the number of candidate combinations considered internally. - Visualization parameters only change the optional PNG outputs, not the actual scoring.
QA and Acceptance Criteria
- Verify mode-specific required arguments are correct.
- Verify the example uses actual runtime argument names.
- Verify the tie-point CSV header exactly matches the documented schema.
- Verify both JSON outputs contain the documented fields.
- Verify the returned payload contains the documented keys.
- If visualization is enabled, verify the directory and PNG count match the summary.
The workflow fails if the mode is invalid, if required mode-specific paths are missing, if image files do not exist, if numeric limits are out of range, if min_match_count < 1, if min_inlier_ratio is outside [0, 1], if qc_policy is not one of strict, balanced, permissive, or if output_prefix / output is provided as an empty string.
Advanced Operational Guidance
- Use pair mode for deterministic review of a known image pair.
- Use set mode when the workflow needs to nominate promising pairs from a larger image collection.
- Review
pair_failuresbefore dismissing a dataset; some failures are decode or image-quality issues rather than geometric incompatibility. - For cross-modal imagery, inspect
attempt_traceandstrategy_usedto see whether preprocessing fallback was necessary.
Implementation Patterns
- Pair QA run: one explicit pair, no visualization, for automated diagnostics.
- Pair review run: same pair with visualization enabled for human inspection.
- Set planning run: directory-based candidate ranking before downstream registration.
- Threshold tuning run: vary
min_matches,ratio_test, andmax_features_per_imageon the same imagery.
Related Tools
sar_coregistrationsar_analysis_readinessguided_uav_image_intake_workflow
When To Use This Workflow
Use this workflow when you need evidence about registration readiness rather than a finished registered image. It is especially useful when teams must justify which pairs are good enough for downstream alignment and which ones require manual review.
What this workflow helps you do:
- Rank and screen candidate image pairs.
- Inspect fallback behavior rather than hiding it.
- Hand off tie points and QA evidence to downstream registration steps.
Results Delivery Checklist
- Deliver
pair_diagnostics.json,match_summary.json, andtie_points.csvtogether. - State clearly whether the run used
mode=pairormode=set. - Record the final
min_matches,min_match_count,min_inlier_ratio,qc_policy,ratio_test, andmax_features_per_imagevalues. - If visualization was enabled, include the visualization directory and note the scaling settings.
- Review
status,low_quality_pairs, andpairs_requiring_fallbackbefore approving downstream registration.
Common Questions
Q: Why can a run have many matches and still end up as review?
A: Because review is triggered when match count alone is not enough. Low mean_inlier_proxy or pairs below min_matches can still keep the run out of pass.
Q: What is the main misinterpretation risk with tie_points.csv?
A: Treating it as a final registration model. It only contains tie points, not a solved transformation or warped image.
Q: Which settings matter most for scenario sensitivity?
A: min_matches, ratio_test, and max_features_per_image because they determine whether fallback is needed and whether pairs stay above the QA gate.
Q: When should teams enable the optional visualizations?
A: Enable them when a pair is borderline, cross-modal, or heading to manual review. They are evidence outputs for people, not part of the scoring itself.