visfeats.hsv_features#

visfeats.hsv_features(image: Image, bins: int = 100, return_hsv: Literal[False] = False) → dict[str, float]#
visfeats.hsv_features(image: Image, bins: int = 100, *, return_hsv: Literal[True]) → tuple[dict[str, float], NDArray[float64]]

Compute the mean and entropy of the HSV channels of an image.

Parameters:
imageImage

Input image.

binsint, default=100

Number of bins for the histograms used to compute entropy.

return_hsvbool, default=False

If True, also return the per-pixel HSV array (see Returns).

Returns:
featuresdict of {str: float}

A mapping of feature names to values:

Key

Description

hue_mean

Circular mean hue in [0, 1).

saturation_mean

Mean saturation in [0, 1].

value_mean

Mean value (brightness) in [0, 1].

hue_entropy

Entropy of the hue histogram.

saturation_entropy

Entropy of the saturation histogram.

value_entropy

Entropy of the value histogram.

hsvndarray, shape (height, width, 3)

Raw per-pixel HSV values. Only returned when return_hsv=True.

Notes

The image is converted to RGB, then to HSV using skimage.color.rgb2hsv().