Exemple #1
0
        /// <summary>
        /// Applies a binary blob thinning operation, to achieve a skeletization of the input image.
        /// The function transforms a binary blob image into a skeletized form using the technique of Zhang-Suen.
        /// </summary>
        /// <param name="src">Source 8-bit single-channel image, containing binary blobs, with blobs having 255 pixel values.</param>
        /// <param name="dst">Destination image of the same size and the same type as src. The function can work in-place.</param>
        /// <param name="thinningType">Value that defines which thinning algorithm should be used. </param>
        public static void Thinning(
            InputArray src, OutputArray dst,
            ThinningTypes thinningType = ThinningTypes.ZHANGSUEN)
        {
            if (src == null)
            {
                throw new ArgumentNullException(nameof(src));
            }
            if (dst == null)
            {
                throw new ArgumentNullException(nameof(dst));
            }
            src.ThrowIfDisposed();
            dst.ThrowIfNotReady();

            NativeMethods.ximgproc_thinning(src.CvPtr, dst.CvPtr, (int)thinningType);

            GC.KeepAlive(src);
            dst.Fix();
        }
Exemple #2
0
 private static extern void cveThinning(IntPtr src, IntPtr dst, ThinningTypes thinningType);
Exemple #3
0
 /// <summary>
 /// Applies a binary blob thinning operation, to achieve a skeletization of the input image. 
 /// The function transforms a binary blob image into a skeletized form using the technique of Zhang-Suen.
 /// </summary>
 /// <param name="src">Source 8-bit single-channel image, containing binary blobs, with blobs having 255 pixel values.</param>
 /// <param name="dst">Destination image of the same size and the same type as src. The function can work in-place.</param>
 /// <param name="thinningType">Value that defines which thinning algorithm should be used.</param>
 public static void Thinning(IInputArray src, IOutputArray dst, ThinningTypes thinningType)
 {
     using (InputArray iaSrc = src.GetInputArray())
     using (OutputArray oaDst = dst.GetOutputArray())
         cveThinning(iaSrc, oaDst, thinningType);
 }