We address the problem of foreground object detection through background subtraction. Although eigenbackground models are successful in many computer vision applications, background subtraction methods based on a conventional eigenbackground method may suffer from high false-alarm rates in the foreground detection due to possible absorption of foreground changes into the eigenbackground model. This paper introduces an improved eigenbackground modeling method for videos by recursively applying an error compensation process to reduce the influence of foreground moving objects on the eigenbackground model. An adaptive threshold method is also introduced for background subtraction, where the threshold is determined by combining a fixed global threshold and a variable local threshold. A fast algorithm is then given as an approximation to the proposed method by imposing and exploiting a constraint on motion consistency, leading to about 50% reduction in computations. Experiments have been performed on a range of videos with satisfactory results. Performance is evaluated using an objective criterion. Comparisons are made with two existing methods.