开启左侧

请教 如何识别出图片中的所有数字

[复制链接]
yxwbbwc 发表于 2020-4-13 10:26:12 | 显示全部楼层 |阅读模式
悬赏10视觉币未解决
数字1.jpg
  1. read_image(a,'C:/Users/tde/Desktop/数字1.jpg')
  2. get_image_size(a, Width, Height)
  3. dev_close_window()
  4. dev_open_window(0, 0, Width, Height, 'black', WindowHandle)
  5. rgb1_to_gray(a, b)
  6. dev_display(b)

  7. gen_rectangle1(c, 22, 16, 65, 46)
  8. reduce_domain(b, c, d)

  9. *create_shape_model(d, 'auto', rad(0.0), rad(360.0), 'auto', 'auto', 'use_polarity', 'auto', 'auto', one)
  10. *get_shape_model_contours(e, one, 1)
  11. *find_shape_model(b, one, rad(0.0), rad(360.0), 0.8, 0, 0.0, 'least_squares', 0, 0.8, Row, Column, Angle, Score)

  12. create_scaled_shape_model(d, 'auto', 0, 0, 'auto', 0.5, 2.5, 'auto', 'auto', 'use_polarity', 'auto', 'auto', one)
  13. get_shape_model_contours(e, one, 1)
  14. find_scaled_shape_model(b, one, rad(-180.0), rad(360.0), 0.3, 3, 0.9, 0, 0.0, 'least_squares', 0, 0.9, Row, Column, Angle, Scale, Score)

  15. tuple_length(Row, Length)
  16. for i:=0 to Length-1 by 1
  17.     r[i]:=10
  18. endfor

  19. dev_set_color('red')
  20. dev_set_draw('margin')
  21. dev_clear_window()
  22. dev_display(a)
  23. gen_circle(Circle, Row, Column, r)

  24. *dump_window(WindowHandle, 'jpeg', 'C:/Users/tde/Desktop/1111111111')
复制代码

现在能识别正向的不同大小的“1”,但是无法识别倾斜、倒置的“1”,不知该用什么方法{:6_222:}
1111111111.jpg

Criss 发表于 2020-4-13 10:37:11 | 显示全部楼层
识别识别OCR是基于区域特征的,倒置或者倾斜都会导致无法匹配的,建议楼主先进行位置校准!
 楼主| yxwbbwc 发表于 2020-4-14 10:36:12 | 显示全部楼层
Criss 发表于 2020-4-13 10:37
识别识别OCR是基于区域特征的,倒置或者倾斜都会导致无法匹配的,建议楼主先进行位置校准! ...

啊{:6_219:}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表