1. A foreground image separation method for separating dynamic foreground and static background in continuously inputted images with automatic white balance adjustment and brightness variation, comprising: providing a reference image as a basis for color gain compensation; receiving an input image from the camera; performing a color gain compensation step to the input image according to the reference image to generate a compensated image with color and brightness which are approximately similar to that of at least part of regions of the reference image corresponding to the compensated image; and performing a background subtraction algorithm to generate a background separation result, wherein the step of providing the reference image further comprises: processing the input image with the background subtraction algorithm to generate a background mask; calculating a ratio of foreground portions to whole size of the input image; and selecting the input image as the reference image if the calculated ratio is less than a predetermined value.