1. A method for detecting an object, the method comprising: receiving input information relating to a moving object included in a plurality of images; identifying moving pixels, using a difference between corresponding pixels of two or more images; receiving information about the moving pixels; classifying the information about the moving pixels according to a preset parameter and generating a regression tree; in response to receiving a new image, communicating information of a moving object included in the new image into the regression tree; and determining a size of a person included in the new image based at least on a resultant value of the regression tree.