设置首页收藏本站
开启左侧

兄弟们,这个条码识别不出来,求助

[复制链接]
lanmanck 发表于 2024-12-26 12:09:34 | 显示全部楼层 |阅读模式
  1. create_bar_code_model ([], [], BarCodeHandle)
  2. read_image (Image, 'c:/a.jpg')
  3. rgb1_to_gray (Image, Image)
  4. tuple_ord ('5', Ord)
  5. *第一种边缘提取初步提取轮廓
  6. //laplace_of_gauss(Image, Image, 2) //拉布拉斯算子
  7. //laplace_of_gauss(Image, ImageLaplace, 2) //拉布拉斯算子
  8. //threshold(ImageLaplace, Region3, 5, 127)
  9. //skeleton(Region3, Skeleton3)
  10. //connection (Skeleton3, ConnectedRegions2)
  11. //select_shape (ConnectedRegions2, SelectedRegions, ['area','width','height'], 'and', [0,0,0], [220,80,200])

  12. //threshold(Image,Image,0,100)
  13. //gen_rectangle1(rect,270,100,424,360)
  14. //reduce_domain(Image,rect,Image)
  15. //crop_domain(Image,Image)
  16. set_bar_code_param(BarCodeHandle,'element_size_min', 8)
  17. set_bar_code_param(BarCodeHandle,'check_char','present')
  18. set_bar_code_param(BarCodeHandle,'num_scanlines',0)
  19. //set_bar_code_param (BarCodeHandle, 'start_stop_tolerance', 'high')

  20. find_bar_code (Image, SymbolRegions, BarCodeHandle, 'auto', DecodedDataStrings)

  21. area_center (SymbolRegions, Area, Row, Column)
  22. dev_display (SymbolRegions)
  23. disp_message (WindowHandle, DecodedDataStrings, 'image', Row - 240, Column - 280, 'black', 'true')
  24. get_bar_code_result (BarCodeHandle, 'all', 'decoded_types', BarCodeResults)
  25. disp_message (WindowHandle, '类型:'+BarCodeResults, 'image', Row - 340, Column - 280, 'black', 'true')
  26. get_bar_code_result (BarCodeHandle, 'all', 'decoded_strings', BarCodeResults1)
  27. get_bar_code_result (BarCodeHandle, 'all', 'element_size', BarCodeResults2)
复制代码

a.jpg

奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
 楼主| lanmanck 发表于 2024-12-27 09:31:04 | 显示全部楼层
来个大神帮帮忙
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
lyyyy 发表于 2024-12-27 10:04:39 | 显示全部楼层
  1. rgb1_to_gray (Image, GrayImage)
  2. dev_get_window (WindowHandle)
  3. draw_rectangle1 (WindowHandle, Row1, Column1, Row2, Column2)
  4. gen_rectangle1 (Rectangle, Row1, Column1, Row2, Column2)
  5. reduce_domain (GrayImage, Rectangle, ImageReduced)
  6. area_center (Rectangle, Area, Row, Column)
  7. create_bar_code_model ([], [], BarCodeHandle)
  8. find_bar_code (GrayImage, SymbolRegions, BarCodeHandle, 'auto', DecodedDataStrings)
  9. dev_set_draw ('margin')
  10. disp_message (WindowHandle, DecodedDataStrings, 'window', 12, 12, 'black', 'true')
  11. dev_display (SymbolRegions)
复制代码

可以提取阿
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
lyyyy 发表于 2024-12-27 10:10:10 | 显示全部楼层
lyyyy 发表于 2024-12-27 10:04
rgb1_to_gray (Image, GrayImage)
dev_get_window (WindowHandle)
draw_rectangle1 (WindowHandle, Row1, C ...

有结果出来
新建 BMP 图像.png
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
小马哥 发表于 2024-12-27 15:59:20 | 显示全部楼层
直接就可以识别
halcon_dump.png
识别.hdev (865 Bytes, 下载次数: 1, 售价: 1 视觉币)
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
 楼主| lanmanck 发表于 2024-12-27 19:11:04 | 显示全部楼层

你的代码是黏贴的?怎么ROI的数字都没有的
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
 楼主| lanmanck 发表于 2024-12-27 19:12:11 | 显示全部楼层

没有币啊亲
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
 楼主| lanmanck 发表于 2024-12-27 19:13:27 | 显示全部楼层
你们用什么版本?我是17的
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
南風 发表于 2024-12-27 22:13:25 | 显示全部楼层
这不就识别出来了
11.png
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
 楼主| lanmanck 发表于 2024-12-28 08:38:16 | 显示全部楼层
南風 发表于 2024-12-27 22:13
这不就识别出来了

贴下代码啊哥,用的版本号是?
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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