Object detection and binarization