source_path = os.path.join(input_folder, filename)       
        input = cv2.imread(source_path)

        hsv = cv2.cvtColor(input, cv2.COLOR_BGR2HSV)
        lower_range = np.array([0, 0, 0])
        upper_range = np.array([255, 255, 255])
        mask = cv2.inRange(hsv, lower_range, upper_range)
        mask = cv2.bitwise_not(mask)
        result = cv2.bitwise_and(input, input, mask=mask)

        tagart_path = os.path.join(output_folder, os.path.splitext(filename)[0] + ".png")

        cv2.imwrite(tagart_path, result)
这段代码生成的图片全是黑色