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时报错。</