Main Content

colorChecker

X-Rite ColorChecker test chart

Description

A colorChecker object stores the positions and measurements of the regions of interest (ROIs) of an X-Rite® ColorChecker test chart.

Creation

Description

example

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

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

example

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

Input Arguments

expand all

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'Downsample',false

Downsample the chart image for chart detection, specified as the comma-separated pair consisting of 'Downsample' and 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 the comma-separated pair consisting of 'Sensitivity' and 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
ROIA 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
displayChartDisplay test chart with overlaid regions of interest

Examples

collapse all

Read an image of an X-Rite® 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 X-Rite' char(174)], ...
    'FontSize',10,'HorizontalAlignment','right')

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)

Read an image of an X-Rite® 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 X-Rite' char(174)], ...
    '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

  • X-Rite has manufactured two versions of the ColorChecker test chart with slightly different reference values. The reference values of the colorChecker object match the "After November 2014" version of the chart.

References

[1] 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.

Introduced in R2020b