Accord.Vision.Tracking.Camshift.computeHistogramRatio C# (CSharp) Method

computeHistogramRatio() private static method

Computes the ratio histogram between to histograms.
http://www.robinhewitt.com/research/track/backproject.html
private static computeHistogramRatio ( float histogramM, float histogramI, float ratio ) : float
histogramM float
histogramI float
ratio float
return float
        private static float computeHistogramRatio(float[] histogramM, float[] histogramI, float[] ratio)
        {
            float sum = 0;

            for (int i = 0; i < ratio.Length; i++)
            {
                sum += ratio[i] = (histogramI[i] != 0) ?
                    Math.Max(Math.Min(histogramM[i] / histogramI[i], 1f), 0f) : 0f;
            }

            return sum;

        }