denoise
This commit is contained in:
parent
6deed1d937
commit
2276e0ab2a
1 changed files with 2 additions and 2 deletions
|
|
@ -130,9 +130,9 @@ def preprocess_image(image_path):
|
||||||
gray = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE)
|
gray = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE)
|
||||||
resampled = bicubic(gray)
|
resampled = bicubic(gray)
|
||||||
# Convert grayscale to 3-channel RGB by duplicating the gray channel
|
# 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.imshow(img)
|
||||||
plt.axis("off")
|
plt.axis("off")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue