test.py 484 B

12345678910111213
  1. import cv2
  2. import os
  3. import time
  4. import numpy as np
  5. screenshot_frame_last = np.zeros((500, 500, 3), dtype=np.uint8)
  6. screenshot_frame_last[:, :] = [255, 255, 255] # BGR
  7. get_time: str = time.strftime("%H:%M:%S")
  8. current_file_path = os.path.realpath(__file__)
  9. current_dir = os.path.dirname(current_file_path)
  10. parent_dir = os.path.dirname(current_dir)
  11. file_path = os.path.join(parent_dir, "export", f"OSC.{get_time.replace(':', '.')}.png")
  12. cv2.imwrite(file_path, screenshot_frame_last)