• No results found

Chapter 4 Materials and methods

4.4 Pre-processing

Pre-processing involves all alterations that have to be made to get the original image data in the correct format for feature extraction. In this work, pre-processing consisted of cropping, resizing, conversion to greyscale and normalisation.

4.4.1 Cropping and resizing

In some cases images can be cropped to remove irrelevant information, such as the background. High-resolution images place a high demand on computer memory, and therefore it may be necessary to resize images to reduce the resolution. The final resolution of the images should be the maximum possible given the hardware limitations, since low quality images can affect the results adversely. In this work images were resized using bicubic interpolation with antialiasing (Keys, 1981). With bicubic interpolation an output pixel value becomes a weighted average of the pixel values in its nearest 4-by-4 neighbourhood, while antialiasing smoothes edges to improve visual appearance.

Another reason for changing the image size is due to a limitation of the steerable pyramid implementation used in this work (Portilla & Simoncelli, 2000). The algorithm was implemented in such a way that images are required to have a width and height that is divisible by 2𝐽, where 𝐽 is the number of levels in the decomposition. To achieve this, images can be resized horizontally or vertically, or if the original aspect ratio would be drastically affected by resizing, a small portion of the image may be cropped off. It is interesting to note that the execution times of several other texture analysis algorithms are increased when the image dimensions are odd.

The cropping and resizing procedures for each case study are described in the remainder of this section.

Case study I: Platinum flotation froths

Images in the flotation data set were not cropped, but they were resized to reduce the resolution from 1280 × 720 pixels to 1024 × 576 pixels.

Case study II: Coal particles on a conveyor belt

Other studies that used this data set (Aldrich et al., 2010; Jemwa & Aldrich, 2012) cropped images to a central patch to minimise the effect of uneven lighting, and to remove the conveyor belt background and South African R5 coin that was used as a scale indicator. However, in this work images were not cropped, because:

 a good inferential sensor should be robust to uneven lighting conditions and random artefacts (such as the R5 coin), making it desirable to retain these conditions,

the coal particle size distribution is not always uniform across an image, which means that cropping off large sections of the image skews the information available to the classification algorithm, potentially leading to worse results, and

Chapter 4 – Materials and methods 80

such cropping would require manual intervention, which would limit automated inferential sensing applications.

The original coal images had a resolution of 2272 × 1704 pixels, but since these were subdivided into four non-overlapping patches, each subdivision had a resolution of 1136 × 852 pixels. These were resized to 1024 × 768 pixels.

Case study III: Hydrocyclone underflows

Images in the original hydrocyclone data set as obtained from Uahengo (2013) did not have identical resolutions. The first step in resizing these images was to crop each image to the minimum width (3000 pixels) and minimum height (2262 pixels) in the data set, retaining the central part of each image.

The resultant images from the first cropping step still contained a large portion of black background, and could therefore be further cropped to remove this background to some extent. The size and position of a common cropping rectangle across all images were visually determined by overlaying all images on top of each other. Appropriate coordinates for the upper-left corner of the cropping rectangle (𝑥0, 𝑦0) were determined to be (0, 100), and the size of the cropping rectangle was 2560 (width) × 2048 (height) pixels.

The final cropped images were resized from 2560 × 2048 pixels to 1280 × 1024 pixels.

4.4.2 Conversion to greyscale

Traditional texture analysis methods were developed for the analysis of greyscale images, but many methods of incorporating colour or spectral information exist, such as multi-resolution multivariate image analysis (MR-MIA). Although the choice of using only greyscale information is not to be made lightly, in this work it can be motivated by the fact that colour is not expected to play an important role in any of the three case studies considered.

Image data for all three case studies were initially in RGB format. The standard formula for converting an RGB image to greyscale (4-4) was used: the greyscale image 𝐼𝐺 is an average of the 𝑹, 𝑮, 𝑩 components, weighted according to human perception of colours:

4.4.3 Image normalisation

A common problem in vision-based sensing is inconsistent lighting conditions. If illumination varies across images, the feature extraction algorithm may incorrectly recognise this variation as a key feature. However, a good texture analysis algorithm should be robust to non-optimal lighting conditions, as this would typically be encountered in a real plant environment. Therefore, only the most basic method of correcting for lighting inconsistencies, namely normalisation, was used.

Chapter 4 – Materials and methods 81

To obtain a normalised image 𝐼𝑛𝑜𝑟𝑚 with zero mean and unit standard deviation from the original greyscale image 𝐼𝐺, its mean 𝜇𝐺 is subtracted and the result is divided by its standard deviation 𝜎𝐺:

Here 𝐽𝑤,ℎ is a matrix of ones with dimensions ℎ and 𝑤, the height and width of the image (required for matrix subtraction).