ReferencePixels

Qualified name: CDC.color_models.ReferencePixels

class ReferencePixels(*, reference, annotated)[source]

Bases: object

A Class for handling the reference pixels for color models. Extracted from a reference image and an annotated mask.

Parameters:
  • reference (pathlib.Path) – Reference image from which the pixels are extracted.

  • annotated (pathlib.Path) – Image with annotated pixels locations for extraction.

Methods

generate_pixel_values

Generate Pixel values from reference and mask image.

load_image

Load image from file.

Attributes

values

The reference pixel values.

static load_image(file_name)[source]

Load image from file.

Parameters:

file_name (Path)

Return type:

ndarray

generate_pixel_values(ref_image, mask_image, lower_range=(245, 0, 0), higher_range=(256, 10, 10))[source]

Generate Pixel values from reference and mask image. Lower_range and higher_range is only used if mask is annotated with a color to extract the pixel with a given color. Default red.

Parameters:
Return type:

None

values: ndarray

The reference pixel values.