# Path: lib/easypr/core_func.py
# def clearLiuDingOnly(img):
# def getPlateType(src, adaptive_minsv):
# def clearLiuDingChar(img):
# def clearLiuDing(mask, top, bottom):
# def ThresholdOtsu(mat):
# def bFindLeftRightBound1(bound_threshold):
# def plateColorJudge(src, r, adaptive_minsv):
# def colorMatch(src, r, adaptive_minsv):
# def bFindLeftRightBound(bound_threshold):
#             H = src_hsv[i, j, 0]
#             S = src_hsv[i, j, 1]
#             V = src_hsv[i, j, 2]


import cv2
import numpy as np
from lib.easypr.core_func import getPlateType, Color, ThresholdOtsu, clearLiuDingChar
        warpImage = cv2.warpAffine(in_mat, transform, (m, m), cv2.INTER_LINEAR, cv2.BORDER_CONSTANT, 0)

        return cv2.resize(warpImage, (charSize, charSize))

    def charsSegment(self, input, result):
        w = input.shape[1]
        h = input.shape[0]

        tmp = input[int(h * 0.1):int(h * 0.9), int(w * 0.1):int(w * 0.9)]

        plateType = getPlateType(tmp, True)

        input_gray = cv2.cvtColor(input, cv2.COLOR_BGR2GRAY)

        if plateType == Color.BLUE:

            w = input_gray.shape[1]
            h = input_gray.shape[0]

            tmp = input_gray[int(h * 0.1):int(h * 0.9), int(w * 0.1):int(w * 0.9)]

            threadHoldV = ThresholdOtsu(tmp)

            _, img_threshold = cv2.threshold(input_gray, threadHoldV, 255, cv2.THRESH_BINARY)
        elif plateType == Color.YELLOW:
            w = input_gray.shape[1]
            h = input_gray.shape[0]

            tmp = input_gray[int(h * 0.1):int(h * 0.9), int(w * 0.1):int(w * 0.9)]


# Path: lib/easypr/core_func.py
# def clearLiuDingOnly(img):
# def getPlateType(src, adaptive_minsv):
# def clearLiuDingChar(img):
# def clearLiuDing(mask, top, bottom):
# def ThresholdOtsu(mat):
# def bFindLeftRightBound1(bound_threshold):
# def plateColorJudge(src, r, adaptive_minsv):
# def colorMatch(src, r, adaptive_minsv):
# def bFindLeftRightBound(bound_threshold):
#             H = src_hsv[i, j, 0]
#             S = src_hsv[i, j, 1]
#             V = src_hsv[i, j, 2]


# Path: lib/easypr/chars_segment.py
import cv2
import numpy as np
from lib.easypr.core_func import getPlateType, Color, ThresholdOtsu, clearLiuDingChar

        warpImage = cv2.warpAffine(in_mat, transform, (m, m), cv2.INTER_LINEAR, cv2.BORDER_CONSTANT, 0)

        return cv2.resize(warpImage, (charSize, charSize))

    def charsSegment(self, input, result):
        w = input.shape[1]
        h = input.shape[0]

        tmp = input[int(h * 0.1):int(h * 0.9), int(w * 0.1):int(w * 0.9)]

        plateType = getPlateType(tmp, True)

        input_gray = cv2.cvtColor(input, cv2.COLOR_BGR2GRAY)

        if plateType == Color.BLUE:

            w = input_gray.shape[1]
            h = input_gray.shape[0]

            tmp = input_gray[int(h * 0.1):int(h * 0.9), int(w * 0.1):int(w * 0.9)]

            threadHoldV = ThresholdOtsu(tmp)

            _, img_threshold = cv2.threshold(input_gray, threadHoldV, 255, cv2.THRESH_BINARY)
        elif plateType == Color.YELLOW:
            w = input_gray.shape[1]
            h = input_gray.shape[0]

            tmp = input_gray[int(h * 0.1):int(h * 0.9), int(w * 0.1):int(w * 0.9)]


            threadHoldV = ThresholdOtsu(tmp)