――Zum Beispiel handelt es sich um ein Prüfmuster oder ein Testmuster, das für die Übertragung verwendet wird. [^ 2] [^ 2]: [Testmuster (Broadcast) - Wikipedia](https://ja.wikipedia.org/wiki/%E3%83%86%E3%82%B9%E3%83%88%E3%83% 91% E3% 82% BF% E3% 83% BC% E3% 83% B3_ (% E6% 94% BE% E9% 80% 81))
$python --version
Python 3.8.2
$pip list
Package Version
------------- --------
numpy 1.18.3
opencv-python 4.2.0.34
pip 20.0.2
setuptools 46.1.3
wheel 0.34.2
Beispielcode zum Generieren von Graustufen und Farbbalken
import cv2
import numpy as np
from enum import Enum
def gray_scale_chart():
width = 1920
height = 1080
gray_img = np.zeros((height,width), dtype=np.uint8)
val = 0
bar_width = 120
step = 17
for i in range(0, width, bar_width):
gray_img[0:height,i:i+bar_width]=val
val += step
cv2.imwrite("gray_scale.bmp", gray_img)
class Color(Enum):
WHITE=(255,255,255)
YELLOW=(0,255,255)
CYAN=(255,255,0)
GREEN=(0,255,0)
MAGENTA=(255,0,255)
RED=(0,0,255)
BLUE=(255,0,0)
BLACK=(0,0,0)
def full_color_bar():
width = 1920
height = 1080
color_img = np.zeros((height,width,3), dtype=np.uint8)
bar_width = 240
i = 0
for c in Color:
color_img[0:height,i:i+bar_width]=c.value
i += bar_width
cv2.imwrite("full_color_bar.bmp",color_img)
if __name__=='__main__':
gray_scale_chart()
full_color_bar()
Bitte überprüfen Sie den Monitor
Recommended Posts