| Graphics | ![]() |
Mathematical Operations Support for uint8 and uint16
To use the following MATLAB functions with uint8 and uint16 data, first convert the data to type double: conv2, convn, fft2, fftn. For example, if X is a uint8 image, cast the data to type double:
In these cases, the output is always double.
The sum function returns results in the same type as its input, but provides an option to use double precision for calculations.
Integer Mathematics in MATLAB
See Integer Mathematics in the MATLAB Math documentation for more information on how mathematical functions work with data types that are not doubles.
Most of the functions in the Image Processing Toolbox accept uint8 and uint16 input. If you plan to do sophisticated image processing on uint8 or uint16 data, you should consider adding the Image Processing Toolbox to your MATLAB computing environment.
| 8-Bit and 16-Bit RGB Images | Other 8-Bit and 16-Bit Array Support | ![]() |
© 1994-2005 The MathWorks, Inc.