Class GConvertImage
- java.lang.Object
-
- boofcv.core.image.GConvertImage
-
public class GConvertImage extends java.lang.ObjectGeneralized functions for converting between different image types. Numerical values do not change or are closely approximated in these functions. If an output image is not specified then a new instance is declared and returned.
-
-
Constructor Summary
Constructors Constructor Description GConvertImage()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends boofcv.struct.image.ImageGray<T>>
Taverage(boofcv.struct.image.ImageInterleaved input, T output)Converts aPlanarinto aImageGrayby computing the average value of each pixel across all the bands.static <T extends boofcv.struct.image.ImageGray<T>>
Taverage(boofcv.struct.image.ImageMultiBand input, T output)Converts aImageMultiBandinto aImageGrayby computing the average value of each pixel across all the bands.static <T extends boofcv.struct.image.ImageGray<T>>
Taverage(boofcv.struct.image.Planar<T> input, T output)Converts aPlanarinto aImageGrayby computing the average value of each pixel across all the bands.static voidconvert(boofcv.struct.image.ImageBase input, boofcv.struct.image.ImageBase output)Converts one type of between two types of images using a default method.static <T extends boofcv.struct.image.ImageGray<T>>
Tconvert(boofcv.struct.image.ImageGray<?> src, T dst, java.lang.Class<T> typeDst)Converts an image from one type to another type.static boofcv.struct.image.GrayU8convert(boofcv.struct.image.ImageGray input, double min, double max, int numValues, boofcv.struct.image.GrayU8 output)Converts pixel values in the input image into an integer values from 0 to numValues.
-
-
-
Method Detail
-
convert
public static void convert(boofcv.struct.image.ImageBase input, boofcv.struct.image.ImageBase output)Converts one type of between two types of images using a default method. Both are the same image type then a simple type cast if performed at the pixel level. If the input is multi-band and the output is single band then it will average the bands. If input is single band and output is multi-band then the single band is copied into each of the other bands.
In some cases a temporary image will be created to store intermediate results. If this is an issue you will need to create a specialized conversion algorithm.
- Parameters:
input- Input image which is being converted. Not modified.output- (Optional) The output image. If null a new image is created. Modified.
-
average
public static <T extends boofcv.struct.image.ImageGray<T>> T average(boofcv.struct.image.ImageMultiBand input, T output)Converts aImageMultiBandinto aImageGrayby computing the average value of each pixel across all the bands.- Parameters:
input- ImageMultiBand that is being converted. Not modified.output- (Optional) The single band output image. If null a new image is created. Modified.- Returns:
- Converted image.
-
average
public static <T extends boofcv.struct.image.ImageGray<T>> T average(boofcv.struct.image.Planar<T> input, T output)Converts aPlanarinto aImageGrayby computing the average value of each pixel across all the bands.- Parameters:
input- Input Planar image that is being converted. Not modified.output- (Optional) The single band output image. If null a new image is created. Modified.- Returns:
- Converted image.
-
average
public static <T extends boofcv.struct.image.ImageGray<T>> T average(boofcv.struct.image.ImageInterleaved input, T output)Converts aPlanarinto aImageGrayby computing the average value of each pixel across all the bands.- Parameters:
input- Input Planar image that is being converted. Not modified.output- (Optional) The single band output image. If null a new image is created. Modified.- Returns:
- Converted image.
-
convert
public static boofcv.struct.image.GrayU8 convert(boofcv.struct.image.ImageGray input, double min, double max, int numValues, boofcv.struct.image.GrayU8 output)Converts pixel values in the input image into an integer values from 0 to numValues.- Parameters:
input- Input imagemin- minimum input pixel value, inclusivemax- maximum input pixel value, inclusivenumValues- Number of possible pixel values in output imageoutput- (Optional) Storage for the output image. Can be null.- Returns:
- The converted output image.
-
convert
public static <T extends boofcv.struct.image.ImageGray<T>> T convert(boofcv.struct.image.ImageGray<?> src, T dst, java.lang.Class<T> typeDst)Converts an image from one type to another type. Creates a new image instance if an output is not provided.- Parameters:
src- Input image. Not modified.dst- Converted output image. If null a new one will be declared. Modified.typeDst- The type of output image.- Returns:
- Converted image.
-
-