• No results found

4. Multiple Image Dynamic Exposure Colour Classification

4.5 Building Classifiers

The following sections in this chapter relate to the unique system proposed by this research. The evaluation of pie slice data to construct the classifier is directly linked to the pie slice and colour space chosen in Section 4.5.2, while classifier constriction in the next section is last to consider both colour spaces.

4.5.1

Pie Slice Classifier Construction

Once the approximately 90,000 data points per colour have been converted to angle and radius values, the points are plotted into the colour space.

The angle and radius ranges are then calculated, along with the mean values and standard deviations. These values are then used to assume a normal distribution, used later to calculate the probability or ‘confidence’ of each camera’s match.

Individual colour classifiers are created by adding and subtracting a single standard deviation from the mean angles and radii. By using a spread of one standard deviation, it is expected to cover approximately 68% of the sampled colour data, excluding extreme outliers, such as almost-black or almost-white samples. It is important to exclude extreme values as widening the pie slice classifier both by angle (hue) or radius (saturation) would result in a significant increase in false positive matches.

Figure 4-12: Pie Slice classifier, indicating the two priority regions

The classifier matching system includes standard deviation based priority, discussed in Section 4.5.3, further widening the classifier as a ‘last resort’ to match a colour.

Classifiers are individually stored in standard text files. This enables manual checks and editing if required. For a system with three cameras, identifying eight colours, a total of 24 classifiers are generated. For each colour, only the colour space identified in the next section is used to save the classifier.

4.5.2

Colour Space Selection Process

Up until this point, all colours have been processed in parallel using both colour spaces. The next stage of processing selects the best colour space based on a range of evaluation criteria. The classifier is then saved in the best colour space – no further processing is run for that colour in the worse-off colour space.

Colour spaces are compared by the following criteria: Maximising True Positives; Score = Score + 0.40

Maximise the matches that have been correctly found in the known-areas for this colour.

Minimising False Positives; Score = Score + 0.35

Minimise the matches that have been incorrectly found outside any known-areas for this colour. This is a simple comparison between the two colour space percentages.

Minimise Angle Range; Score = Score + 0.15

Minimise the difference of the maximum and minimum angles for this colour. Angle and radius ranges are calculated by subtracting the minimum value from the maximum value.

Minimise Radius Range; Score = Score + 0.05

Minimise the difference of the maximum and minimum radii for this colour. Minimise Grey False Negatives; Score = Score + 0.05

Minimise the number of matches that occur less than the minimum radius value. These values are closer to the ambiguous ‘grey area’ of the colour space,

discussed in Section 2.2.2.

Once these scores have been added, the colour space with the higher score will be selected for the final classifier for this colour. The scores were chosen based on the

In the event that a tie between colour spaces occurs, the cyan/magenta colour space is selected. This is due to experimental results of the cyan/magenta colour space matching or exceeding the performance of the red/green colour space in most tests.

4.5.3

Standard Deviation Priority during Classification

Discussed previously, each colour classifier is based on the ranges of a single standard deviation from each angle and radius mean. As the data is assumed to be a simple normal distribution, this would expect to cover approximately 68 percent of cases for that exposure.

Adding another standard deviation either side of the range, effectively making the classifier ± 2 standard deviations either side of the mean would result in approximately 95 percent of the data points being covered.

In practice, expecting 95 percent of the data points is difficult due to the layout of each colour space, however this extra standard deviation is seen as a ‘last resort’, only being added if no other classifiers are matched.

Terminology of a ‘direct match’ is used if the classifier has not been extended, matching within one standard deviation, while it is said to be a ‘plus one’ match if an additional standard deviation has been added.

The following algorithm explains the classification for each colour, with respect to the standard deviation priority levels:

Algorithm 4-4: Matching a classifier with multiple priority levels For each c every classifier

Check for a direct match with classifier c Check for a plus one match with classifier c If one or more direct matches Then

Find best colour (see Section 4.5.4) Else If one or more plus one matches Then

Find best colour (see Section 4.5.4) Else no match for this pixel

Examples below explain how the prioritising system works with regard to the two classifier ‘match types’:

Figure 4-13: Example of multiple classifiers matching Dark Blue

Seen above, Camera A and Camera C have both matched with Blue classifiers, however Camera A matched Dark Blue, while Camera B matched Light Blue.

As Camera A has matched its colour within the red ‘direct match’ (single standard deviation) area, this camera takes priority over Camera C. The final output would be Dark Blue.

Figure 4-14: Example of multiple classifiers matching Yellow

Despite two cameras matching the same colour, priority is given to the colour which has a direct match, this being Camera B, outputting Yellow.

Figure 4-15: Example of multiple classifiers matching, with no priority

This example does not have a direct match, so there is no standard deviation ordering required. It is notable that all cameras have matched contradictory colours, so further processing is required to decide which colour is correct. The normal density function, discussed in the next section calculates the probability of each classifier, picking the most probable.

4.5.4

Handling Multiple Classifications

There are occasions when the system has classified multiple colours for the same pixel. This may be due to overlapping classifiers or particularly difficult lighting conditions, where two cameras classify different colours. These conflicts are resolved by comparing the normal density function of both the angle and radii of conflicting colours.

The normal density function above, is run for both the radius and angle of each classifier match. These values, when added together, create a value which increases the closer to the mean point of each pie slice. It would be expected that a data point aligned perfectly in the centre of the pie slice classifier would output a normal density value close to 1, while a further away point would output a number closer to 0.

The output from this function is treated as a confidence level, prioritising one particular colour above others when multiple matches occur. In manual calculation tests, multiple matches between similar colours, such as light blue and dark blue, were resolved successfully with the correct colour being classified.

Related documents