Stitching detailed and Autocalibration

Hello Everyone,

Recently I have been working on Stitching several images as scans, and the calibrations get crucial to ensure the grouped images to be straight.

I working with the stitching detailed pipeline provided with Opencv 4.2, and I am working on Python 3.6

https://docs.opencv.org/3.4/d9/dd8/samples_2cpp_2stitching_detailed_8cpp-example.html

Well but is noticeably that K matrix is not calculated by cv.detail AffineBased Estimator() just the R matrix. I wonder if, there is a method to include the autocalibration funcion into this stitching project? :

     cv.detailed.calibrateRotatingCamera(Hs) 

     https://docs.opencv.org/3.4/d4/dbc/group__stitching__autocalib.html

Actually I tried but, this autocalibration function does not accept the arrays: features, pair_matches(p). Showing next error:

cv.detail.calibrateRotatingCamera(features)
TypeError: Hs is not a numpy array, neither a scalar

I appreciate your interest in this topic.

from the c++ src, i’d think, it expects a list of Homography matrices(3x3), and returns (ok, K)

cv.detail.calibrateRotatingCamera(features)

you must have gotten that idea from the broken docstring here:

calibrateRotatingCamera(...)
    calibrateRotatingCamera(Hs[, K]) -> retval, K
    .   @brief Estimates focal lengths for each given camera.
    .
    .   @param features Features of images.
    .   @param pairwise_matches Matches between all image pairs.
    .   @param focals Estimated focal lengths for each camera.

( params are actually for estimateFocal() , which is mysteriously missing)