public class UtilImageIO
extends java.lang.Object
| Constructor and Description |
|---|
UtilImageIO() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends boofcv.struct.image.ImageBase<T>> |
loadImage(java.io.File image,
boolean orderRgb,
boofcv.struct.image.ImageType<T> imageType) |
static java.awt.image.BufferedImage |
loadImage(java.lang.String fileName)
A function that load the specified image.
|
static <T extends boofcv.struct.image.ImageGray<T>> |
loadImage(java.lang.String fileName,
java.lang.Class<T> imageType)
Loads the image and converts into the specified image type.
|
static java.awt.image.BufferedImage |
loadImage(java.lang.String directory,
java.lang.String fileName) |
static <T extends boofcv.struct.image.ImageGray<T>> |
loadImage(java.lang.String directory,
java.lang.String fileName,
java.lang.Class<T> imageType) |
static java.awt.image.BufferedImage |
loadImage(java.net.URL fileName)
A function that load the specified image.
|
static java.util.List<java.awt.image.BufferedImage> |
loadImages(java.lang.String directory,
java.lang.String regex)
Loads all the image in the specified directory which match the provided regex
|
static boofcv.struct.image.GrayU8 |
loadPGM_U8(java.io.InputStream inputStream,
boofcv.struct.image.GrayU8 storage)
Loads a PGM image from an
InputStream. |
static boofcv.struct.image.GrayU8 |
loadPGM_U8(java.lang.String fileName,
boofcv.struct.image.GrayU8 storage)
Loads a PGM image from an
InputStream. |
static java.awt.image.BufferedImage |
loadPGM(java.io.InputStream inputStream,
java.awt.image.BufferedImage storage)
Loads a PGM image from an
InputStream. |
static java.awt.image.BufferedImage |
loadPGM(java.lang.String fileName,
java.awt.image.BufferedImage storage)
Loads a PGM image from a file.
|
static boofcv.struct.image.Planar<boofcv.struct.image.GrayU8> |
loadPPM_U8(java.io.InputStream inputStream,
boofcv.struct.image.Planar<boofcv.struct.image.GrayU8> storage,
org.ddogleg.struct.GrowQueue_I8 temp)
Reads a PPM image file directly into a Planar
|
static boofcv.struct.image.Planar<boofcv.struct.image.GrayU8> |
loadPPM_U8(java.lang.String fileName,
boofcv.struct.image.Planar<boofcv.struct.image.GrayU8> storage,
org.ddogleg.struct.GrowQueue_I8 temp)
Reads a PPM image file directly into a Planar
|
static java.awt.image.BufferedImage |
loadPPM(java.io.InputStream inputStream,
java.awt.image.BufferedImage storage)
Loads a PPM image from an
InputStream. |
static java.awt.image.BufferedImage |
loadPPM(java.lang.String fileName,
java.awt.image.BufferedImage storage)
Loads a PPM image from a file.
|
static void |
saveImage(java.awt.image.BufferedImage img,
java.lang.String fileName)
Saves the
BufferedImage to the specified file. |
static void |
saveImage(boofcv.struct.image.ImageBase image,
java.lang.String fileName)
Saves the BoofCV formatted image.
|
static void |
savePGM(boofcv.struct.image.GrayU8 gray,
java.lang.String fileName)
Saves an image in PGM format.
|
static void |
savePPM(boofcv.struct.image.Planar<boofcv.struct.image.GrayU8> rgb,
java.lang.String fileName,
org.ddogleg.struct.GrowQueue_I8 temp)
Saves an image in PPM format.
|
public static java.awt.image.BufferedImage loadImage(java.lang.String fileName)
public static java.awt.image.BufferedImage loadImage(java.lang.String directory,
java.lang.String fileName)
public static java.util.List<java.awt.image.BufferedImage> loadImages(java.lang.String directory,
java.lang.String regex)
directory - File directoryregex - Regex used to match file namespublic static java.awt.image.BufferedImage loadImage(java.net.URL fileName)
public static <T extends boofcv.struct.image.ImageGray<T>> T loadImage(java.lang.String fileName,
java.lang.Class<T> imageType)
fileName - Path to image file.imageType - Type of image that should be returned.public static <T extends boofcv.struct.image.ImageGray<T>> T loadImage(java.lang.String directory,
java.lang.String fileName,
java.lang.Class<T> imageType)
public static <T extends boofcv.struct.image.ImageBase<T>> T loadImage(java.io.File image,
boolean orderRgb,
boofcv.struct.image.ImageType<T> imageType)
public static void saveImage(java.awt.image.BufferedImage img,
java.lang.String fileName)
BufferedImage to the specified file. The image type of the output is determined by
the name's extension. By default the file is saved using ImageIO.write(RenderedImage, String, File)}
but if that fails then it will see if it can save it using BoofCV native code for PPM and PGM.img - Image which is to be saved.fileName - Name of the output file. The type is determined by the extension.public static void saveImage(boofcv.struct.image.ImageBase image,
java.lang.String fileName)
Saves the BoofCV formatted image. This is identical to the following code:
BufferedImage out = ConvertBufferedImage.convertTo(image,null,true); saveImage(out,fileName);
image - Image which is to be saved.fileName - Name of the output file. The type is determined by the extension.public static java.awt.image.BufferedImage loadPPM(java.lang.String fileName,
java.awt.image.BufferedImage storage)
throws java.io.IOException
fileName - Location of PPM imagestorage - (Optional) Storage for output image. Must be the width and height of the image being read.
Better performance of type BufferedImage.TYPE_INT_RGB. If null or width/height incorrect a new image
will be declared.java.io.IOException - Thrown if there is a problem reading the imagepublic static java.awt.image.BufferedImage loadPGM(java.lang.String fileName,
java.awt.image.BufferedImage storage)
throws java.io.IOException
fileName - Location of PGM imagestorage - (Optional) Storage for output image. Must be the width and height of the image being read.
Better performance of type BufferedImage.TYPE_BYTE_GRAY. If null or width/height incorrect a new image
will be declared.java.io.IOException - Thrown if there is a problem reading the imagepublic static java.awt.image.BufferedImage loadPPM(java.io.InputStream inputStream,
java.awt.image.BufferedImage storage)
throws java.io.IOException
InputStream.inputStream - InputStream for PPM imagestorage - (Optional) Storage for output image. Must be the width and height of the image being read.
Better performance of type BufferedImage.TYPE_INT_RGB. If null or width/height incorrect a new image
will be declared.java.io.IOException - Thrown if there is a problem reading the imagepublic static java.awt.image.BufferedImage loadPGM(java.io.InputStream inputStream,
java.awt.image.BufferedImage storage)
throws java.io.IOException
InputStream.inputStream - InputStream for PGM imagestorage - (Optional) Storage for output image. Must be the width and height of the image being read.
Better performance of type BufferedImage.TYPE_BYTE_GRAY. If null or width/height incorrect a new image
will be declared.java.io.IOExceptionpublic static boofcv.struct.image.Planar<boofcv.struct.image.GrayU8> loadPPM_U8(java.lang.String fileName,
boofcv.struct.image.Planar<boofcv.struct.image.GrayU8> storage,
org.ddogleg.struct.GrowQueue_I8 temp)
throws java.io.IOException
fileName - Location of PPM filestorage - (Optional) Where the image is written in to. Will be resized if needed.
If null or the number of bands isn't 3, a new instance is declared.temp - (Optional) Used internally to store the image. Can be null.java.io.IOException - Thrown if there is a problem reading the imagepublic static boofcv.struct.image.Planar<boofcv.struct.image.GrayU8> loadPPM_U8(java.io.InputStream inputStream,
boofcv.struct.image.Planar<boofcv.struct.image.GrayU8> storage,
org.ddogleg.struct.GrowQueue_I8 temp)
throws java.io.IOException
inputStream - InputStream for PPM imagestorage - (Optional) Where the image is written in to. Will be resized if needed.
If null or the number of bands isn't 3, a new instance is declared.temp - (Optional) Used internally to store the image. Can be null.java.io.IOException - Thrown if there is a problem reading the imagepublic static boofcv.struct.image.GrayU8 loadPGM_U8(java.lang.String fileName,
boofcv.struct.image.GrayU8 storage)
throws java.io.IOException
InputStream.fileName - InputStream for PGM imagestorage - (Optional) Storage for output image. Must be the width and height of the image being read.
If null a new image will be declared.java.io.IOException - Thrown if there is a problem reading the imagepublic static boofcv.struct.image.GrayU8 loadPGM_U8(java.io.InputStream inputStream,
boofcv.struct.image.GrayU8 storage)
throws java.io.IOException
InputStream.inputStream - InputStream for PGM imagestorage - (Optional) Storage for output image. Must be the width and height of the image being read.
If null a new image will be declared.java.io.IOException - Thrown if there is a problem reading the imagepublic static void savePPM(boofcv.struct.image.Planar<boofcv.struct.image.GrayU8> rgb,
java.lang.String fileName,
org.ddogleg.struct.GrowQueue_I8 temp)
throws java.io.IOException
rgb - 3-band RGB imagefileName - Location where the image is to be written to.temp - (Optional) Used internally to store the image. Can be null.java.io.IOException - Thrown if there is a problem reading the imagepublic static void savePGM(boofcv.struct.image.GrayU8 gray,
java.lang.String fileName)
throws java.io.IOException
gray - Gray scale imagefileName - Location where the image is to be written to.java.io.IOException - Thrown if there is a problem reading the image