I am trying to split an openCV frame image that I get from an input video stream
_, frame = cap.read()
into several smaller images and store them into an array. I don't know how many smaller images I will have beforehand, for example: I could split the image into 4 smaller images, or 8, 16 etc.
I want to create a function that allows me to display any arbitrary combination of the smaller images. Currently, it doesn't matter to me if they're being displayed in two separate windows or the same one (even though I would prefer them to be displayed in separate windows).
What I tried obviously doesn't work, looping over the list only displays the last image in the list:
# GridCells is the List that contains all the smaller images
def showCells(self):
for c in self.GridCells:
c.showC()
Where showC() is:
def showC(self):
cv2.imshow('cell',self.image)
As said I don't know how many smaller images I will have beforehand, hence having arbitrarily many cv2.imshow()
statements is not a solution.
Thank you for your time!