Detecting a Basketball Net in an Image in Opencv with Python. Our task is to draw a bounding box around the basket after detecting it. The approach we will follow here is that we will convert this image to binary using such a threshold that the entire white region of the basket is detected as a single object.