Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ragavsachdeva/CYWS-3D/llms.txt

Use this file to discover all available pages before exploring further.

Before the model can determine what has changed between two images, it must solve a geometric alignment problem: features extracted from image 2 must be mapped into the coordinate frame of image 1 so that corresponding regions in 3D space overlap in feature space. Without this step, any difference in camera position or angle would be indistinguishable from a genuine scene change. CYWS-3D provides three registration strategies — 3d, 2d, and identity — that cover the full spectrum from richly-annotated multi-view captures to simple aligned image pairs.

Strategy Reference

When to use

Use the 3d strategy whenever the two images are captured from different 3D viewpoints — for example, photos taken of the same room or outdoor scene from different positions or angles. This strategy warps features through 3D world coordinates using PyTorch3D point-cloud rendering, which correctly handles perspective changes, occlusions, and scene depth.Three sub-modes are available depending on how much geometric metadata you can supply.

Required inputs

Sub-modedepth_maprotation, position, intrinsics
RGB onlyNot required (predicted)Not required
Depth providedGround truthNot required
Full camera paramsGround truthAll three required
  • depth_map — a per-pixel depth image aligned with the RGB image.
  • rotation — 3×3 camera rotation matrix.
  • position — 3-element camera position vector.
  • intrinsics — 3×3 camera intrinsics matrix (focal lengths, principal point).

How it works

Step 1 — Depth estimation (if needed). When no depth map is provided, ZoeDepth runs on both images to predict monocular depth. When a ground-truth depth map is available, it is used directly.Step 2 — Correspondence extraction (if needed). When camera intrinsics are provided, the rotation and position matrices are used to compute the relative transformation (Rt) between the two cameras directly — no keypoint matching is required. Otherwise, SuperPoint detects up to 1 024 keypoints in each image (after resizing the longest side to 640 px), and SuperGlue matches them using a graph neural network with 20 Sinkhorn iterations. RANSAC (500 iterations, minimum 10 inliers) then filters to a reliable inlier set in 3D world coordinates (points are unprojected using depth before RANSAC). The inliers are passed to estimate_Rt_using_points, which fits a linear 3D warp via least squares.Step 3 — Differentiable feature warping. The DifferentiableFeatureWarper lifts the feature map of image 2 into a 3D point cloud using the depth map and camera parameters, then re-renders it from the viewpoint of image 1 using PyTorch3D’s PerspectiveCameras, PointsRasterizer, and AlphaCompositor. A visibility mask is computed to track which pixels in image 1 have a valid projection from image 2.Step 4 — Feature difference. The aligned feature difference is computed as:
feature_diff = visibility2 × (features_image1 − features_image2_warped)
Multiplying by the visibility mask ensures that pixels where image 2 has no coverage do not contribute a spurious difference signal.

YAML example

# input_metadata.yml — 3D strategy, full camera parameters
- image1: scene_before.jpg
  image2: scene_after.jpg
  registration_strategy: 3d
  depth_map1: depth_before.png
  depth_map2: depth_after.png
  rotation1: [[1,0,0],[0,1,0],[0,0,1]]
  position1: [0.0, 0.0, 0.0]
  rotation2: [[0.9998,-0.0175,0.0],[0.0175,0.9998,0.0],[0.0,0.0,1.0]]
  position2: [0.5, 0.0, 0.0]
  intrinsics: [[525.0,0,319.5],[0,525.0,239.5],[0,0,1]]
# input_metadata.yml — 3D strategy, depth only (correspondences estimated)
- image1: scene_before.jpg
  image2: scene_after.jpg
  registration_strategy: 3d
  depth_map1: depth_before.png
  depth_map2: depth_after.png
# input_metadata.yml — 3D strategy, RGB only (depth + correspondences estimated)
- image1: scene_before.jpg
  image2: scene_after.jpg
  registration_strategy: 3d

Batch Mixing

A single batch submitted to CYWS-3D can contain items that use different registration strategies. For example, one sample in the batch may use 3d with full camera parameters while another uses identity. The FeatureRegistrationModule dispatches each sample to the appropriate sub-module based on the registration_strategy field in its metadata, then collects and concatenates the results before passing them to the encoder-decoder. This means you do not need to split your dataset by strategy or run separate inference passes.

SuperGlue Weights

The CorrespondenceExtractor supports two sets of SuperGlue pretrained weights:
  • indoor (default) — trained on indoor scenes; recommended for indoor environments and general use.
  • outdoor — trained on outdoor scenes; may perform better on images captured outside.
CorrespondenceExtractor(superglue="outdoor")
The weight set is selected at construction time and applies to both the 3d and 2d strategies wherever correspondence estimation is triggered.

Build docs developers (and LLMs) love