Class ConvertImageMisc

java.lang.Object
boofcv.io.image.ConvertImageMisc

public class ConvertImageMisc extends Object
Functions for converting image formats that don't cleanly fit into any other location
  • Constructor Details

    • ConvertImageMisc

      public ConvertImageMisc()
  • Method Details

    • convert_F32_U16

      public static void convert_F32_U16(GrayF32 src, int fractionBits, GrayU16 dst)

      Converts a floating point image with all positive values into a 16-bit image using fixed-point math. The number of bits dedicated to the fractional component is configurable. If 8-bits are allocated then the max integer value is 256 and the fractional resolution is 1/256 Limitations:

      • Fractional bits specifies accuracy of fractional component. FR=2**fractional_bits
      • src must have values with in the range 0 ≤ x ≤ 2**(16-fractional_bits)
      • fractional component will only be saved to within 1/FR resolution
      • To reduce discretization bias rounding is done instead of flooring
      Parameters:
      src - (Input) Input F32 image
      fractionBits - (Input) Number of bits allocated to the fractional component
      dst - (Output) Output U16 image
    • convert_U16_F32

      public static void convert_U16_F32(GrayU16 src, int fractionBits, GrayF32 dst)
      Parameters:
      src - (Input) Input U16 image
      fractionBits - (Input) Number of bits allocated to the fractional component
      dst - (Output) Output F32 image