Spaces:
Sleeping
Sleeping
File size: 352 Bytes
b6fadef 8619a66 f916fbb | 1 2 3 4 5 6 7 8 | import cv2
import numpy as np
def preprocess_image(image_np):
# RapidOCR utilizes DBNet for differentiable binarization text detection.
# We maintain color/grayscale channels and apply a gentle scaling to preserve edge clarity.
image_np = cv2.resize(image_np, None, fx=1.5, fy=1.5, interpolation=cv2.INTER_CUBIC)
return image_np |