ImageContainer.features_histogram

ImageContainer.features_histogram#

ImageContainer.features_histogram(layer, library_id=None, feature_name='histogram', channels=None, bins=10, v_range=None)#

Compute histogram counts of color channel values.

Returns one feature per bin and channel.

Parameters:
layer str

Image layer in img that should be processed. If None and only 1 layer is present, it will be selected.

library_id str | None (default: None)

Name of the Z-dimension that this function should be applied to.

feature_name str (default: 'histogram')

Base name of feature in resulting feature values dict.

channels int | Sequence[int] | None (default: None)

Channels for this feature is computed. If None, use all channels.

bins int (default: 10)

Number of binned value intervals.

v_range tuple[int, int] | None (default: None)

Range on which values are binned. If None, use the whole image range.

Returns:

dict[str, Any] – Returns features with the following keys for each channel c in channels:

  • '{feature_name}_ch-{c}_bin-{i}' - the histogram counts for each bin i in bins.