Images, videos, and audio files nowadays are an integral part of our lives. We use them widely thanks to the capabilities provided by modern devices that enable us to capture, store, and manipulate them. They often represent the input data we use in our machine learning applications, because through such algorithms, it is possible to extract a lot of information that at first glance is not so obvious. In this section, we will learn to deal with such files in the MATLAB environment.
Raster images are made up of a grid of colored pixels. In MATLAB, images can be represented as two-dimensional matrices, where each matrix element corresponds to a single pixel of the displayed image. For example, a 800x600 photo (consisting of 600 lines and 800 columns of pixel of different colors) will be stored as a 600x800 matrix. However, sometimes, a third dimension will be required to store the depth of color. For example, for RGB images, you will need to specify red...