Patent ID: 7302082

Claim:
A method for detecting motion pixels in an image, comprising the steps of: step 1: obtaining a difference image according to a difference between a current image and a background image; step 2: finding a first binarization threshold from a distribution of all absolute pixel values in said difference image; step 3: using all or part of the pixel values, in said difference image, whose absolute values are smaller than or equal to said first binarization threshold to compensate the effect of an illumination change and to obtain an updated difference image; step 4: finding a second binarization threshold from the distribution of all absolute pixel values in said updated difference image, changing the pixel values whose absolute values are larger than said second binarization threshold to high, and changing the pixel values whose absolute values are equal to or smaller than said second binarization threshold to low, thereby obtaining a binarized updated difference image; and step 5: determining pixels in said binarized updated difference image whose values are high as motion pixels; wherein said step 2 includes the sub-steps of: (1) counting occurrences of all absolute pixel values to plot a cumulative histogram of pixel values, wherein a transverse axis of said cumulative histogram indicates all possible absolute pixel values arranged in ascending order, and a longitudinal axis indicates a cumulative occurrence count equal to or smaller than the absolute pixel values: (2) defining two linear segments constructed by (i) an occurrence count of the minimum absolute pixel value, (ii) said cumulative occurrence count of the absolute pixel values equal to or smaller than a selected absolute pixel value between the minimum and maximum absolute pixel values and (iii) said cumulative occurrence count of the absolute pixel values equal to or smaller than the maximum absolute pixel value, wherein said selected absolute pixel value includes all possible absolute pixel values between the minimum and maximum absolute pixel values; (3) defining the coordinate of every point in the two linear segments as (i, L i ), and defining the coordinate of every point in an envelope line of the cumulative histogram as (i, E i ); and (4) finding, among said selected pixel value, a pixel value that minimizes at least one of the sum ∑ i ⁢ ⁢  L i - E i  , the sum ∑ i ⁢ ⁢ ( L i - E i ) 2 , and the sum of the maximum correlation coefficient of {L i } and {E i } sequences, so as optimally to approximate the cumulative histogram, and designating said minimizing pixel value as said first binarization threshold.