Computer aided method for colour calibration and analysis of digital rock photographs

The methods used in geology to determine colour and colour coverage are expensive, time consuming, and/ or subjective. Estimates of colour coverage can only be approximate since they are based on rough comparison- based measuring etalons and subjective estimation, which is dependent upon the skill and experience of the person performing the estimation. We present a method which accelerates, simpli es, and objecti es these tasks using a computer application. It automatically calibrates the colours of a digital photo, and enables the user to read colour values and coverage, even after returning from eld work. Colour identi cation is based on the Munsell colour system. For the purposes of colour calibration we use the X-Rite ColorChecker Passport colour chart placed onto the photographed scene. Our computer application detects the ColorChecker colour chart, and nds a colour space transformation to calibrate the colour in the photo. The user can then use the application to read colours within selected points or regions of the photo. 
The results of the computerised colour calibration were compared to the reference values of the ColorChecker chart. The values slightly deviate from the exact values, but the deviation is around the limit of human capability for visual comparison. We have devised an experiment, which compares the precision of the computerised colour analysis and manual colour analysis performed on a variety of rock samples with the help of geology students using Munsell Rock-color Chart. The analysis showed that the precision of manual comparative identi cation on multi- coloured samples is somewhat problematic, since the choice of representative colours and observation points for a certain part of a sample are subjective. The computer based method has the edge in veri ability and repeatability of the analysis since the application the original photo to be saved with colour calibration, and tagging of colour- analysed points and regions.


Introduction
The methods used in geology to determine colours are: (a) verbal description, which is dependent upon the skill and visual perception of the person performing it, and is thus subjective, (b) measurement using a spectrophotometer, which is time consuming, expensive and impractical for field work, and (c) comparison based comparative determination using a colour chart (e.g. Munsell Rock Colour chart), which can be time consuming, especially for rocks with many colour shades, and is not always appropriate for field work since the colour patches are sensitive to weather and environmental conditions.
Estimates of colour coverage can only be approximate, since they are based on rough comparison-based measuring etalons and is also dependent upon the skill and experience of the person performing the assessment. Statistical assessment of colour "classes" is possible if points on a regular grid are used to count occurrences of each "class" , but this method is also time consuming and thus expensive, and not commonly used.
With more objective colour values and statistically significant rock colour coverage analyses we could extract much more significant and consequently valuable rock data parameters.
We introduce a method, which greatly accelerates and simplifies these tasks, and makes them more objective. We have developed a computer application for automatic colour calibration of digital photographs made either during field work, or in the laboratory, which allows the user to accurately identify colours in the Munsell colour system; a standard used in geology for colour determination. We use the X-Rite ColorChecker Passport reference colour chart in combination with computer vision and colour calibration algorithms. This enables completely automated colour calibration of digital photographs. Colour calibration is a necessary step, since it greatly improves the quality of the colour information by diminishing the various effects, such as weather, illumination, the photographic equipment used, etc.
Before capturing a digital photograph, the ColorChecker chart needs to be placed into the photograph capture area of the rock we wish to analyze. To ensure a good baseline and thus improve the accuracy of results, the illumination should be as uniform as possible. Additional lighting or camera flash can be used to achieve this, if natural illumination conditions are not favourable or if the angle of sunlight produces shadows.
Existing methods for colour calibration used in professional photography are either manual or semi-automatic and are more focused on providing the photographer with tools to achieve the best aesthetic effect, not necessarily the most correct colour information (Van Hurkman, 2013). The photographers also use the calibration tools differently, since they capture one image with the colour chart, and then (keeping other parameters as similar as possible) capture the images they have actually set out to photograph. The existing tools are shaped by this mode of work, and are not well suited for the use case covered by the application we have developed, i.e. completely automatic colour calibration and a user interface focused on objective analysis rather than aesthetics.
The computer application we developed uses the ASIFT algorithm (Yu & morel, 2011) to detect the ColorChecker chart on the captured photograph, and then determines a transformation of the CIE Lab colour space, which then colour-calibrates the photograph. The user is then able to read out the colour values in selected points and regions. Approximate measuring of distances on the photograph is also possible, if we assume the objects are in the same plane as the ColorChecker chart.
Differences in colour of rocks and soils is the result of differences in qualitative and quantitative mineral composition and, in particular, in the presence and quantity of the pigment minerals (most common are lepidocrocite, goethite and hematite). Mineral and chemical composition determination requires complex and time consuming sampling and more costly analyses. Unfortunately the number of such analyses is limited by available funds. Due to the fact that colour is one of the basic properties/attributes of rock, which is noticed macroscopically in the field, an objective capture is very important and useful.
Rocks within some lithologic units are unicoloured, which means, that the variability of colour values is within a very narrow range of colour hue. In such cases field researchers do not compare their colour with the colour chart on every outcrop, but rather assign the same colour value on the basis of previous observation experiences. This shortens observation and time needed for comparison, but they can unwittingly neglect differences in the lateral colour variability within the same lithostratigraphic unit and lose part of the information. Huge variability of colour within the same lithostratigraphic unit of clastic sedimentary rocks reflects differences in their microenvironment of their origin (sedimentation energy) resulting into grain-size differences and also differences in the mineral composition, porosity and permeability of the sedimentary clastic rocks and consequently onto differences in the oxygen availability during diagenetic processes. This influences the oxidation state of the pigment minerals.
Multicoloured lithostratigraphic units contain several indirect colour information on grain size, mineral composition and genetic environment and rock diagenetic processes. A number of determined colours is fully left to the subjective decision of the observer, who will usually, due to the time needed for a full procedure, only determine a few characteristic colours based on their needs or a regional similarity approach. A more objective capture of the colour range and colour coverage would undoubtedly offer a lot of additional information.
The processes of magmatic and metamorphic rocks genesis also result in their different mineral and grain size composition and consequently a different colour range and coverage.
As much as possible objective and detailed colour analysis can offer very useful additional information which enable simple and significant statistical comparison between rock samples and rock outcrops within the same lithostratigraphic units and between the different ones.
The proposed computer aided method of colour calibration and analysis is based on the Munsell, CIE XYZ and CIE Lab colour models and calculates colour distances within them and a short overview of these models follows.

CIE 1931 XYZ Colour Model
CIE XYZ, which was standardized in 1931, was the first mathematically defined colour model that still serves as the basis for newer models and as the linking model used to convert colour values from one model to another.
The model is comprised of three components: X, Y, and Z which were modelled after the human visual system with its three types of cone cells. Experimental data determined how strongly each type of cone cell responds to some wavelength of light, and from the response the colour matching functions x (λ), ȳ(λ) and z(λ) (Schanda, 2007) were derived. A spectrophotometer is a device for measuring material reflectance values at different wavelengths. If we integrate the reflectance measurements with the colour matching functions we get the colour values for the components X, Y, and Z respectively.
The values also vary depending on the illuminant used to perform the measurements which is also defined as a function of λ. The International Commission on Illumination (CIE) has also provided several standard illumination sources. Unless otherwise specified the values in this article use the D65 standard illuminant which is modelled after natural daylight on Earth.
Spectrophotometers are used in laboratories, but are impractical for field work and are very expensive devices. Further drawbacks of their use is a small operating range, usually a few millimeters, the inability to directly measure colour coverage, sampling is required, and the inability to measure rough uneven surfaces (ruiz & Pereira, 2014).

Munsell colour system
The Munsell colour system (munsell, 1905) was developed by prof. Albert H. Munsell with the goal of creating a perceptually uniform system. Perceptual uniformity means that an equal change of a colour component anywhere inside the system means approximately the same perceptual difference to a human observer. Colour in the Munsell system is determined by three components: hue, value, and chroma. The first component, "Hue" , is given as number from 0 to 10, and a one or two letter abbreviation of the hue name. Apart from the colour hues in Fig. 1, there is also a special abbreviation N, which stands for neutral and is reserved for grey shades. "Value" determines the lightness of a colour on a scale from 0 (black) to 10 (white). The third component, "chroma" determines the saturation and has no upper bound in theory, but in practice it is limited by the pigments that can be manufactured. A neutral colour has a chroma value of 0, the highest value we find in the Rock and Soil charts is 8 and 20 would mean a very saturated colour.
The advantages of the Munsell system are intuitive components, and a long tradition of use in industry, art, and science. The drawback is that it is not a mathematically defined colour model, and is connected to the mathematically defined models only by tables of measurements (riT munsell Color sCienCe laboraTorY), which makes exact calculation and conversion difficult.

Use of Munsell colour system in Geology
The Munsell system has a long tradition of use in geology. In 1948 the Geological Society of America (GSA) released the first Rock-color Chart based on the Munsell system. In 1949 the Munsell Color Company collaborated with the United States Department of Agriculture (USDA) to release the first "Munsell Soil-color Chart" . These are books of colour charts intended for comparative determination of colour values of rocks and soil. Both books are still available in updated editions and still in widespread use. They have effectively become the standard for colour communication in geology.
Munsell colour charts are used both for geological field work and work in a laboratory. The comparative method is a lot more precise and objective than verbal descriptions of colours, but is still somewhat subjective and inaccurate, because the books contain a limited number of colour patches, and because of the limitations of the human visual system to accurately distinguish colour differences. Munsell Soil-color Chart (X-riTe, inC., 2009C) contains nine pages, which cover colours with hues from 5R to 5Y at various values of value and chroma components, and four additional pages; one with a few colours with hue values 10Y and 5GY, two pages with low-chroma colours for gleysols, and one page with colours with a high value component. The colours on pages are sorted in two dimensions by value and chroma, so the user can gain a feel for the colours with a particular hue, and can in some cases decide to visually interpolate and assign a colour not depicted in the chart. Rockcolor Chart (X-riTe, inC., 2009b) contains only three pages with the most common rock colours. The colours are not sorted by any of the Munsell system components, which prevents visual interpolation.
Each page of colour chart contains up to 42 colour patches, usually fewer, since some pigments are more expensive or difficult to produce. Each colour patch has a hole to allow direct comparison of the patch with the rock or soil for which the colour is being determined. Next to each colour page is a page with the Munsell values and colour names in the ISCC-NBS system, according to the mapping defined in (kellY & Judd, 1976). The design purpose of ISCC-NBS was to improve the accuracy of colour descriptions by constraining the language to a set of colour names and a few standard adjectives (e.g. dark, vivid, very pale), and to define which parts of the Munsell system correspond to which colour descriptions.

CIE Lab colour model
The International Commission on Illumination (CIE) accepted the CIE Lab colour model in 1976. A colour in CIE Lab is defined by three components: L* -lightness, a* -red/green, and b* -blue/yellow. CIE Lab was designed to be perceptually uniform on all three components at once, and is mathematically defined, which makes it very appropriate for colour computation.

Measuring colour distance
When working with colour, e.g. in print, or industrial design, a common task is tolerancingchecking if colours are acceptably close to some predefined standard. A colour distance measure, where, to the human eye, the same distance means the same amount of change, is very useful, since it can be used for all the colours used. In this section we will mention three formulas for colour distance (sCHanda, 2007), which have been implemented in our computer application.
Since CIE Lab was designed with good perceptual uniformity on all components at once, the first colour distance measure CIE is simply the Euclidean distance of the per component deltas of two colours: istance colour, e.g. in print, or industrial design, a common task is tolerancingre acceptably close to some predefined standard. A colour distance measure, eye, the same distance means the same amount of change, is very useful, since l the colours used. In this section we will mention three formulas for colour 007), which have been implemented in our computer application. esigned with good perceptual uniformity on all components at once, the first ure CIE !" * is simply the Euclidean distance of the per component deltas of !" * = * ! + * ! + * ! that CIE Lab is not completely perceptually uniform, so in 1994 CIE Lab rmula CIE !" * , which was based on a large amount of experimental data motive industry. This formula is defined on CIE LCH -a colour model related same L* component and C* -chroma, and H* -hue, which are simply polar b*.
released another formula, CIE !! * , which experimentally works very well tances, but has some mathematical discontinuities which skew the results SHARMA ET AL., 2005).
e had when working with CIE !! * is that the formula takes a lot more cause of these issues we use CIE !" * for most tasks, and CIE !! * where nce is small.
etation of later results, let us provide some context to the values from these at which the average human observer barely distinguishes two colours if laid 2.3. This value is called the just noticeable difference (JND) (MAHY et al., ate distance between neighbouring grey shades on the ColorChecker chart is stances between pairs of nearest colour values on the Munsell Rock-color chart d colours a bit farther apart, and colours with low saturation a bit nearer).

application calibration chart
Later it was found that CIE Lab is not completely perceptually uniform, so in 1994 CIE Lab confirmed a new formula CIE , which was based on a large amount of experimental data collected by the automotive industry. This formula is defined on CIE LCH -a colour model related to CIE Lab, with the same L* component and C* -chroma, and H* -hue, which are simply polar definitions of a* and b*.

ur distance
with colour, e.g. in print, or industrial design, a common task is tolerancingurs are acceptably close to some predefined standard. A colour distance measure, man eye, the same distance means the same amount of change, is very useful, since or all the colours used. In this section we will mention three formulas for colour DA, 2007), which have been implemented in our computer application.
was designed with good perceptual uniformity on all components at once, the first measure CIE !" * is simply the Euclidean distance of the per component deltas of !" * = * ! + * ! + * ! und that CIE Lab is not completely perceptually uniform, so in 1994 CIE Lab w formula CIE !" * , which was based on a large amount of experimental data automotive industry. This formula is defined on CIE LCH -a colour model related h the same L* component and C* -chroma, and H* -hue, which are simply polar and b*.
CIE released another formula, CIE !! * , which experimentally works very well r distances, but has some mathematical discontinuities which skew the results ces (SHARMA ET AL., 2005).
lty we had when working with CIE !! * is that the formula takes a lot more e. Because of these issues we use CIE !" * for most tasks, and CIE !! * where fference is small.
terpretation of later results, let us provide some context to the values from these imit at which the average human observer barely distinguishes two colours if laid her is 2.3. This value is called the just noticeable difference (JND) (MAHY et al., oximate distance between neighbouring grey shades on the ColorChecker chart is of distances between pairs of nearest colour values on the Munsell Rock-color chart turated colours a bit farther apart, and colours with low saturation a bit nearer).
In the year 2000 CIE released another formula, CIE , which experimentally works very well for small colour distances, but has some mathematical discontinuities which skew the results at larger distances (sHarma eT al., 2005).

ring colour distance
working with colour, e.g. in print, or industrial design, a common task is tolerancingg if colours are acceptably close to some predefined standard. A colour distance measure, to the human eye, the same distance means the same amount of change, is very useful, since e used for all the colours used. In this section we will mention three formulas for colour e (SCHANDA, 2007), which have been implemented in our computer application.
IE Lab was designed with good perceptual uniformity on all components at once, the first distance measure CIE !" * is simply the Euclidean distance of the per component deltas of ours: !" * = * ! + * ! + * ! t was found that CIE Lab is not completely perceptually uniform, so in 1994 CIE Lab ed a new formula CIE !" * , which was based on a large amount of experimental data d by the automotive industry. This formula is defined on CIE LCH -a colour model related Lab, with the same L* component and C* -chroma, and H* -hue, which are simply polar ons of a* and b*.
ear 2000 CIE released another formula, CIE !! * , which experimentally works very well all colour distances, but has some mathematical discontinuities which skew the results r distances (SHARMA ET AL., 2005).
r difficulty we had when working with CIE !! * is that the formula takes a lot more ting time. Because of these issues we use CIE !" * for most tasks, and CIE !! * where ected difference is small. easier interpretation of later results, let us provide some context to the values from these s. The limit at which the average human observer barely distinguishes two colours if laid each other is 2.3. This value is called the just noticeable difference (JND) (MAHY et al., The approximate distance between neighbouring grey shades on the ColorChecker chart is average of distances between pairs of nearest colour values on the Munsell Rock-color chart Another difficulty we had when working with CIE is that the formula takes a lot more computing time. Because of these issues we use CIE for most tasks, and CIE where the expected difference is small. For an easier interpretation of later results, let us provide some context to the values from these formulas. The limit at which the average human observer barely distinguishes two colours if laid next to each other is 2.3. This value is called the just noticeable difference (JND) (maHY et al., 1994). The approximate distance between neighbouring grey shades on the ColorChecker chart is 15. The average of distances between pairs of nearest colour values on the Munsell Rock-color chart is 5.4 (highly saturated colours a bit farther apart, and colours with low saturation a bit nearer).

ColorChecker colour calibration chart
ColorChecker colour chart was developed in 1976 by the Macbeth company (today part of X-Rite company) (mCCamY et al., 1976). The chart is used for the colour calibration of different devices (e.g. cameras, printers, displays). ColorChecker colour chart contains four lines with six colour patches, 24 patches in all. Patches have precisely defined colour values which can be used to check the quality of colour reproduction or colour acquisition. The first two lines contain approximations of some common natural hues (e.g. human skin, greenery, blue sky) and intermediate hues (e.g. orange, yellow-green). The third line represents the extreme points of the RGB (red, green, blue) colour system and CMY (cyan, magenta, yellow) colour system. The fourth line contains 6 patches of grey that can be used for calibration of lightness and white balance.
For the usage in our application we chose the X-Rite ColorChecker Passport (X-riTe, inC., 2009a), shown in Figure 3, instead of the classical variant of ColorChecker since it better suits our requirements. This version of the colour chart is suitable for field work in geology since it is smaller than the classical version and has a hard plastic casing. Concerning the accuracy of colours one of the larger colour charts with more colour patches (e.g. ColorChecker Digital SG, IT8) would be more appropriate for laboratory work. The advantage of a smaller format of the colour chart is that its size better suits the size of rock samples and thus enables us to capture the samples in a higher resolution. For many samples an even smaller colour chart of 3 cm × 2 cm would be convenient.
The X-Rite ColorChecker Passport colour chart contains two additional calibration charts compared to the classic ColorChecker chart -a special section with a large grey patch for white balance and a section named Creative Enhancement Target (CET). CET contains 28 patches: 8 highly saturated colour patches, 2 lines of 6 patches for visual white balance and 4 very light grey and 4 very dark grey patches for detection of overexposure and underexposure. This colour chart is not meant for automatic colour calibration, which may be the reason Computer aided method for colour calibration and analysis of digital rock photographs why there is no data on official colour values of the patches available in the literature or on the internet. However, we have found unofficial spectrophotometric measures (mYers, 2010) which we used to help evaluate the calibration quality of our method.

Detection of the ColorChecker colour chart -ASIFT algorithm
Precise detection of patches on the ColorChecker is very important since the calibration process depends on the measured colour values. For detection of the ColorChecker colour chart we used Affine Scale Invariant Feature Transform or ASIFT (Yu & morel, 2011).
SIFT (lowe, 2004) is a computer vision algorithm which extracts features that can be used for various tasks in computer vision, e.g. object detection (lowe, 1999), panorama stitching (agarwala et al., 2006), automatic 3D modelling (Vergauwen & Van gool, 2006) and gesture recognition (sCoVanner et al., 2007). Features detected by SIFT are resistant to scaling, translation, and to some degree rotation. ASIFT is a simple extension of SIFT where combinations of rotation and shearing transformations are applied multiple times on the image. SIFT features are extracted from the transformed image and transformed back to the original image coordinate space. Using this process we get a larger number of features that are also more robust under affine transforms. According to a recommendation by Yu & morel, 2011, it is sufficient to use 6 shears and rotations from 0° to 180° depending on degree of shearing -in all 42 transformations.

Colour chart detection
To detect a particular object with the ASIFT algorithm we need an image of the object, we then extract SIFT features from both images, the image where we want to detect the object and the image of the object. Detection is performed by finding the best correspondence between the SIFT features of both images. Figure 4 shows lines connecting the corresponding pairs of ASIFT points. Squares on the photo show the centre of the patches. On the bottom left we see the aligned image of the detected object (colour chart) and squares with averaged colours inside the detected patches.  The method is sufficiently general to be used for other colour charts as well. The only part we would need to change is the colour chart image and the arrangement of the patches as they appear on a particular colour chart. For the purpose of evaluating the quality of calibration we have added the option to detect the CET colour chart on the ColorChecker Passport.

Colour calibration of photographs
The aim of photograph colour calibration is to bring the colour values of the photograph as close as possible to values we would measure on the surfaces we are photographing. Calibration could be attempted completely programmatically without the colour chart by extracting the necessary information from the metadata and the image itself (e.g. conditions under which the photograph was taken and the equipment used) and infer the actual colours in the photograph. Because this procedure cannot guarantee accuracy we have decided on calibration using a colour chart.
Colour calibration can be done using ColorChecker colour calibration chart that is put in the photographed scene. To assure best results the lighting of both the colour chart and the rock should be as uniform as possible (X-riTe, inC., 2009a) and with a sufficiently wide spectrum. We can achieve that by using additional lighting or the camera flash. If we use natural light the direction and the intensity of the light should be as much as possible similar on both the rock and the chart.
During the calibration process the application first detects the ColorChecker colour chart on the photograph. Then average colour values are extracted from the chart and the distances from the reference colour values for the chart are calculated. Thus we get a calibration vector in CIE Lab colour space for each colour patch. The calibration could be done in another colour space as well but CIE Lab is very suitable for this purpose because of its good perceptual uniformity.

The issue of overfitting
We are generalizing on the basis of a quite small amount of data, so we have to take care not to overfit the algorithm (HasTie et al., 2009). With simple calibration methods overfitting may appear because of the uneven colour distances between colour patches, since parts of the colour space represented by more patches are weighted more. When using more complex methods we also have to take care, that the algorithms do not transform the colours in a way that does not correspond to physical reality. In calibration with translation the overfitting was avoided by using leave-one-out cross validation (HasTie et al., 2009), where the colour patch, for which the value is being predicted, is not used in the prediction.
In calibration with a linear combination some resilience against overfitting is provided by the fact that the patches on the ColorChecker chart contain both the extreme and central points in the colour space, and since the space is perceptually uniform, a linear method is not likely to overfit.

Calibration with translation
The first method for colour calibration that we implemented finds a single colour vector in the CIE Lab space, which minimizes the CIE The issue of overfitting We are generalizing on the basis of a quite small amount overfit the algorithm (HASTIE et al., 2009). With simple cal because of the uneven colour distances between colour p represented by more patches are weighted more. When usi to take care, that the algorithms do not transform the colou physical reality. In calibration with translation the overfitt cross validation (HASTIE et al., 2009), where the colour patc is not used in the prediction. In calibration with a linea overfitting is provided by the fact that the patches on th extreme and central points in the colour space, and since th method is not likely to overfit. Calibration with translation The first method for colour calibration that we implemente Lab space, which minimizes the CIE !! * distance bet detected colour patches ! and the reference values ! . n = 24 patches, but the method works with any number of pa = ( , , ) ′ = + Where is a vector which minimizes the following expres distance between the average colour value on the detected colour patches The issue of overfitting We are generalizing on the basis of a quite small amount of da overfit the algorithm (HASTIE et al., 2009). With simple calibratio because of the uneven colour distances between colour patche represented by more patches are weighted more. When using mo to take care, that the algorithms do not transform the colours in physical reality. In calibration with translation the overfitting wa cross validation (HASTIE et al., 2009), where the colour patch, for is not used in the prediction. In calibration with a linear com overfitting is provided by the fact that the patches on the Col extreme and central points in the colour space, and since the spac method is not likely to overfit. Calibration with translation The first method for colour calibration that we implemented find Lab space, which minimizes the CIE !! * distance between detected colour patches ! and the reference values ! . Using n = 24 patches, but the method works with any number of patches = ( , , ) ′ = + Where is a vector which minimizes the following expression: and the reference values CIE Lab is very suitable for this purpose because of its good perceptual uniformity. The issue of overfitting We are generalizing on the basis of a quite small amount of data, so we have to take care not to overfit the algorithm (HASTIE et al., 2009). With simple calibration methods overfitting may appear because of the uneven colour distances between colour patches, since parts of the colour space represented by more patches are weighted more. When using more complex methods we also have to take care, that the algorithms do not transform the colours in a way that does not correspond to physical reality. In calibration with translation the overfitting was avoided by using leave-one-out cross validation (HASTIE et al., 2009), where the colour patch, for which the value is being predicted, is not used in the prediction. In calibration with a linear combination some resilience against overfitting is provided by the fact that the patches on the ColorChecker chart contain both the extreme and central points in the colour space, and since the space is perceptually uniform, a linear method is not likely to overfit. Calibration with translation The first method for colour calibration that we implemented finds a single colour vector in the CIE Lab space, which minimizes the CIE !! * distance between the average colour value on the detected colour patches ! and the reference values ! . Using the ColorChecker chart, we have n = 24 patches, but the method works with any number of patches.
= ( , , ) ′ = + Where is a vector which minimizes the following expression: Using the ColorChecker chart, we have n = 24 patches, but the method works with any number of patches.
The issue of overfitting We are generalizing on the basis of a quite small amount of data, so we have to take care not to overfit the algorithm (HASTIE et al., 2009). With simple calibration methods overfitting may appear because of the uneven colour distances between colour patches, since parts of the colour space represented by more patches are weighted more. When using more complex methods we also have to take care, that the algorithms do not transform the colours in a way that does not correspond to physical reality. In calibration with translation the overfitting was avoided by using leave-one-out cross validation (HASTIE et al., 2009), where the colour patch, for which the value is being predicted, is not used in the prediction. In calibration with a linear combination some resilience against overfitting is provided by the fact that the patches on the ColorChecker chart contain both the extreme and central points in the colour space, and since the space is perceptually uniform, a linear method is not likely to overfit. Calibration with translation The first method for colour calibration that we implemented finds a single colour vector in the CIE Lab space, which minimizes the CIE !! * distance between the average colour value on the detected colour patches ! and the reference values ! . Using the ColorChecker chart, we have n = 24 patches, but the method works with any number of patches.
= ( , , ) ′ = + Where is a vector which minimizes the following expression: Where colour space for each colour patch. The calibration could be done in CIE Lab is very suitable for this purpose because of its good percept The issue of overfitting We are generalizing on the basis of a quite small amount of data, overfit the algorithm (HASTIE et al., 2009). With simple calibration because of the uneven colour distances between colour patches, s represented by more patches are weighted more. When using more to take care, that the algorithms do not transform the colours in a w physical reality. In calibration with translation the overfitting was cross validation (HASTIE et al., 2009), where the colour patch, for wh is not used in the prediction. In calibration with a linear combi overfitting is provided by the fact that the patches on the ColorC extreme and central points in the colour space, and since the space i method is not likely to overfit. Calibration with translation The first method for colour calibration that we implemented finds a Lab space, which minimizes the CIE !! * distance between th detected colour patches ! and the reference values ! . Using th n = 24 patches, but the method works with any number of patches.
= ( , , ) ′ = + Where is a vector which minimizes the following expression: is a vector which minimizes the following expression: The issue of overfitting We are generalizing on the basis of a quite small amount of data, so we have to take care not to overfit the algorithm (HASTIE et al., 2009). With simple calibration methods overfitting may appear because of the uneven colour distances between colour patches, since parts of the colour space represented by more patches are weighted more. When using more complex methods we also have to take care, that the algorithms do not transform the colours in a way that does not correspond to physical reality. In calibration with translation the overfitting was avoided by using leave-one-ou cross validation (HASTIE et al., 2009), where the colour patch, for which the value is being predicted is not used in the prediction. In calibration with a linear combination some resilience agains overfitting is provided by the fact that the patches on the ColorChecker chart contain both the extreme and central points in the colour space, and since the space is perceptually uniform, a linear method is not likely to overfit. Calibration with translation The first method for colour calibration that we implemented finds a single colour vector in the CIE Lab space, which minimizes the CIE !! * distance between the average colour value on the detected colour patches ! and the reference values ! . Using the ColorChecker chart, we have n = 24 patches, but the method works with any number of patches.
= ( , , ) ′ = + Where is a vector which minimizes the following expression: As mentioned, the CIE Lab space is not perfectly perceptually uniform, furthermore, the photograph capturing process is not perfect and introduces various changes to the colour space (e.g. contrast, fringing, over-or underexposure), which require more advanced methods of correction. However the method is simple so we implemented it to compare it with other methods.
This method can also be used in conjunction with other methods, since it cannot skew the colour space, however, it should not be used after a calibration method which is more robust against overfitting.

Calibration with a weighted average
The method of calibrating with the weighted average of calibration vectors As mentioned, the CIE Lab space is not perfectly perceptually uniform, furthermore, the photograph capturing process is not perfect and introduces various changes to the colour space (e.g. contrast, fringing, over-or underexposure), which require more advanced methods of correction. However the method is simple so we implemented it to compare it with other methods. This method can also be used in conjunction with other methods, since it cannot skew the colour space, however, it should not be used after a calibration method which is more robust against overfitting. Calibration with a weighted average The method of calibrating with the weighted average of calibration vectors ! , computes the weighted average using two weighting coefficients. The value of the first coefficient ! ! is determined using an evolutionary algorithm before calibration, while the value of the second coefficient ! ( ) is a function of the distance between the colour being calibrated and the colour patch ! . C = ( , , ), ′ = ( ′, ′, ′) For the first weights ! ! we have 3 • normalized weights, which determine the importance of each component ( , , and ) of each colour patch. If the colour value of some patch deviates greatly from the reference value (e.g. because of a damaged patch, over--or underexposure, shadows, partly occluded patch), or put another way: if the other patches offer a better , computes the weighted average using two weighting coefficients , the CIE Lab space is not perfectly perceptually uniform, furthermore, the photograph cess is not perfect and introduces various changes to the colour space (e.g. contrast, r-or underexposure), which require more advanced methods of correction. However simple so we implemented it to compare it with other methods.
can also be used in conjunction with other methods, since it cannot skew the colour er, it should not be used after a calibration method which is more robust against ith a weighted average of calibrating with the weighted average of calibration vectors ! , computes the rage using two weighting coefficients. The value of the first coefficient ! ! is using an evolutionary algorithm before calibration, while the value of the second ! ( ) is a function of the distance between the colour being calibrated and the eights ! ! we have 3 • normalized weights, which determine the importance of ent ( , , and ) of each colour patch. If the colour value of some patch deviates the reference value (e.g. because of a damaged patch, over--or underexposure, . The value of the first coefficient is determined using an evolutionary algorithm before calibration, while the value of the second coefficient As mentioned, the CIE Lab space is capturing process is not perfect and fringing, over-or underexposure), w the method is simple so we impleme This method can also be used in co space, however, it should not be u overfitting. Calibration with a weighted average The method of calibrating with th weighted average using two weig determined using an evolutionary coefficient ! ( ) is a function of t colour patch ! . C ! ! ( For the first weights ! ! we have 3 each component ( , , and ) of e greatly from the reference value is a function of the distance between the colour being calibrated As mentioned, the CIE Lab space is not perfectly perceptually uniform, furthermore, the photograph capturing process is not perfect and introduces various changes to the colour space (e.g. contrast, fringing, over-or underexposure), which require more advanced methods of correction. However the method is simple so we implemented it to compare it with other methods. This method can also be used in conjunction with other methods, since it cannot skew the colour space, however, it should not be used after a calibration method which is more robust against overfitting. Calibration with a weighted average The method of calibrating with the weighted average of calibration vectors ! , computes the weighted average using two weighting coefficients. The value of the first coefficient ! ! is determined using an evolutionary algorithm before calibration, while the value of the second coefficient ! ( ) is a function of the distance between the colour being calibrated and the colour patch ! .
For the first weights ! ! we have 3 • normalized weights, which determine the importance of and the colour patch As mentioned, the CIE Lab space is not perfec capturing process is not perfect and introduce fringing, over-or underexposure), which requ the method is simple so we implemented it to c This method can also be used in conjunction space, however, it should not be used after overfitting.
Calibration with a weighted average The method of calibrating with the weighte weighted average using two weighting coef determined using an evolutionary algorithm coefficient ! ( ) is a function of the distanc colour patch ! .

For the first
As mentioned, the CIE Lab space is not perfectly perceptually uniform, furthe capturing process is not perfect and introduces various changes to the colou fringing, over-or underexposure), which require more advanced methods o the method is simple so we implemented it to compare it with other methods. This method can also be used in conjunction with other methods, since it c space, however, it should not be used after a calibration method which i overfitting.
Calibration with a weighted average The method of calibrating with the weighted average of calibration vecto weighted average using two weighting coefficients. The value of the fi determined using an evolutionary algorithm before calibration, while th coefficient ! ( ) is a function of the distance between the colour being colour patch ! . C = ( , , ), ′ = ( ′, ′, ′) For the first weights ! ! we have 3 • normalized weights, which determi each component ( , , and ) of each colour patch. If the colour value of greatly from the reference value (e.g. because of a damaged patch, ove shadows, partly occluded patch), or put another way: if the other pa calibration in the part of the colour space the current patch occupies, th smaller. These weights are determined before the calibration with an algorithm.
The algorithm starts with all weights set to ! ! , and then iteratively makes r computes the fitness function to see if the new set of weights is better th The fitness function works according to the leave--one--out cross valid means the algorithm is used n times, and one patch is left out of the calib value of the remaining patch is calibrated each time, and the output of t the average of colour distances !! * from the calibrated patch colour v colour value. weights we have 3 · n normalized weights, which determine the importance of each component (L, a, and b) of each colour patch. If the colour value of some patch deviates greatly from the reference value (e.g. because of a damaged patch, over-or underexposure, shadows, partly occluded patch), or put another way: if the other patches offer a better calibration in the part of the colour space the current patch occupies, then its weight will be smaller. These weights are determined before the calibration with an evolutionary search algorithm.
For the first weights ! ! we have 3 • normalized weights, which determine the importance of each component ( , , and ) of each colour patch. If the colour value of some patch deviates greatly from the reference value (e.g. because of a damaged patch, over--or underexposure, shadows, partly occluded patch), or put another way: if the other patches offer a better calibration in the part of the colour space the current patch occupies, then its weight will be smaller. These weights are determined before the calibration with an evolutionary search algorithm.
The algorithm starts with all weights set to ! ! , and then iteratively makes random changes, and computes the fitness function to see if the new set of weights is better than the previous one. The fitness function works according to the leave--one--out cross validation strategy. This means the algorithm is used n times, and one patch is left out of the calibration each time. The value of the remaining patch is calibrated each time, and the output of the fitness function is the average of colour distances !! * from the calibrated patch colour value to the reference colour value.
, and then iteratively makes random changes, and computes the fitness function to see if the new set of weights is better than the previous one. The fitness function works according to the leave-one-out cross validation strategy. This means the algorithm is used n times, and one patch is left out of the calibration each time. The value of the remaining patch is calibrated each time, and the output of the fitness function is the average of colour distances • normalized weights, which determine the importance of , and ) of each colour patch. If the colour value of some patch deviates rence value (e.g. because of a damaged patch, over--or underexposure, uded patch), or put another way: if the other patches offer a better t of the colour space the current patch occupies, then its weight will be ts are determined before the calibration with an evolutionary search ith all weights set to ! ! , and then iteratively makes random changes, and function to see if the new set of weights is better than the previous one. works according to the leave--one--out cross validation strategy. This s used n times, and one patch is left out of the calibration each time. The g patch is calibrated each time, and the output of the fitness function is distances !! * from the calibrated patch colour value to the reference from the calibrated patch colour value to the reference colour value.

The second weight coefficient
The second weight coefficient ! ( ) is a function of the colour being calibrated. The colour patches which are further away in the colour space are weighted less than those nearby. The CIE !" * formula was used, since the colour differences are expected to be large, which makes the use of CIE !! * inappropriate. Calibration with a linear combination This calibration method computes each calibrated component as a linear combination of the old component values in CIE Lab. Again, the task is to find the coefficients where the distance between the calibrated patches and their respective reference values is minimal.
= ( , , ), ′ = ( ′, ′, ′) ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! The meaning of components a and b in CIE Lab is the balance between red and green, and yellow and blue. We can add some more strength to the method by choosing different coefficients for the positive and negative side of the a and b axes: As shown later, this improves the results somewhat, but since it is still a linear transformation there should be no problems with skewing the colour space. The exception would be if the colour value of some patch deviated greatly from the reference values. This could be avoided by leaving out the patches which deviate the most. However this could lead to overfitting, or bad calibration results in cases, where some part of the colour space on the captured photograph really was quite far from the reference values. The method for calibration with a weighted average is more robust against this kind of problem. Apart from this, we have only noticed one more interesting glitch, later found not to be limited to this method. The cyan patch found in the third row of the ColorChecker calibration chart has Lab values which fall outside the range of colours presentable in the RGB colour system which is used in digital photography. This means there is some colour clamping upon conversion from CIE Lab back is a function of the colour being calibrated. The colour patches which are further away in the colour space are weighted less than those nearby. The CIE The second weight coefficient ! ( ) is a function of the colour being calibrated. T patches which are further away in the colour space are weighted less than those ne CIE !" * formula was used, since the colour differences are expected to be large, wh the use of CIE !! * inappropriate. Calibration with a linear combination This calibration method computes each calibrated component as a linear combination component values in CIE Lab. Again, the task is to find the coefficients where the distanc the calibrated patches and their respective reference values is minimal.
= ( , , ), ′ = ( ′, ′, ′) The meaning of components a and b in CIE Lab is the balance between red and green, a and blue. We can add some more strength to the method by choosing different coefficie positive and negative side of the a and b axes: As shown later, this improves the results somewhat, but since it is still a linear transform should be no problems with skewing the colour space. The exception would be if the colou some patch deviated greatly from the reference values. This could be avoided by leavi patches which deviate the most. However this could lead to overfitting, or bad calibration cases, where some part of the colour space on the captured photograph really was quite fa reference values. The method for calibration with a weighted average is more robust a kind of problem. Apart from this, we have only noticed one more interesting glitch, later found not to be this method. The cyan patch found in the third row of the ColorChecker calibration cha values which fall outside the range of colours presentable in the RGB colour system which formula was used, since the colour differences are expected to be large, which makes the use of CIE e second weight coefficient ! ( ) is a function of the colour being calibrated. The colour tches which are further away in the colour space are weighted less than those nearby. The E !" * formula was used, since the colour differences are expected to be large, which makes e use of CIE !! * inappropriate.
libration with a linear combination is calibration method computes each calibrated component as a linear combination of the old mponent values in CIE Lab. Again, the task is to find the coefficients where the distance between calibrated patches and their respective reference values is minimal.
= ( , , ), ′ = ( ′, ′, ′) ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! e meaning of components a and b in CIE Lab is the balance between red and green, and yellow d blue. We can add some more strength to the method by choosing different coefficients for the sitive and negative side of the a and b axes: shown later, this improves the results somewhat, but since it is still a linear transformation there ould be no problems with skewing the colour space. The exception would be if the colour value of me patch deviated greatly from the reference values. This could be avoided by leaving out the tches which deviate the most. However this could lead to overfitting, or bad calibration results in ses, where some part of the colour space on the captured photograph really was quite far from the erence values. The method for calibration with a weighted average is more robust against this d of problem.
art from this, we have only noticed one more interesting glitch, later found not to be limited to inappropriate.

Calibration with a linear combination
This calibration method computes each calibrated component as a linear combination of the old component values in CIE Lab. Again, the task is to find the coefficients where the distance between the calibrated patches and their respective reference values is minimal. coefficient ! ( ) is a function of the colour being calibrated. The colour further away in the colour space are weighted less than those nearby. The as used, since the colour differences are expected to be large, which makes ! inappropriate.
near combination thod computes each calibrated component as a linear combination of the old n CIE Lab. Again, the task is to find the coefficients where the distance between es and their respective reference values is minimal.
= ( , , ), ′ = ( ′, ′, ′) ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! ponents a and b in CIE Lab is the balance between red and green, and yellow dd some more strength to the method by choosing different coefficients for the e side of the a and b axes: improves the results somewhat, but since it is still a linear transformation there ms with skewing the colour space. The exception would be if the colour value of d greatly from the reference values. This could be avoided by leaving out the te the most. However this could lead to overfitting, or bad calibration results in The meaning of components a and b in CIE Lab is the balance between red and green, and yellow and blue. We can add some more strength to the method by choosing different coefficients for the positive and negative side of the a and b axes: cient ! ( ) is a function of the colour being calibrated. The colour r away in the colour space are weighted less than those nearby. The ed, since the colour differences are expected to be large, which makes ropriate.
ombination omputes each calibrated component as a linear combination of the old Lab. Again, the task is to find the coefficients where the distance between their respective reference values is minimal. = ( , , ), ′ = ( ′, ′, ′) ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! nts a and b in CIE Lab is the balance between red and green, and yellow e more strength to the method by choosing different coefficients for the of the a and b axes: ves the results somewhat, but since it is still a linear transformation there h skewing the colour space. The exception would be if the colour value of tly from the reference values. This could be avoided by leaving out the As shown later, this improves the results somewhat, but since it is still a linear transformation there should be no problems with skewing the colour space. The exception would be if the colour value of some patch deviated greatly from the reference values. This could be avoided by leaving out the patches which deviate the most. However this could lead to overfitting, or bad calibration results in cases, where some part of the colour space on the captured photograph really was quite far from the reference values. The method for calibration with a weighted average is more robust against this kind of problem.
Apart from this, we have only noticed one more interesting glitch, later found not to be limited to this method. The cyan patch found in the third row of the ColorChecker calibration chart has Lab values which fall outside the range of colours presentable in the RGB colour system which is used in digital photography. This means there is some colour clamping upon conversion from CIE Lab back to RGB. We have noticed this effect on an image which had strong JPEG compression artifacts, which the clamping had amplified. If the RGB colour system supported a wider range, the red component of RGB would need to be negative, but this issue is not too problematic, since the CIE the calibrated patches and their respective reference values is minimal. = ( , , ), ′ = ( ′, ′, ′) ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! ′ = ⋅ ! ! + ⋅ ! ! + ⋅ ! ! + ! The meaning of components a and b in CIE Lab is the balance between re and blue. We can add some more strength to the method by choosing diff positive and negative side of the a and b axes: As shown later, this improves the results somewhat, but since it is still a lin should be no problems with skewing the colour space. The exception would some patch deviated greatly from the reference values. This could be avo patches which deviate the most. However this could lead to overfitting, or cases, where some part of the colour space on the captured photograph real reference values. The method for calibration with a weighted average is kind of problem. Apart from this, we have only noticed one more interesting glitch, later fo this method. The cyan patch found in the third row of the ColorChecker c values which fall outside the range of colours presentable in the RGB colou digital photography. This means there is some colour clamping upon conve to RGB. We have noticed this effect on an image which had strong JPE which the clamping had amplified. If the RGB colour system supported component of RGB would need to be negative, but this issue is not too pr !! * distance between the actual and clamped value is only 2.2, and the calculations and user readouts in the CIE Lab colour space, so the glitch screen, and upon saving back to JPEG. distance between the actual and clamped value is only 2.2, and the application performs the calculations and user readouts in the CIE Lab colour space, so the glitch was noticeable only on screen, and upon saving back to JPEG.

User interface
The application user interface is simple and contains only the necessary components for swift, accurate and repeatable colour analysis. The interface was built using the Scala Swing library. In figure 5 the original photograph can be seen on the left including annotation points for the colour charts ColorChecker, and Creative Enhancement Target. On the right side the colour calibrated photo with some manually added annotations is shown. The results of colour analysis at these points and areas are presented in the text field on the right. Additionally the photograph metadata and annotation data can be saved to a file. To ease working with the calibrated photograph, we can choose to hide the original photograph.
If the user only wants to check particular photograph colour values, they can click on the desired points. If the shift key is held when moving the mouse pointer around the photograph, the colour values under the mouse cursor are continually printed out on the right. An area on the photograph can be selected holding the control key and dragging the mouse. The application then prints the average colour value and percentage of coverage of individual Munsell colour values. In the annotation mode colour values of currently selected points and areas are printed out on the right side.
librating with the weighted average of calibration vectors ! , computes the using two weighting coefficients. The value of the first coefficient ! ! is an evolutionary algorithm before calibration, while the value of the second a function of the distance between the colour being calibrated and the C = ( , , ), ′ = ( ′, ′, ′) s ! ! we have 3 • normalized weights, which determine the importance of , , and ) of each colour patch. If the colour value of some patch deviates eference value (e.g. because of a damaged patch, over--or underexposure, ccluded patch), or put another way: if the other patches offer a better part of the colour space the current patch occupies, then its weight will be ights are determined before the calibration with an evolutionary search s with all weights set to ! ! , and then iteratively makes random changes, and ss function to see if the new set of weights is better than the previous one. on works according to the leave--one--out cross validation strategy. This m is used n times, and one patch is left out of the calibration each time. The ning patch is calibrated each time, and the output of the fitness function is our distances !! * from the calibrated patch colour value to the reference

Measuring the accuracy of colour calibration
A good colour calibration is necessary to precisely determine the colour values. Therefore we evaluated the accuracy of the calibration procedure. We estimated the accuracy with statistical analysis of deviations between measured and reference colour values of two colour charts. We first compiled a statistic for the ColorChecker colour chart. This could be problematic as this data also served as the basis of fitting the parameters for the calibration procedure. In the case of a too strong fit (overfitting), we would not be able to detect it. Therefore we chose to additionally evaluate the colour deviations on the upper eight patches of the Creative Enhancement Suite (CET) colour chart. We have to reiterate that the reference colour values used for CET colour chart are not provided by the colour chart manufacturer, which could cause deviations.
However, the deviations should be small since the values we use were acquired with accurate spectrophotometric measuring (mYers, 2010).
We used two sets of digital photographs for evaluation. The first set contains 40 different photographs taken under non-controlled conditions -outdoors (field work) and indoors -and therefore contains a mixture of different light conditions (direct sunlight, cloudy weather, indirect lighting in shadows, camera flash, indoor lighting etc.) taken with a variety of digital photographic cameras.
The second set of photographs contains 10 digital photographs, which were taken using the geological sample collection of Faculty of Natural Sciences and Engineering, University of Ljubljana. This set of photographs was taken under good lighting conditions on a white surface using camera flash illumination. Both sides of the colour chart (ColorChecker and CET) were positioned and lit as consistently as possible in every photograph. Computer aided method for colour calibration and analysis of digital rock photographs As we can see in figures 6 and 7 the colour calibration lowers deviations and distances in almost every case and thus enhances the quality of colour information. First column in the figures represents the distances of measured uncalibrated colour values from the reference values. Other columns show colour distances after different colour calibration procedures, which were presented in the colour calibration section.
In the photos captured in non-controlled conditions we can see a large difference between the values shown on the left and right in Figure 6. This is likely the consequence of different illumination on the two colour charts in the photographs, therefore we once again stress the importance of uniform lighting, i.e. usage of additional lighting or camera flash when photographing. For photographs taken under laboratory conditions in figure 7 the colour deviations between detected and reference values are much lower and the interval is narrower. It is interesting that all values, even in the uncalibrated first column on the left graph in figure 7 are lower compared to the right graph in figure 7. This may be the consequence of deviation between the official values for ColorChecker colour chart and the unofficial values for the CET colour chart.
On the basis of the above measurements of deviation from the reference values, we can assess that by using the proposed computer-aided method under good lighting conditions we can calibrate colours almost as precise as an average human being can differentiate between different shades of colours (maHY eT al., 1994). Moreover for photographs captured in non-controlled conditions, we can greatly improve the quality of colour information.

Comparative analysis
In the second part of the evaluation we compared the results of manual colour analysis of rock samples by students of geology using a Munsell Rock-color Chart. From the geological rock sample collection of Department of geology of Faculty of Natural Sciences and Engineering, University of Ljubljana, we selected 10 rock samples (Table 1) and photographed them on a level white surface using camera flash (Fig. 8). Captured images were colour calibrated with the second linear combination procedure, which performed best in the assessment. Then we selected and determined the colour values of representative parts of each sample using the application.  With the help of eight volunteer geology students we conducted an experiment. We enumerated and put 10 rock samples on the laboratory table and we specified how many different colours have to be determined for each sample (Fig. 8). The students were instructed to determine the set number of colours based on the importance and colour coverage using their domain knowledge. The students had the appropriate experiences for the task, since they have already been trained to determine colour using comparison methods in laboratory and outdoor field working conditions. It turned out that not every student determined the colours on the same part of the multi-coloured rock samples and consequently the order and colour labels did not match. The result is somewhat worse compared to the expected precision of colour value discrimination precision of the average human. The experiment has shown that the selection of measuring points on rock surface is subjective. In some cases it was difficult to infer which part of rock is described by a given colour value. Table 1 summarizes the determined colour labels for all samples. The last column shows the average of average CIE ΔE00* distance between the determined colour values in each group. Computer aided method for colour calibration and analysis of digital rock photographs Sample no. 3 is the only cut and polished sample. The values for red agree well, however for grey and black the students chose less saturated hues, i.e. purer grey and black. A possible explanation for this is that the surrounding red colour influenced the students' perception of grey and black. Such phenomena of human visual perception are acknowledged by sHarma & bala, 2002. We chose sample no. 5 for its relatively uniform coloration and therefore we instructed the students to determine only one colour value -in this case the subjectivity of choosing the measuring location is smaller. Samples no. 4 and 9 proved to be problematic as the students chose many different colour values. Sample no. 9 was problematic for the application as well since it contains small fragments of brown mineral sphalerite which somewhat reflects light -in this case it would be better to photograph the sample without using the flash and in a very high resolution to be able to analyse individual fragments. It would be necessary to examine and determine the optimal conditions for photographing samples that are reflecting light to different degrees.
Let us name a few other problems we noticed during the experiment. One of the students turned the colour chart the other way around and read the wrong colour values, however he noticed the mistake after finishing the first sample and corrected the results. One of the noted colour values was not a valid value in the Munsell system. Two of the students marked two different rock samples with the same number, however we managed to determine which sample they belong to in both cases by examining the remaining data. Some samples were missing a few of the colour values and there was one sample with one value more than the requested number of values. When transcribing the written data into the computer we made a few mistakes that were identified and corrected after proofreading. Colour analysis with the help of the application would solve most of the subjective causes for problems.
If we count the number of measures for each sample we can see that every colour is on average represented by four different Munsell colour values. If all the students took the measures on the same points of the rock sample and if we eliminate some of the other errors that occurred in the data, the average would likely be reduced. However, it is necessary to stress that the students were motivated volunteers who did the colour determinations in a well-lit room. We believe that the values acquired during field work would be much more varied, since we have to take into account the weather, and changing light conditions.

Discussion
Estimation of colour value and colour coverage for multicoloured objects in geology is very subjective especially in field work due to lack of time and unpredictable weather and lighting conditions. Objectivity is higher when these parameters are estimated on the samples brought from field work to the laboratory, where there are fewer time constraints and the lighting conditions are better. Moreover there is no precipitation, humidity is low and there is less chance to make the colour chart dirty or otherwise degrade its quality. The presented computer application is useful in both environments. During field work it enables very quick acquisition of the observed object's colours information, while the analyses can be done later in the laboratory or office with the use of the proposed application when there is more time available.
The computer application also substantially enhances and improves the work in the laboratory.
We propose to include colour calibrated photographs into the archives along with the samples or other objects of observation.
Further development of the application can take several directions. We can implement it as a web and/or mobile application suited for field work use. Digital photography is inexpensive and enables photographic documentation of all important rock outcrops on the route of field observation, which could result in several hundred observed outcrops and samples daily. With the synchronous capture of digital photographs of rocks outcrops and samples combined with the GPS coordinates the user can map rock colour variability in the area.
In areas where rock colour is distinctive of a specific part of the lithostratigraphic succession (lithostratigraphic unit) we can use the quality rock colour information as basic lithology recognition parameters, which in turn enable us to construct geological maps together with the use of structural and tectonic elements.
For further processing of the acquired data we can use additional statistical approaches (e.g. clustering) and with the help of crowdsourcing we can build a database containing colours of rock and mineral types, which could aid computer rock identification.
The proposed method is most useful for recognition of lithostratigraphic units, which contain varieties of clastic sedimentary and mixed carbonate-clastic sedimentary rock varieties. We believe that most of such lithostratigraphic units could be distinguished and recognised on the basis of the proposed method of colour analysis.

Conclusions
Munsell Rock-color Chart and Munsell Soilcolor Chart for soils have already been used for precise comparative determination of rock and mineral colours for some decades. Determining colour values of multicoloured rocks in the field with the manual method is very time consuming and consequently expensive. This is especially so in detrimental weather conditions when colour charts could get wet and/or dirty, making comparison inconvenient and can severely degrade the quality of the standard chart used for comparison. Conventional colour charts are relatively expensive, so every additional purchase in order to replace a dirty chart is an additional unplanned cost.
In search for the best compromise between time used for colour determination and quality of colour determination for multicoloured objects, each observer chooses their own set of representative points. This was found to be more or less subjective and did not necessarily result in colour values, which were representative for the observed outcrop or for a rock fragment, taking into account the surface area of a specific colour.
Surface colour representation and coverage is often very subjectively estimated. Determination of colour surface coverage on the basis of a statistically representative number of evenly distributed points on the analysed surface is too time consuming and consequently too expensive and usually omitted. This results in subjectivity and an incorrect estimation of various visible rock characteristics.
Digital cameras have become a standard tool for documenting geological and other field observations. Besides various other information found in digital photographs, they can be also used as an objective source of colour values and their areal coverage on the captured objects, if the digital photographs are properly calibrated.
To provide fast, objective and repeatable colour values determination we have developed a computer application, which provides automatic colour calibration of digital photographs on the basis of a standard colour chart ColorChecker, systematically added onto the photographed surface. It automatically identifies colours within the Munsell colour system, and calculates colour surface/areal representativity coverage and logs the details of executed analyses (positions of measured points and areas saved along with calibrated images).
For digital photograph colour calibration we implemented the detection of the ColorChecker and Creative Enhancement Suite colour charts, which are a part of the ColorChecker Passport produced by the X-Rite Company. It is easy to add support for any other models or types of colour charts, if needed, as the used approach for detection and calibration is general and can be used for any of them.
We have implemented four methods for computer colour calibration, which use evolutionary algorithms to determine the best coefficients for each method.
Methods for colour calibrations have improved the quality of colour information on practically all the digital photographs used in the assessment. In some test photographs, taken in non-controlled conditions, there was quite a big deviation of colour values from the reference values for the Creative Enhancement Target, which was not used in calibration ( fig. 6). The deviation is likely a consequence of uneven natural lighting, so it is necessary that during the capture of the digital photographs, the colour chart and the outcrop, rock or any other object of photography, is as evenly illuminated as possible (e.g. by using camera flash). The test photographs were taken in very varied conditions on purpose, so the effectivity of the method could be tested.
The assessment results of the colour calibration methods we implemented also show that under laboratory conditions the colour distances from reference colour values are low and around the limit which still can be recognised by human vision. For the photographs taken under non-controlled conditions the average colour distances are larger, but still quite low and within acceptable limits.
Results of the comparison between the proposed automatic and the existing manual/comparative methods have shown, that manual/comparative colour determination is subjective and error-prone, even in stable laboratory conditions with no time pressure and with optimal lighting conditions. The user interface of the developed computer application enables colour value determination at selected points and calculation of colour value coverage and average colour of a broader selected area. Selected annotation points and areas, and the detail of calibration are saved inside the metadata of photographs, which enables full repeatability, and verifiability of the analyses at a later date.