使用php或javascript从单个图像读取多个条形码

Read multiple barcode from a single image using php or javascript

本文关键字:读取 条形码 图像 单个 php javascript 使用      更新时间:2023-09-26

是否有任何方法可以使用PHP或JavaScript一次从单个图像扫描多个条形码?我用谷歌搜索过,但只能扫描图像中的单个条形码。

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

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

{
  "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": {}
    }
  ]
}