python中的多个图像拼接

时间:2018-04-04 05:43:34

标签: python image-stitching opencv-stitching

我正在尝试使用Windows上的opencv Stitcher模块在图像拼接上运行代码。

这是一段代码:

import cv2
import numpy as np
import glob

images = []

for file in glob.glob("path_to_images/*.png"):
    n= cv2.imread(file)
    images.append(n)

result = images[0]   
for i in images:
    stitcher = cv2.createStitcher(False)
    result = stitcher.stitch(result, images[i])
    cv2.imwrite("C:/Users/user/Desktop/mosaicing/island/out1.jpg", result[1])

我收到错误消息: TypeError:只能将整数标量数组转换为标量索引

我很感激有关如何解决它的任何提示。 TIA

0 个答案:

没有答案
相关问题