Saturday, 24 September 2016

Field Marks - Grey Scales and Gulls (Part 5)

In this series of postings I have been concerned with trying to replicate the famous (among gull enthusiasts) Kodak Grey Scale in sRGB colour space.  The intention has been to try and directly measure gull upper-wing and mantle tones from digital images, in a manner consistent with studies using an actual Kodak Grey Scale card alongside a gull in the hand.  Why?  Because, upperparts tone can be instructive in gull identification, and if reliable measurements can be taken from digital images it will help in some gull identifications. To date I have written four other blog postings on the subject, parts OneTwoThree and Four.  In the most recent posting I took a conceptual look under the hood as it were, focusing on the various parameters that together explain the non-linearity of tonality in digital images.  

For starters, human perception of brightness is non-linear (covered by the luminosity function).  Next we have gamma - a non-linear function applied to images to cater for the non-linear properties of older display monitors.  Lastly we have the characteristic curve, used in photography to make subtle tonal corrections and get the best out of our photographs.  In this posting it's time to get 'down and dirty'.  Would the real Kodak Grey Scale card please stand up?

From left to right, the X-rite (formerly Gretag-Macbeth) Colour Checker Passport is the modern professional photographer's quality control tool for exposure and colour calibration.  I have used it in discussions about colour in this blog.  Centre, the Kodak Grey Scale together with the Colour Separation Guide (not shown) represent the original quality control tool for many photographers.  Though the Kodak tool has tended to be surpassed in more recent times by more robust, all-in-one tools like the X-rite Colourchecker Passport, the Kodak grey scale tool has long been favoured by gull researchers as a tool to aid in the separation of taxa based on mantle shade.  And so it remains.  Lastly to the right I have included a cheap and cheerful, Mudder white balance card, consisting of a white card, an 18% grey card and black card.  Time for a more practical, direct look at the Koday Grey Scale.

Online Resources - sRGB Guideline Values
Having spent a long time trying to obtain appropriate sRGB values for the Kodak Grey Scale, I finally stumbled upon an excellent resource from Berkeley, University of California as outlined in my last instalment on this subject (HERE).  

 The sRGB values certainly appear to replicate Berkeley's high quality copy of the Kodak Grey Scale.  However, in attempting to apply those values in my analysis of gulls, something didn't quite fit.  It proved necessary to darken my gull images before applying the tool.  Considering that I had been able to obtain surprisingly consistent results using just a linear grey scale model, and without having to darken the images drastically to read off the mantle tones, something seemed to be amiss.  Hence the research has continued, and hence I find myself writing yet another chapter on Grey Scales and Gulls.

A Comparison of Multiple Grey Card Captures
For my first experiment with the Kodak Grey Scale card I have simply taken a series of bracketed exposures with my Canon 70D and 300mm lens, then selected the most representative one.  I then took another image of the card with an Iphone 6.  I found it was necessary to adjust the brightness of the Iphone 6 image slightly to obtain a matching exposure (note I used the 18% greycard in both images as a standard exposure reference).  Next I converted both images to greyscale in Adobe Elements before samplling each swatch from each image (using the sampling procedure HERE).  Lastly I compared each image both visually and graphically.

The results showed a clear difference between the camera's in terms of tonality.  What more, both differed markedly from the Berkeley image.  Of the various parameters I had explored in my earlier post only one could account for this vast difference - the camera's Characteristic Curve.

Though it's difficult to make a meaningful comparison between my eye's perception of the tonality of the actual Kodak Grey Scale card and various on-screen depictions of it, I nonetheless gave it a go.  To my eyes the Canon 70D gave the closest match to the actual Kodak Grey Scale card in terms of mid-tones, say from level 2 or 3 to level B.  Whereas the Iphone did a much better job in depicting the highlights and shadows, i.e. levels A - 2 and B - 19.  So I decided to average the Canon 70D results and Iphone results and graph the averages alongside each of the different captured versions.  The resulting compromise certainly has the classic sigmoid or S-shape of a characteristic curve and it looks elegant.  But are we any closer to that elusive ideal sRGB Grey Scale after all of this?

What Next?
 It may be tempting at this point to throw in the towel and say that, as all camera's have differing characteristic curves surely it's impossible to accurately reproduce and measure tones along any comparable scale?  And yet, all the results to date have been surprisingly effective using just a purely linear model (the blue scale in the graph above).  So it's not all doom and gloom.

Once again...more to come.

Saturday, 3 September 2016

Colour - Pros and Cons of Boosting Saturation

As a young boy I can remember being told that white light can be scattered by a prism into all the colours of the rainbow.  Like most kids, I found that an incomprehensible concept.  For a child, used to subtractive mixing of coloured paints, the additive mixing of coloured light to produce white light is totally alien.  For more on additive and subtractive colour mixing see HERE.

In the typical model of colour that most of us work with in image processing we have three axes which together describe all the colours that we see.  The classic rainbow is defined by the property of colour referred to as hue.  This represents colours at their purest and most vibrant (fully saturated).  Luminance is merely a measure of the brightness of a colour.  If we take away hue what we are left with essentially is a B&W image made up of levels of brightness of each pixel along a grey scale.

The third axis, saturation is a little harder to grasp, but, actually I have just described it in the previous paragraph.  Desaturation of colour is the gradual removal of colour to reveal a grey scale.  Scientifically, saturation is a measure of the purity of the most dominant wavelength of light.  The presence of other wavelengths of light desaturates the dominant wavelength making it less vibrant.  It's totally counter-intuitive.  By adding more colours we end up with grey scale.  If this sounds a bit like the process involved in creating white light that's because it is the very same process.  A prism splits apart different wavelengths of light so they become individual, vibrant, saturated colours.  Take away the prism and all these wavelengths intermingle again, reducing their individual vibrancy or saturation levels until what remains is pure luminance, without colour.  I have written a bit more about saturation HERE.

Boosting Colour Saturation
As birders we put a lot of demands on our digital cameras.  We bolt on a long lens and ramp up aperture and shutter speed in the hopes of capturing an elusive, often small and fast-moving subject, using minimal levels of light.  Thankfully, modern digital cameras use advanced processing to boost the sensitivity of the camera sensor to increase it's versatility in low light situations.  Part of that process may include a boosting of colour saturation.

 In the illustration above I have taken a typical exposure and boosted saturation beyond normally acceptable levels.  It reveals a number of pros and cons about the tool.  On the plus side, colourful objects like the bareparts of the gulls are boosted in a positive way.  We also see a boosting of other natural colours including the mantle shades of the gulls (these are not neutral greys as it turns out), plus the colour of the sand and sky reflection on the water.  These are 'over-cooked' here for illustrative purposes.  Taking saturation back a few notches will render them more acceptably.  

On the negative side we can see how boosting saturation makes colour noise more apparent and makes shadows appear unnatural in colour.  In reality even shadows have underlying colour in them which only becomes apparent when saturation is boosted.  Provided we have an understanding of each of these inherent pros and cons saturation can be used as a forensic tool.

To illustrate that true neutral greys are not altered by the saturation tool note I have added six grey boxes, three of which are neutral grey.  The other three have a minimal, almost imperceptible colour cast applied, which is revealed when the saturation is boosted.

So, what can boosting saturation tell us about the image above?  
  • It tells us that the mantle shades of these gulls are not neutral grey.
  • We can better visualise leg colour, not always clear from low saturation images
  • We can see there are a number of things impacting the shadows including the blue sky and reflected sand.  We  often think of shadows as grey but in fact they generally have underlying colour in them.
  • We may be better able to detect a white balance error
  • If there are any true neutral greys in an image these will be revealed

In Camera Saturation Processing
Processing from RAW, saturation is one of the parameters requiring setting by the operator.  RAW data files are naturally low in contrast and saturation.  When the camera outputs a JPEG from RAW the processor uses proprietary settings for saturation.  These may not always be easy to anticipate.  For instance in an earlier posting HERE, I carried out an analysis of the relationship between exposure and saturation, with some unexpected results.

 In another posting HERE I explored the intrinsic interrelationship between brightness, contrast, saturation and sharpness.  Adjusting any one results in a knock-on effect for all the others.

 In summary, saturation is an intrinsic part of colour.  It is also yet another tool which we can use in the forensic analysis of images.  There are of course limitations which we need to understand in order to use this tool effectively.