Releases¶
This page records pyTheia releases. It no longer mirrors the historical TheiaSfM upstream changelog; older version notes referred to upstream tarballs and features that this fork no longer ships.
1.4.2 (2026-11-27)¶
Initialization-free SfM (experimental), including the depth-augmented OSE with monocular depth priors, and C++ readers for COLMAP and OpenMVG reconstructions.
Features¶
- Initialization-free SfM (experimental).
ReconstructionEstimatorType.INIT_FREE(InitFreeReconstructionEstimator, options inReconstructionEstimatorOptions.init_free_options) estimates cameras and points jointly from random starts, without rotation averaging, position estimation or incremental registration. Formulations: pOSE, pOSE with rotation terms (POSE_ROT), rOSE, RpOSE and expOSE, solved by variable projection with dense or sparse Cholesky, power series or optional CUDA solvers (-DTHEIA_WITH_CUDA_SOLVERS=ON). Options include a Cauchy robust loss (IRLS), two-view rotation weighting, projective refinement with an optional Huber loss, and a metric upgrade by self-calibration for calibrated rays, per-camera or shared focal lengths, and radial cameras. Each restart is checked (fraction in front, orthogonality error, conditioning) before one is accepted. New examples:pyexamples/sfm/init_free_synthetic.py(synthetic data, no download) andpyexamples/eth3d/init_free_sfm.py. See Initialization-free SfM.
For real tracks, which contain wrongly merged observations, the projective refinement offers a choice of loss (loss_function_type, e.g. Cauchy) and an outlier rejection (outlier_rejection_rounds, outlier_threshold); tracks with rejected observations are left out of the metric bundle adjustment. The metric upgrade also estimates the dual quadric in a point-normalized frame and keeps the better candidate, drops single cameras that collapsed during refinement (max_camera_orthogonality_error, max_fraction_dropped_cameras) and estimates the upgrade again without them, and checks the relative rotations of the upgraded cameras against the view graph (max_relative_rotation_error_deg, POSE_ROT). The projective refinement solves with one thread by default (deterministic), so that results do not change between runs. On real SIFT matches of the 13 ETH3D training scenes the estimator now succeeds on 12 (before: 6), with errors close to the global pipeline.
-
Depth-augmented OSE (DOSE, experimental).
OseFormulationType.DOSEin the initialization-free estimator adds a monocular depth prior per observation to the OSE objective (InitFree-SfM, arXiv:2611.31516). It optimizes Euclidean cameras[R | t]with a three-stage weight continuation and a Huber loss, and needs calibrated rays, a view graph andFeaturedepth priors. It runs no projective refinement and no metric upgrade. Exposed in Python (OseFormulationType.DOSE,InitFreeCameraInitType.EUCLIDEAN_RANDOM,InitFreeOptions.dose_*,OseProblem.observation_depths). A joint metric refinement with per-image depth scales (RefineDoseReconstruction,DoseRefinementOptions) runs on every restart that passes a check before it (dose_check_before_refinement), using the reprojection error as image residual and a log-ratio depth residual instead of the paper's (the paper's metric pairwise translation and log-scale terms and depth-consistent pair filtering are not implemented). On 13 ETH3D training scenes DOSE with refinement gives a result on 10, including playground, on which the pOSE+rot estimator fails. See Initialization-free SfM. -
C++ readers for COLMAP and OpenMVG reconstructions (
theia::ReadColmapFiles,theia::ReadOpenMVGSfMData, Pythonpt.io.ReadColmapFiles,pt.io.ReadOpenMVGSfMData). The COLMAP model reader (text and binary, all twelve COLMAP camera models, the same folder search andpixel_offset) is the counterpart ofWriteColmapFiles; the OpenMVG reader parsessfm_data.jsonwith the bundled nlohmann/json. Both return(success, reconstruction, messages), whereImportMessagesholds the error, afile_not_foundflag and the warnings.pytheia.importers.read_colmap_modelandread_openmvg_sfm_datakeep their signatures and behavior and now wrap the C++ readers.read_colmap_databasestays in Python, so the C++ library does not depend on SQLite. See Importers.
1.4.1 (2026-11-11)¶
Global pose estimation (ART positions, MORE rotation refinement, rig-aware global SfM), faster and more accurate bundle adjustment and RANSAC, and many fixes. Also contains the changes listed under 1.4.0, which was not tagged separately.
Compatibility¶
.reconfiles written by 1.4.x cannot be read by 1.3.x or older. Two serialized classes gained fields:CameraIntrinsicsPrioris version 5 (radial_distortion_6andthin_prism_distortion, for the COLMAP camera models) andTrackis version 2 (the 3D point prior). An older reader treats the new versions like the old ones, reads too few fields and fails further on, usually withCannot load a polymorphic type that is not default constructable and does not have a load_and_construct functionorFailed to read ... bytes from input stream.Trackversion 2 came after the untagged 1.4.0 release commit, so that commit cannot read files from 1.4.1 either; use 1.4.1 or later for every reader. Files written by 1.3.x still load in 1.4.x. Upgrade every reader (for example worker images) before you write reconstructions with 1.4.x.
Features¶
-
GlobalPositionEstimatorType.ART(ARTPositionEstimator,ReconstructionEstimatorOptions.art_position_estimator_options): Analytical Rotation-guided Translation, a track-based global position estimator from Li, Cai and Wu (arXiv:2611.11770). Closed-form triplet translations (LiGT-based, Theorem 1) are registered by one sparse weighted least-squares solve with per-triplet scales and Huber IRLS. Views that the triplets cannot attach are kept with rigid-component merging, bridging triplets and LiGT track constraints (num_coverage_rounds,min_bridge_tracks), and each triplet's observation filter has a robust start (num_robust_samples); see ART view coverage. The LiGT constraint construction moved into a sharedligt_constraintshelper. -
Rotation refinement with MORE (
ReconstructionEstimatorOptions.refine_rotations_with_rotation_only_error,rotation_only_refiner_options,pt.sfm.RefineRotationsWithRotationOnlyError): rotation-only reprojection refinement after rotation filtering, from Li, Cai and Wu (arXiv:2611.11770). Translations are eliminated analytically with the ART Theorem 1 solution. The optimizer schedule, tuple gating and IRLS weights are pyTheia choices. Observations are verified epipolarly against the initial rotations first (RotationOnlyRefinerOptions.verify_observations_px, default 4 px), so unverified mismatches do not enter the analytic translations. -
Monocular-depth relative pose: optional depth term in the local optimization (
EstimateMonoDepthRelativePose(..., depth_reprojection_weight=0.0),EstimateTwoViewInfoOptions.monodepth_reprojection_weight, C++RefineMonoDepthRelativePose(..., reprojection_weight)). Before, the local optimization of the calibrated three-point estimator always weighted the reprojection error of the depth-lifted points equally with the Sampson error, so the errors of the predicted depths biased the pose. The default is now a Sampson-only refinement, after which scale and depth shifts are fitted to the depths of the inliers triangulated with the refined pose (robust linear fit). Without this fit, the shifts kept their noisy minimal-sample values and the scale was off by up to 40% in tests. With MoGe-3 depth on ETH3D image pairs, the AUC\@5° of the three-point estimator rose from 67.6 to 78.6 (SIFT) and from 61.2 to 72.9 (DISK+LightGlue), above the five-point estimator, together with the LO-RANSAC changes under Changed defaults. A positive weight restores the joint refinement of pose, scale and shifts and only pays off for depths that are accurate relative to the image noise. The uncalibrated variants are unchanged. -
Analytic Jacobians for bundle adjustment (
BundleAdjustmentOptions.analytic_jacobians, defaultTrue). Hand-derived Jacobians replace Ceres autodiff for the reprojection residual ofPINHOLE,PINHOLE_RADIAL_TANGENTIAL,FISHEYE,DOUBLE_SPHERE,EXTENDED_UNIFIED,FOV,DIVISION_UNDISTORTION,FULL_OPENCV,RADIAL_FISHEYE,THIN_PRISM_FISHEYEandRAD_TAN_THIN_PRISM_FISHEYE, for both the XYZ and the inverse-depth parametrization and inBundleAdjustTwoViews. They agree with autodiff to about 1e-8 relative and make the Jacobian phase about 3x faster (solve time 1.2-4x lower on small and medium problems, more with inverse depth, tending to 1.1x on large problems where the linear solve dominates).ORTHOGRAPHICandSim3residuals stay on autodiff; setanalytic_jacobians = Falseto use autodiff everywhere. SuiteSparse (GPL) is intentionally not used. See Bundle adjustment. -
3D point priors (ground control points, LiDAR or other known points). A
Trackcan carry a prior position and a sqrt information (Track.SetPositionPrior) or a covariance (Track.SetPositionPriorCovariance, returnsFalseif it is not positive definite), with accessorsHasPositionPrior,PositionPrior,PositionPriorSqrtInformationandRemovePositionPrior. WithBundleAdjustmentOptions.use_point_priors = Trueeach optimized track with a prior adds the residualsqrt_information * (X - prior);robust_loss_width_point_prior(default 0, no robust loss) optionally makes it robust. Tracks held constant get no prior, and the inverse-depth parametrization does not support point priors (they are ignored with a warning). Tracks are serialized as version 2 of theTrackarchive; existing.reconfiles still load (without priors). See Bundle adjustment. -
View graph consistency filters (opt-in, both default
0= off):ReconstructionEstimatorOptions.view_graph_min_relative_inliers(drop edges with fewer verified matches than this fraction of the strongest edge of either endpoint view; alsopytheia.sfm.FilterViewGraphByRelativeInliers) andview_graph_max_cycle_rotation_error_degrees(triplet rotation-loop filter, asFilterViewGraphCyclesByRotation). Applied by the global, hybrid and incremental estimators before estimation. In our DISK+LightGlue (8192 keypoints) benchmark, both together removed the single-scene failures (mean-of-means over 13 scenes for nonlinear global SfM dropped from 159 to 0.04 and for incremental SfM from 0.41 to 0.05, with similar medians); on SIFT the relative-inlier filter lost registered views, so enable it for dense or learned-feature matches only. After filtering, the estimators also prune the tracks to the remaining edges (an observation is kept only if its view still has an edge to another view of the track; also available aspytheia.sfm.PruneTracksToViewGraph). This is only a partial safeguard: a wrong edge may already have merged two true tracks, which cannot be undone afterwards. For the full effect, filter the view graph (FilterViewGraphByRelativeInliers,FilterViewGraphCyclesByRotation) BEFORE building the tracks and only add the correspondences of the surviving edges to theTrackBuilder. -
Rig-aware global SfM (fixed sensor extrinsics). (1) The global position estimators
LEAST_UNSQUARED_DEVIATION,LIGT,GLOMAPandNONLINEARaccept per-view rig offset constraints (PositionEstimator::SetRigConstraints,RigOffsetConstraint), which make the position problem metric;GlobalRigReconstructoruses them by default (use_rig_constraints_in_position_estimation = True,GlomapPositionEstimatorOptions/NonlinearPositionEstimatorOptions::rig_constraint_weight).LINEAR_TRIPLETignores them. (2) New rig-constrained bundle adjustmentBundleAdjustRigReconstruction: one pose per capture, constant sensor extrinsics, analytic or autodiff Jacobians, position / orientation / gravity / depth priors on rig views; used byGlobalRigReconstructorandIncrementalRigReconstructor(use_rig_constrained_ba = True).PropagateCameraPosesForCapture(..., update_view_estimated=True)can now leave the estimated flags untouched. (3)EstimateMetricEdgeScales(GlobalRigReconstructorOptions.use_rig_edge_scales, defaultTrue) fillsTwoViewInfo.scale_estimateof same-sensor view-graph edges from stereo triangulation with the known baseline; it is needed on near-collinear forward motion, where translation directions do not fix the spacing of the captures (LUD, GLOMAP and NONLINEAR failed with 8-112 m on KITTI 04 without it). GLOMAP initializes its positions from these scales whenuse_pairwise_scale_priorsis on, and LUD uses the view graph path when rig constraints are on.IncrementalRigReconstructorgetsbundle_adjust_every_n_captures(default 5) andnum_seed_candidates(default 20). (4) The capture view graph prefers same-sensor view edges, because a unit-norm two-view translation cannot be combined consistently with a metric sensor offset for cross-sensor pairs; the slow and on forward motion unreliable metric 5+1 RANSAC edges are skipped when rig constraints are on. On KITTI odometry sequence 04 (stereo, shared SIFT matches), the global pipelines with LUD, LiGT, GLOMAP and NONLINEAR positions go from 8-112 m (rig, no constraints or no scales) to a Sim(3) ATE of 0.13 m and a metric scale (0.98), on par with COLMAP with a rig (0.16 m); see Rigs.
Changed defaults¶
-
LO-RANSAC reworked (
RansacParameters.use_lo, all RANSAC variants). Before, the refined model replaced the best model without being rescored, the termination criterion used the inlier ratio of the unrefined model, the final refinement ran once on the inliers of the unrefined model, and local optimization started only at iteration 50 (lo_start_iterations), which on clean data often meant never before termination. Now each local optimization refines the model on its inliers, rescores it on all data, re-selects the inliers and repeats while the truncated (MSAC) cost decreases (newRansacParameters.lo_max_refinements, default 5). A refined model is accepted only if it lowers the MSAC cost, as in PoseLib; accepting by inlier count rejected more accurate models that lost a single inlier at the threshold. The refined inlier ratio drives the termination criterion, the final model gets the same local optimization, andRansacSummary.inliersare the inliers of the returned model.lo_start_iterationsnow defaults to 10 (was 50), as doesReconstructionEstimatorOptions.ransac_lo_start_iterations. On ETH3D image pairs (2 px threshold), the AUC\@5° of the five-point estimator rose from 77.0 to 77.7 (SIFT) and from 65.2 to 70.7 (DISK+LightGlue). In the PnP localization the median position error of P3P with LO went from 0.39 to 0.24 cm with DISK+LightGlue and stayed at 0.19 cm with SIFT. See RANSAC — local optimization. -
EstimateTwoViewInfoOptionsnow follows COLMAP's two-view geometry defaults:max_sampson_error_pixels = 4,expected_ransac_confidence = 0.999,min_ransac_iterations = 100,max_ransac_iterations = 10000, newmin_inlier_ratio = 0.25, anduse_lo = True(was off). The Sampson threshold is no longer rescaled with the image size (it used to be defined for a 1024 pixel wide image and scaled bymax(w, h) / 1024); setscale_threshold_with_resolution = Truefor the old behavior.ReconstructionEstimatorOptions.ransac_min_iterations / ransac_max_iterationsare now 100 / 10000.
Fixes¶
LIGTfailed on ETH3Dkicker(8 of 31 views, or none, depending on the RANSAC seed). A view seen in only 2 tracks has a nearly singular block in the LiGT system, and the scale-constrained solution put almost all of its norm on that view: it ended up at distance 1, the other 30 views within 1e-4 of each other, and triangulation and bundle adjustment could not recover. Views seen in fewer thanLiGTPositionEstimatorOptions.min_tracks_per_view(new, default 5) tracks of length three or more are now removed before the system is built; 0 restores the old behavior. Kicker now registers 30 of 31 views for every seed.-
num_threadshad no effect inLIGT(and in the newART): the parallel loops used OpenMP pragmas, but pyTheia is not built with OpenMP. They now use a smallstd::threadhelper (theia/util/parallel_for.h); the result does not depend on the thread count. -
Docs and checks for RANSAC thresholds:
RansacParameters.error_threshis the squared error in normalized (inv(K)) coordinates, so a pixel threshold is(px / f) ** 2; this is now stated in the header, binding docstring and docs.FourPointsPoseFocalLengthRadialDistortionand the radial absolute pose estimators now raiseValueErrorfor invalid distortion bounds (both must be <= 0,max_radial_distortionis the lower bound) instead of aborting the process. pt.sfm.SQPnPis callable again (thePnPTypeenum value no longer shadows the solver; usePnPType.SQPnP).EstimateTriangulationno longer reports success with zero inliers (and returns a zero point instead of uninitialized memory).ColorizeReconstructionraised no error but left all tracks black (the implementation was a stub); it now raisesValueError. Set colors withTrack.SetColor.View.Set{Position,Orientation,Gravity}Prior: the matrix argument is the SQUARE ROOT of the information matrix (documented; argument names unchanged for compatibility).EstimateTwoViewInfoaborted the process (glogCHECKin the RANSAC sampler) for image pairs with fewer correspondences than a minimal sample; it now returnsFalsefor fewer than 5 (calibrated) or 8 (uncalibrated) correspondences.- Angular epipolar error (
AngularEpipolarError, used byBundleAdjustTwoViewsAngularand the refinement inEstimateUncalibratedRelativePose): the quadratic term mixedR * f2withR^T * f2, so for most correct matches the square-root argument was negative and the residual fell back to its constant 1000; the refinement therefore did not move (or moved in an arbitrary direction). Both rays are now rotated into camera 1 consistently and normalized, and the residual is the angular epipolar error itself (the square root of the former squared-sine expression, so least squares no longer minimizes fourth powers of the angles); invalid configurations get a residual of 1 instead of 1000. Robust loss widths for this residual are therefore in radians.TwoViewInfo.position_2is, as documented, the position of camera 2 in the frame of camera 1. TriangulateNViewSVDdid not initialize its design matrix (only the blocks of the projection matrices and image points were written), so the result depended on leftover memory: it was nondeterministic and often NaN or infinite. This affected direct calls andTriangulationMethodType.SVDin track estimation (the default isMIDPOINT).- MLPnP (
MLPnP,PnPType.MLPnP, and the shared refiner ofUPMLPnP): the Gauss-Newton refinement used Jacobians for a left-multiplied rotation update and an additive world-frame translation update, while the update step applies the rotation and translation increments in the camera frame. For any rotation other than the identity, the steps pointed in the wrong direction and the refinement stopped far from the optimum (on six noisy points the final cost was a median of 350 times the optimal cost; it is now optimal). Inside RANSAC, the better minimal hypotheses also reduce the number of iterations considerably (on ETH3D localization with DISK+LightGlue matches, median 178 -> 22 iterations and 5.0 -> 0.7 ms per query). The planar branch resolved the sign ambiguity after rotating back from the plane frame and did not center the points, so it failed for about 20-30% of planar inputs (and in general for planes not through the origin); it now centers the points and resolves the sign in the plane frame. The translation of the linear solution is scaled by the mean singular value of the estimated rotation block instead of the smallest one, which was unstable for noisy minimal samples. The linear step accumulates the 12x12 normal matrix directly and uses a symmetric eigensolver instead of an explicit design matrix, a sparse weight matrix and a Jacobi SVD (about 2x faster per call). -
Hybrid SfM (
HybridReconstructionEstimator) was considerably less accurate than the global and incremental pipelines and failed on weakly textured scenes. Five fixes: (1) the camera orientations from global rotation averaging were held constant in every bundle adjustment and never refined; the estimator now ends with a re-triangulation and a full bundle adjustment with free orientations. (2) When an initial-pair candidate was rejected, the first camera of the next candidate kept the position from the previous attempt, so most of its triangulations failed; it is now reset to the origin, and the known-orientation initialization requires the orientations of both views (it accepted pairs with only one). (3) The initial pair needs 100 triangulated tracks instead of 200, as in the incremental estimator. (4) Candidate initial pairs were ranked by the angle between the two principal rays, which favors pure rotations without baseline; they are now ranked by the median parallax of the matched features (angle between the world-frame rays, using the known orientations), as in the original TheiaSfM code. (5) Like the global estimator, it now reconstructs only the largest connected component of the view graph; a disconnected view graph made rotation averaging abort (Map key not foundinFindOrDie). On 13 ETH3D scenes with SIFT matches and calibrated intrinsics the median camera-center error dropped to the level of global SfM (e.g. courtyard 45 -> 5.3 mm), andmeadowandofficeno longer fail. With the parallax criterion the initial pair is also independent of the random seed. -
Inverse-depth bundle adjustment (
use_inverse_depth_parametrization = True): it produced NaN residuals when the inverse depths had not been initialized, and several entry points optimized stale anchors or the wrong state. The reference view, the unit bearing and the inverse depth are now derived from the current 3D point of each track right before the track is added (Reconstruction.InitializeTrackInverseDepth, also bound for single tracks), soReconstruction.InitializeInverseDepth()is optional and poses that moved cannot leave stale anchors. The inverse depth isw / rangealong a unit bearing (it was1 / zwith a bearing that was not unit for the fisheye and sphere models), so wide-angle models work. The residual is evaluated without dividing by the inverse depth and matches the XYZ residual at the same point for all central camera models; the inverse depth is bounded below by 0. The reference-view residual no longer carries the pose, tracks that cannot be represented are skipped instead of corrupting the solve (and their points are no longer overwritten from stale inverse depths),BundleAdjustPartialReconstructionandBundleAdjustPartialViewsConstantnow keep views outside the requested set constant,BundleAdjustTrackandBundleAdjustTracksno longer optimize the intrinsics, the covariance overloads no longer overwrite the optimized point with a stale inverse depth,BundleAdjustReconstructionWithConstantTracksno longer crashes when the option is set, andTrack::RemoveViewkeeps the reference view when the removed view is not the reference. New:Track.SetReferenceViewId,BundleAdjuster.AddInvTrack. See Bundle adjustment.
1.4.0¶
Not tagged separately; first released as part of 1.4.1.
Tooling around the library: command line, browser viewer and exporters for Gaussian splatting.
Features¶
- Gaussian splatting export.
WriteColmapFiles(..., binary=True)writes the COLMAP binary model (cameras.bin,images.bin,points3D.bin).WriteTransformsJsonwritestransforms.jsonwith OpenGL camera-to-world matrices. The newpytheia.export.export_for_gaussian_splattingwrites undistorted images,sparse/0and a seedpoints3d.plyin one call. See Gaussian splatting export. - Browser viewer. New
pytheia.viewerpackage:export_html(recon, path)writes one self-contained HTML file (three.js r160 and OrbitControls inlined, scene data as base64 buffers, works offline);show(recon)embeds it in a notebook andserve(recon, port)serves it locally. Orbit controls, camera frusta, point size, RGB / track-length / reprojection-error colors, error and track-length filters, click-to-inspect cameras (thumbnails) and points (track residuals), per-view table, unregistered-view highlight, dark/light theme, PNG screenshot. Also: compare mode (viewer.compare(a, b, path)) aligns a second reconstruction onto the first with a Sim(3) fit on shared view names and shows per-camera errors; depth coloring, camera trajectory, a two-click measure tool and a WASD fly mode. Only numpy is required. See Browser viewer. - Command line interface. New
pytheiacommand (alsopython -m pytheia) withinfo,convert,view,export-splat,alignandsfmsubcommands.sfmtakes everyReconstructionEstimatorOptionsfield from a JSON config and--set key=valueoverrides, and--seedfor reproducible runs. See Command line interface. - Native applications. Built with
-DBUILD_APPS=ON(off by default, not in the wheel):theia_global_sfm,theia_incremental_sfmandtheia_hybrid_sfmread the samereconstruction.recon+view_graph.bininput directory aspytheia sfmand take the same--config/--setoptions;theia_inforeports a reconstruction andtheia_convertwrites COLMAP text or binary, NVM, Bundler, PLY, nerfstudio,transforms.jsonand JSON. See Native applications. - COLMAP camera models. New intrinsics models
FULL_OPENCV,RADIAL_FISHEYE,THIN_PRISM_FISHEYEandRAD_TAN_THIN_PRISM_FISHEYE(FullOpenCVCameraModel,RadialFisheyeCameraModel,ThinPrismFisheyeCameraModel,RadTanThinPrismFisheyeCameraModel), with autodiff for bundle adjustment and a Newton inverse.read_colmap_modelimports every COLMAP model (includingOPENCV_FISHEYE,FOV,RADIAL_FISHEYE,SIMPLE_RADIAL_FISHEYE) without dropping terms, andWriteColmapFileswrites the four new models back as their COLMAP models, in text and binary.CameraIntrinsicsPriorgainedradial_distortion_6andthin_prism_distortion(serialization version 5). - Importers. New pure-Python
pytheia.importersmodule:read_colmap_model(path)reads a COLMAP or GLOMAP sparse model in text or binary form (SIMPLE_PINHOLE,PINHOLE,SIMPLE_RADIAL,RADIAL,OPENCV,FULL_OPENCVand the fisheye and FOV models, all without dropped terms) into apt.sfm.Reconstruction.read_openmvg_sfm_data(path)reads an OpenMVGsfm_data.json(views, pinhole and radial intrinsics, poses, structure).read_colmap_database(path)returns keypoints, matches and two-view geometries of a COLMAPdatabase.dbas numpy arrays. See Importers.
Fixes¶
WriteColmapFilestext cameras: the second radial term was written ask1(... k1 k1). It now writesk2.FISHEYEunprojection:FisheyeCameraModel::UndistortPointused a fixed-point iteration that did not converge at large ray angles (about 0.8 px round-trip error at 80 degrees) while still returning success. It now uses the same Newton inverse as the other COLMAP fisheye models, with round-trip tests up to 85 degrees.- Bundle adjustment with unobserved views: estimated views without any observation made
BundleAdjustReconstructionand the otherBundleAdjust*entry points fail with "The program has N parameter blocks, but the parameter block ordering has N+4". Such views are now left out of the linear solver ordering, and the covariance queries no longer abort on blocks that are not in the problem. BundleAdjustPartialReconstruction: the track ids used to refresh the inverse depths were padded with zeros. Only the requested tracks are now updated.NonlinearPositionEstimatorOptions:min_num_points_per_view,point_to_camera_weightandmax_power_iterationswere bound to the wrong C++ members (for examplemin_num_points_per_viewwrotenum_threads). They now map correctly;max_num_iterationsandrobust_loss_widthwere added, and the old namesmax_power_iterationsandeigensolver_thresholdstay as aliases.- Incremental SfM: the initial pair now resets camera 1 to the identity pose, so inputs that already contain poses (such as a
.reconfile) no longer fail triangulation of the initial pair. Views without an image size are skipped with an error message instead of aborting on aCHECK. ViewGraph::AddEdge: documented thatTwoViewInfois stored unchanged and read as larger id relative to smaller id (useSwapCamerasfor reversed ids).
1.3.2¶
Robustness: a robust default bundle-adjustment loss, and fixes for the LINEAR_TRIPLET and LIGT global position estimators.
Defaults¶
- BA loss is now
HUBERwith a 1 px width (wasTRIVIAL/ pure L2 with a 10 px width) in bothReconstructionEstimatorOptionsandBundleAdjustmentOptions. A plain L2 loss is dominated by the few wrong correspondences that survive geometric verification. On ETH3D (12 scenes, SIFT, calibrated, global SfM) the median camera-center error drops from 4.5 to 3.5 mm and the mean error from 37 to 18 mm. A Huber width of 10 px is practically identical toTRIVIAL, so the width matters as much as the loss. SetLossFunctionType.TRIVIALto get the old behavior.
Features¶
- Keyword arguments everywhere. All pybind11 bindings (
sfm,solvers,math,io,matching,mvs) now name their arguments after the C++ parameters, sopt.sfm.Feature(point=..., covariance=...)works. Positional calls are unchanged. Stubs show the names. - Feature uncertainty in bundle adjustment. The reprojection residual is whitened with the full 2x2
Feature.covariance(it used only the diagonal before). NewFeature.set_isotropic_sigma(sigma)andFeature.sqrt_information(). The comment oncovariance_said "standard deviation"; it is a covariance in px^2.
Fixes¶
LINEAR_TRIPLET: triplets whose baseline ratios could not be computed (too few well-conditioned common tracks) were kept with baseline(0, 0, 0), which turns the ratios intoNaN, poisons the constraint matrix and made the eigensolver throw (TridiagEigen: eigen decomposition failed). Such triplets are now discarded. Registered views on ETH3D rise from 16 % to 64 % (scenes that work: 2/13 to 9/13).LIGT: the smallest eigenvector of the constraint matrix only fixes||x|| = 1, so a weakly constrained view can take almost all of the norm and the rest collapse (registered 0 of 45 views on ETH3Delectro, 0 of 76 onfacade). The scale is now fixed with a ShapeFit-style constraint that sums the two-view translation directions (LiGTPositionEstimatorOptions.use_scale_constraint, defaultTrue; one sparse solve, falls back to the eigenvector). The system is restricted to the largest connected set of views, with the best constrained view fixed at the origin. Constraints are also row-normalized and re-weighted with Huber IRLS (normalize_constraints,num_irls_iterations,irls_scale_multiplier). On 13 ETH3D scenes with SIFT matches, every scene now registers at least 44 of 45 views (previously 4 scenes failed); median errors are 1-12 mm exceptmeadow(56 mm). Also removed a stray debugstd::coutprint.
Known limitations¶
- With deep matchers (SuperPoint/ALIKED + LightGlue) on repetitive scenes up to half of the view-graph edges can be wrong in a mutually consistent way, so triplet-loop, rotation and translation-direction filters cannot remove them; pyTheia registers fewer views there than COLMAP/GLOMAP.
1.3.1¶
Opt-in reproducible RNG seeding and a bundle-adjuster fix.
Reproducible runs¶
- Fixed seed for default-constructed RNGs. RANSAC samplers and global estimators that are not handed a
RandomNumberGeneratorseed from the clock by default. They can now use a fixed seed, so repeated runs draw identical sample sequences.- Python:
pt.solvers.SetDefaultRandomSeed(seed),pt.solvers.ClearDefaultRandomSeed(),pt.solvers.HasDefaultRandomSeed(). - C++: the same names in the
theia::namespace (theia/util/random.h). - Environment:
THEIA_RANDOM_SEED=<unsigned decimal>sets the seed at process start. An invalid value is ignored and the clock is used. - The seed is process-wide and re-applied on every default construction, so each RANSAC / estimator run restarts from the same state. Without a seed, behavior is unchanged.
- Python:
Fixes¶
BundleAdjuster::SetCameraExtrinsicsConstantno longer aborts in Ceres for a view that has no residual block (all observations removed, no gravity prior). The extrinsics block is added before it is marked constant.
Maintenance¶
- Type stubs regenerated with pybind11-stubgen 3.0.0; they now include the seed functions and previously missing entries such as
io.WriteRigPlyFile. - Bumped vulnerable pins in the vendored pybind11
requirements.txtfiles (no effect on the built package).
Docs: RANSAC.
1.3.0¶
Compact binary format for reconstructions.
I/O¶
- Reconstruction format version 2.
ReadReconstruction/WriteReconstructionwrite a compact, lossless layout: about 27 B/observation instead of 191 on a synthetic 50-view / 2000-track set. - Older files (Reconstruction version 0 or 1) still load exactly. Files written by 1.3.x cannot be read by 1.2.x.
- Tests and fixtures:
pytests/io/test_compact_reconstruction_format.py(legacy load, lossless round-trip, size).
Docs: IO — binary .recon format.
1.2.1¶
Rig pipeline hardening on top of 1.2.0: metric capture–capture relative pose, clearer global-rig logging, rig PLY export, and example cleanup.
Metric relative rig pose¶
- In-tree 5+1 generalized relative pose (
FivePointOnePointGeneralizedRelativePose) and upright 4-pt wrapper; RANSAC viaEstimateRelativeRigInfo/EstimateRelativeRigInfoUpright. BuildCaptureViewGraphdefaults to metric edges from tracks (lift rays → 5+1); View–View strip is fallback only for missing pairs.GlobalRigReconstructor:capture_graph_options, optionalrescale_positions_to_metric_edges, and INFO logging for capture-graph / rotation / position / triangulation stages (same style as monocular global SfM).
I/O and examples¶
WriteRigPlyFile— tracks + capture trajectory + intra-capture sensor baselines (densely sampled polylines for MeshLab / Open3D).- Reorganized
pyexamples/(preprocess/,stereo/,sfm/, …); ZED SVO extract (zed_svo_extract_stereo.py); stereo example--frames_dir, default xfeat, rig PLY + mean reprojection stats. IncrementalRigReconstructorOptions: default BAnum_threads=1(avoids SIGSEGV when Ceres OpenMP runs after Torch CUDA matching); stereo example clears the GPU matcher before Estimate.- Bindings:
ReconstructionEstimatorOptions.triangulation_max_reprojection_error_in_pixels. - Fixes: Sim3 alignment setters API, deep-matching None deref, LoFTR confidence filtering, Open3D PLY viewer stub.
Docs: Rigs, Pose — generalized relative, IO, Examples showcase.
1.2.0¶
Calibrated multi-camera / stereo rig support: abstract body frame, synchronized captures, incremental and global reconstructors, docs, and a vismatch stereo example.
Camera rigs¶
CameraRig/RigSensor/RigCaptureonReconstruction— one capture = one timestamp = one body pose; Views keep features/matches; sensor extrinsics live in the abstract rig CS (default body at identity).PropagateCameraPosesForCapture/BuildCaptureViewGraph— compose View cameras from body ⊕ calibrated sensors; derive capture–capture edges from View–ViewTwoViewInfo.IncrementalRigReconstructor— seed at identity, triangulate (intra-rig metric), localize later captures (generalized 2D–3D / single-view fallback).GlobalRigReconstructor(MGSfM-inspired) — capture graph + selectable Theia averaging backends (GlobalRotationEstimatorType/GlobalPositionEstimatorTypeviasfm_options). Extrinsics assumed calibrated (not optimized in averaging).- Docs: Rigs. Example:
pyexamples/stereo/stereo_rig_reconstruction.py(baseline / intrinsics, vismatchedm, global or incremental).
Tests¶
pytests/test_camera_rig.py,pytests/test_global_rig_reconstructor.py.
1.1.0¶
Bulk calibrated two-view estimation now carries monodepth depth priors and returns relative depth-map scale.
Bulk two-view API¶
BulkEstimateTwoViewInfoaccepts optional per-correspondencedepth_i/depth_j(1-D float arrays, length \(N\)) and setsFeature.depth_priorwhen building flat correspondences. WithEstimateTwoViewInfoOptions.use_monodepth=Trueand ≥95% valid depths, each pair uses the calibrated monodepth 3-pt path (same as scalarEstimateTwoViewInfo).- Return dict gains
scales: per-pairTwoViewInfo.scale_estimate(\(-1\) when unset / unused). Existing keys (success,orientations,positions,inlier_offsets,inlier_indices) are unchanged. - Smoke test:
pytests/sfm/test_bulk_monodepth_two_view.py.
Narrative: RANSAC — monocular-depth-assisted two-view, Performance — GIL / bulk, Estimators — relative pose.
1.0.9¶
Faster two-view / PnP RANSAC paths: PoseLib-adapted minimal solvers plus dense LM local optimization that replaces Ceres in the LO hot path.
Two-view estimation¶
- Sturm-sequence 5-point essential-matrix solver (
FivePointRelativePoseSturm,theia/math/sturm.h), adapted from PoseLib / Nistér. Default forEstimateRelativePose/ essential-matrix RANSAC viaRansacParameters.use_sturm_5pt(defaulttrue). - RANSAC-loop speedups for relative pose: Sampson-only scoring with a single final essential-matrix decomposition, vectorized Sampson residuals, less allocation churn in
SampleConsensusEstimator. - Monodepth 3-point relative-pose solvers and estimators (
relative_pose_monodepth_3pt,EstimateMonoDepthRelativePose+ shared-/varying-focal variants), adapted from PoseLib RePoseD DingRePoseD2025. Wired intoEstimateTwoViewInfoviause_monodepth/monodepth_shared_focalwhen correspondences carryFeature.depth_prior.
Narrative: RANSAC, Performance, Pose — Sturm 5-pt, Pose — monodepth 3-pt, Pose — dense LM refiners, Math — Sturm, Math — lmlsq.
Dense LM RANSAC local optimization (use_lo)¶
New tiny Levenberg–Marquardt stack under theia/math/lmlsq/ (truncated loss + dense normal equations). Model-specific refiners (PoseLib-style Jacobians, Theia types) replace Ceres problem setup on every LO call:
| Estimator | Refiner | Residual / DoF |
|---|---|---|
EstimateRelativePose |
refine_relative_pose |
Sampson; 5 |
EstimateMonoDepthRelativePose (+ shared/varying focal) |
refine_monodepth_relative_pose |
Sampson (+ \(F\)) and depth reprojection; 7–9 |
EstimateCalibratedAbsolutePose |
refine_absolute_pose |
Reprojection; 6 |
Full-scene / multi-view bundle adjustment is unchanged and still uses Ceres. Details: RANSAC — local optimization, Pose — dense LM refiners.
Docs and licensing¶
- MkDocs pages updated for the new solvers and LO path (RANSAC, Estimators, Performance, Math, Bundle adjustment, Pose).
- PoseLib BSD-3-Clause attribution extended to the ported refiners (License, README Acknowledgements).
1.0.x¶
Stable Python packaging line with MkDocs documentation, cross-run alignment APIs, and continued binding coverage for cameras, BA, pose solvers, view graphs, and I/O (COLMAP, Bundler, NVM, PLY, Nerfstudio, SDFStudio, etc.).
Highlights since 0.6.0¶
- Versioning aligned across root
VERSION, CMakeproject(), andpyproject.toml. - Documentation maintained as MkDocs under
docs/content/(Sphinx-era pages removed). - Cross-run alignment APIs documented in Cross-run alignment and Transformations (BA relative pose edges, Sim(3) pose graph, scale-invariant odometry).
- Examples: lightweight scripts in
pyexamples/; showcaseexamples/vismatch_sfm/; Nerfstudio export viapyexamples/io/nerfstudio_export_reconstruction.py. - Wheels: manylinux builds for Python 3.8–3.13 via Docker (
urbste/pytheia_base). - 1.0.9: Sturm 5-pt + monodepth 3-pt solvers; dense LM RANSAC LO for relative / monodepth / calibrated absolute pose — see 1.0.9 notes.
- 1.1.0:
BulkEstimateTwoViewInfodepth priors +scales— see 1.1.0 notes. - 1.2.0: Calibrated stereo / multi-camera rigs (
CameraRig, incremental + global reconstructors) — see 1.2.0 notes. - 1.2.1: Metric 5+1 capture edges,
WriteRigPlyFile, example / logging fixes — see 1.2.1 notes.
Known limitations¶
- C++ unit tests exist but are mostly unwired in CMake; CI builds wheels without running pytest or CTest. A growing subset of pose / estimator /
lmlsqtests can be enabled withBUILD_TESTING=ON. - Feature detection / descriptor matching in C++ is deprecated in favor of Python-side pipelines; see 0.6.0 notes below.
0.6.0¶
Major cleanup: smaller surface area, Python-first imaging and features, fewer vendored or optional dependencies in the default build path.
Removed or deprecated in this line¶
- Raster / EXIF in C++: The
theia/imagestack and OpenImageIO integration are gone. Images and EXIF are expected in Python (OpenCV, Pillow, etc.). C++ keeps geometry, reconstructions, cameras, BA, and solvers. - Feature and descriptor I/O: Reading/writing bundled keypoint–descriptor files and SIFT key formats has been removed from the library and from Python bindings. Feature detection and matching stay outside the core package; you pass correspondences and use
Feature,FeatureCorrespondence, and estimators as needed. - Python API trim: Descriptor-centric matching helpers (e.g.
KeypointsAndDescriptors, brute-force / cascade hash matchers, Fisher-vector globals, two-view verification types that depended on that stack) are no longer exposed onpytheia.matching/pytheia.sfm.FeaturesAndMatchesDatabase,InMemoryFeaturesAndMatchesDatabase,ReconstructionBuilder, andReconstructionBuilderOptionsare also removed from Python (C++ Theia still uses the match database inside its own reconstruction-builder path). - Exports and extras: Legacy PMVS export and other dead or redundant tooling paths have been removed or stripped from docs and CMake where applicable.
- Documentation: Sphinx-era pages were replaced with MkDocs; narrative docs focus on what pyTheia actually exposes and how to wire Python-side features into SfM.
Cross-run alignment additions (0.6.x)¶
New capabilities for aligning two independent reconstructions (segment + run). Narrative docs: Cross-run alignment.
BundleAdjustReconstructionWithRelativePoseEdges— full BA plus SE(3) pose-to-pose edges that snapshot run odometry at setup time.RelativePoseConstraint.scale_invariant_translation— optional scale-invariant odometry (translation direction + optional log-magnitude) viaScaledRelativePoseError.BundleAdjustReconstructionWithConstantTracks— control-point BA: fixed map tracks, optimized run cameras.- Sim(3) view helpers —
GetSim3LieFromView,RelativeSim3BetweenViews,SetViewCameraFromSim3Lie. - Cross-reconstruction Sim(3) pose graph —
AlignReconstructionsWithPoseGraph,CrossReconstructionSim3PoseGraphOptimizer, sequential / anchor / scale-smoothness edges (CrossViewAnchorEdge,SequentialSim3Edge, …). Documented under Transformations → pose graph.
Still here¶
- Core SfM pipelines, bundle adjustment, cameras, pose / triangulation solvers, view graph, I/O for reconstructions (binary/JSON, Bundler, NVM, COLMAP text, PLY, Nerfstudio, SDFStudio, etc.), and pybind11 Python API for the remaining types and functions.
If you need the old upstream release notes for academic comparison, see the TheiaSfM repository tags and history.