Beispiel #1
0
        public CVImage CalcBackProject(CVHistogram histogram)
        {
            CVImage[] planes = Split();

            CVImage backProjection =
                new CVImage(
                    planes[0].RegionOfInterest.Width,
                    planes[0].RegionOfInterest.Height,
                    planes[0].Depth,
                    planes[0].Channels);

            __IplImagePtr[] iplImages = new __IplImagePtr[planes.Length];
            for (int i = 0; i < planes.Length; ++i)
            {
                iplImages[i] = planes[i].Internal;
            }

            PInvoke.cvCalcBackProject(iplImages, backProjection.Internal, histogram.Internal);
            CVUtils.CheckLastError();

            for (int i = 0; i < planes.Length; ++i)
            {
                planes[i].Release();
            }

            return(backProjection);
        }