Calculate background using histogram. Update the input image by background instead of black color.