According to latest OpenCV (OpenCV 2.4.5) documentation, cvGetHistValue_1D
has been deprecated from imgproc module, and is now part of the legacy
module.
I would like to know what should be used instead of cvGetHistValue_1D
if I do not plan to use the legacy
module.
My previous code is as under, which needs to be rewritten without the use of cvGetHistValue_1D
CvHistogram *hist = cvCreateHist(1, &numBins, CV_HIST_ARRAY, ranges, 1);
cvClearHist(hist);
cvCalcHist(&oDepth,hist);
cvNormalizeHist(hist, 1.0f);
float *cumHist = new float[numBins];
cumHist[0] = *cvGetHistValue_1D(hist, 0);
for(int i = 1; i<numBins; i++)
{
cumHist[i] = cumHist[i-1] + *cvGetHistValue_1D(hist, i);
if (cumHist[i] > 0.95)
{
oMaxDisp = i;
break;
}
}