This commit is contained in:
千住柱間 2025-04-21 19:46:13 -04:00
commit 5fd063f6df
Signed by: hashirama
GPG key ID: 53E62470A86BC185

View file

@ -146,7 +146,7 @@ def preprocess_image(image_path):
gray = enhance_text(image_path)
resampled = bicubic(gray)
# Convert grayscale to 3-channel RGB by duplicating the gray channel
img = contrast_stretch(adjust_gamma(cv2.cvtColor(resampled, cv2.COLOR_GRAY2RGB),gamma=1.68,alpha=1.75,beta=-5)) # perfect tunning
img = contrast_stretch(adjust_gamma(cv2.cvtColor(resampled, cv2.COLOR_GRAY2RGB),gamma=1.6,alpha=1.75,beta=-15)) # perfect tunning
plt.imshow(img)
plt.axis("off")
plt.savefig("/tmp/output.png", bbox_inches="tight", pad_inches=0)