import cv2
class MyVideoCapture():
def createTestImage(self,count):
image = np.zeros((480, 640, 3), dtype=np.uint8)
font = cv2.FONT_HERSHEY_SIMPLEX
font_scale = 2.0
text_color = (255, 255, 255)
text = str(count)
text_size, _ = cv2.getTextSize(text, font, font_scale, thickness=1)
text_x = (image.shape[1] - text_size[0]) // 2
text_y = (image.shape[0] + text_size[1]) // 2
colors = [(55, 0, 0), (0, 0, 55), (0, 55, 55), (55, 55, 55)]
background_color = colors[count % len(colors)]
image[:] = background_color
cv2.putText(image, text, (text_x, text_y), font, font_scale, text_color, thickness=2, lineType=cv2.LINE_AA)
return image