Exemplo n.º 1
0
        protected void CreateHist(int[] binSizes, CVPair[] binRanges)
        {
            this._binSizes  = binSizes;
            this._binRanges = binRanges;



            float[][] ranges = new float[binRanges.Length][];

            // make sure ranges & sizes are of the same dimention.
            System.Diagnostics.Debug.Assert(binSizes.Length == binRanges.Length, "Ranges & sizes must be of the same dimention");

            // create ranges array.
            for (int i = 0; i < binRanges.Length; ++i)
            {
                float[] range = new float[2];
                range[0]  = binRanges[i].First;
                range[1]  = binRanges[i].Second;
                ranges[i] = range;
            }

            this.Internal = PInvoke.cvCreateHist(this._binSizes, (int)CVHistogramType.Array, ranges, true);
            CVUtils.CheckLastError();
        }