boofcv.io.image.ConvertImageMisc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of boofcv-io Show documentation
Show all versions of boofcv-io Show documentation
BoofCV is an open source Java library for real-time computer vision and robotics applications.
/*
* Copyright (c) 2011-2019, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package boofcv.io.image;
import boofcv.concurrency.BoofConcurrency;
import boofcv.io.image.impl.ImplConvertImageMisc;
import boofcv.io.image.impl.ImplConvertImageMisc_MT;
import boofcv.struct.image.GrayF32;
import boofcv.struct.image.GrayU16;
/**
* Functions for converting image formats that don't cleanly fit into any other location
*
* @author Peter Abeles
*/
public class ConvertImageMisc {
/**
* 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 *
© 2015 - 2024 Weber Informatics LLC | Privacy Policy