1. A computer-implemented method for object detection comprising: determining directional weighted averages for individual pixels of an input image based at least in part on pixel values of a plurality of neighbor pixels of each of the individual pixels and weights associated with locations of each of the neighbors pixels relative to the individual pixels; generating a binary coded image for the input image by assigning, for each of the individual pixels, the neighbor pixels thereof one of a first value or second value based on a comparison of each pixel value of the neighbor pixels to the directional weighted average of the individual pixel and determining a binary coded representation for each of the individual pixels by arranging the first or second values of the neighbor pixels thereof into an order; performing object detection for the input image by applying a multi-stage cascade classifier to the binary coded image.