# displayColorPatch

Display measured and reference color as color patches

## Syntax

``displayColorPatch(colorTable)``
``displayColorPatch(colorTable,Name,Value)``

## Description

example

````displayColorPatch(colorTable)` displays measured and reference colors, `colorTable`, for color patch regions of interest (ROIs) in a test chart. The measured color values are displayed as squares surrounded by a thick boundary of the corresponding reference color.```

example

````displayColorPatch(colorTable,Name,Value)` displays measured color values with additional parameters to control aspects of the display.```

## Examples

collapse all

Read an image of an X-Rite® ColorChecker® chart into the workspace.

`I = imread('colorCheckerTestImage.jpg');`

Create a `colorChecker` object, then display the chart with ROI annotations.

```chart = colorChecker(I); displayChart(chart,'displayRegistrationPoints',false)```

Measure the color in each color patch ROI.

`colorTable = measureColor(chart);`

On a color patch diagram, display the measured and reference colors and the color error ($\Delta \mathrm{E}$).

`displayColorPatch(colorTable)`

This example shows how to display the color patch diagram from measurements of color accuracy on an Imatest® eSFR chart.

Read an image of an eSFR chart into the workspace.

`I = imread('eSFRTestImage.jpg');`

Create an `esfrChart` object. Display the chart, highlighting the 16 color patches.

```chart = esfrChart(I); displayChart(chart,'displayEdgeROIs',false, ... 'displayGrayROIs',false,'displayRegistrationPoints',false)```

Measure the color in all color patch ROIs.

`colorTable = measureColor(chart);`

Display the color accuracy measurements without the ROI index overlay. Each square color patch is the measured color, and the thick surrounding border is the reference color for that ROI. The color accuracy measurement is displayed as `Delta_E`, the Euclidean distance between measured and reference colors in CIE 1976 L*a*b* color space. More accurate colors have a smaller `Delta_E`.

`displayColorPatch(colorTable,'displayROIIndex',false)`

## Input Arguments

collapse all

Color values in each color patch, specified as an m-by-8 color table, where m is the number of patches. The eight columns represent these variables:

VariableDescription
`ROI`Index of the sampled ROI. The value of `ROI` is an integer in the range [1, 16]. The indices match the ROI numbers displayed by `displayChart`.
`Measured_R`

Mean value of red channel pixels in an ROI. `Measured_R` is a scalar of the same data type as `chart.Image`, which can be of type `single`, `double`, `uint8`, or `uint16`.

`Measured_G`

Mean value of green channel pixels in an ROI. `Measured_G` is a scalar of the same data type as `chart.Image`.

`Measured_B`

Mean value of blue channel pixels in an ROI. `Measured_B` is a scalar of the same data type as `chart.Image`.

`Reference_L`

Reference L* value corresponding to the ROI. `Reference_L` is a scalar of type `double`.

`Reference_a`

Reference a* value corresponding to the ROI. `Reference_a` is a scalar of type `double`.

`Reference_b`

Reference b* value corresponding to the ROI. `Reference_b` is a scalar of type `double`.

`Delta_E`Euclidean color distance between the measured and reference color values, as outlined in CIE 1976.

### 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: `displayColorPatch(myColorTable,'displayROIIndex',false)` turns off the display of the ROI indices.

Display ROI index labels, specified as the comma-separated pair consisting of `'displayROIIndex'` and `true` or `false`. When `displayROIIndex` is `true`, then `displayColorPatch` overlays color patch ROI index labels on the displayed color patches. The indices match the ROI numbers displayed by `displayChart`.

Data Types: `logical`

Display color error ("delta E") values, specified as the comma-separated pair consisting of `'displayDeltaE'` and `true` or `false`. When `displayDeltaE` is `true`, `displayColorPatch` overlays the color error values on the displayed color patches.

Data Types: `logical`

Axes handle of the displayed image object, specified as the comma-separated pair consisting of `'Parent'` and an axes handle. `Parent` specifies the parent of the image object created by `displayColorPatch`.

## Tips

### Objects

Introduced in R2017b