MinMaxLoc() 개인적인 메소드

private MinMaxLoc ( IntPtr gpuMat, double &minVal, double &maxVal, Point &minLoc, Point &maxLoc, IntPtr mask ) : void
gpuMat System.IntPtr
minVal double
maxVal double
minLoc Point
maxLoc Point
mask System.IntPtr
리턴 void
예제 #1
0
        /// <summary>
        /// Returns the min / max location and values for the image
        /// </summary>
        /// <param name="maxLocations">The maximum locations for each channel </param>
        /// <param name="maxValues">The maximum values for each channel</param>
        /// <param name="minLocations">The minimum locations for each channel</param>
        /// <param name="minValues">The minimum values for each channel</param>
        public void MinMax(out double[] minValues, out double[] maxValues, out Point[] minLocations, out Point[] maxLocations)
        {
            minValues    = new double[NumberOfChannels];
            maxValues    = new double[NumberOfChannels];
            minLocations = new Point[NumberOfChannels];
            maxLocations = new Point[NumberOfChannels];

            if (NumberOfChannels == 1)
            {
                GpuInvoke.MinMaxLoc(Ptr, ref minValues[0], ref maxValues[0], ref minLocations[0], ref maxLocations[0], IntPtr.Zero);
            }
            else
            {
                GpuMat <TDepth>[] channels = Split(null);
                try
                {
                    for (int i = 0; i < NumberOfChannels; i++)
                    {
                        GpuInvoke.MinMaxLoc(Ptr, ref minValues[i], ref maxValues[i], ref minLocations[i], ref maxLocations[i], IntPtr.Zero);
                    }
                }
                finally
                {
                    foreach (GpuMat <TDepth> mat in channels)
                    {
                        mat.Dispose();
                    }
                }
            }
        }