Colour - Checker Detection - Examples: Segmentation

This notebook showcases segmentation retated colour checker detection examples.

Note: The original *.CR2 files were processed with dcraw as follows: dcraw -T -g 2.4 12.92 *.CR2 and then resized and converted to *.png.

In [1]:
from __future__ import division

import cv2
import glob
import matplotlib.pyplot as plt
import numpy as np
import os
from collections import OrderedDict

import colour
from colour.plotting import *

from colour_checker_detection import (
    EXAMPLES_RESOURCES_DIRECTORY,
    colour_checkers_coordinates_segmentation,
    detect_colour_checkers_segmentation)
from colour_checker_detection.detection.segmentation import (
    adjust_image)

colour.utilities.describe_environment();
===============================================================================
*                                                                             *
*   Interpreter :                                                             *
*       python : 3.7.4 (default, Sep  7 2019, 18:27:02)                       *
*                [Clang 10.0.1 (clang-1001.0.46.4)]                           *
*                                                                             *
*   colour-science.org :                                                      *
*       colour : 0.3.14                                                       *
*       colour-checker-detection : v0.1.0-46-g297f935                         *
*                                                                             *
*   Runtime :                                                                 *
*       imageio : 2.6.1                                                       *
*       matplotlib : 3.0.3                                                    *
*       numpy : 1.17.3                                                        *
*       scipy : 1.3.1                                                         *
*       six : 1.12.0                                                          *
*       opencv : 4.1.1                                                        *
*                                                                             *
===============================================================================
In [2]:
colour_style();

Data

In [3]:
COLOUR_CHECKER_IMAGE_PATHS = glob.glob(
    os.path.join(EXAMPLES_RESOURCES_DIRECTORY, 'detection', '*.png'))

COLOUR_CHECKER_IMAGES = [
    colour.cctf_decoding(colour.io.read_image(path))
    for path in COLOUR_CHECKER_IMAGE_PATHS
]

for image in COLOUR_CHECKER_IMAGES:
    plot_image(colour.cctf_encoding(image));
/Users/kelsolaar/Library/Caches/pypoetry/virtualenvs/colour-checker-detection-4JNYxXhS-py3.7/lib/python3.7/site-packages/colour/utilities/verbose.py:235: ColourUsageWarning: "OpenImageIO" related API features are not available, switching to "Imageio"!
  warn(*args, **kwargs)