def process_text(file_path):
    image = cv2.imread(file_path)
    height = image.shape[0]
    width = image.shape[1]
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    blurred = cv2.bilateralFilter(gray, 25, 15, 15)
    thresh = cv2.threshold(blurred, 60, 255, cv2.THRESH_BINARY)[1]
    temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.png')
    temp_filename = temp_file.name
    cv2.imwrite(temp_filename, thresh)
    return temp_filename
def process_text(file_path):
    image = cv2.imread(file_path)
    height = image.shape[0]
    width = image.shape[1]
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    blurred = cv2.bilateralFilter(gray, 25, 15, 15)
    thresh = cv2.threshold(blurred, 60, 255, cv2.THRESH_BINARY)[1]
    temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.png')
    temp_filename = temp_file.name
    cv2.imwrite(temp_filename, thresh)
    return temp_filename