Evaluate the color accuracy of a camera

The camera object is a structure with slots for optics (oi), image sensor (sensor), and image processing pipeline (vci). We frequently use the camera structure to evaluate whole system properties.

Here, the accuracy is measured for a Macbeth Color Checker under D65. Running this script requires some user-interaction.

See also: cameraColorAccuracy, macbethCompareIdeal, s_metricsAcutance, macbethDrawRects, imageIncreaseImageRGBSize

Copyright ImagEval Consultants, LLC, 2012.

Contents

ieInit

Initialize a camera objects.

% The camera object contains an optics structure, a sensor, and a default
% processing pipeline.  You can change the parameters of these structure.
camera = cameraCreate;
Camera from default oi,sensor and ip
Interpolating display SPD for consistency with new wave.

Color accuracy test

% Measure the CIELAB delta E values for rendering a Macbeth Color
% Checker under a D65 illuminant.
%
sensor  = cameraGet(camera,'sensor');
sensor  = sensorSet(sensor,'auto exposure',1);
camera  = cameraSet(camera,'sensor',sensor);

% Run the color accuracy analysis.  This creates an MCC scene,
% passes it all the way to the processed image, and then
% calculates the error plot.
cAccuracy     = cameraColorAccuracy(camera);

% To have a look at the MCC image and rectangles, you can run this code
%
%   vci = cameraGet(cAccuracy,'vci');
%   vci = ipSet(vci,'name','Color Accuracy Test');
%   ieAddObject(vci); ipWindow
%   vci = macbethDrawRects(vci,'on');
%   vci = macbethDrawRects(vci,'off');
Warning: Resizing sensor to match scene FOV (3.7) 

Make visual comparisons of the rendered and target MCC

macbethCompareIdeal;

% Print out the $\Delta E$ values
dE = reshape(cAccuracy.deltaE,4,6);
fprintf('Here are the Delta E values for each patch\n')
fprintf('-----\n')
dE
fprintf('-----\n')
Here are the Delta E values for each patch
-----

dE =

    5.4792    9.4431    2.1684    9.4522    4.8467   10.0489
    1.0716    2.8284    3.5222    6.8388    6.0331    1.6039
    6.5935    5.8276    7.3670    5.1792    3.5232    8.5127
    5.7550    2.8631    5.2981    6.9867    9.5313    3.9609

-----

Or make an image of the delta E values

   pSize = 25;
   deimage = imageIncreaseImageRGBSize(dE,pSize);
   vcNewGraphWin; imagesc(deimage); colormap(gray)
   colorbar; axis image; axis off
   title('\DeltaE values')