1 Colour - Checker Detection#
A Python package implementing various colour checker detection algorithms and related utilities.
It is open source and freely available under the BSD-3-Clause terms.

1.1 Features#
The following colour checker detection algorithms are implemented:
Segmentation
Machine learning inference via Ultralytics YOLOv8
The model is published on HuggingFace, and was trained on a purposely constructed dataset.
The model has only been trained on ColorChecker Classic 24 images and will not work with ColorChecker Nano or ColorChecker SG images.
Inference is performed by a script licensed under the terms of the GNU Affero General Public License v3.0 as it uses the Ultralytics YOLOv8 API which is incompatible with the BSD-3-Clause.
1.1.1 Examples#
Various usage examples are available from the examples directory.
1.2 User Guide#
User Guide#
The user guide provides an overview of Colour - Checker Detection and explains important concepts and features, details can be found in the API Reference.
Installation Guide#
Because of their size, the resources dependencies needed to run the various examples and unit tests are not provided within the Pypi package. They are separately available as Git Submodules when cloning the repository.
Primary Dependencies#
Colour - Checker Detection requires various dependencies in order to run:
Secondary Dependencies#
Pypi#
Once the dependencies are satisfied, Colour - Checker Detection can be installed from the Python Package Index by issuing this command in a shell:
pip install --user colour-checker-detection
The tests suite dependencies are installed as follows:
pip install --user 'colour-checker-detection[tests]'
The documentation building dependencies are installed as follows:
pip install --user 'colour-checker-detection[docs]'
The overall development dependencies are installed as follows:
pip install --user 'colour-checker-detection[development]'
Bibliography#
Felix Abecassis. OpenCV - Rotation (Deskewing). http://felix.abecassis.me/2011/10/opencv-rotation-deskewing/, 2011.
Jacob Dallas. [BUG]: Flipped colour chart. January 2024.
Alexander Olferuk. How to force approxPolyDP() to return only the best 4 corners? - Opencv 2.4.2. https://stackoverflow.com/a/55339684/931625, March 2019.
Tim Walter. [ENHANCEMENT] Proposal to allow detection from different perspectives. https://github.com/colour-science/colour-checker-detection/issues/60, 2022.
1.3 API Reference#
API Reference#
Colour - Checker Detection#
Detection#
Inference#
colour_checker_detection
Settings for the inference of the X-Rite ColorChecker Classic. |
|
Settings for the inference of the X-Rite ColorChecker Classic Mini. |
|
|
Predict the colour checker rectangles in given image using Ultralytics YOLOv8. |
|
Detect the colour checkers swatches in given image using inference. |
Segmentation#
colour_checker_detection
Settings for the segmentation of the X-Rite ColorChecker Classic and X-Rite ColorChecker Passport. |
|
Settings for the segmentation of the X-Rite ColorChecker SG*. |
|
Settings for the segmentation of the X-Rite ColorChecker Nano*. |
|
|
Detect the colour checker rectangles in given image \(image\) using segmentation. |
|
Detect the colour checkers swatches in given image using segmentation. |
Common Utilities#
colour_checker_detection.detection
alias of |
|
alias of |
|
Settings for the detection of the X-Rite ColorChecker Classic and X-Rite ColorChecker Passport. |
|
Settings for the detection of the X-Rite ColorChecker SG*. |
|
Settings for contour detection. |
|
Convert given variable \(a\) to |
|
Convert given variable \(a\) to |
|
|
Return swatch masks for given image width and height and swatches count. |
|
Extract the swatch colours from given image using given masks. |
|
Reformat given image so that it is horizontal and resizes it to given target width. |
|
Transform given image using given translation, rotation and scale values. |
|
Detect the contours of given image using given settings. |
|
Return if given contour is a square. |
|
Return the centroid of given contour. |
|
Scale given contour by given scale factor. |
|
Approximate given contour to have given number of points. |
|
Convert given to quadrilaterals. |
|
Remove amd filter out the stacked contours from given contours keeping either the smallest or the largest ones. |
|
Colour checker swatches data used for plotting, debugging and further analysis. |
|
Sample the colour checker using the given source quadrilateral, i.e. detected colour checker in the image, and the given target rectangle. |
Indices and tables#
1.4 Code of Conduct#
The Code of Conduct, adapted from the Contributor Covenant 1.4, is available on the Code of Conduct page.