found perfect parameters 3/3

This commit is contained in:
千住柱間 2025-04-21 01:53:44 -04:00
commit 31bb1eb722
Signed by: hashirama
GPG key ID: 53E62470A86BC185

View file

@ -130,7 +130,7 @@ def preprocess_image(image_path):
gray = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE)
# Convert grayscale to 3-channel RGB by duplicating the gray channel
img = adjust_gamma(cv2.cvtColor(gray, cv2.COLOR_GRAY2RGB),gamma=2,alpha=1.5,beta=-0.5) # perfect tunning
img = adjust_gamma(cv2.cvtColor(gray, cv2.COLOR_GRAY2RGB),gamma=1.67,alpha=1.67,beta=-6) # perfect tunning
mat_in = ncnn.Mat.from_pixels_resize(
img, ncnn.Mat.PixelType.PIXEL_RGB, img.shape[1], img.shape[0], 224, 224
)