1. A method for object detection by an electronic device, comprising: obtaining an image pyramid comprising a plurality of pyramid levels for a frame and a plurality of scale levels for each pyramid level; providing a scanning window; setting a scanning step size that is proportional to dimensions of the frame at a scale level, wherein the scanning step size is uniform for the plurality of pyramid levels corresponding to a same scale level; scanning at least two of the plurality of scale levels of the frame at a plurality of scanning window locations, wherein a number of scanning window locations is equal for each scale level of the at least two scale levels of a first pyramid level; and detecting an object based on the scanning.