Files
2505140092 4ed4364b14
2026-04-16 15:58:38 +08:00

12 lines
224 B
Plaintext

import numpy as np
img = np.array([
[255, 255, 0, 0 ],
[255, 255, 0, 0 ],
[0, 0, 255, 255],
[0, 0, 255, 255]
], dtype=np.uint8)
white_count = np.sum(img == 255)
black_count = np.sum(img == 0)