From ee7fbfd13b7ac44dae960470ace7e4a790be0b13 Mon Sep 17 00:00:00 2001 From: wonder Date: Sun, 2 Nov 2025 13:24:48 +0800 Subject: [PATCH] =?UTF-8?q?=20=F0=9F=94=84Update:=20[Lab-1]=20numpy=20?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lab-1/src/copy_img.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Lab-1/src/copy_img.py diff --git a/Lab-1/src/copy_img.py b/Lab-1/src/copy_img.py new file mode 100644 index 0000000..4c8b26c --- /dev/null +++ b/Lab-1/src/copy_img.py @@ -0,0 +1,16 @@ +import cv2 +import numpy as np +from read_img import read_img +from show_img import show_img + +def copy_img(inner_img): + new_img = np.zeros(inner_img.shape, np.uint8) + new_img[:] = inner_img + return new_img + +if __name__ == '__main__': + img = read_img('../img/1.jpeg') + # print(img) + img2 = copy_img(img) + # print(img2) + show_img(img2) \ No newline at end of file