title: why I cannot create histograms with calcHist in openCV
body: <p>this is my code for calculation of histogram:</p>
  
  <pre><code>Mat hist;
  int histSize = 4000;
  float range[] = { 0, 4000 } ;
  int channels[] = {0};
  const float* histRange = { range };
  bool uniform = true; bool accumulate = false;
  for(int i = 0; i &lt; sz;i++){
      id = orders.at&lt;int&gt;(i);
      int from = activities[id].frame_from;
      int to = activities[id].frame_to;
      Mat labelsForHist = labels(Range(from,to),Range(0,1));     
      calcHist(&amp;labelsForHist,1,channels,Mat(),hist,1,&amp;histSize,&amp;histRange,uniform,accumulate);  
  
  }
  </code></pre>
  
  <p>but I am getting this error: <code>error: (-210) in function calcHist</code><br>
  in for loop I am getting values from certain ranges of the <code>labels</code> array and put it into <code>labelsForHist</code> to calculate its histogram.<br>
  any idea why i get this error?  </p>