title: What causes "OpenCV(4.0.1) Error : Assertion failed(m.dims <= 2)"
body: <p>What causes this error?</p>
  
  <blockquote>
    <p>OpenCV: terminate handler is called!The last OpenCV error is :
    OpenCV(4.0.1) Error : Assertion failed(m.dims &lt;= 2) in
    cv::FormattedImpl::FormattedImpl, file c : \build\master_winpack -
    build - win64 - vc15\opencv\modules\core\src\out.cpp, line 87</p>
  </blockquote>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;opencv2/opencv.hpp&gt;
  
  using namespace cv;
  using namespace std;
  
  void main()
  {
  
      int ordo[3] = { 2, 2, 2 };
      Mat obj(3, ordo, CV_8UC1, Scalar::all(0));
      cout &lt;&lt; obj &lt;&lt; endl;
      waitKey(0);
  }
  </code></pre>