From 61d003bc5e91313402a0bae04f522f4f2b958f54 Mon Sep 17 00:00:00 2001 From: rise0chen Date: Tue, 30 Jul 2024 17:10:42 +0800 Subject: [PATCH] perf: disable webp, because save it use too much time --- apriltag/bin/src/apriltag.py | 2 +- camera/bin/src/camera.py | 4 ++-- camera/web/index.html | 4 ++-- camera_calibrater/bin/src/camera_calibrater.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apriltag/bin/src/apriltag.py b/apriltag/bin/src/apriltag.py index adb2ca1..85f757f 100644 --- a/apriltag/bin/src/apriltag.py +++ b/apriltag/bin/src/apriltag.py @@ -53,7 +53,7 @@ def main(): tag_size = float(tag_size) at_detector = apriltag.Detector(families=tag_family) - img = cv2.imread(os.path.join(images_dir, "img.webp"), cv2.IMREAD_GRAYSCALE) + img = cv2.imread(os.path.join(images_dir, "img.jpg"), cv2.IMREAD_GRAYSCALE) img = cv2.undistort(img, np.array(camera_matrix), np.array(dist_coeffs)) #_, img = cv2.threshold(img, 128, 255, cv2.THRESH_BINARY) if img.size == 0: diff --git a/camera/bin/src/camera.py b/camera/bin/src/camera.py index dc90ea6..95c7b09 100644 --- a/camera/bin/src/camera.py +++ b/camera/bin/src/camera.py @@ -59,8 +59,8 @@ def main(): frame = cv2.GaussianBlur(frame, (5, 5), 0) cv2.imwrite(os.path.join(images_dir, "img.tmp.jpg"), frame, [cv2.IMWRITE_JPEG_QUALITY, 50]) shutil.move(os.path.join(images_dir, "img.tmp.jpg"), os.path.join(images_dir, "img.jpg")) - cv2.imwrite(os.path.join(images_dir, "img.tmp.webp"), frame, [cv2.IMWRITE_WEBP_QUALITY, 50]) - shutil.move(os.path.join(images_dir, "img.tmp.webp"), os.path.join(images_dir, "img.webp")) + # cv2.imwrite(os.path.join(images_dir, "img.tmp.webp"), frame, [cv2.IMWRITE_WEBP_QUALITY, 50]) + # shutil.move(os.path.join(images_dir, "img.tmp.webp"), os.path.join(images_dir, "img.webp")) if cmd == "reinit": cap.release() cap = init_camera() diff --git a/camera/web/index.html b/camera/web/index.html index f9496a2..89bb56a 100644 --- a/camera/web/index.html +++ b/camera/web/index.html @@ -21,7 +21,7 @@
- +