Files
digitale-bildverarbeitung-l…/5_Bildanalyse/ü2/d.py

23 lines
510 B
Python

import cv2
import numpy as np
I = np.asarray([
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 1, 0, 1, 1, 0, 1, 0],
[0, 1, 0, 1, 1, 0, 1, 1, 1, 0],
[0, 0, 1, 0, 0, 0, 0, 1, 1, 0],
[0, 0, 1, 0, 0, 1, 0, 0, 1, 0],
[0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 1, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 1, 1, 1, 0, 1, 1, 0],
[0, 1, 0, 1, 1, 1, 0, 1, 1, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
], dtype=np.uint8)
s = np.asarray([
[0, 1, 0],
[0, 1, 1],
[0, 0, 0],
], dtype=np.uint8)