1. A computer implemented method for video-based encroachment detection, the method performed by the computer comprising the steps of: receiving first and second images; modeling a background from the first image; subtracting the background from the second image to provide a detection map; calibrating the size of an object at different parts of the image from the pixel level; integrating a projection of the object with the detection map using dynamic programming to form an integration map; computing true base positions in the presence of partial occlusions as points in the integration map that are local maxima; and detecting the object in a region if the true base position of the projection matches that region of the detection map.