A Technical Overview of Reikan FoCal RGB Analysis

Reikan FoCal 1.9.5 introduces a brand new analysis method called RGB Analysis.  This post is intended to give an overview of the benefits of this new analysis method – it’s quite technical so if you like getting into the details then read on!

1.9.5

 

History of FoCal’s Analysis

To start with, I’ll give a little history: Internally, we call the analysis calculation “CalcQ”, and the first development version was called CalcQ1.  Between the initial development and the release of FoCal 1.0, we went through a number of different analysis methods and FoCal 1.0 launched using CalcQ6.   With the release of FoCal 1.5 we addressed a few shortcomings with a new analysis method called CalcQ7, leaving CalcQ6 for use in LiveView analysis (the Semi Automatic test and some internal functions, all of which are not affected by the issues found in CalcQ6).

Step forward to today, and the internal name for our new RGB Analysis is CalcQ10d.  It took quite a few more goes to get this one right!

The discussion below will reference the two analysis methods as Q7 (the original analysis method up to FoCal 1.9.2), and Q10d (the new RGB Analysis method used in FoCal 1.9.5).

Analysis Results Comparison

During the development of the analysis methods, we use a mix of simulated images, captured test images and real testing under various lighting conditions to assess the performance of each revision.  In fact, our test suite for Q10d outputs a PDF file with internal analysis calculations and graphs that spans nearly 200 pages!

The ideal analysis calculation result will have the following properties:

  • changes a known amount with respect to the sharpness of an image
  • does not change with a change in light level
  • does not change with a change in image content

Those last 2 points make the development of an analysis algorithm quite complex!

I’ll address each of these and how we test them below.

Image Sharpness

The chart below shows the results of shifting the focus point of an EF 35mm f/1.4L lens from in front of the chart, through perfect focus on the chart to behind the chart (the x-scale is arbitrary and doesn’t relate to any specific unit of focus shift).  The orange line is for the older Q7 analysis, and the blue line for the new Q10d analysis:

q10q7defocus

The 3 images below the chart show the analysed image for the far left (point 1), middle (point 15) and the far right (point 29) of the chart.

Essentially, the curves are very similar.  We scaled the value of Q10d so the peak would approximately match the Q7 value, but haven’t adjusted the out-of-focus value at all which is why it appears higher at the edges than Q7 (in fact if we scaled the square of the Q10d result, the curves overlay almost perfectly).  This isn’t a problem for the tests in FoCal – essentially we’re just after something that gives a higher number for a sharper image.

The result of Q10d does, however, reflect more accurately the perceived sharpness of the image.  To illustrate this, the following shows the images from points 14 to 17 of the chart:

Defocus Images 14-17
image-1734
Images 14-17. (Click to see full size image)

There’s not a great difference between them, and yet Q7 significantly penalised the right hand image with a QoF drop of nearly 13%.  Looking at the individual channels there is a slight rise in quality of the red channel, a bigger drop in the green and pretty much no change in the blue channel, but as this was shot under lighting with a stronger red component the red and green pretty much cancel out in the Q10d algorithm leaving a resulting QoF which only varies by around 1.5%.

Light Level

The chart below shows the QoF results for an identical image through a change in light level of almost 8 stops from left to right.   Again, the orange line is for the older Q7 analysis, and the blue line for the new Q10d analysis:

q10q7light

The 3 images below the chart show the analysed image for the far left (point 1), middle (point 15) and the far right (point 30) of the chart.

For a completely ideal analysis algorithm, what we’d be looking for would be a flat line – i.e. the QoF would not vary at all because the sharpness of the image hasn’t changed despite the light level change.

First, take a look at the Q7 result.  Across the change in light level we get a massive change in QoF value, from a value of nearly 0 at either end to a value of almost 2000 in the centre.  Clearly, this is far from ideal.

And now the Q10d result.  This has much less variation, ranging from around 1200 to 2000.  It’s still a big change, but the isolation from light level change in Q10d is massively improved over Q7.

However, it’s important to take this particular set of results in context.  The instructions for using FoCal do specify that you try to keep the light level as constant as possible, so in real use the performance of the algorithm to a change in light level is less relevant than it might first appear.  Certain tests – like the Aperture Sharpness test – will result in images being analysed which have slightly differing brightnesses, so the results will be better using Q10d for this test.

Furthermore, Q10d isn’t just about the analysis result.  There are a number of internal statistics within the Q10d algorithm which allow FoCal to determine the quality of the final output result, and give ideas as to why it may not be optimal.  For this first release (FoCal 1.9.5), we have implemented a warning if the image being analysed is too bright or too dark, which means that in reality FoCal will only be dealing with the light levels in the flatter part of the curve above, exhibiting a QoF change of only 200-300 points at it’s most extremes.

Image Content

The final criteria for the new algorithm was an isolation in the result from the image being analysed.  To test this, we shifted our analysis point around the target.  The chart below shows the results for 30 different analysed points on the target:

q10q7shift

The 3 images below the chart show the analysed image for the far left (point 1), middle (point 15) and the far right (point 30) of the chart.

We have a very clear winner here!  Like the light level change results, the ideal line would be flat across the chart, meaning you get the same QoF results irrespective of where on the target you analyse.

The Q7 result shows a huge change of almost 2000 QoF points for various points on the target.  Q10d, however, shows a variation of only about 100 QoF points.

Being able to get the same result for the same level of sharpness is useful to compensate for any movement through lens focus breathing, lens element shift on focus and also for horizontal and vertical QoF measurement comparisons.  Through analysis, we’ve determined that the maximum change in horizontal and vertical results of a single image is a little less than 3% (although it’s typically much less than 1%), and further work on the Q10d algorithm should reduce this error further.

There is another possible benefit to this as well – you may be able to compare results across different FoCal tests.  This needs further proving, but results from our testing suggest that the numbers from various tests can be compared as long as they are from the same camera, under similar lighting and using the same Image Capture Mode (i.e. Raw or JPEG).

Why RGB Analysis?

Any appropriate analysis method for FoCal would operate by looking at how brightness changes across the image.  It may be through direct comparisons, through edge detection analysis, spectral analysis of the derivative of the brightness levels or various other methods, but it all comes down to quantifying the overall rate of change of brightness.

The sensor of the camera is covered with a colour filter array (typically a Bayer matrix), which makes certain photosites sensitive to either red, green or blue light.  In the most common configuration, only a quarter of the photosites are sensitive to red and blue, and the remaining half sensitive to green – so for your 20 megapixel camera, only 5 million of those photosites are detecting red and blue, and 10 million are detecting green.  A demosaicing algorithm cleverly mixes all this information together to create an image with a red, green and blue component for every pixel of the image (in our exampling, giving you 20 million pixels with red, green and blue colour information).

So, we’ve got capture in 3 colours (red, green and blue), and an analysis algorithm that looks at brightness changes.  The Q7 algorithm worked purely on the green channel* , but Q10d runs independently on each colour channel and then combines the results based on the amount of each colour in the analysed image (as the FoCal target is white and black, the amount of each colour in the image should reflect the components of the lighting source).

(* Now in FoCal 1.9.5 if you uncheck the RGB Analysis setting so you use Q7, it will actually analyse a mix of 30% red, 40% green and 30% blue rather than just the green channel)

Raw processing

This brings us on to a problem.  The whole point of the demosaicing algorithm mentioned above is to fill in the blanks in each colour in a way that gives you a nice realistic image.  If you treat each channel independently, you generally get lots of artefacts in the resulting full colour image so typically the algorithms take advantage of spectral correlation – the similarity between pixels of all colours.  This is great for a final image, but not so great if you want to look at how each channel behaves independently.

So FoCal uses a custom raw processing algorithm which keeps all the channels independent.  The first version of this processing algorithm in FoCal 1.9.5 results in a displayed image (in the panels and report) which is a little blockier and slightly susceptible to moiré (due to the on-filter low pass filter not being optimal for this sort of processing).  However, because of how Q10d works, neither of these affect the results of the analysis so as long as the Image Capture Mode setting in FoCal is set to Raw, the red, green and blue channel results truly reflect the independent quality of each channel.

If you choose to use the JPEG Image Capture Mode, the demosaicing algorithm will introduce a little contamination between the channels, but other settings on the camera may more significantly affect the results.  Chromatic aberration correction and distortion correction settings should all be set to off for the best JPEG analysis results.

Effects of Axial Chromatic Aberration

Axial (or longitudinal) chromatic aberration is the name given to the phenomenon where a lens focuses different wavelengths of light in different planes, and you would see this effect in FoCal as a spreading of the best quality points of each colour.

The chart below shows this effect to some extent – the red and green microadjustment values are around -4, but the blue value is almost -11.:

Spread RGB Result

Spectral Content: Spectral Content: R: 46% (±0.1%) G: 34% (±0.1%) B: 20% (±0.2%)

For the example above, FoCal gave an suggested AF Microadjustment setting of -5.  As shown by the Spectral Content above (which is shown in the FoCal report), only 20% of the light content is blue, so although the blue solution is far from the red and green solution it carries much less weight than the other two channels.

Why analyse Horizontal and Vertical?

The Q10d algorithm works on groups of lines rather than processing the whole image in one go, so within FoCal we analyse lines in a horizontal and vertical direction separately.  We think there’s quite a lot of potential use for the ratio between horizontal and vertical sharpness, but right now it’s a new measurement in FoCal so the software will just show the value rather than make any assumptions about what it means.

At the moment, we present this as a field called HVR (Horizontal-to-Vertical Ratio) which is defined as follows:

HVR = (max(QoFh, QoFv) / min(QoFh, QoFv)) * 100

if QoFv > QoFh, make the result negative

A positive value for HVR means the image is sharper in the horizontal axis (i.e. left-to-right), and a negative value means it’s sharper in the vertical axis (i.e. top-to-bottom).  This will be shown in FoCal Plus and FoCal Pro the image panels, and in FoCal Pro in the report along with some further statistics (such as mid value and variability).

So what can you deduce from this value?

Lens Defects

If your lens is producing an image that’s significantly sharper in one direction than the other, it could indicate poor lens optics or possibly a misaligned element (maybe from a knock or manufacturing defect).

In the FoCal Pro report, there is a new RGB Analysis section which contains information about the HVR, light spectral content and red, green and blue analysis results.  The HVR is shown as follows:

H-to-V Ratio Range 12.1% (±0.8%)

If, when running a test which does not change the focus (e.g. the AF Consistency Test in Single AFMA mode) you see a constant positive or negative HVR value larger than about 5% with a small variability (less than 3%), you may be seeing the effects of a lens defect and it might be worth taking a closer look at some real images produced from this lens.  The example above shows this: 12.1% difference between horizontal and vertical quality, but very little variation between the shots indicates a repeatable discrepancy between the quality in the 2 axes.

Vibration

If you see a high variability (greater than about 5%) to the data, it may indicate vibration.  The cause will depend on the value of the mid result, so for example:

  • positive result (e.g. 6.7% ± 9.2%) would indicate that the vertical axis is less sharp and so could be the result of mirror-slap vibration as the shot is taken.
  • near-zero result (e.g. 0.2% ± 11.1%) would indicate that there is a large variation but in both horizontal and vertical axes, indicating general vibration, possibly from the ground.
  • negative result (e.g.  -7.2% ± 10.7%) would be unlikely, as it would indicate the horizontal axis is less sharp and imply rotational vibration around the ground-to-ceiling axis.

What’s Next?

We’ll continue to work on Q10d – we think we can get better isolation of both light level changes and image content without significantly changing the QoF value for our test conditions (which mean that any results you get now will be able to be compared with the improved Q10d results).

Future version of FoCal will do much more checking of the suitability of the captured image for analysis, meaning more reliable results.  We’ll continue to develop use of the Horizontal-to-Vertical Ratio value to help identify issues with your setup or your lenses.

This is a big change that was originally intended for FoCal 2, but we wanted to bring the benefits of this new analysis algorithm to you earlier.

Feedback

Let us know if you have any comments, suggestions or other feedback either from this post or from using FoCal with the new RGB Analysis.  You can either comment on this post or get in touch with the contact form.

 

One comment on “A Technical Overview of Reikan FoCal RGB Analysis

  • Working with Focal Pro for approximately one year I found out by myself, that the light level changes the test results a lot (up to Version 1.9.2)! For that reason I changed my daylight tests to tests in the basement, using artificial illumination (halogen light). Test done like this, are quite repeatable. A problem still remains, that the found values are not 100% useable for all lighting conditions. For that mentioned reasons I really appreciate, that you work on your new Q10d algorithm! I will give it a try! Thanks a lot!

    Reply

Leave a Reply

Your email address will not be published.