Skip to content

Error when Stitching Images with >10.000 Pixels #17508

@lukasalexanderweber

Description

@lukasalexanderweber
System information (version)
  • OpenCV => 4.2.0
  • Operating System / Platform => Windows 10 64 Bit
  • Compiler => Spyder 4.0.1 with Python 3.7.3
Detailed description

The goal is to stitch high resolution scans/images with >10,000 x 10,000 pixel together. When trying to stitch them it immediately returns status 1 ("no success!") without even trying to stitch the images. It's surely not due to a missing overlap or so since if the Images are rescaled to a percentage of the size it works.

Steps to reproduce

Example data can be found here.

It contains in each case two high resolution images cropped into two subframes. The Bathy subframes represent images >10.000 px and the Historic subframes < 10.000 px:

  1. Bathy
    into 14133 px x 10783 px and 12191 px x 10775 px

  2. Historic
    into 6641 px x 6081 px and 5433 px x 6025 px

I use the following code:

import os
import cv2

images = r"path_to_folder/Stitching/Bathy"
os.chdir(images)

images = []
for image in os.listdir():
    image = cv2.imread(image)
    print('Image Dimensions : ',image.shape)
    images.append(image)

stitcher = cv2.Stitcher_create()
status, pano  = stitcher.stitch(images)

if status == 0:
    cv2.imshow("Pano", pano)
    cv2.waitKey(0)
    cv2.destroyAllWindows()
else:
    print("no success!")

The historic images (<10.000 px subframes) are loaded, it takes a short time to run and the stitched image is shown. The bathymetric images (>10.000 px subframes) are loaded, too, but then it immediately returns status 1 ("no success!") without even trying to stitch the images. If the Images are rescaled to e.g. 10% of the size it works:

for image in os.listdir():
    image = cv2.imread(image)
    print('Image Dimensions : ',image.shape)
    scale_percent = 10 
    width = int(image.shape[1] * scale_percent / 100)
    height = int(image.shape[0] * scale_percent / 100)
    dim = (width, height)
    image = cv2.resize(image, dim, interpolation = cv2.INTER_AREA) 
    print('Resized Dimensions : ',image.shape) 
    images.append(image)
Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    question (invalid tracker)ask questions and other "no action" items here: https://forum.opencv.org

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions