backgound and foreground calibration