代码: import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2.imread(r'C:\Users\HouLw\Desktop\cat.jpg', 0) ret, thresh1 = cv2.threshold(img, 127, 255, cv2.THRESH_BINARY) ret, thresh2 = cv2.threshold(img, 127, 255, cv2.THRESH_BINARY_INV) ret, thresh3 = cv2.threshold(img, 127, 255, ...