# Stitching detailed and Autocalibration

**URL:** https://forum.opencv.org/t/stitching-detailed-and-autocalibration/3333
**Category:** Uncategorized
**Created:** [May 14, 2021, 8:48am UTC](https://forum.opencv.org/t/stitching-detailed-and-autocalibration/3333 "2021-05-14T08:48:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![JamieSCZ](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@JamieSCZ](https://forum.opencv.org/u/JamieSCZ)
#### Post date: [May 14, 2021, 8:48am UTC](https://forum.opencv.org/t/stitching-detailed-and-autocalibration/3333/1 "2021-05-14T08:48:32Z")

</div>

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](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.

---

<div class="post-metadata">

### Author: ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)
#### Post date: [May 14, 2021, 10:07am UTC](https://forum.opencv.org/t/stitching-detailed-and-autocalibration/3333/2 "2021-05-14T10:07:17Z")

</div>

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()](https://docs.opencv.org/master/d4/dbc/group __stitching__ autocalib.html#ga7de597a5c64fc2b9e64e7889936fd370) , which is mysteriously missing)
