1. A computer readable medium embodying instructions executable by a processor to perform a method for detecting an object in an image that contains invalid data regions, the method comprising the steps of: determining a data mask for the image to indicate which pixels in the image are valid; representing the data mask as an integral mask in which each pixel has a value corresponding to a total number of valid pixels in the image above and to left of the pixel; applying a rectangular feature to the image, the rectangular feature having at least one positive region and one negative region; determining the number of pixels in the rectangular feature that are valid using the integral mask, wherein the integral mask comprises at least one occlusion and the number of valid pixels in the rectangular feature corresponds to pixels that do not comprise the occlusion; approximating a mean intensity value for a region that contains invalid pixels, wherein the mean intensity value is approximated by using only the number of valid pixels in the region; determining a feature value for the rectangular feature by computing a weighted difference between a sum of intensity values in the positive and negative regions of the rectangular feature; and using the feature value to determine if an object has been detected.