Python Thresholding-and-masking-using-OpenCV Resources