How to deal with large images

Hi,

Can you post error message?
Is it :

cv2.error: OpenCV(4.5.2-dev) G:\Lib\opencv\modules\imgcodecs\src\loadsave.cpp:77: error: (-215:Assertion failed) pixels <= CV_IO_MAX_IMAGE_PIXELS in function ‘cv::validateInputImageSize’

or

cv2.error: OpenCV(4.5.2-dev) G:\Lib\opencv\modules\core\src\alloc.cpp:73: error: (-4:Insufficient memory) Failed to allocate 12884901888 bytes in function ‘cv::OutOfMemoryError’

?

Example wih python and windows

Microsoft Windows [version 10.0.19041.985]
(c) Microsoft Corporation. Tous droits réservés.

C:\Users\Laurent>python
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> import cv2 as cv
>>> img = np.zeros(shape=(33000,33000), dtype=np.uint8)
>>> cv.imwrite("test.png",img)
True
>>> img2 = cv.imread("test.png")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
cv2.error: OpenCV(4.5.2-dev) G:\Lib\opencv\modules\imgcodecs\src\loadsave.cpp:77: error: (-215:Assertion failed) pixels <= CV_IO_MAX_IMAGE_PIXELS in function 'cv::validateInputImageSize'

>>> exit()

C:\Users\Laurent>set OPENCV_IO_MAX_IMAGE_PIXELS=17179869184

C:\Users\Laurent>python
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> import cv2 as cv
>>> img2 = cv.imread("test.png")
>>> img2.shape
(33000, 33000, 3)
>>>