I am trying to deal with a massive numpy array that I then end up writing into a JPEG image using cv2.imwrite(numpy.array). Unfortunately, what I am working with does not fit into my RAM even though the final JPG image should come up to about 200 MB only.
How can I manage such loads without overloading my RAM?
Are there other ways to write an image without storing the entire array in my RAM at once? It's possible for me to load small bits of the array at a time, but I don't know which module/function to use to write to an image without storing the whole thing on my RAM at once.
As of right now, I have saved the whole image in 4 smaller images (quarters) because that's the best I could do with my limited RAM. But I still want to be able to stitch them together into one complete image. The target image is a 3-channel 26112 x 20480 image.