def get_plate_ver2(image, Dmax=608, Dmin = 250):
    vehicle = preprocess_ver2(image)
    ratio = float(max(vehicle.shape[:2])) / min(vehicle.shape[:2])
    side = int(ratio * Dmin)
    bound_dim = min(side, Dmax)
    _ , LpImg, _, cor = detect_lp(wpod_net, vehicle, bound_dim, lp_threshold=0.5)
    return vehicle, LpImg, cor
def get_plate(image_path):
    Dmax = 608
    Dmin = 288
    vehicle = preprocess_image(image_path)
    ratio = float(max(vehicle.shape[:2])) / min(vehicle.shape[:2])
    side = int(ratio * Dmin)
    bound_dim = min(side, Dmax)
    _ , LpImg, _, cor, final_x, final_y = detect_lp(wpod_net, vehicle, bound_dim, lp_threshold=0.5)
    return vehicle, LpImg, cor, final_x, final_y
def get_plate(image_path, dir_path):
    Dmax = 608
    Dmin = 288
    vehicle = preprocess_image(image_path, dir_path)
    # print("preprocessing ends-> !! ")
    ratio = float(max(vehicle.shape[:2])) / min(vehicle.shape[:2])  # 350-197
    side = int(ratio * Dmin)
    bound_dim = min(side, Dmax)
    _, LpImg, _, cor = detect_lp(wpod_net,
                                 vehicle,
                                 bound_dim,
                                 lp_threshold=0.5)
    return LpImg, cor
Example #4
0
def get_plate(image_path):
    Dmax = 608
    Dmin = 288
    # Loading model for plate detection
    wpod_net_path = "wpod-net.json"
    wpod_net = load_modell(wpod_net_path)

    vehicle = preprocess_image(image_path)
    ratio = float(max(vehicle.shape[:2])) / min(vehicle.shape[:2])
    side = int(ratio * Dmin)
    bound_dim = min(side, Dmax)
    _, LpImg, _, cor = detect_lp(wpod_net,
                                 vehicle,
                                 bound_dim,
                                 lp_threshold=0.5)
    return vehicle, LpImg, cor
Example #5
0
def get_plate(image_path):
    Dmax = 608
    Dmin = 288
    vehicle = preprocess_image(image_path)
    ratio = float(max(vehicle.shape[:2])) / min(vehicle.shape[:2])
    side = int(ratio * Dmin)
    bound_dim = min(side, Dmax)
    _, LpImg, _, cor = detect_lp(wpod_net,
                                 vehicle,
                                 bound_dim,
                                 lp_threshold=0.5)
    count = 0
    for img in LpImg:
        plt.imsave("croppedImgs/cropped" + str(count) + ".jpg", img)
        count += 1
    return LpImg