Load huge image
I try to load relativity big image 32000x32000, 1 channel but assertions raised:
Error: Assertion failed (pixels <=> (1<<30)) in> cv::validateInputImageSize, file C:\Lib\opencv\source\opencv\modules\imgcodecs\src\loadsave.cpp, line 74
OpenCV(4.0.0-pre) Error: Assertion failed ((size_t)valueInt == sz) in validateToInt, file C:\Lib\opencv\source\opencv\modules\imgcodecs\src\utils.cpp, line 48
imread_('e:/0/33333b.bmp'): can't read data: OpenCV(4.0.0-pre) C:\Lib\opencv\source\opencv\modules\imgcodecs\src\utils.cpp:48: error: (-215:Assertion failed) (size_t)valueInt == sz in function 'validateToInt'
However we can:
Mat m(65000, 40000, CV_8U);
uint64 i, n = (uint64)m.rows*m.cols;
for( i = 0; i < n; i++ )
m.data[i] = (uchar)(i & 255);
cv::threshold(m, m, 127, 255, cv::THRESH_BINARY);
imwrite("e:/0/ttt.jpg", m);
and it works fine. This means we cant load image bigger 1 Gigapixel (UPD. by imread), but able to process and save it?
consider this
probably you can't save if your Mat defined
@sturkmen. Sory, I make mistake. It was 32000x32000, 3 channel image, but I loaded it as grayscale
No, we can. (Win 10 x64)