|
楼主 |
发表于 2021-5-16 17:59:02
|
显示全部楼层
数据集介绍:
test.txt
- 20456343_4045240981.jpg 89 201 241 178 19 94 19 22 26 656
- 20457281_3395886438.jpg 120 1061 2 376 78 249 272 272 120 1061
- 20458000_2937840822.jpg 318 1949 586 3 84 25 1 44 33 870
- 20459625_3011879797.jpg 923 1229 1328 337 21 2 1130 153 522 9
复制代码 train.txt
- 20455828_2605100732.jpg 263 82 29 56 35 435 890 293 126 129
- 20455953_2495695852.jpg 183 17 1454 304 43 259 312 11 130 795
- 20456062_1743140291.jpg 153 432 950 150 65 899 115 7 97 49
- 20456156_569666054.jpg 466 28 192 99 412 28 199 2 169 27
复制代码 Synthetic Chinese String Dataset解析(halcon12):图像:280x32,3通道
- dev_update_off()
- dev_set_draw('margin')
- path1:='E:/BaiduYunDownload/数据集'
- File_Name := 'train.txt'
- open_file (path1 + '/' + File_Name, 'input', FileHandle)
- IsEOF := 0
- fread_line (FileHandle, Number, IsEOF)
- * fread_line (FileHandle, Number, IsEOF)
- close_file (FileHandle)
- ************* 提取信息开始 *************
- tuple_split(Number, '\n', Substrings)
- tuple_split(Substrings[0], ' ', Substrings1)
- imageName:=Substrings1[0]
- * OCR1:=number(Substrings1[1])
- * OCR2:=number(Substrings1[2])
- * OCR3:=number(Substrings1[3])
- * OCR4:=number(Substrings1[4])
- * OCR5:=number(Substrings1[5])
- * OCR6:=number(Substrings1[6])
- * OCR7:=number(Substrings1[7])
- * OCR8:=number(Substrings1[8])
- * OCR9:=number(Substrings1[9])
- * OCR10:=number(Substrings1[10])
- ************* 提取信息结束 *************
- *
- imagepath:='F:/Synthetic Chinese String Dataset/images'
- read_image(Image, imagepath + '/' + imageName)
- *
- ************* 读取字典开始 *************
- open_file (path1 + '/' + 'char_std_5990.txt', 'input', FileHandle)
- IsEOF := 0
- nums := []
- while (IsEOF == 0)
- fread_string (FileHandle, Number, IsEOF)
- nums := [nums, Number]
- endwhile
- close_file (FileHandle)
- ************* 读取字典结束 *************
- *
- ************* 根据索引OCRi显示文字 *************
- ids := ''
- for i:=1 to |Substrings1|-1 by 1
- ids := ids+nums[number(Substrings1[i])]
- endfor
- ************* 显示文字结束 *************
- *
- dev_display(Image)
- disp_message(3600, ids, 'window', 12, 12, 'black', 'true')
- stop()
复制代码
参考:【1】生成验证码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|