Image processing

Fig. 4.0.1

Image preprocessing

The raw image data we collect from the drone consist of three three-dimensional unsigned-integer-8 arrays. While this contains all the information we need to perform image processing, it is not the most convenient format to work with. Since the resolution of the quadcopter’s camera is 160 x 120 pixels, it is most natural for us to work with images of the size 120 x 160 x 3, with the third dimension being the color channel dimension. However, during the quadcopter’s flight, it captures an image every 200 ms, so we have an additional time dimension. For example, in the data shown on the right, “106” means there are 106 images in the entire data. In order to convert these three variables into a variable (rt_RGB) of the desired size of 120 x 160 x 3 x 106, we take advantage of MATLAB’s cat() and permute() functions. After this conversion, we can easily obtain the RGB representation of any arbitrary image (say, the 25th image in the data) by indexing the fourth dimension of the rt_RGB variable (for example, rt_RGB(:, :, :, 25)) and the preprocessing stage is complete.