使用php或javascript从单个图像中读取多个条形码 [英] Read multiple barcode from a single image using php or javascript

查看:208
本文介绍了使用php或javascript从单个图像中读取多个条形码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用PHP或JavaScript一次扫描单个图像中的多个条形码。我用谷歌搜索,但只能扫描图像中的单个条形码。

Is there any way to scan multiple bar-codes from a single image at a time using PHP or JavaScript. I have googled, but can scan only single barcode from an image.

我试过这段代码: https://gist.github.com/tobytailor/421369

推荐答案

您还可以使用HP IDOL OnDemand中的条形码识别API 。 (我为惠普工作)。我通过在线控制台运行上面的图像进行快速测试,并能够从图像文件中提取以下信息......

You could also use a Barcode Recognition API like the one from HP IDOL OnDemand (I work for HP). I ran the image above through the online console for a quick test and was able to extract the following information from the image file...

{
  "barcode": [
    {
      "text": "CODE128",
      "barcode_type": "code-128",
      "left": 1498,
      "top": 552,
      "width": 598,
      "height": 262,
      "additional_information": {}
    },
    {
      "text": "CODE39",
      "barcode_type": "code-39",
      "left": 300,
      "top": 552,
      "width": 768,
      "height": 262,
      "additional_information": {}
    },
    {
      "text": "0012345678905",
      "barcode_type": "ean-13",
      "left": 1480,
      "top": 1466,
      "width": 619,
      "height": 260,
      "additional_information": {
        "country": "U.S. and Canada"
      }
    },
    {
      "text": "1234567890128",
      "barcode_type": "ean-13",
      "left": 366,
      "top": 1922,
      "width": 584,
      "height": 260,
      "additional_information": {
        "country": "U.S. (reserved for later use)"
      }
    },
    {
      "text": "01234565",
      "barcode_type": "ean-8",
      "left": 1696,
      "top": 2022,
      "width": 390,
      "height": 160,
      "additional_information": {}
    },
    {
      "text": "012345",
      "barcode_type": "codabar",
      "left": 300,
      "top": 1010,
      "width": 672,
      "height": 260,
      "additional_information": {}
    },
    {
      "text": "CODE93",
      "barcode_type": "code-93",
      "left": 300,
      "top": 1466,
      "width": 730,
      "height": 260,
      "additional_information": {}
    },
    {
      "text": "00123456",
      "barcode_type": "i25",
      "left": 1501,
      "top": 1010,
      "width": 264,
      "height": 260,
      "additional_information": {}
    },
    {
      "text": "00",
      "barcode_type": "i25",
      "left": 1394,
      "top": 1029,
      "width": 242,
      "height": 242,
      "additional_information": {}
    }
  ]
}

这篇关于使用php或javascript从单个图像中读取多个条形码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆