def set_sign_board_region(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, 90, 255, cv2.THRESH_BINARY)[1]
    output = image.copy()
    cnts = cv2.findContours(thresh.copy(), cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
    cnts = imutils.grab_contours(cnts)
    region = []
    for c in cnts:
        epsilon = (0.02 * cv2.arcLength(c, True))
        c = cv2.approxPolyDP(c, epsilon, True)
        area = cv2.contourArea(c)
        if (area < int(((height * width) / 3))):
            continue
        (x, y, w, h) = cv2.boundingRect(c)
        cv2.rectangle(output, (x, y), ((x + w), (y + h)), (0, 255, 0), 2)
        region.append((x, y, (x + w), (y + h)))
    return (output, region)
def set_sign_board_region(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, 90, 255, cv2.THRESH_BINARY)[1]
    output = image.copy()
    cnts = cv2.findContours(thresh.copy(), cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
    cnts = imutils.grab_contours(cnts)
    region = []
    for c in cnts:
        epsilon = (0.02 * cv2.arcLength(c, True))
        c = cv2.approxPolyDP(c, epsilon, True)
        area = cv2.contourArea(c)
        if (area < int(((height * width) / 3))):
            continue
        (x, y, w, h) = cv2.boundingRect(c)
        cv2.rectangle(output, (x, y), ((x + w), (y + h)), (0, 255, 0), 2)
        region.append((x, y, (x + w), (y + h)))
    return (output, region)