Files
task-3-1-3-Matrix-Fundament…/lx1
2505140092 4ed4364b14
2026-04-16 15:58:38 +08:00

22 lines
363 B
Plaintext

import numpy as np
image = np.array([
[100, 150, 200],
[80, 120, 180],
[60, 90, 140]
], dtype=np.uint8)
print("原图:")
print(image)
image_dark = image - 20
print("变暗20: ")
print(image_dark)
image_crop = image[0:2, 0:2]
print("裁剪左上角: ")
print(image_crop)
image_flip = np.fliplr(image)
print("水平翻转: ")
print(image_flip)