I would like to do something like the following in order to display two images on the screen:
imshow("1", img1);
imshow(\'2\', \'img2\');
I ran into the problem of having to create an arbitrary number of openCV windows. I had them stored in a list and couldn't simply loop over it to display them:
# images is a list of openCV image object
for img in images:
cv2.imshow('image',i)
This doesn't work for the trivial reason of images requiring a different label, hence this loop would only display the last item in the list.
That can be solved by using an iterator and python string formatters:
for i, img in enumerator(images):
cv2.imshow("Image number {}".format(i), img)
Therefore now all images will be displayed since they have been assigned a different label.