Home Panorama stitching - AttributeError: 'NoneType' object has no attribute 'shape'
Reply: 0

Panorama stitching - AttributeError: 'NoneType' object has no attribute 'shape'

user1749 Published in April 26, 2018, 5:31 am

I'm trying to make this work on my computer for an assignment but when I run the stitch.py it keeps returning

Traceback (most recent call last):
  File "stitch.py", line 22, in <module>
    imageA = imutils.resize(imageA, width=400)
  File "/anaconda3/lib/python3.6/site-packages/imutils/convenience.py", line 69, in resize
    (h, w) = image.shape[:2]
AttributeError: 'NoneType' object has no attribute 'shape'

I've tried finding the path that may be incorrect but I can't seem to find it. Here's how the code looks: Stitcher.py

# python stitch.py --first images/bryce_left_01.png --second images/bryce_right_01.png 

# import the necessary packages
from pyimagesearch.panorama import Stitcher
import argparse
import imutils
import cv2

# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-f", "--first", required=True,
ap.add_argument("-s", "--second", required=True,
args = vars(ap.parse_args())

# load the two images and resize them to have a width of 400 pixels
# (for faster processing)
imageA = cv2.imread(args["first"])
imageB = cv2.imread(args["second"])
imageA = imutils.resize(imageA, width=400)
imageB = imutils.resize(imageB, width=400)

# stitch the images together to create a panorama
stitcher = Stitcher()
(result, vis) = stitcher.stitch([imageA, imageB], showMatches=True)

# show the images
cv2.imshow("Image A", imageA)
cv2.imshow("Image B", imageB)
cv2.imshow("Keypoint Matches", vis)
cv2.imshow("Result", result)

I'm at a loss

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.304946 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO