From 2276e0ab2adee2366c685093024fbb682782de71 Mon Sep 17 00:00:00 2001 From: hashirama Date: Tue, 22 Apr 2025 11:29:52 -0400 Subject: [PATCH] denoise --- inference_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inference_test.py b/inference_test.py index 3aa08af..99ee4bd 100644 --- a/inference_test.py +++ b/inference_test.py @@ -130,9 +130,9 @@ def preprocess_image(image_path): gray = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE) resampled = bicubic(gray) # Convert grayscale to 3-channel RGB by duplicating the gray channel - img1 = contrast_stretch(adjust_gamma(cv2.cvtColor(resampled, cv2.COLOR_GRAY2RGB),gamma=1,alpha=1.4,beta=-5)) # perfect tunning + img1 = contrast_stretch(adjust_gamma(cv2.cvtColor(resampled, cv2.COLOR_GRAY2RGB),gamma=0.3,alpha=1.6,beta=-5)) # perfect tunning - img = cv2.fastNlMeansDenoising(img1, None, 20, 10, 20) + img = cv2.fastNlMeansDenoising(img1, None, 30, 10, 20) plt.imshow(img) plt.axis("off")