Blender V5.0
reconstruction.cc File Reference

Go to the source code of this file.

Classes

struct  libmv_Reconstruction
struct  EuclideanCamera
struct  EuclideanPoint
class  EuclideanReconstruction
class  ProgressUpdateCallback
class  Tracks

Macros

#define SET_DISTORTION_FLAG_CHECKED(type, coefficient)

Functions

libmv_Reconstructionlibmv_solveReconstruction (const libmv_Tracks *libmv_tracks, const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options, libmv_ReconstructionOptions *libmv_reconstruction_options, reconstruct_progress_update_cb progress_update_callback, void *callback_customdata)
libmv_Reconstructionlibmv_solveModal (const libmv_Tracks *libmv_tracks, const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options, const libmv_ReconstructionOptions *libmv_reconstruction_options, reconstruct_progress_update_cb progress_update_callback, void *callback_customdata)
int libmv_reconstructionIsValid (libmv_Reconstruction *libmv_reconstruction)
void libmv_reconstructionDestroy (libmv_Reconstruction *libmv_reconstruction)
int libmv_reprojectionPointForTrack (const libmv_Reconstruction *libmv_reconstruction, int track, double pos[3])
double libmv_reprojectionErrorForTrack (const libmv_Reconstruction *libmv_reconstruction, int track)
double libmv_reprojectionErrorForImage (const libmv_Reconstruction *libmv_reconstruction, int image)
int libmv_reprojectionCameraForImage (const libmv_Reconstruction *libmv_reconstruction, int image, double mat[4][4])
double libmv_reprojectionError (const libmv_Reconstruction *libmv_reconstruction)
libmv_CameraIntrinsicslibmv_reconstructionExtractIntrinsics (libmv_Reconstruction *libmv_reconstruction)
void EuclideanScaleToUnity (EuclideanReconstruction *reconstruction)
void EuclideanBundle (const Tracks &tracks, EuclideanReconstruction *reconstruction)
void EuclideanCompleteReconstruction (const Tracks &tracks, EuclideanReconstruction *reconstruction, ProgressUpdateCallback *update_callback)
bool EuclideanReconstructTwoFrames (const vector< Marker > &markers, EuclideanReconstruction *reconstruction)
double EuclideanReprojectionError (const Tracks &image_tracks, const EuclideanReconstruction &reconstruction, const CameraIntrinsics &intrinsics)

Macro Definition Documentation

◆ SET_DISTORTION_FLAG_CHECKED

#define SET_DISTORTION_FLAG_CHECKED ( type,
coefficient )
Value:
do { \
if (refine_intrinsics & LIBMV_REFINE_##type##_DISTORTION_##coefficient) { \
bundle_intrinsics |= libmv::BUNDLE_##type##_##coefficient; \
} \
} while (0)

Function Documentation

◆ EuclideanBundle()

void libmv::EuclideanBundle ( const Tracks & tracks,
EuclideanReconstruction * reconstruction )

Refine camera poses and 3D coordinates using bundle adjustment.

This routine adjusts all cameras and points in *reconstruction. This assumes a full observation for reconstructed tracks; this implies that if there is a reconstructed 3D point (a bundle) for a track, then all markers for that track will be included in the minimization. tracks should contain markers used in the initial reconstruction.

The cameras and bundles (3D points) are refined in-place.

Note
This assumes an outlier-free set of markers.
This assumes a calibrated reconstruction, e.g. the markers are already corrected for camera intrinsics and radial distortion.
See also
EuclideanResect, EuclideanIntersect, EuclideanReconstructTwoFrames

Definition at line 650 of file bundle.cc.

Referenced by libmv_solveReconstruction().

◆ EuclideanCompleteReconstruction()

void libmv::EuclideanCompleteReconstruction ( const Tracks & tracks,
EuclideanReconstruction * reconstruction,
ProgressUpdateCallback * update_callback = NULL )

Estimate camera poses and scene 3D coordinates for all frames and tracks.

This method should be used once there is an initial reconstruction in place, for example by reconstructing from two frames that have a sufficient baseline and number of tracks in common. This function iteratively triangulates points that are visible by cameras that have their pose estimated, then resections (i.e. estimates the pose) of cameras that are not estimated yet that can see triangulated points. This process is repeated until all points and cameras are estimated. Periodically, bundle adjustment is run to ensure a quality reconstruction.

tracks should contain markers used in the reconstruction. reconstruction should contain at least some 3D points or some estimated cameras. The minimum number of cameras is two (with no 3D points) and the minimum number of 3D points (with no estimated cameras) is 5.

See also
EuclideanResect, EuclideanIntersect, EuclideanBundle

Definition at line 345 of file intern/libmv/libmv/simple_pipeline/pipeline.cc.

Referenced by libmv_solveReconstruction().

◆ EuclideanReconstructTwoFrames()

bool libmv::EuclideanReconstructTwoFrames ( const vector< Marker > & markers,
EuclideanReconstruction * reconstruction )

Initialize the reconstruction using two frames.

markers should contain all markers belonging to tracks visible in both frames. The pose estimation of the camera for these frames will be inserted into *reconstruction.

Note
The two frames need to have both enough parallax and enough common tracks for accurate reconstruction. At least 8 tracks are suggested.
The origin of the coordinate system is defined to be the camera of the first keyframe.
This assumes a calibrated reconstruction, e.g. the markers are already corrected for camera intrinsics and radial distortion.
This assumes an outlier-free set of markers.
See also
EuclideanResect, EuclideanIntersect, EuclideanBundle

Definition at line 54 of file initialize_reconstruction.cc.

Referenced by libmv_solveReconstruction().

◆ EuclideanReprojectionError()

double libmv::EuclideanReprojectionError ( const Tracks & image_tracks,
const EuclideanReconstruction & reconstruction,
const CameraIntrinsics & intrinsics )

◆ EuclideanScaleToUnity()

Scale euclidean reconstruction in a way variance of camera centers equals to one.

Definition at line 26 of file reconstruction_scale.cc.

Referenced by libmv_solveReconstruction().

◆ libmv_reconstructionDestroy()

void libmv_reconstructionDestroy ( libmv_Reconstruction * libmv_reconstruction)

◆ libmv_reconstructionExtractIntrinsics()

libmv_CameraIntrinsics * libmv_reconstructionExtractIntrinsics ( libmv_Reconstruction * libmv_reconstruction)

◆ libmv_reconstructionIsValid()

int libmv_reconstructionIsValid ( libmv_Reconstruction * libmv_reconstruction)

◆ libmv_reprojectionCameraForImage()

int libmv_reprojectionCameraForImage ( const libmv_Reconstruction * libmv_reconstruction,
int image,
double mat[4][4] )

◆ libmv_reprojectionError()

double libmv_reprojectionError ( const libmv_Reconstruction * libmv_reconstruction)

Definition at line 511 of file intern/reconstruction.cc.

References libmv_Reconstruction::error.

Referenced by BKE_tracking_reconstruction_solve().

◆ libmv_reprojectionErrorForImage()

◆ libmv_reprojectionErrorForTrack()

◆ libmv_reprojectionPointForTrack()

int libmv_reprojectionPointForTrack ( const libmv_Reconstruction * libmv_reconstruction,
int track,
double pos[3] )

◆ libmv_solveModal()

◆ libmv_solveReconstruction()