colour_checker_detection.detection.templates.generate_template#

colour_checker_detection.detection.templates.generate_template(swatch_centroids: ndarray, colours: ndarray, name: str, width: int, height: int, show: bool = False, output_directory: str | None = None) Template[source]#

Generate a template from colour checker structure.

Parameters:
  • swatch_centroids (ndarray) – Centroids of the swatches.

  • colours (ndarray) – Colours of the swatches.

  • name (str) – Name of the template.

  • width (int) – Width of the template.

  • height (int) – Height of the template.

  • show (bool) – Whether to show visualizations of the template.

  • output_directory (str | None) – Directory to save the template JSON file. If None, saves in the templates directory.

Returns:

Generated template object.

Return type:

Template