Contrast control

NAFE image analyzer has full automatic contrast control i.e. automatic setting of Input Black, Input White, Output Black, Output White. Switching this control on/off is done by means of Contrast Auto/Fix switch buttons. Fix means that setting of all contrast parameters is done by user. It makes sense only rarely in case that you want to process several images with exactly the same setting.

The exact meaning of Input Black, Input White, Output Black, Output White parameters can be found in NAFE paper:

  • Input Black is a0 and Input White is a1 in formula (3).
  • b0=0,b1=65535 in formula (3)
  • Output Black and Output White define the linear transform between 16 bit/pixel image B in formula (2) and resulting 8 bit/pixel image.

Contrast control for ROI

If the ROI is set the automatic contrast control takes the ROI into consideration. The behaviour of contrast control is dependent on four constants GlobalB, LocalB, GlobalW, LocalW which are set in NAFE.ini file. Output Black used for final image calculation is computed as weighted mean of two values: Output Black pixel value derived from the whole image and Output Black pixel value derived from ROI only. GlobalB, LocalB are weights of these two values and they must satisfy the conditions
GlobalB≥0,    LocalB≥0,    GlobalB + LocalB = 1.

Analogously the pair GlobalW, LocalW defines the weights for calculating the Output White and must satisfy the conditions

GlobalW≥0,    LocalW≥0,    GlobalW + LocalW = 1.

There exist two extereme settings. If

GlobalB=0,   LocalB=1,   GlobalW=0,   LocalW=1

then the contrast is set according to ROI only and the rest of image has no influence on resulting image. If

GlobalB=1,   LocalB=0,   GlobalW=1,   LocalW=0

then the ROI setting has no influence on resulting image. Default values are

GlobalB=0.3,   LocalB=0.7,   GlobalW=0.3,   LocalW=0.7.