import cv2 import numpy cap = cv2.VideoCapture(2) cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640) cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480) while True: _, frame = cap.read() grey = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) t1 = cv2.adaptiveThreshold(grey, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY_INV, 3, 7) t2 = cv2.adaptiveThreshold(grey, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY_INV, 13, 7) t3 = cv2.adaptiveThreshold(grey, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY_INV, 23, 7) threshed = numpy.concatenate((t1, t2, t3), axis=1) cv2.imshow('threshed', threshed) cv2.waitKey(1)