2.3 Deducing a Transformation Matrix
The patch values for the source image to be processed
and the ground truth image taken by the DSLR are
used to deduce a transformation for the source im-
age. This process is analogous to the characterisation
of imaging devices including digital cameras. Vari-
ous characterisation methods exist (Luo and Rhodes,
2001; Tominaga, 1999). They essentially involve de-
ducing a mapping for targets that have known device
independent CIE XYZ values. Linear and polynomial
transformations have been used to this end as well as
neural networks. However, an important distinction
for our application should be noted: normally char-
acterisation is done once for a given device. Hence
it is important that the mapping used generalises for
all conceivable scenes and lighting conditions. Con-
versely, in our application, we only need the mapping
to work well for one particular image.
To exploit this stipulation we have experimented
with weighting the relative cost for the residual error
of particular patches under the deduced transforma-
tion according to how numerous image pixels closest
to that patch are in a given image. Hence, in most
of our images greens and browns would be favoured
as they primarily depict plants. For the quadratic and
linear transformations we utilise, this lends itself to a
weighted least squares optimisation. We term this our
‘heuristic’ approach, whereas normal least squares
will hereafter be referred to as ‘pure’.
The colour targets we tested only have 24 patches.
We found this was not enough correspondences for
training MLP neural networks and Support Vector
Machines as generalisation was poor. Conversely,
the quadratic and linear transformations considered
here produce perceptually convincing results. Cheung
and Westland describe a quadratic mapping function
(Cheung and Westland, 2002) formulation that may
be solved as a linear system (see Equation 1):
X = a
1
R + a
2
G + a
3
B
+ a
4
RG + a
5
RB + a
6
GB
+ a
7
R
2
+ a
8
G
2
+ a
9
B
2
+ a
10
Y = a
11
R + a
12
G + a
13
B
+ a
14
RG + a
15
RB + a
16
GB
+ a
17
R
2
+ a
18
G
2
+ a
19
B
2
+ a
20
Z = a
21
R + a
22
G + a
23
B
+ a
24
RG + a
25
RB + a
26
GB
+ a
27
R
2
+ a
28
G
2
+ a
29
B
2
+ a
30
(1)
We experimented with this formulation as well, as
a basic linear transformation shown in Equation 2 and
a simplified version of the polynomial described in
Equation 1. where the constant and interaction terms
for the tristimulus values were dropped as given in
Equation 3.
X = a
1
R + a
2
G + a
3
B
Y = a
4
R + a
4
G + a
6
B
Z = a
7
R + a
8
G + a
9
B
(2)
X = a
1
R + a
2
G + a
3
B
+ a
4
R
2
+ a
5
G
2
+ a
6
B
2
Y = a
7
R + a
8
G + a
9
B
+ a
10
R
2
+ a
11
G
2
+ a
12
B
2
Z = a
13
R + a
14
G + a
15
B
+ a
16
R
2
+ a
17
G
2
+ a
18
B
2
(3)
For each of the colour charts, the above formu-
lations were tested using both least squares optimi-
sation (‘pure’) and weighted least squares based on
the content of the image being processed (‘heuristic’).
Specifically for each pixel the Euclidian distance from
every patch was determined. Each patch’s weighting
was based upon the total number of pixels that were
closest to it in the camera’s device dependent RGB
colour space. This process is analogous to preselect-
ing colour patch values on the basis of the application
area. Cheung and Westland (Cheung and Westland,
2004) note that it would be sensible to select a char-
acterization set based on the colour of the object being
measured. Our approach is to augment this process by
skewing the optimisation such that colours depicted in
the image or more heavily favoured.
3 RESULTS AND EVALUATION
Two data sets are presented here. The first were taken
at our university botanical gardens in late spring. Fif-
teen different plants were photographed with 5 differ-
ent cameras including the DLSR which acts as our
ground truth. Generally 2-3 shots were taken with
each camera to ensure at least one of acceptable qual-
ity would be available. Objective results and sample
images are provided below. Analysis was performed
using the X-Rite ColorChecker. Results for the poly-
nomial function defined in Equation 1 were relatively
poor in comparison and thus are not presented here.
This may be as 24 samples were inadequate to train
a function of this complexity as others have reported
that 40 to 60 are a suitable number (Luo and Rhodes,
2001).
The second data set trials our custom colour
chart and compares it’s effectiveness against the Col-
orChecker chart in out application. Once again 5 cam-
eras were used including the DSLR. In these photos,
collections of leaves from different plants were used.
BIOINFORMATICS 2011 - International Conference on Bioinformatics Models, Methods and Algorithms
328