Algorithm For Object Detection