title: OpenCV Mat object - get data length
body: <p>In OpenCV, I'm able to capture frames using VideoCapture in C++, however, when I try to get the data from a frame and calculate length, it just returns me 0.</p>
  
  <p>Below is my sample code:</p>
  
  <pre><code>VideoCapture cap(0);
  for(;;) {
    Mat frame;
    cap &gt;&gt; frame;
    int length = strlen((char*) frame.data); // returns 0
  }
  </code></pre>
  
  <p>As I mentioned above that if I save the frame in a PNG file, I can actually see the image so I'm not able to understand why the data length is coming out to be zero.</p>
  
  <p>Any clue?</p>