#2415·openMVG

How to use GCPs not for the bundle adjustment, but just as reference for the world coordinate system

Author: RheinwaltCreated Apr 25, 2025Updated May 21, 2026

What I'm aiming at is to do the incremental reconstruction as always, but rotate and scale the model to the world coordinate system of a checkerboard within the scene. So I have GCPs from opencv that I injected into the sfm_data.json. All of that seems to work, but if I look at the PLY output file of openMVG_main_ComputeSfM_DataColor I only have a few more points on the checkerboard, less points overall, and most importantly the same random world coordinate system. What is the best way of doing something like this? Here is what I tried:

bash
echo intrinsics analysis
openMVG_main_SfMInit_ImageListing \
        -i ../$img_dir \
        -o . \
        -d $cam_params

echo compute features
openMVG_main_ComputeFeatures \
        -i sfm_data.json \
        -o . \
        -m "SIFT"

echo compute matching pairs
openMVG_main_PairGenerator \
        -i sfm_data.json \
        -o pairs.bin

echo compute matches
openMVG_main_ComputeMatches \
        -i sfm_data.json \
        -p pairs.bin \
        -o matches.putative.bin

echo filter matches
openMVG_main_GeometricFilter \
        -i sfm_data.json \
        -m matches.putative.bin \
        -g f \
        -o matches.f.bin

echo incremental reconstruction
openMVG_main_SfM \
        --sfm_engine INCREMENTAL \
        --input_file sfm_data.json \
        --match_dir . \
        --output_dir .

echo sfm_data.bin to sfm_data.json
openMVG_main_ConvertSfM_DataFormat -i sfm_data.bin -o sfm_data.json
rm -rf sfm_data.bin

echo inject GCPs
python inject_gcps_into_sfm_data.py

echo compute structure
openMVG_main_ComputeStructureFromKnownPoses \
        -i sfm_data_with_gcps.json \
        -m . \
        -f matches.f.bin \
        -o sfm_data_reconstructed.json

echo colorize structure
openMVG_main_ComputeSfM_DataColor \
        -i sfm_data_reconstructed.json \
        -o sfm_data_gcps_colorized.ply

echo MVG to MVS
mkdir -p scene_undistorted
openMVG_main_openMVG2openMVS \
        -i sfm_data_reconstructed.json \
        -o scene.mvs \
        -d scene_undistorted

echo densify point cloud
DensifyPointCloud scene.mvs