Code using opencv for object detection