<p dir="auto">Noncontinuous cv::Mat is created when the matrix needed memory is bigger than 3 GB (while create or clone the mat), although in the create() function doc, its says 'Matrices created with Mat::create() are always continuous'.</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/opencv/opencv/blob/e959f449ae53272f29bcfcb4121a861291045703/modules/core/src/matrix.cpp#L318">opencv/modules/core/src/matrix.cpp</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 318
      in
      <a data-pjax="true" class="commit-tease-sha" href="/opencv/opencv/commit/e959f449ae53272f29bcfcb4121a861291045703">e959f44</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L318" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="318"></td>
          <td id="LC318" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">void</span> <span class="pl-en">Mat::create</span>(<span class="pl-k">int</span> d, <span class="pl-k">const</span> <span class="pl-k">int</span>* _sizes, <span class="pl-k">int</span> _type) </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 3.4.2</li>
<li>Operating System / Platform =&gt; Ubuntu 18.04</li>
<li>Compiler =&gt; gcc 8</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">Hi, I have the following in OpenCV 3.4.2</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cv::Mat3b a(cv::Size(30511, 26060)); 
cout &lt;&lt; a.isContinuous() &lt;&lt; endl;
cv::Mat3b b = a.clone();
cout &lt;&lt; b.isContinuous() &lt;&lt; endl;"><pre class="notranslate"><code class="notranslate">cv::Mat3b a(cv::Size(30511, 26060)); 
cout &lt;&lt; a.isContinuous() &lt;&lt; endl;
cv::Mat3b b = a.clone();
cout &lt;&lt; b.isContinuous() &lt;&lt; endl;
</code></pre></div>
<p dir="auto">and the result is 0 (false) in both cases, which I think is not correct. At least for <code class="notranslate">cv::Mat3b b</code> the docs say "The original step[] is not taken into account. So, the array copy is a continuous array occupying total()*elemSize() bytes.".</p>