12345678910111213 |
- import cv2
- import os
- import time
- import numpy as np
- screenshot_frame_last = np.zeros((500, 500, 3), dtype=np.uint8)
- screenshot_frame_last[:, :] = [255, 255, 255] # BGR
- get_time: str = time.strftime("%H:%M:%S")
- current_file_path = os.path.realpath(__file__)
- current_dir = os.path.dirname(current_file_path)
- parent_dir = os.path.dirname(current_dir)
- file_path = os.path.join(parent_dir, "export", f"OSC.{get_time.replace(':', '.')}.png")
- cv2.imwrite(file_path, screenshot_frame_last)
|