Skip to content

Failing Calibration Initialization #71

@Sridhar701Pitt

Description

@Sridhar701Pitt

I have followed the steps as stated in README to calibrate my fixed rig cameras (24MP) (both intrinsics and extrinsics). But the calibration fails at the initial dense initialization. I have manually collected data from the camera ('Calibrating a camera from images in a folder'). I was able to successfully extract image features ('Feature Extraction').

Tracing the debug in VSCode, in function ('bool DenseInitialization::AttemptRelativePoseInitialization(...)') i found that the variable *num_point_triples never increments and returns false in the subsequent if condition.

// In file dense_initialization.cc
// Attempt initialization: Compute relative poses of the calibration target in the three images.
 // Use all pixels which have matches in all three images.
 // LOG(1) << "Running relative pose initializer ...";
 
 *num_point_triples = 0;
 for (u32 y = 0; y < dense_matches[0].height(); ++ y) {
   for (u32 x = 0; x < dense_matches[0].width(); ++ x) {
     if (!dense_matches[0](x, y).hasNaN() &&
         !dense_matches[1](x, y).hasNaN() &&
         !dense_matches[2](x, y).hasNaN()) {
       ++ (*num_point_triples); // DOES NOT INCREMENT
     }
   }
 }
 
 LOG(INFO) << "Image fraction covered by point triples: " << ((100. * (*num_point_triples)) / dense_matches[0].pixel_count());
 // TODO: This threshold is somewhat arbitrary. This is chosen higher than the minimum point triple count since we operate on interpolated matches here.
 constexpr double kMinRequiredMatchedImageAreaFraction = 0.01; // 0.05;  // TODO: Make configurable?
 if (*num_point_triples < kMinRequiredMatchedImageAreaFraction * dense_matches[0].pixel_count()) {
   LOG(INFO) << "Calibration failed: num_point_triples == " << *num_point_triples << " < " << (kMinRequiredMatchedImageAreaFraction * dense_matches[0].pixel_count());
   return false; // RETURNS HERE!!!
 }

I have attached the docker files, docker instructions, generated features file, calibration yaml and pdf file, vscode settings.json for debugging that i have used.

failed_data_calibration.zip

Also below is a subset of images I have used for detecting the features.
sample images used for calibration

Any idea on what the issue is? @puzzlepaint

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions