经过几周繁忙的学习,这两周变得清闲了起来O(∩_∩)O,上上周在我去上海参加培训时,学校的实习周也请来了深圳的公司为我们专业进行为期一周的机器人实训。在我从上海回来后刚好赶上了个尾巴,因为刚培训完视觉,我对这方面的兴趣正浓。回来后我义无反顾的又开始了新的学校,通过问同学,问老师,紧赶慢赶的追上了一些。闲来无事就随便写写。
车牌识别在停车场和高速公路车辆管理中得到广泛应用,车牌识别技术也是识别车辆身份的主要手段。车牌识别技术结合电子不停车收费系统(ETC)识别车辆,过往车辆通过道口时无须停车,即能够实现车辆身份自动识别、自动收费。在车场管理中,为提高出入口车辆通行效率,车牌识别针对无需收停车费的车辆(如月卡车、内部免费通行车辆),建设无人值守的快速通道,免取卡、不停车的出入体验,正改变出入停车场收费管理系统模式。
(1)读入图像并且得到图像的尺寸信息
read_image (Image,'./ImageCardOfCar (1)’)
get_image_size (Image, Width, Height)
(1)以图片中点为旋转点进行旋转
text_line_orientation (Image, Image, 50, rad(-50), rad(50), OrientationAngle)
rotate_image (Image, ImageRotate, -OrientationAngle / rad(180) * 180, 'constant')
emphasize (ImageRotate, ImageEmphasize, 7, 7, 1)
median_image (ImageRotate, ImageMedian, 'circle', 5.5, 'mirrored')
decompose3 (ImageEmphasize, r, g, b)
trans_from_rgb (r, g, b, h, s, v, 'hsv')
(1)动态阈值第一次分割(v通道)
mask_H:=25
mask_w:=15
mean_image ( v, Region,mask_w, mask_H)
offset:=21
dyn_threshold ( v, Region, RegionDynThresh, offset, 'light’)
connection ( RegionDynThresh, ConnectedRegions)
(3)特征筛选
select_shape (ConnectedRegions, SelectedRegions, ['area','width','height'], 'and', [59.32,0,21], [340,21.67,54.067])
union1 (SelectedRegions, RegionFillUp1)
dilation_rectangle1 (RegionFillUp1, RegionDilation1, 11,7)
connection (RegionDilation1, ConnectedRegions4)
*筛选最大面积区
select_shape_std (ConnectedRegions4, SelectedRegions3, 'max_area', 70)
fill_up (SelectedRegions3, RegionFillUp1)
shape_trans (RegionFillUp1, RegionTrans2, 'rectangle2')
(1)筛选车牌矩形
count_obj (RegionTrans2, Number)
gen_empty_obj (ROI)
for i := 1 to Number by 1
select_obj (RegionTrans2, ObjectSelected, i)
region_features (ObjectSelected, 'rect2_len1', Value1)
region_features (ObjectSelected, 'rect2_len2', Value2)
a:=Value1/Value2
if (a>1.1 and a<4.0)
concat_obj (ROI, ObjectSelected, ROI)
endif
endfor
count_obj (ROI, Number1)
dev_display (ImageRotate)
dev_display (ROI)
erosion_rectangle1 (ROI, RegionErosion, 9, 8)
*缩小图像定义域
reduce_domain (ImageEmphasize, RegionErosion, ImageReduced)
(1)动态阈值第二次分割
mask_H:=32
mask_w:=16
mean_image ( ImageReduced, thresholdImage,mask_w, mask_H)
offset:=1
dyn_threshold ( ImageReduced, thresholdImage, RegionDynThresh, offset, 'light’)
connection (RegionDynThresh, ConnectedRegions2)
(3)特征筛选
select_shape (ConnectedRegions2, SelectedRegions2, ['width','area','height'], 'and', [0,0,9.367], [185.73,800.67,31.433])
dilation_circle (SelectedRegions2, RegionDilation, 1)
*union1 (RegionDilation, RegionUnion)
connection (RegionUnion, ConnectedRegions3)
(1)排序
sort_region (RegionIntersection, SortedRegions, 'character', 'true', 'column’)
(2)加载机器学习模型
read_ocr_class_mlp ('charact.omc', OCRHandle)
(3)确定一个显示位置
shape_trans (SortedRegions, RegionSamllestRect, 'rectangle1')
area_center (RegionSamllestRect, Area1, Row1, Column1)
RowMean:=mean(Row1)
count_obj (SortedRegions, Number2)
dev_clear_window ()
dev_display (Image)
for Index1 := 1 to Number2 by 1
select_obj (SortedRegions, Obj, Index1)
do_ocr_single_class_mlp (Obj, ImageReduced, OCRHandle, 1, Class, Confidence1)
*Confidence置信度
if (Confidence1>0.8)
Confidence_:=[Confidence_,Confidence1]
Class_Bottle:=[Class_Bottle,Class]
disp_message (3600, Class, 'image', RowMean+15, Column1[Index1-1], 'yellow', 'false')
endif
endfor
stop()
endfor
综上所述为我们本次实训其中一个项目(车牌识别实验)的流程,另外还有瓶盖识别,条形码识别等。虽然开始我没有听到老师的讲解,但回来后看同学做的,请教同学,并且没事一起聊聊,觉得大致思路我还是欧克的。
通过这次实训和上次去上海培训,学到了很多,也看到了许多。我觉得这些最核心的还是实现这些项目程序以及算法,其他的只要学一学掌握思路,明白指令的含义,并且能正确的调用,就能很好的实现这些功能,所以我还是非常佩服写出这些软件的大神呢,以后的路还很长,希望自己不忘初心,继续努力,加油(ง •_•)ง