/// <summary> /// <para>(Accord .NET internal call)</para> /// In image processing, a Gabor filter, named after Dennis Gabor, is a linear /// filter used for edge detection. Frequency and orientation representations /// of Gabor filters are similar to those of the human visual system, and they /// have been found to be particularly appropriate for texture representation /// and discrimination. In the spatial domain, a 2D Gabor filter is a Gaussian /// kernel function modulated by a sinusoidal plane wave. The Gabor filters are /// self-similar: all filters can be generated from one mother wavelet by dilation /// and rotation. /// </summary> /// <param name="img">Image.</param> /// <param name="gaborFilter">Gabor filter instance. /// <para>To avoid calculating Gabor every time use this function overload that receives instance.</para> /// </param> /// <returns>Filtered image.</returns> internal static Gray <byte>[,] GaborFilter(this Gray <byte>[,] img, GaborFilter gaborFilter) { return(img.ApplyFilter(gaborFilter)); }
/// <summary> /// Applies wavelet transform filter (Accord.NET). /// </summary> /// <param name="img">Image.</param> /// <param name="wavelet">A wavelet function.</param> /// <param name="backward">True to perform backward transform, false otherwise.</param> /// <returns>Transformed image.</returns> public static Gray <byte>[,] WaveletTransform(this Gray <byte>[,] img, IWavelet wavelet, bool backward = false) { WaveletTransform wt = new WaveletTransform(wavelet, backward); return(img.ApplyFilter((BaseFilter)wt)); }
/// <summary> /// <para>(Accord .NET internal call)</para> /// The Variance filter replaces each pixel in an image by its /// neighborhood variance. The end result can be regarded as an /// border enhancement, making the Variance filter suitable to /// be used as an edge detection mechanism. /// </summary> /// <param name="img">Image.</param> /// <param name="radius">The radius neighborhood used to compute a pixel's local variance.</param> /// <returns>Processed image.</returns> public static Gray <byte>[,] Variance(this Gray <byte>[,] img, int radius = 2) { Variance v = new Variance(radius); return(img.ApplyFilter(v)); }
/// <summary> /// Kuwahara filter. /// <para>Accord.NET internal call. See: <see cref="Accord.Imaging.Filters.Kuwahara"/> for details.</para> /// </summary> /// <param name="img">Image.</param> /// <param name="size">the size of the kernel used in the Kuwahara filter. This should be odd and greater than or equal to five</param> /// <param name="blockSize">the size of each of the four inner blocks used in the Kuwahara filter. This is always half the <paramref name="size"/> minus one.</param> /// <param name="inPlace">Apply in place or not. If it is set to true return value can be omitted.</param> /// <returns>Processed image.</returns> public static Gray <byte>[,] Kuwahara(this Gray <byte>[,] img, int size = 5, int blockSize = 2, bool inPlace = false) { Kuwahara k = new Kuwahara(); return(img.ApplyFilter(k, inPlace)); }