WHat I am trying to do is to take 2 2 images from then stitch them together in a loop. This is the code i am trying to use:
for i in range(1,3):
imageA = cv2.imread('frame%d.jpg'%i);i=i+1;print imageA.shape;
imageB = cv2.imread('frame%d.jpg'%i);i=i+1;print imageB.shape;
result,vis = stitcher.stitch([imageA, imageB], showMatches=True)
cv2.imwrite('Stitch%d.jpg'%n,result); n=n+1;
But it is giving an error:
Traceback (most recent call last):
File "test1.py", line 123, in <module>
imageA = cv2.imread('frame%d.jpg'%i);i=i+1;print imageA.shape;
AttributeError: 'NoneType' object has no attribute 'shape'
Now when i remove the for loop and only execute the statements which were in the loop, it runs perfectly fine.
What could be the problem?