Main Content

colorChecker

Calibrite ColorChecker test chart

Since R2020b

Description

A colorChecker object stores the positions and measurements of the regions of interest (ROIs) of a Calibrite ColorChecker® Classic test chart (formerly produced by X-Rite® and GretagMacbeth®) [1].

Creation

Description

chart = colorChecker(A) creates a colorChecker object from input image A. The input image sets the Image property.

example

chart = colorChecker(A,Name=Value) controls the automatic chart detection using one or more name-value arguments.

chart = colorChecker(A,"RegistrationPoints",p) creates a colorChecker object and sets the RegistrationPoints property using the specified points in p.

example

Input Arguments

expand all

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: chart = colorChecker(A,Downsample=false) does not downsample the chart image for chart detection

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: chart = colorChecker(A,"Downsample",false) does not downsample the chart image for chart detection

Downsample the chart image for chart detection, specified as a numeric or logical 1 (true) or 0 (false). When true, colorChecker resizes the image while preserving the aspect ratio such that the size of the smallest dimension is 1000. Downsampling enables colorChecker to detect the chart more quickly.

colorChecker uses the downsampled image for detection only. The object calculates all properties using the original image.

Sensitivity of chart detection, specified as a number in the range [0, 1]. If you set a high sensitivity value, colorChecker detects more points of interest with which to register the test chart image.

Data Types: single | double

Properties

expand all

This property is read-only.

Test chart image, specified as an RGB image.

Data Types: single | double | uint8 | uint16

This property is read-only.

Position and intensity values of the color patches, specified as a 24-by-1 vector of structures. Each element in the vector corresponds to one ROI and contains these fields:

FieldDescription
ROI

1-by-4 vector specifying the spatial extent of the ROI. The vector has the form [X Y Width Height]. X and Y are the coordinates of the top-left corner of the ROI. Width and Height are the width and height of the ROI, in pixels. ROI is of data type double.

ROIIntensity

Array of color values within the ROI. The array has dimensions Height-by-Width-by-3. The data type of ROIIntensity matches the data type of the Image property.

Coordinates of registration points, specified as a 4-by-2 numeric matrix. The registration points are the (x,y) coordinates of the plus-shaped (+) fiducials on the outer corners of the chart. Each row of the matrix contains the coordinates for one registration point. Specify the points in the order "black", "white", "dark skin", and "bluish green" according to the color of the nearest color patch.

Data Types: double

Object Functions

measureColorMeasure color reproduction using test chart
measureIlluminantMeasure scene illuminant using test chart
displayChartDisplay test chart with overlaid regions of interest

Examples

collapse all

Read an image of a ColorChecker® chart into the workspace.

I = imread("colorCheckerTestImage.jpg");

Display the image.

imshow(I)
title("Captured Image of ColorChecker Chart")
text(size(I,2),size(I,1)+15,"Chart courtesy of Calibrite", ...
    "FontSize",10,"HorizontalAlignment","right")

Figure contains an axes object. The hidden axes object with title Captured Image of ColorChecker Chart contains 2 objects of type image, text.

Create a colorChecker object by performing automatic chart detection on the image.

chart = colorChecker(I)
chart = 
  colorChecker with properties:

                 Image: [1024x1541x3 uint8]
    RegistrationPoints: [4x2 double]
             ColorROIs: [24x1 struct]

To confirm that the colorChecker object detected the chart correctly, display the chart and detected ROIs. Each ROI appears as a blue rectangle centered in the appropriate color patch. The registration points appear as red diamonds on the outer corners of the chart.

displayChart(chart)

Figure Color checker test chart contains an axes object. The hidden axes object contains 25 objects of type image, text.

Read an image of a ColorChecker® chart into the workspace.

I = imread("colorCheckerTestImage.jpg");

Display the image.

imshow(I)
title("Captured Image of ColorChecker Chart")
text(size(I,2),size(I,1)+15,"Chart courtesy of Calibrite", ...
    "FontSize",10,"HorizontalAlignment","right")

Draw point ROIs that overlap the plus-shaped (+) fiducials at the corners of the chart.

blackPoint = drawpoint;
whitePoint = drawpoint;
darkSkinPoint = drawpoint;
bluishGreenPoint = drawpoint;

Combine the (x,y) coordinates of the point ROIs into a 4-by-2 matrix.

cornerPoints = [blackPoint.Position;
    whitePoint.Position;
    darkSkinPoint.Position;
    bluishGreenPoint.Position];

Create a colorChecker object by specifying the (x,y) coordinates of the corner registration points.

chart = colorChecker(I,"RegistrationPoints",cornerPoints);

To confirm that the colorChecker object detected the chart correctly, display the chart and detected ROIs.

displayChart(chart)

Tips

  • Some measurement functions expect that test chart data is in the sRGB color space. If your image is not in the sRGB color space, you can convert it to the intermediate L*a*b* color space using rgb2lab and then to the sRGB color space using lab2rgb.

  • There are two manufactured versions of the ColorChecker test chart that have slightly different reference values. The reference values of the colorChecker object match the "After November 2014" version of the chart.

References

[1] Calibrite. "ColorChecker Classic". https://calibrite.com/us/product/colorchecker-classic/.

[2] Fernandez, P. D. M., F. A. Guerrero-Peña, T. I. Ren, and G. J. J. Leandro, "Fast and robust multiple ColorChecker detection using deep convolutional neural networks," Image and Vision Computing, Volume 81, 2019, pp. 15-24.

Version History

Introduced in R2020b