From 81fb0edd2ac9c9a76e42673d16c1c86bdf3f86bd Mon Sep 17 00:00:00 2001 From: pb8jmewuc <2067353580@qq.com> Date: Tue, 7 Jan 2025 18:02:56 +0800 Subject: [PATCH] ADD file via upload --- debug.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 debug.py diff --git a/debug.py b/debug.py new file mode 100644 index 0000000..7d2231a --- /dev/null +++ b/debug.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +import cv2 +import numpy as np + +#用于中间环节对处理图像的输出 + +def img_show(filename): + if filename.dtype == "float32": + filename = filename.astype(np.uint8) + cv2.imshow("img_show", filename) + cv2.waitKey(0) + + +def img_contours(oldimg, box): + box = np.int0(box) + oldimg = cv2.drawContours(oldimg, [box], 0, (0, 0, 255), 2) + cv2.imshow("img_contours", oldimg) + cv2.waitKey(0) + + +def img_car(img_contours): + pic_hight, pic_width = img_contours.shape[:2] + return pic_hight, pic_width