From c4b2089019f4dfea07db6f98b5093ab88d1ff4fe Mon Sep 17 00:00:00 2001 From: 2509165019 <2509165019@student.edu.cn> Date: Thu, 16 Apr 2026 16:04:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BD=9C=E4=B8=9AX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- text.py | 25 +++++++++++++++++++++++++ text2.py | 0 text3.py | 0 3 files changed, 25 insertions(+) create mode 100644 text.py create mode 100644 text2.py create mode 100644 text3.py diff --git a/text.py b/text.py new file mode 100644 index 0000000..6a84256 --- /dev/null +++ b/text.py @@ -0,0 +1,25 @@ +import numpy as np + +image = np.array([ + [100, 150, 200], + [80, 120, 180], + [60, 90, 140] +], dtype=np.uint8) + +print("原图:") +print(image) +print("-" * 20) +#1 +dark_imafe = np.clip(image 20, 0, 255).astype(np.uint8) +print("变暗20后:") +print(dark_imafe) +print("-" * 20) +#2 +crop_image = dark_imafe[0:2, 0:2] +print("裁剪左上角2*2后:") +print(crop_image) +print("-" * 20) +#3 +flip_image = np.fliolr(crop_image) +print("水平翻转后:") +print(flip_image) \ No newline at end of file diff --git a/text2.py b/text2.py new file mode 100644 index 0000000..e69de29 diff --git a/text3.py b/text3.py new file mode 100644 index 0000000..e69de29