title: openCV imread limit for large or huge images Mat bug #3258
body: <p>I've been searching for days about this issue and didn't find any solved thread.
  I need loading pretty large images (4 GB and beyond, either .tiff / .png) into openCV code, by means of a simple</p>
  
  <pre><code>src = imread(filepath, 1);
  </code></pre>
  
  <p>I'm using Visual Studio 2013, C++.</p>
  
  <p>Though I'm using a 96Gb-RAM machine, runtime alerts are coming out when loading these large images by OpenCV's "imread" function. Been trying with smaller and smaller images/files untill the point they are indeed read/loaded, so we know it's a matter of memory/allocation since smaller images are correctly loaded and processed.</p>
  
  <p>Console is throughing the following message, extracted by "catch (...)"</p>
  
  <blockquote>
    <p>OpenCV Error: One of arguments' values is out of range (The total
    matrix size does not fit to "size_t" type) in cv::setSize, file
    C:\builds\2_4_PackSlave-win32-
    vc12-shared\opencv\modules\core\src\matrix.cpp, line 126</p>
  </blockquote>
  
  <p>On the other hand, VS2013 shows the following alert while running (no compilation issues at all):</p>
  
  <blockquote>
    <p>Unhandled exception at 0x76385608 in poblacion.exe: Microsoft C++
    exception: cv::Exception at memory location 0x00C7EA70</p>
  </blockquote>
  
  <p>also arguing "no symbols loaded". We are compiling in Win32, Debug mode.</p>
  
  <p>This issue is bug #3258 but no solved thread is found out there, just discussion regarging size_t type leading to no clear solution... There should be a way of reading large images without going through openCV libraries...</p>
  
  <p>Did this happen to anybody there who can help us?? I will spread any satifying solution.</p>
  
  <p>THANX in advance!</p>
  
  <p>Alex</p>