Detection#

Inference#

colour_checker_detection

detect_colour_checkers_inference(...)

Detect the colour checkers swatches in specified image using inference.

inferencer_default(image[, cctf_encoding, ...])

Predict the colour checker rectangles in specified image using Ultralytics YOLOv8.

extractor_inference(image, inference_data[, ...])

Extract colour swatches using inference-based methods.

SETTINGS_INFERENCE_COLORCHECKER_CLASSIC

Settings for the inference of the X-Rite ColorChecker Classic.

SETTINGS_INFERENCE_COLORCHECKER_CLASSIC_MINI

Settings for the inference of the X-Rite ColorChecker Classic Mini.

Segmentation#

colour_checker_detection

detect_colour_checkers_segmentation(...)

Detect the colour checkers swatches in specified image using segmentation.

segmenter_default(...)

Detect the colour checker rectangles in specified image using segmentation.

extractor_segmentation(...)

Extract colour swatches using segmentation-based methods.

SETTINGS_SEGMENTATION_COLORCHECKER_CLASSIC

Settings for the segmentation of the X-Rite ColorChecker Classic and X-Rite ColorChecker Passport.

SETTINGS_SEGMENTATION_COLORCHECKER_NANO

Settings for the segmentation of the X-Rite ColorChecker Nano*.

SETTINGS_SEGMENTATION_COLORCHECKER_SG

Settings for the segmentation of the X-Rite ColorChecker SG*.

colour_checker_detection.detection

DataSegmentationColourCheckers(rectangles, ...)

Colour checkers detection data used for plotting, debugging and further analysis.

Templated#

colour_checker_detection

detect_colour_checkers_templated(...)

Detect the colour checkers swatches in specified image using templated methods.

segmenter_templated(...)

Detect the colour checker rectangles, clusters and swatches in specified image using segmentation with advanced filtering.

extractor_templated(...)

Extract colour swatches using template-based perspective transformation.

SETTINGS_TEMPLATED_COLORCHECKER_CLASSIC

Settings for the templated detection of the X-Rite ColorChecker Classic.

colour_checker_detection.detection

WarpingData([cluster_id, cost, transformation])

Data class for storing the results of the correspondence finding.

Templates#

colour_checker_detection.detection

Template(swatch_centroids, colours, ...)

Template dataclass for colour checker structure representation.

generate_template(swatch_centroids, colours, ...)

Generate a template from colour checker structure.

load_template(template_path)

Load a template from a structured NPZ file.

PATH_TEMPLATE_COLORCHECKER_CLASSIC

Path to the X-Rite ColorChecker Classic 24-patch template NPZ file.

PATH_TEMPLATE_COLORCHECKER_CREATIVE_ENHANCEMENT

Path to the X-Rite ColorChecker Creative Enhancement 140-patch template NPZ file.

Plotting#

colour_checker_detection

plot_detection_results(colour_checkers_data, ...)

Visualize colour checker detection results.

Common Utilities#

colour_checker_detection.detection

approximate_contour(contour[, points, ...])

Approximate specified contour to have specified number of points.

as_float32_array(a)

Convert specified variable \(a\) to numpy.ndarray using np.float32 numpy.dtype.

as_int32_array(a)

Convert specified variable \(a\) to numpy.ndarray using np.int32 numpy.dtype.

contour_centroid(contour)

Return the centroid of specified contour.

DataDetectionColourChecker(swatch_colours, ...)

Colour checker swatches data used for plotting, debugging and further analysis.

detect_contours(image[, additional_data])

Detect the contours of specified image using specified settings.

DTYPE_FLOAT_DEFAULT

DTYPE_INT_DEFAULT

is_square(contour[, tolerance])

Return if specified contour is a square.

quadrilateralise_contours(contours)

Convert specified contours to quadrilaterals.

reformat_image(image, target_width[, ...])

Reformat specified image so that it is horizontal and resizes it to specified target width.

remove_stacked_contours(contours[, ...])

Remove and filter out the stacked contours from specified contours keeping either the smallest or the largest ones.

sample_colour_checker(image, quadrilateral, ...)

Sample the colour checker using the specified source quadrilateral, i.e., detected colour checker in the image, and the specified target rectangle.

scale_contour(contour, factor)

Scale specified contour by specified scale factor.

cluster_swatches(image, swatches, ...)

Cluster swatches by expanding them and fitting rectangles to overlapping areas.

filter_clusters(clusters, swatches, ...)

Filter clusters by the number of swatches they contain.

SETTINGS_CONTOUR_DETECTION_DEFAULT

Settings for contour detection.

SETTINGS_DETECTION_COLORCHECKER_CLASSIC

Settings for the detection of the X-Rite ColorChecker Classic and X-Rite ColorChecker Passport.

SETTINGS_DETECTION_COLORCHECKER_SG

Settings for the detection of the X-Rite ColorChecker SG*.

swatch_colours(image, masks)

Extract the swatch colours from specified image using specified masks.

swatch_masks(width, height, swatches_h, ...)

Return swatch masks for specified image width and height and swatches count.

transform_image(image[, translation, ...])

Transform specified image using specified translation, rotation and scale values.