Previous topic

image_utilities

Next topic

morpho_utilities

This Page

color_utilities

This file contains some useful wrappers over Yayi basic color processing functions.

Yayi.color_utilities.HLS1FromRGB(im)[source]

Transforms the input RGB UInt8 image into the HLS (hue, luma, saturation) color space. The definition of the HUE used is the one using the l1 norm (see Hanbury).

param im:input RGB image
rtype:image
returns:same image, in the HLS color space. The hue, luma and saturation channels are in this order
Yayi.color_utilities.ThresholdCircularDomainDegres(im, angle_in, angle_out)[source]

Returns a binary image corresponding to a threshold of the input image expressed in an angular domain. This is basically a threshold function, except the fact that it handles correctly the case angle_in > angle_out of the circular domain.

If angle_in < angle_out, we have:

\[\begin{split}\forall p \in \mathcal{D}(im), im_o(p) = \left\{\begin{array}{ll}255&im_1(p) \in [a_{in}, a_{out}[\\ 0 & otherwise\end{array}\right.\end{split}\]

If angle_in > angle_out, we have

\[\begin{split}\forall p \in \mathcal{D}(im), im_o(p) = \left\{\begin{array}{ll}255&im_1(p) \in [a_{in}, 360[ \cup [0, a_{out}[\\ 0 & otherwise\end{array}\right.\end{split}\]
Parameters:
  • im – the input image to be thresholded (should be mono-channel)
  • angle_in – the beginning of the interval (integer)
  • angle_out – the end of the interval (integer)
Return type:

a “binary” mask image, where 255 indicates the points in the desired interval (0 otherwise)

Yayi.color_utilities.colorComposeFrom3(im1, im2, im3)[source]

Combines the 3 mono-channel images into one 3-channels image

Yayi.color_utilities.colorGetChannel(im, channel)[source]

Returns a copy of the specified channel.

Parameters:
  • im (image) – input image
  • channel (int) – the desired channel
Return type:

image

Returns:

copy of the specified channel of the input image

Example:

imout = colorGetChannel(imin, 2)
Yayi.color_utilities.colorSplitTo3(im)[source]

Splits the input 3-channel image into 3 outputs, each of them corresponding to one of the input’s channel