Image Processing Toolbox | ![]() ![]() |
Working with Image Data
Images are most commonly stored in MATLAB using the logical
, uint8
, uint16
and double
data types. This section describes how to work with image data in MATLAB. Topics include:
For information about displaying and printing images, see Displaying and Printing Images.
You can also perform many standard MATLAB array manipulations on uint8
and uint16
image data, including:
Certain MATLAB functions, including the find
, all
, any,
conv2
, convn
, fft2
, fftn
, and sum
functions accept uint8
or uint16
data but return data in double precision format.
The basic MATLAB arithmetic operators, however, do not accept uint8
or uint16
data. For example, if you attempt to add two uint8
images, A
and B
, you get an error, such as,
Because these arithmetic operations are an important part of many image-processing operations, the Image Processing Toolbox includes functions that support these operations on uint8
and uint16
data, as well as the other numeric data types. See Image Arithmetic for more information.
![]() | Converting Image Types | Reading a Graphics Image | ![]() |