Package boofcv.io.image
Class ConvertImageMisc
java.lang.Object
boofcv.io.image.ConvertImageMisc
Functions for converting image formats that don't cleanly fit into any other location
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static void
convert_U16_F32
(GrayU16 src, int fractionBits, GrayF32 dst) Inverse ofconvert_F32_U16(GrayF32, int, GrayU16)
-
Constructor Details
-
ConvertImageMisc
public ConvertImageMisc()
-
-
Method Details
-
convert_F32_U16
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 imagefractionBits
- (Input) Number of bits allocated to the fractional componentdst
- (Output) Output U16 image
-
convert_U16_F32
Inverse ofconvert_F32_U16(GrayF32, int, GrayU16)
- Parameters:
src
- (Input) Input U16 imagefractionBits
- (Input) Number of bits allocated to the fractional componentdst
- (Output) Output F32 image
-