private MinMaxLoc ( |
||
gpuMat | ||
minVal | double | |
maxVal | double | |
minLoc | Point | |
maxLoc | Point | |
mask | ||
return | void |
/// <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(); } } } }