I have used openCV python and encountered an error.
img_blur = cv2.medianBlur(self.cropped_img,5) img_thresh_Gaussian = cv2.adaptiveThreshold(img_blur, 255,
Convert the image to grayscale before thresholding:
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) img_blur = cv2.medianBlur(img_gray,5) img_thresh_Gaussian = cv2.adaptiveThreshold(img_blur, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 11, 2)