darsia.BaseBalance#

class BaseBalance[source]#

Bases: ABC

Base class for finding and applying a color/white balance.

Methods

apply_balance(img)

Apply the color balance to an image.

find_balance(swatches_src, swatches_dst)

Find the color balance of an image.

apply_balance(img)[source]#

Apply the color balance to an image.

Parameters:
imgnp.ndarray

Image to apply the color balance to.

Returns:
Balanced_img (np.ndarray): Balanced image.
abstractmethod find_balance(swatches_src, swatches_dst)[source]#

Find the color balance of an image.

This routine defines the color balance of an image by finding a linear transformation.

Parameters:
swatches_srcnp.ndarray

Source swatches.

swatches_dstnp.ndarray

Destination swatches.