ALBULA  4.0.1
dectris.albula.DContrast Class Reference

Class DContrast computes recommendations for foreground and background values, that may be used when representing a DImageInt or DImageFloat by a color scale. The parameters necessary for the computation may either be set in the constructor (DContrast()) or by setParams(). The implementation of the computation as operator(DImageInt,DImageInt) makes DContrast an valid callback object for DSubFrame.loadImage(). More...

Public Member Functions

def DContrast (a=6, numberOfSamples=100000)
 Default constructor. More...
 
def setParams (a=6, numberOfSamples=100000)
 Set parameters explicitely. More...
 

Detailed Description

Class DContrast computes recommendations for foreground and background values, that may be used when representing a DImageInt or DImageFloat by a color scale. The parameters necessary for the computation may either be set in the constructor (DContrast()) or by setParams(). The implementation of the computation as operator(DImageInt,DImageInt) makes DContrast an valid callback object for DSubFrame.loadImage().

class DContrast provides the following operations:

DContrast(img,mask)

Compute reasonable suggestions for fore- and background values, that might be used when representing img by a color scale. You may try to fine tune the output by setting the parameters a and numberOfSamples (see DContrast() and setParams()), which enter the computation in the following way:
numberOfSamples is the number of random pixels that are used to determine mean and sigma of the image. The returned fore- and background read:
foreground = mean + a * sigma
background = mean - a * sigma

Parameters
imgDImage object
maskDImage object. If not None pixels masked out by values different from zero are not taken into account
Returns
Tuple (foreground,background)

Constructor & Destructor Documentation

◆ DContrast()

def dectris.albula.DContrast.DContrast (   a = 6,
  numberOfSamples = 100000 
)

Default constructor.

All parameters are keyword arguments.

Parameters
aFloat. See operator().
numberOfSamplesInteger. See operator().

Member Function Documentation

◆ setParams()

def dectris.albula.DContrast.setParams (   a = 6,
  numberOfSamples = 100000 
)

Set parameters explicitely.

All parameters are keyword arguments.

Parameters
aFloat. See operator().
numberOfSamplesInteger. See operator().