Class GImageMiscOps


  • public class GImageMiscOps
    extends java.lang.Object
    Generalized version of ImageMiscOps. Type checking is performed at runtime instead of at compile type.
    • Constructor Summary

      Constructors 
      Constructor Description
      GImageMiscOps()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addGaussian​(boofcv.struct.image.ImageBase input, java.util.Random rand, double sigma, double lowerBound, double upperBound)
      Adds Gaussian/normal i.i.d noise to each pixel in the image.
      static void addUniform​(boofcv.struct.image.ImageBase input, java.util.Random rand, double min, double max)
      Adds uniform i.i.d noise to each pixel in the image.
      static void copy​(int srcX, int srcY, int dstX, int dstY, int width, int height, boofcv.struct.image.ImageBase input, boofcv.struct.border.ImageBorder border, boofcv.struct.image.ImageBase output)
      Copies a rectangular region from one image into another.
      static void copy​(int srcX, int srcY, int dstX, int dstY, int width, int height, boofcv.struct.image.ImageBase input, boofcv.struct.image.ImageBase output)
      Copies a rectangular region from one image into another.
      output[dstX:(dstX+width) , dstY:(dstY+height-1)] = input[srcX:(srcX+width) , srcY:(srcY+height-1)]
      static void fill​(boofcv.struct.image.ImageBase input, double value)
      Computes the mean of the absolute value of the difference between the two images.
      static void fill​(boofcv.struct.image.ImageBase input, double[] values)
      Computes the mean of the absolute value of the difference between the two images.
      static void fillBand​(boofcv.struct.image.ImageMultiBand input, int band, double value)
      Computes the mean of the absolute value of the difference between the two images.
      static void fillBorder​(boofcv.struct.image.ImageBase input, double value, int radius)
      Fills the outside border with the specified value
      static void fillBorder​(boofcv.struct.image.ImageBase input, double value, int borderX0, int borderY0, int borderX1, int borderY1)
      Fills the border with independent border widths for each side
      static void fillGaussian​(boofcv.struct.image.ImageBase input, java.util.Random rand, double mean, double sigma, double lowerBound, double upperBound)
      Sets each value in the image to a value drawn from a Gaussian distribution.
      static void fillRectangle​(boofcv.struct.image.ImageBase input, double value, int x0, int y0, int width, int height)
      Draws a filled rectangle that is aligned along the image axis inside the image.
      static void fillUniform​(boofcv.struct.image.ImageBase input, java.util.Random rand, double min, double max)
      Sets each value in the image to a value drawn from an uniform distribution that has a range of min ≤ X < max.
      static void flipHorizontal​(boofcv.struct.image.ImageBase img)
      Flips the image from left to right
      static void flipVertical​(boofcv.struct.image.ImageBase img)
      Flips the image from top to bottom
      static <T extends boofcv.struct.image.ImageBase<T>>
      void
      growBorder​(T src, boofcv.struct.border.ImageBorder<T> border, int borderX0, int borderY0, int borderX1, int borderY1, T dst)
      Creates a new image which is a copy of the src image but extended with border pixels.
      static void insertBand​(boofcv.struct.image.ImageGray input, int band, boofcv.struct.image.ImageMultiBand output)
      Computes the mean of the absolute value of the difference between the two images.
      static void rotateCCW​(boofcv.struct.image.ImageBase image)
      In-place 90 degree image rotation in the counter-clockwise direction.
      static void rotateCCW​(boofcv.struct.image.ImageBase imageA, boofcv.struct.image.ImageBase imageB)
      Rotates the image 90 degrees in the counter-clockwise direction.
      static void rotateCW​(boofcv.struct.image.ImageBase image)
      In-place 90 degree image rotation in the clockwise direction.
      static void rotateCW​(boofcv.struct.image.ImageBase imageA, boofcv.struct.image.ImageBase imageB)
      Rotates the image 90 degrees in the clockwise direction.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GImageMiscOps

        public GImageMiscOps()
    • Method Detail

      • copy

        public static void copy​(int srcX,
                                int srcY,
                                int dstX,
                                int dstY,
                                int width,
                                int height,
                                boofcv.struct.image.ImageBase input,
                                boofcv.struct.border.ImageBorder border,
                                boofcv.struct.image.ImageBase output)
        Copies a rectangular region from one image into another. Pixels can be outside the input image.
        output[dstX:(dstX+width) , dstY:(dstY+height-1)] = input[srcX:(srcX+width) , srcY:(srcY+height-1)]
        Parameters:
        srcX - x-coordinate of corner in input image
        srcY - y-coordinate of corner in input image
        dstX - x-coordinate of corner in output image
        dstY - y-coordinate of corner in output image
        width - Width of region to be copied
        height - Height of region to be copied
        input - Input image
        border - Method used to hand pixels outside the input image border
        output - output image
      • copy

        public static void copy​(int srcX,
                                int srcY,
                                int dstX,
                                int dstY,
                                int width,
                                int height,
                                boofcv.struct.image.ImageBase input,
                                boofcv.struct.image.ImageBase output)
        Copies a rectangular region from one image into another.
        output[dstX:(dstX+width) , dstY:(dstY+height-1)] = input[srcX:(srcX+width) , srcY:(srcY+height-1)]
        Parameters:
        srcX - x-coordinate of corner in input image
        srcY - y-coordinate of corner in input image
        dstX - x-coordinate of corner in output image
        dstY - y-coordinate of corner in output image
        width - Width of region to be copied
        height - Height of region to be copied
        input - Input image
        output - output image
      • fill

        public static void fill​(boofcv.struct.image.ImageBase input,
                                double value)
        Computes the mean of the absolute value of the difference between the two images.
        Parameters:
        input - Input image. Not modified.
        value - fill value
      • fill

        public static void fill​(boofcv.struct.image.ImageBase input,
                                double[] values)
        Computes the mean of the absolute value of the difference between the two images.
        Parameters:
        input - Input image. Not modified.
        values - Array which contains the values each band is to be filled with.
      • fillBand

        public static void fillBand​(boofcv.struct.image.ImageMultiBand input,
                                    int band,
                                    double value)
        Computes the mean of the absolute value of the difference between the two images.
        Parameters:
        input - An image.
        band - Which band is to be filled with the specified value
        value - The value that the image is being filled with.
      • insertBand

        public static void insertBand​(boofcv.struct.image.ImageGray input,
                                      int band,
                                      boofcv.struct.image.ImageMultiBand output)
        Computes the mean of the absolute value of the difference between the two images.
        Parameters:
        input - Single band image
        band - Which band the image is to be inserted into
        output - The multi-band image which the input image is to be inserted into
      • fillBorder

        public static void fillBorder​(boofcv.struct.image.ImageBase input,
                                      double value,
                                      int radius)
        Fills the outside border with the specified value
        Parameters:
        input - An image.
        value - The value that the image is being filled with.
        radius - Border width.
      • fillBorder

        public static void fillBorder​(boofcv.struct.image.ImageBase input,
                                      double value,
                                      int borderX0,
                                      int borderY0,
                                      int borderX1,
                                      int borderY1)
        Fills the border with independent border widths for each side
        Parameters:
        input - An image.
        value - The value that the image is being filled with.
        borderX0 - Width of border on left
        borderY0 - Width of border on top
        borderX1 - Width of border on right
        borderY1 - Width of border on bottom
      • fillRectangle

        public static void fillRectangle​(boofcv.struct.image.ImageBase input,
                                         double value,
                                         int x0,
                                         int y0,
                                         int width,
                                         int height)
        Draws a filled rectangle that is aligned along the image axis inside the image.
        Parameters:
        input - Image the rectangle is drawn in. Modified
        value - Value of the rectangle
        x0 - Top left x-coordinate
        y0 - Top left y-coordinate
        width - Rectangle width
        height - Rectangle height
      • fillGaussian

        public static void fillGaussian​(boofcv.struct.image.ImageBase input,
                                        java.util.Random rand,
                                        double mean,
                                        double sigma,
                                        double lowerBound,
                                        double upperBound)
        Sets each value in the image to a value drawn from a Gaussian distribution. A user specified lower and upper bound is provided to ensure that the values are within a legal range. A drawn value outside the allowed range will be set to the closest bound.
        Parameters:
        input - Input image. Modified.
        rand - Random number generator
        mean - Distribution's mean.
        sigma - Distribution's standard deviation.
        lowerBound - Lower bound of value clip
        upperBound - Upper bound of value clip
      • fillUniform

        public static void fillUniform​(boofcv.struct.image.ImageBase input,
                                       java.util.Random rand,
                                       double min,
                                       double max)
        Sets each value in the image to a value drawn from an uniform distribution that has a range of min ≤ X < max.
        Parameters:
        input - Image which is to be filled. Modified,
        rand - Random number generator
        min - Minimum value of the distribution. Inclusive.
        max - Maximum value of the distribution. Inclusive.
      • addGaussian

        public static void addGaussian​(boofcv.struct.image.ImageBase input,
                                       java.util.Random rand,
                                       double sigma,
                                       double lowerBound,
                                       double upperBound)
        Adds Gaussian/normal i.i.d noise to each pixel in the image. If a value exceeds the specified it will be set to the closest bound.
        Parameters:
        input - Input image. Modified.
        rand - Random number generator.
        sigma - Distributions standard deviation.
        lowerBound - Allowed lower bound
        upperBound - Allowed upper bound
      • addUniform

        public static void addUniform​(boofcv.struct.image.ImageBase input,
                                      java.util.Random rand,
                                      double min,
                                      double max)
        Adds uniform i.i.d noise to each pixel in the image. Noise range is min ≤ X < max.
      • flipVertical

        public static void flipVertical​(boofcv.struct.image.ImageBase img)
        Flips the image from top to bottom
      • flipHorizontal

        public static void flipHorizontal​(boofcv.struct.image.ImageBase img)
        Flips the image from left to right
      • rotateCW

        public static void rotateCW​(boofcv.struct.image.ImageBase image)
        In-place 90 degree image rotation in the clockwise direction. Only works on square images.
      • rotateCW

        public static void rotateCW​(boofcv.struct.image.ImageBase imageA,
                                    boofcv.struct.image.ImageBase imageB)
        Rotates the image 90 degrees in the clockwise direction.
      • rotateCCW

        public static void rotateCCW​(boofcv.struct.image.ImageBase image)
        In-place 90 degree image rotation in the counter-clockwise direction. Only works on square images.
      • rotateCCW

        public static void rotateCCW​(boofcv.struct.image.ImageBase imageA,
                                     boofcv.struct.image.ImageBase imageB)
        Rotates the image 90 degrees in the counter-clockwise direction.
      • growBorder

        public static <T extends boofcv.struct.image.ImageBase<T>> void growBorder​(T src,
                                                                                   boofcv.struct.border.ImageBorder<T> border,
                                                                                   int borderX0,
                                                                                   int borderY0,
                                                                                   int borderX1,
                                                                                   int borderY1,
                                                                                   T dst)
        Creates a new image which is a copy of the src image but extended with border pixels.
        Parameters:
        src - (Input) source image
        border - (Input) image border generator
        borderX0 - (Input) Border x-axis lower extent
        borderY0 - (Input) Border y-axis lower extent
        borderX1 - (Input) Border x-axis upper extent
        borderY1 - (Input) Border y-axis upper extent
        dst - (Output) Output image. width=src.width+2*radiusX and height=src.height+2*radiusY