Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

openCV image Stitching wide angle 160 degrees

I'm trying to Stitching image wide angle 160.5 degree but the result is not a good

i'm using OpenCV 4 and ffmpeg to get frames from video

ffmpeg command to get 15 frame per sec :

ffmpeg -i first.mp4 -vf fps=15  preview%05d.jpg

OpenCV Stitching code

import cv2
import numpy as np

images = []
for i in range(70):
    name = ('preview%05d.jpg' % (i+1))
    print(name)
    images.append(cv2.imread(name , cv2.IMREAD_COLOR))


print("start ")
stitcher = cv2.Stitcher_create()
ret, pano = stitcher.stitch(images)

if ret == cv2.STITCHER_OK:
    cv2.imshow('panorama', pano)
    cv2.waitKey()
    cv2.destroyAllWindows()
else:
    print(cv2.STITCHER_ERR_NEED_MORE_IMGS)
    print(cv2.STITCHER_ERR_HOMOGRAPHY_EST_FAIL)
    print(cv2.STITCHER_ERR_CAMERA_PARAMS_ADJUST_FAIL)
    print(ret)
    print('Error during stiching')

actual result :

image description

expected result :

image description