Ask Your Question
0

openCV image Stitching wide angle 160 degrees

asked 2019-12-02 10:12:37 -0600

aalmasri gravatar image

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-12-03 03:18:05 -0600

mvuori gravatar image

A 160 degree lens would be a fisheye and each frame would need converting into rectilinear first. Without that, what you get would be expected, though I am not an expert on stitcher.

...Of course, without seeing the frames, everthing is purely guessing.

Besides that, 70 frames seem like serious overkill.

edit flag offensive delete link more

Comments

It is not overkill images.

supra56 gravatar imagesupra56 ( 2019-12-03 04:56:47 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-12-02 10:12:37 -0600

Seen: 890 times

Last updated: Dec 03 '19