HyperLPR车牌识别库代码分析(3)

本文详细分析了HyperLPR车牌识别库中的detectPlateRough函数,该函数主要负责图片的预处理,包括获取系统时间、图片初始化、颜色转换、特征提取和安全区域计算,以实现对车牌的粗略定位和裁剪。
摘要由CSDN通过智能技术生成

2021SC@SDUSC

源代码下载地址:https://gitee.com/zeusees/HyperLPR

源码配置的详情见第一篇分析

         根据小组分配的任务,我将负责pipline中的SimpleRecognizePlateByE2E(image)函数的分析,内容如下:

一、time()函数作用

        代码如下:

def SimpleRecognizePlateByE2E(image):
    t0 = time.time()
    images = detect.detectPlateRough(image,image.shape[0],top_bottom_padding_rate=0.1)
    res_set = []

        time()部分函数源码如下:

def time(): # real signature unknown; restored from __doc__
    """
    time() -> floating point number
    
    Return the current time in seconds since the Epoch.
    Fractions of a second may be present if the system clock provides them.
    """
    return 0.0

        可见是用于获取当前的系统时间。

二、detectPlateRough(...)函数作用

 1.以下代码用于粗略地初始化图片,并传给images对象,其中上下填充率默认为0.1

images = detect.detectPlateRough(image,image.shape[0],top_bottom_padding_rate=0.1)
    

image.shape[]数组含义如下:

image.shape[0], 图片垂直尺寸

image.shape[1], 图片水平尺寸

image.shape[2], 图片通道数

        其中detectPlateRough(...)函数源码如下:

def detectPlateRough(image_gray,resize_h = 720,en_scale =1.08 ,top_bottom_padding_rate = 0.05):
    print(image_gray.shape)

    

        该函数传入了图片的颜色,大小,宽高比,上下填充率,并首先输出了图片的图片垂直尺寸, 图片水平尺寸和 图片通道数。

2.其次针对上下填充率进行判断,高于0.2时报错。</

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值