示例#1
0
        /// <summary>
        ///  Gray-Level Difference Method (GLDM).
        ///  <para>Computes an gray-level histogram of difference values between adjacent pixels in an image.</para>
        ///  <para>Accord.NET internal call. Please see: <see cref="Accord.Imaging.GrayLevelDifferenceMethod">Gray-Level Difference Method</see> for details.</para>
        /// </summary>
        /// <param name="image">The source image.</param>
        /// <param name="autoGray">Whether the maximum value of gray should be automatically computed from the image. </param>
        /// <param name="degree">The direction at which the co-occurrence should be found.</param>
        /// <returns>An histogram containing co-occurrences for every gray level in <paramref name="image"/>.</returns>
        public static int[] GrayLevelDifferenceMethod(this Image <Gray, byte> image, CooccurrenceDegree degree, bool autoGray = true)
        {
            GrayLevelDifferenceMethod gldm = new GrayLevelDifferenceMethod(degree, autoGray);
            var hist = gldm.Compute(image.ToAForgeImage(copyAlways: false, failIfCannotCast: true));

            return(hist);
        }
        /// <summary>
        ///  Gray-Level Difference Method (GLDM).
        ///  <para>Computes an gray-level histogram of difference values between adjacent pixels in an image.</para>
        ///  <para>Accord.NET internal call. Please see: <see cref="Accord.Imaging.GrayLevelDifferenceMethod">Gray-Level Difference Method</see> for details.</para>
        /// </summary>
        /// <param name="image">The source image.</param>
        /// <param name="autoGray">Whether the maximum value of gray should be automatically computed from the image. </param>
        /// <param name="degree">The direction at which the co-occurrence should be found.</param>
        /// <returns>An histogram containing co-occurrences for every gray level in <paramref name="image"/>.</returns>
        public static int[] GrayLevelDifferenceMethod(this Image<Gray, byte> image, CooccurrenceDegree degree, bool autoGray = true)
        {
            GrayLevelDifferenceMethod gldm = new GrayLevelDifferenceMethod(degree, autoGray);
            var hist = gldm.Compute(image.ToAForgeImage(copyAlways: false, failIfCannotCast: true));

            return hist;
        }
 /// <summary>
 ///   Initializes a new instance of the <see cref="GrayLevelCooccurrenceMatrix"/> class.
 /// </summary>
 ///
 /// <param name="distance">The distance at which the texture should be analyzed.</param>
 /// <param name="degree">The direction to look for co-occurrences.</param>
 /// <param name="autoGray">Whether the maximum value of gray should be
 ///   automatically computed from the image. Default is true.</param>
 /// <param name="normalize">Whether the produced GLCM should be normalized,
 ///   dividing each element by the number of pairs. Default is true.</param>
 ///
 public GrayLevelCooccurrenceMatrix(int distance, CooccurrenceDegree degree,
                                    bool normalize = true, bool autoGray = true)
 {
     this.distance  = distance;
     this.degree    = degree;
     this.normalize = normalize;
     this.autoGray  = autoGray;
 }
        /// <summary>
        ///  Gray-Level Difference Method (GLDM).
        ///  <para>Computes an gray-level histogram of difference values between adjacent pixels in an image.</para>
        ///  <para>Accord.NET internal call. Please see: <see cref="Accord.Imaging.GrayLevelDifferenceMethod">Gray-Level Difference Method</see> for details.</para>
        /// </summary>
        /// <param name="image">The source image.</param>
        /// <param name="autoGray">Whether the maximum value of gray should be automatically computed from the image. </param>
        /// <param name="degree">The direction at which the co-occurrence should be found.</param>
        /// <returns>An histogram containing co-occurrences for every gray level in <paramref name="image"/>.</returns>
        public static int[] GrayLevelDifferenceMethod(this Gray<byte>[,] image, CooccurrenceDegree degree, bool autoGray = true)
        {
            GrayLevelDifferenceMethod gldm = new GrayLevelDifferenceMethod(degree, autoGray);

            int[] hist;
            using(var uImg = image.Lock())
            {
                hist = gldm.Compute(uImg.AsAForgeImage());
            }

            return hist;
        }
示例#5
0
        /// <summary>
        ///  Gray-Level Difference Method (GLDM).
        ///  <para>Computes an gray-level histogram of difference values between adjacent pixels in an image.</para>
        ///  <para>Accord.NET internal call. Please see: <see cref="Accord.Imaging.GrayLevelDifferenceMethod">Gray-Level Difference Method</see> for details.</para>
        /// </summary>
        /// <param name="image">The source image.</param>
        /// <param name="autoGray">Whether the maximum value of gray should be automatically computed from the image. </param>
        /// <param name="degree">The direction at which the co-occurrence should be found.</param>
        /// <returns>An histogram containing co-occurrences for every gray level in <paramref name="image"/>.</returns>
        public static int[] GrayLevelDifferenceMethod(this Gray <byte>[,] image, CooccurrenceDegree degree, bool autoGray = true)
        {
            GrayLevelDifferenceMethod gldm = new GrayLevelDifferenceMethod(degree, autoGray);

            int[] hist;
            using (var uImg = image.Lock())
            {
                hist = gldm.Compute(uImg.AsAForgeImage());
            }

            return(hist);
        }
 /// <summary>
 ///   Initializes a new instance of the <see cref="GrayLevelCooccurrenceMatrix"/> class.
 /// </summary>
 /// 
 /// <param name="distance">The distance at which the texture should be analyzed.</param>
 /// <param name="degree">The direction to look for co-occurrences.</param>
 /// <param name="autoGray">Whether the maximum value of gray should be
 ///   automatically computed from the image. Default is true.</param>
 /// <param name="normalize">Whether the produced GLCM should be normalized,
 ///   dividing each element by the number of pairs. Default is true.</param>
 /// 
 public GrayLevelCooccurrenceMatrix(int distance, CooccurrenceDegree degree,
     bool normalize = true, bool autoGray = true)
 {
     this.distance = distance;
     this.degree = degree;
     this.normalize = normalize;
     this.autoGray = autoGray;
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref="GrayLevelCooccurrenceMatrix"/> class.
 /// </summary>
 /// 
 /// <param name="distance">The distance at which the texture should be analyzed.</param>
 /// <param name="degree">The direction to look for co-occurrences.</param>
 /// 
 public GrayLevelCooccurrenceMatrix(int distance, CooccurrenceDegree degree)
 {
     this.distance = distance;
     this.degree = degree;
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref="GrayLevelDifferenceMethod"/> class.
 /// </summary>
 /// 
 /// <param name="degree">The direction at which the co-occurrence should be found.</param>
 /// <param name="autoGray">Whether the maximum value of gray should be
 ///   automatically computed from the image. Default is true.</param>
 /// 
 public GrayLevelRunLengthMatrix(CooccurrenceDegree degree, bool autoGray)
 {
     this.degree = degree;
     this.autoGray = autoGray;
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref="GrayLevelDifferenceMethod"/> class.
 /// </summary>
 /// 
 /// <param name="degree">The direction at which the co-occurrence should be found.</param>
 /// 
 public GrayLevelRunLengthMatrix(CooccurrenceDegree degree)
 {
     this.degree = degree;
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref="GrayLevelCooccurrenceMatrix"/> class.
 /// </summary>
 ///
 /// <param name="distance">The distance at which the texture should be analyzed.</param>
 /// <param name="degree">The direction to look for co-occurrences.</param>
 ///
 public GrayLevelCooccurrenceMatrix(int distance, CooccurrenceDegree degree)
 {
     this.distance = distance;
     this.degree   = degree;
 }
示例#11
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="GrayLevelDifferenceMethod"/> class.
 /// </summary>
 ///
 /// <param name="degree">The direction at which the co-occurrence should be found.</param>
 /// <param name="autoGray">Whether the maximum value of gray should be
 ///   automatically computed from the image. Default is true.</param>
 ///
 public GrayLevelRunLengthMatrix(CooccurrenceDegree degree, bool autoGray)
 {
     this.degree   = degree;
     this.autoGray = autoGray;
 }
示例#12
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="GrayLevelDifferenceMethod"/> class.
 /// </summary>
 ///
 /// <param name="degree">The direction at which the co-occurrence should be found.</param>
 ///
 public GrayLevelRunLengthMatrix(CooccurrenceDegree degree)
 {
     this.degree = degree;
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref="GrayLevelDifferenceMethod"/> class.
 /// </summary>
 /// 
 /// <param name="degree">The direction at which the co-occurrence should be found.</param>
 /// <param name="autoGray">Whether the maximum value of gray should be
 ///   automatically computed from the image. Default is true.</param>
 /// 
 public GrayLevelDifferenceMethod(CooccurrenceDegree degree, bool autoGray)
 {
     this.degree = degree;
     this.autoGray = autoGray;
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref="GrayLevelDifferenceMethod"/> class.
 /// </summary>
 /// 
 /// <param name="degree">The direction at which the co-occurrence should be found.</param>
 /// 
 public GrayLevelDifferenceMethod(CooccurrenceDegree degree)
 {
     this.degree = degree;
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref="GrayLevelDifferenceMethod"/> class.
 /// </summary>
 /// 
 /// <param name="degree">The direction at which the co-occurrence should be found.</param>
 /// <param name="autoGray">Whether the maximum value of gray should be
 ///   automatically computed from the image. Default is true.</param>
 /// 
 public GrayLevelDifferenceMethod(CooccurrenceDegree degree, bool autoGray)
 {
     this.degree = degree;
     this.autoGray = autoGray;
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref="GrayLevelDifferenceMethod"/> class.
 /// </summary>
 /// 
 /// <param name="degree">The direction at which the co-occurrence should be found.</param>
 /// 
 public GrayLevelDifferenceMethod(CooccurrenceDegree degree)
 {
     this.degree = degree;
 }