Class BoofCVHelper


  • public class BoofCVHelper
    extends Object
    Helper class for BoofCV operations.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • BoofCVHelper

        public BoofCVHelper()
    • Method Detail

      • toBufferedImage

        public static BufferedImage toBufferedImage​(boofcv.struct.image.ImageBase img)
        Turns the image into a buffered image.
        Parameters:
        img - the image to convert
        Returns:
        the buffered image
      • clone

        public static boofcv.struct.image.ImageBase clone​(boofcv.struct.image.ImageBase img)
        Clones the image.
        Parameters:
        img - the image to clone
        Returns:
        the clone
      • toBoofCVImage

        public static boofcv.struct.image.ImageBase toBoofCVImage​(boofcv.struct.image.ImageBase img,
                                                                  BoofCVImageType type)
        Converts the image to the specified type if necessary.
        Parameters:
        img - the image to convert
        type - the type of image
        Returns:
        the converted container
      • toBoofCVImage

        public static boofcv.struct.image.ImageBase toBoofCVImage​(BufferedImage img)
        Attempts to convert the image to the closest BoofCV type.
        Parameters:
        img - the image to convert
        Returns:
        the converted container
      • toBoofCVMultiBandImage

        public static boofcv.struct.image.ImageBase toBoofCVMultiBandImage​(BufferedImage img)
        Converts the image to the specified type if necessary.
        Parameters:
        img - the image to convert
        Returns:
        the converted image
      • toBoofCVImage

        public static boofcv.struct.image.ImageBase toBoofCVImage​(BufferedImage img,
                                                                  BoofCVImageType type)
        Converts the image to the specified type if necessary.
        Parameters:
        img - the image to convert
        type - the type of image
        Returns:
        the converted container
      • toBoofCVImage

        public static boofcv.struct.image.ImageBase toBoofCVImage​(AbstractImageContainer cont,
                                                                  BoofCVImageType type)
        Converts the image container to the specified image type if necessary.
        Parameters:
        cont - the image container to convert
        type - the type of image
        Returns:
        the converted image
      • toBoofCVImageContainer

        public static BoofCVImageContainer toBoofCVImageContainer​(AbstractImageContainer cont,
                                                                  BoofCVImageType type)
        Creates a BoofCVImageContainer container if necessary, otherwise it just casts the object. In either, the correct image type is generated.
        Parameters:
        cont - the cont to cast/convert
        type - the type of image
        Returns:
        the casted/converted container
      • isBinary

        public static boolean isBinary​(BoofCVImageContainer img)
        Converts an image to greyscale and checks if it is binary or not.
        Parameters:
        img - the image to covert
        Returns:
        True if the image is a binary image, false if not.