darsia.AffineBalance#
- class AffineBalance[source]#
Bases:
BaseBalanceClass for finding and applying a general affine 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.
Attributes
Balance scaling matrix.
Balance translation vector.
- apply_balance(img)[source]#
Apply the color balance to an image.
- Parameters:
- img
np.ndarray Image to apply the color balance to.
- img
- Returns:
Balanced_img(np.ndarray):Balancedimage.
- find_balance(swatches_src, swatches_dst)[source]#
Find the color balance of an image.
- Parameters:
- swatches_src
np.ndarray Source swatches.
- swatches_dst
np.ndarray Destination swatches.
- swatches_src
- balance_scaling#
Balance scaling matrix.
- balance_translation#
Balance translation vector.