title: How to get the max value from n dimensional array in OpenCV
body: <p>I am trying to get max value from a 3-d Mat, but minmaxIdx and mixmaxloc both failed to do this. </p>
  
  <pre><code>int sz[] = {BIN, BIN, BIN};
  Mat accumarray(3, sz, CV_8U, Scalar::all(0)) ;
  double testMaxval = 0;
  int minIdx = accumarray.dims ;
  minMaxIdx(accumarray, NULL, &amp;testMaxval,NULL,minIdx ,NULL) ;
  cout&lt;&lt;testMaxval&lt;&lt;endl ;
  </code></pre>
  
  <p>This code wouldn't work, so Can I use max(), minmaxidx(), or minmaxloc() to get the max value efficiently without manually process the entire n-dimensional array?</p>