WO2018077059A1 - 一种条形码的识别方法和装置 - Google Patents

一种条形码的识别方法和装置 Download PDF

Info

Publication number
WO2018077059A1
WO2018077059A1 PCT/CN2017/106483 CN2017106483W WO2018077059A1 WO 2018077059 A1 WO2018077059 A1 WO 2018077059A1 CN 2017106483 W CN2017106483 W CN 2017106483W WO 2018077059 A1 WO2018077059 A1 WO 2018077059A1
Authority
WO
WIPO (PCT)
Prior art keywords
barcode
character string
row
character
string
Prior art date
Application number
PCT/CN2017/106483
Other languages
English (en)
French (fr)
Inventor
刘正保
Original Assignee
阿里巴巴集团控股有限公司
刘正保
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司, 刘正保 filed Critical 阿里巴巴集团控股有限公司
Priority to KR1020197014605A priority Critical patent/KR102194567B1/ko
Priority to PL17865471T priority patent/PL3531335T3/pl
Priority to SG11201903685PA priority patent/SG11201903685PA/en
Priority to ES17865471T priority patent/ES2808953T3/es
Priority to MYPI2019002299A priority patent/MY193086A/en
Priority to JP2019542767A priority patent/JP2019537177A/ja
Priority to EP17865471.1A priority patent/EP3531335B1/en
Publication of WO2018077059A1 publication Critical patent/WO2018077059A1/zh
Priority to US16/393,648 priority patent/US10726223B2/en
Priority to PH12019500901A priority patent/PH12019500901A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10712Fixed beam scanning
    • G06K7/10722Photodetector array or CCD scanning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14131D bar codes

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a method and an apparatus for identifying a barcode.
  • barcodes have entered people's lives. Through the scanning and identification of barcodes, various services such as payment, adding friends, and obtaining information can be completed.
  • the recognition rate of bar codes has become an important measure of the user's business experience.
  • the present application provides a method and apparatus for identifying a barcode.
  • a method for identifying a barcode comprising:
  • the first character string When the first character string satisfies a preset character rule, the first character string is determined as a recognition result of the barcode in the barcode picture.
  • a barcode identification device comprising:
  • a pixel extraction unit that extracts a row of pixel points in the barcode image according to a preset extraction strategy
  • a pixel point analysis unit that parses the row of pixels to obtain a corresponding first character string
  • the first identifying unit determines the first character string as the recognition result of the barcode in the barcode image when the first character string satisfies a preset character rule.
  • the present application can determine the character string when the character string corresponding to one row of pixels in the barcode image satisfies the character rule. For the recognition result of the barcode, it is not necessary to analyze it multiple times. The recognition rate of the barcode is increased.
  • FIG. 2 is a schematic flow chart of another method for identifying a barcode according to an exemplary embodiment of the present application.
  • the first character string parsed in step 102 in order to improve the accuracy of barcode recognition, when the first character string parsed in step 102 does not satisfy the preset character rule, And determining whether the first character string is the same as the second character string corresponding to another row of pixels other than the row corresponding to the first character string extracted in the barcode image last time according to the extraction policy, and When the first character string is identical to the second character string, the first character string is determined as a recognition result of the barcode.
  • the barcode is recognized by the method shown in FIG.
  • the erroneous problem when the first character string parsed in step 102 does not satisfy the preset character rule, it can continue to determine whether the parsing results of the pixels extracted twice consecutively are consistent, and if they are consistent, they can be consistent. The analysis result is confirmed as the recognition result of the barcode to improve the accuracy of barcode recognition.
  • the pixel may be extracted based on the preset extraction policy, and it is determined whether the character string corresponding to the extracted pixel point satisfies the character rule until the character string corresponding to the pixel of the row satisfies the character rule. Or the string corresponding to the pixel extracted twice in succession is consistent.
  • the present application can determine whether the character strings corresponding to the pixels extracted consecutively are the same, and determine the same character string as the barcode identification. As a result, the accuracy of barcode recognition is further improved.
  • the character string carried by the barcode cannot be recognized based on the character rule, it is also possible to determine whether the string corresponding to the pixel extracted three or four consecutive times is the same, and The same character string is used three or four times in succession as the recognition result of the barcode, and the present application does not specifically limit this.
  • the target extraction line exceeds the barcode image
  • the barcode recognition result is not determined based on the foregoing character rule and the same two consecutive strings
  • the statistically resolved result may be obtained.
  • the frequency of occurrence of each character string, and the character string with the largest frequency and greater than 1 is determined as the recognition result of the barcode in the barcode picture. For example, suppose that two strings have been parsed, namely string A and string B, string A appears 3 times, and string B appears once, then string A can be determined as the barcode recognition result.
  • the present invention can additionally identify the barcode image that cannot be identified in the foregoing manner, thereby improving the accuracy of barcode recognition.
  • the frequency of determining the barcode recognition result may be set to be greater than 2 or greater than 3, etc., to further improve the accuracy of barcode recognition, for example, for a barcode that does not include a check code, Set a larger frequency of occurrences.
  • the frequency of occurrence of each character string that has been parsed is 1, the barcode recognition failure can be determined.
  • the target extraction line exceeds the barcode picture, if any character string is still not resolved, it can be determined that the barcode recognition has failed.
  • the barcode is recognized at the fastest rate based on the character rule, and most of the barcode can be identified. Therefore, the present application can first identify the barcode based on the character rule.
  • the rate of recognition using the string corresponding to the pixels extracted twice consecutively is second. Therefore, the present application can be used as a supplementary recognition method for the character rule recognition manner.
  • the rate of identification using the appearance frequency is the slowest, so this application uses it as a supplementary identification method for the first two identification methods. It can be seen that the present application can identify the barcode by using three identification methods, and can improve the accuracy of the barcode recognition while taking into consideration the recognition rate.
  • FIG. 2 is a schematic flow chart of another method for identifying a barcode according to an exemplary embodiment of the present application.
  • the pixel of the first row of the barcode image is parsed to obtain a corresponding character string A.
  • Step 204 Extract a row of pixel points in the barcode image according to the extraction strategy.
  • the 11th row of the barcode image may be extracted.
  • the 11th row of pixel points may be parsed to obtain a corresponding character string B.
  • Step 206 Determine whether the character string B satisfies the character rule. If the string B satisfies the character rule, step 208 can be performed. If the character string B does not satisfy the character rule, step 207 may be performed.
  • Step 208 determining a recognition result of the barcode.
  • the character string A when the character string A corresponding to the pixel of the first row of the barcode image satisfies the character rule, the character string A can be determined as the recognition result of the barcode.
  • the character string B when the character string B is identical to the character string A, the character string B can be determined as the recognition result of the barcode.
  • step 204 may be performed again, and the 21st pixel of the barcode image is extracted, and the step 203 is further analyzed.
  • the 21st row of pixels is obtained to obtain a corresponding character string C. It is judged whether the character string C satisfies the character rule, and if satisfied, the character string C can be determined as the recognition result of the barcode. If the character string C does not satisfy the character rule, it is determined whether the character string C and the character string B are the same. If they are the same, the character string C may also be determined as the recognition result of the barcode.
  • the present application also provides an embodiment of the barcode identification device.
  • An embodiment of the identification device of the barcode of the present application can be applied to a terminal device.
  • the device embodiment may be implemented by software, or may be implemented by hardware or a combination of hardware and software.
  • the processor of the terminal device is configured to read the corresponding computer program instructions in the non-volatile memory into the memory.
  • FIG. 3 a hardware structure diagram of the terminal device where the identification device of the barcode of the present application is located, except for the processor, the memory, the network interface, and the non-volatile memory shown in FIG.
  • the terminal device where the device is located in the embodiment may also include other hardware according to the actual function of the terminal device, and details are not described herein again.
  • FIG. 4 is a block diagram of an apparatus for identifying a barcode according to an exemplary embodiment of the present application.
  • the barcode identification device 300 can be applied to the terminal device shown in FIG. 3, and includes: a pixel point extraction unit 301, a pixel point analysis unit 302, a first identification unit 303, and the same determination unit 304.
  • the pixel point extraction unit 301 extracts a row of pixel points in the barcode image according to the preset extraction strategy.
  • the pixel point parsing unit 302 parses the row of pixel points to obtain a corresponding first character string
  • the first identifying unit 303 determines the first character string as the recognition result of the barcode in the barcode image when the first character string satisfies the preset character rule.
  • the same judging unit 304 determines, when the first character string does not satisfy the character rule, the first character string and the first character string extracted in the barcode image according to the extraction strategy last time. Whether the second string corresponding to another row of pixels other than the corresponding row is the same;
  • a second identifying unit 305 when the first character string is the same as the second character string, determining the first character string as a recognition result of the barcode in the barcode image, when the first character string and When the second character strings are different, the root pixel point extracting unit is returned.
  • the extracting strategy is to extract the pixel points from the default row and the number of fixed rows, until the target extraction row exceeds the barcode image.
  • the extraction strategy is to extract pixel points from the default row and dynamically change the number of rows until the target extraction row exceeds the barcode image.
  • the third identifying unit 307 determines the character string having the largest frequency and greater than 1 as the recognition result of the barcode in the barcode image.
  • the fourth identifying unit 308 determines that the barcode recognition has failed when the frequency of occurrence of each of the parsed character strings is 1.
  • the fifth identifying unit 309 determines that the barcode recognition fails if the target extraction line exceeds the barcode picture, if no character string is obtained by parsing.
  • the character rule is that there is no consecutive preset characters, and the preset characters do not include: 26 uppercase and lowercase letters, 0 to 9 and spaces.
  • the device embodiment since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the present application. Those of ordinary skill in the art can understand and implement without any creative effort.

Abstract

一种条形码的识别方法和装置。所述方法包括:根据预设的提取策略,在条形码图片中提取一行像素点(S101);对该行像素点进行解析,以得到对应的第一字符串(S102);当所述第一字符串满足预设的字符规则时,将所述第一字符串确定为所述条形码图片中条形码的识别结果(S103)。该方法可以在条形码图片中一行像素点对应的字符串满足所述字符规则时,将该字符串确定为条形码的识别结果,无需多次解析,大大提高了条形码的识别速率。

Description

一种条形码的识别方法和装置 技术领域
本申请涉及计算机技术领域,尤其涉及一种条形码的识别方法和装置。
背景技术
随着互联网技术的快速发展,条形码走进了人们的生活,通过对条形码的扫描与识别,可以完成支付、添加好友、获取信息等各种业务。条形码的识别速率已成为用户业务体验的重要衡量标准。
发明内容
有鉴于此,本申请提供一种条形码的识别方法和装置。
具体地,本申请是通过如下技术方案实现的:
一种条形码的识别方法,所述方法包括:
根据预设的提取策略,在条形码图片中提取一行像素点;
对该行像素点进行解析,以得到对应的第一字符串;
当所述第一字符串满足预设的字符规则时,将所述第一字符串确定为所述条形码图片中条形码的识别结果。
一种条形码的识别装置,所述装置包括:
像素点提取单元,根据预设的提取策略,在条形码图片中提取一行像素点;
像素点解析单元,对该行像素点进行解析,以得到对应的第一字符串;
第一识别单元,当所述第一字符串满足预设的字符规则时,将所述第一字符串确定为所述条形码图片中条形码的识别结果。
由以上描述可以看出,由于大部分条形码携带的字符串都满足预设的字符规则,因此本申请可以在条形码图片中一行像素点对应的字符串满足所述字符规则时,将该字符串确定为条形码的识别结果,无需多次解析,大大提 高了条形码的识别速率。
附图说明
图1是本申请一示例性实施例示出的一种条形码的识别方法的流程示意图。
图2是本申请一示例性实施例示出的另一种条形码的识别方法的流程示意图。
图3是本申请一示例性实施例示出的一种用于条形码的识别装置的一结构示意图。
图4是本申请一示例性实施例示出的一种条形码的识别装置的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。
在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本申请可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本申请范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应 于确定”。
图1是本申请一示例性实施例示出的一种条形码的识别方法的流程示意图。
请参考图1,所述条形码的识别方法可以应用在手机、平板电脑等终端设备中,包括有以下步骤:
步骤101,根据预设的提取策略,在条形码图片中提取一行像素点。
在本实施例中,终端设备在扫描条形码后,可以获得包括有条形码的图片,为便于后续识别,终端设备可以对所述包括有条形码的图片进行压缩、灰度化、二值化等处理,这部分的处理与实现可以参考相关技术,本申请在此不再一一赘述。
在本实施例中,可以将经过压缩、灰度化、二值化等处理后的所述包括有条形码的图片称为条形码图片。在本步骤中,可以根据预设的提取策略,在所述条形码图片中提取一行像素点。其中,所述预设的提取策略是以行为单位进行像素点的提取,具体可以由开发人员进行设置。
在一个例子中,可以从缺省的行开始,间隔固定的行数进行像素点的提取,直至目标提取行超出所述条形码图片。假设,将所述缺省的行设置为所述条形码图片的第1行,所述固定的行数可以为10。依据这样的提取策略,第一次提取所述条形码图片的第1行像素点,第二次提取所述条形码图片的第11行像素点,第三次提取所述条形码图片的第21行像素点,第N次提取所述条形码图片的第1+(N-1)×10行像素点,直至所述第1+(N-1)×10行像素点超出所述条形码图片,结束像素点的提取。当然,所述缺省的行也可以是所述条形码图片的第2行,所述固定的行数也可以是15行等,本申请对此不做特殊限制。
在另一个例子中,还可以从缺省的行开始,间隔动态变化的行数进行像素点的提取,直至目标提取行超出所述条形码图片。假设,将所述缺省的行设置为所述条形码图片的第1行,间隔的行数在10和20这两个数值之间变 化。依据这样的提取策略,第一次提取所述条形码图片的第1行像素点,第二次提取所述条形码图片的第11行像素点,第三次提取所述条形码图片的第31行像素点,第四次提取所述条形码图片的第41行像素点,第五次提取所述条形码图片的第61行,依次类推,直至目标提取行超出所述条形码图片,结束像素点的提取。
步骤102,对该行像素点进行解析,以得到对应的第一字符串。
基于前述步骤101,在提取到一行像素点后,可以对这行像素点进行解析,以得到对应的第一字符串。需要说明的是,依据条形码的组成规则,所述条形码中通常会包含校验码,针对包含有校验码的条形码,所述解析得到第一字符串通常已通过校验码的校验。当然,还有一些条形码中不包含校验码,针对不包含校验码的条形码,所述第一字符串未进行校验。这部分的处理与实现可以参照相关技术,本申请在此不再一一赘述。
步骤103,当所述第一字符串满足预设的字符规则时,将所述第一字符串确定为所述条形码图片中条形码的识别结果。
基于前述步骤102,在得到所述第一字符串之后,可以判断所述第一字符串是否满足预设的字符规则,如果所述第一字符串满足所述字符规则,则可以确定所述第一字符串为所述条形码图片中条形码的识别结果。
在本实施例中,所述字符规则可以由开发人员进行设置,比如:不存在连续的预设字符,所述预设字符通常不包括:26个大小写字母、0至9以及空格,即所述预设字符可以为除26个大写字母、26个小写字母、0至9以及空格之外的其他字符,比如:字符“&”、字符“%”、字符“#”等。具体地,在实际应用中,条形码中出现连续的所述预设字符的概率几乎为0,因此在本步骤中,可以判断所述第一字符串是否不存在连续的所述预设字符,如果所述第一字符串不存在连续的所述预设字符,则可以确定所述第一字符串为条形码的识别结果。当然,在实际的应用中,根据条形码的携带的字符串的特点,开发人员还可以设置其他的字符规则,比如:国产商品的条形码前三位通常为690-699,针对国产商品的条形码,所述字符规则还可以包括 前三位在690至699之间等。
由以上描述可以看出,由于大部分条形码携带的字符串都满足预设的字符规则,因此本申请可以在条形码图片中一行像素点对应的字符串满足所述字符规则时,将该字符串确定为条形码的识别结果,无需多次解析,大大提高了条形码的识别速率。
可选的,在本申请另一个例子中,基于图1所示的实施例,为提高条形码识别的准确率,当步骤102中解析得到的第一字符串不满足预设的字符规则时,可以继续判断所述第一字符串与上一次根据所述提取策略在所述条形码图片中提取的除所述第一字符串对应的行之外其他一行像素点对应的第二字符串是否相同,并在所述第一字符串与所述第二字符串相同时,将所述第一字符串确定为条形码的识别结果。
具体地,虽然将近100%的条形码中携带的字符串均满足所述预设的字符规则,但为了避免条形码中携带不满足所述字符规则的字符串,采用图1所示的方式导致条形码识别错误的问题,当步骤102中解析得到的所述第一字符串不满足预设的字符规则时,可以继续判断连续两次提取的像素点的解析结果是否一致,如果一致,则可以将一致的解析结果确认为条形码的识别结果,以提高条形码识别的准确率。如果不一致,则可以基于预设的提取策略继续提取像素点,并判断本次提取的像素点对应的字符串是否满足所述字符规则,直至某行像素点对应的字符串满足所述字符规则,或者连续两次提取的像素点对应的字符串一致。
由以上描述可以看出,本申请在基于字符规则无法识别出条形码携带的字符串时,可以判断连续两次提取的像素点对应的字符串是否相同,并将相同的字符串确定为条形码的识别结果,进而提高条形码识别的准确率。当然,在实际应用中,为进一步提高条形码识别的准确率,在基于字符规则无法识别出条形码携带的字符串时,还可以判断连续三次或四次提取的像素点对应的字符串是否相同,并将连续三次或四次相同的字符串作为条形码的识别结果,本申请对此不作特殊限制。
可选的,在本申请另一个例子中,当目标提取行超出条形码图片时,如果基于前述字符规则和连续两次字符串相同的方案仍未确定出条形码的识别结果,则可以统计已解析得到的各个字符串的出现频数,并将出现频数最大且大于1的字符串确定为条形码图片中条形码的识别结果。举例来说,假设已解析得到两个字符串,分别为字符串A和字符串B,字符串A出现3次,字符串B出现1次,则可以将字符串A确定为条形码的识别结果。本申请可以根据解析出的字符串的出现频数对前述方式无法识别的条形码图片进行补充识别,提高了条形码识别的准确率。可以理解的是,在实际实现中,还可以将确定条形码识别结果的出现频数设置为大于2或者大于3等,以进一步提高条形码识别的准确率,比如:针对不包含校验码的条形码,可以设置较大的出现频数。在本实施例中,如果已解析得到的各字符串的出现频数均为1,则可以确定条形码识别失败。另一方面,当目标提取行超出所述条形码图片时,如果仍未解析得到任何字符串,也可以确定条形码识别失败。
在本申请中,基于字符规则对条形码进行识别的速率最快,且能够识别出绝大多数的条形码,因此,本申请可先基于字符规则对条形码进行识别。而采用连续两次提取的像素点对应的字符串相同方式进行识别的速率其次,因此,本申请可以将其作为字符规则识别方式的补充识别方式。而采用出现频数进行识别的速率最慢,故本申请将其作为前两种识别方式的补充识别方式。由此可以看出,本申请可以采用三种识别方式对条形码进行识别,在兼顾识别速率的同时还可提高条形码识别的准确率。
图2是本申请一示例性实施例示出的另一种条形码的识别方法的流程示意图。
请参考图2,本例中条形码的识别方法可以包括以下步骤:
步骤201,根据预设的提取策略,在条形码图片中提取缺省行像素点。
在本实施例中,假设经终端设备进行压缩、灰度化、二值化等处理之后得到的条形码图片一共有40行像素点,缺省的行为第1行,预设的提取策略为间隔10行进行像素点的提取。在本步骤中,首次提取所述条形码图片的第 1行像素点。
步骤202,对该行像素点进行解析,以得到对应的字符串A。
在本步骤中,解析所述条形码图片的第1行像素点,得到对应的字符串A。
步骤203,判断所述字符串A是否满足预设的字符规则。如果所述字符串A不满足所述字符规则,则可以执行步骤204。如果所述字符串A满足所述字符规则,则可以执行步骤208。
步骤204,根据所述提取策略,在条形码图片中再提取一行像素点。
基于前述步骤203的判断结果,当所述条形码图片的第1行像素点对应的字符串A不满足所述字符规则时,根据所述提取策略,可以提取所述条形码图片的第11行像素点。
步骤205,对该行像素点进行解析,以得到对应的字符串B。
基于前述步骤204,可以对所述第11行像素点进行解析,以得到对应的字符串B。
步骤206,判断所述字符串B是否满足所述字符规则。如果所述字符串B满足所述字符规则,则可以执行步骤208。如果所述字符串B不满足所述字符规则,则可以执行步骤207。
步骤207,判断所述字符串B和上一次提取的像素点对应的字符串(所述字符串A)是否相同。如果相同,则可以执行步骤208。如果不相同,则可以继续执行步骤204。
基于前述步骤206的判断结果,当所述条形码图片的第11行像素点对应的字符串B也不满足所述字符规则时,可以判断所述字符串B与所述字符串A是否相同,如果相同,则可以执行步骤208。
步骤208,确定条形码的识别结果。
基于前述步骤203的判断结果,当所述条形码图片的第1行像素点对应的字符串A满足所述字符规则时,可以将所述字符串A确定为条形码的识别结果。
基于前述步骤206的判断结果,当所述条形码图片的第11行像素点对应的字符串B满足所述字符规则时,可以将所述字符串B确定为条形码的识别结果。
基于前述步骤207的判断结果,当所述字符串B与所述字符串A相同时,可以将所述字符串B确定为条形码的识别结果。
在本实施例中,如果步骤207中确定所述字符串B与所述字符串A不相同,则可以再次执行步骤204,提取所述条形码图片的第21行像素点,并继续执行步骤203解析所述第21行像素点,以得到对应的字符串C。判断所述字符串C是否满足所述字符规则,如果满足,则可以将所述字符串C确定为条形码的识别结果。如果所述字符串C不满足所述字符规则,则判断所述字符串C与所述字符串B是否相同,如果相同,则也可以将所述字符串C确定为条形码的识别结果。如果不相同,则可以继续提取所述条形码图片的第31行,并通过解析得到第31行像素点对应的字符串D,如果字符串D不满足所述字符规则,且字符串D与字符串C也不相同,而第41行像素点又已经超出了条形码图片,则可以统计各个字符串的出现频数,并将出现频数最高且大于1的字符串确定为条形码的识别结果。如果各字符串的出现频数均为1,则可以确定条形码识别失败。
与前述条形码的识别方法的实施例相对应,本申请还提供了条形码的识别装置的实施例。
本申请条形码的识别装置的实施例可以应用在终端设备上。装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在终端设备的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图3所示,为本申请条形码的识别装置所在终端设备的一种硬件结构图,除了图3所示的处理器、内存、网络接口、以及非易失性存储器之外,实施例中装置所在的终端设备通常根据该终端设备的实际功能,还可以包括其他硬件,对此不再赘述。
图4是本申请一示例性实施例示出的一种条形码的识别装置的框图。
请参考图4,所述条形码的识别装置300可以应用在前述图3所示的终端设备中,包括有:像素点提取单元301、像素点解析单元302、第一识别单元303、相同判断单元304、第二识别单元305、频数统计单元306、第三识别单元307、第四识别单元308以及第五识别单元309。
其中,像素点提取单元301,根据预设的提取策略,在条形码图片中提取一行像素点;
像素点解析单元302,对该行像素点进行解析,以得到对应的第一字符串;
第一识别单元303,当所述第一字符串满足预设的字符规则时,将所述第一字符串确定为所述条形码图片中条形码的识别结果。
相同判断单元304,当所述第一字符串不满足所述字符规则时,判断所述第一字符串与上一次根据所述提取策略在所述条形码图片中提取的除所述第一字符串对应的行之外其他一行像素点对应的第二字符串是否相同;
第二识别单元305,当所述第一字符串与所述第二字符串相同时,将所述第一字符串确定为所述条形码图片中条形码的识别结果,当所述第一字符串与所述第二字符串不相同时,返回根像素点提取单元。
可选的,所述提取策略为从缺省的行开始,间隔固定的行数进行像素点的提取,直至目标提取行超出所述条形码图片。
可选的,所述提取策略为从缺省的行开始,间隔动态变化的行数进行像素点的提取,直至目标提取行超出所述条形码图片。
频数统计单元306,当目标提取行超出所述条形码图片时,统计已解析得到的各字符串的出现频数;
第三识别单元307,将出现频数最大,且大于1的字符串确定为所述条形码图片中条形码的识别结果。
第四识别单元308,当已解析得到的各字符串的出现频数均为1时,确定条形码识别失败。
第五识别单元309,当目标提取行超出所述条形码图片时,如果未解析得到任何字符串,则确定条形码识别失败。
可选的,所述字符规则为不存在连续的预设字符,所述预设字符不包括:26个大小写字母、0至9以及空格。
上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。

Claims (16)

  1. 一种条形码的识别方法,其特征在于,所述方法包括:
    根据预设的提取策略,在条形码图片中提取一行像素点;
    对该行像素点进行解析,以得到对应的第一字符串;
    当所述第一字符串满足预设的字符规则时,将所述第一字符串确定为所述条形码图片中条形码的识别结果。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    当所述第一字符串不满足所述字符规则时,判断所述第一字符串与上一次根据所述提取策略在所述条形码图片中提取的除所述第一字符串对应的行之外其他一行像素点对应的第二字符串是否相同;
    当所述第一字符串与所述第二字符串相同时,将所述第一字符串确定为所述条形码图片中条形码的识别结果;
    当所述第一字符串与所述第二字符串不相同时,返回根据预设的提取策略在条形码图片中提取一行像素点的步骤。
  3. 根据权利要求2所述的方法,其特征在于,
    所述提取策略为从缺省的行开始,间隔固定的行数进行像素点的提取,直至目标提取行超出所述条形码图片。
  4. 根据权利要求2所述的方法,其特征在于,
    所述提取策略为从缺省的行开始,间隔动态变化的行数进行像素点的提取,直至目标提取行超出所述条形码图片。
  5. 根据权利要求3或4所述的方法,其特征在于,所述方法还包括:
    当目标提取行超出所述条形码图片时,统计已解析得到的各字符串的出现频数;
    将出现频数最大,且大于1的字符串确定为所述条形码图片中条形码的识别结果。
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    当已解析得到的各字符串的出现频数均为1时,确定条形码识别失败。
  7. 根据权利要求3或4所述的方法,其特征在于,所述方法还包括:
    当目标提取行超出所述条形码图片时,如果未解析得到任何字符串,则确定条形码识别失败。
  8. 根据权利要求1所述的方法,其特征在于,
    所述字符规则为不存在连续的预设字符,所述预设字符不包括:26个大小写字母、0至9以及空格。
  9. 一种条形码的识别装置,其特征在于,所述装置包括:
    像素点提取单元,根据预设的提取策略,在条形码图片中提取一行像素点;
    像素点解析单元,对该行像素点进行解析,以得到对应的第一字符串;
    第一识别单元,当所述第一字符串满足预设的字符规则时,将所述第一字符串确定为所述条形码图片中条形码的识别结果。
  10. 根据权利要求9所述的装置,其特征在于,所述装置还包括:
    相同判断单元,当所述第一字符串不满足所述字符规则时,判断所述第一字符串与上一次根据所述提取策略在所述条形码图片中提取的除所述第一字符串对应的行之外其他一行像素点对应的第二字符串是否相同;
    第二识别单元,当所述第一字符串与所述第二字符串相同时,将所述第一字符串确定为所述条形码图片中条形码的识别结果,当所述第一字符串与所述第二字符串不相同时,返回根像素点提取单元。
  11. 根据权利要求10所述的装置,其特征在于,
    所述提取策略为从缺省的行开始,间隔固定的行数进行像素点的提取,直至目标提取行超出所述条形码图片。
  12. 根据权利要求10所述的装置,其特征在于,
    所述提取策略为从缺省的行开始,间隔动态变化的行数进行像素点的提取,直至目标提取行超出所述条形码图片。
  13. 根据权利要求11或12所述的装置,其特征在于,所述装置还包括:
    频数统计单元,当目标提取行超出所述条形码图片时,统计已解析得到的各字符串的出现频数;
    第三识别单元,将出现频数最大,且大于1的字符串确定为所述条形码图片中条形码的识别结果。
  14. 根据权利要求13所述的装置,其特征在于,所述装置还包括:
    第四识别单元,当已解析得到的各字符串的出现频数均为1时,确定条形码识别失败。
  15. 根据权利要求11或12所述的装置,其特征在于,所述装置还包括:
    第五识别单元,当目标提取行超出所述条形码图片时,如果未解析得到任何字符串,则确定条形码识别失败。
  16. 根据权利要求9所述的装置,其特征在于,
    所述字符规则为不存在连续的预设字符,所述预设字符不包括:26个大小写字母、0至9以及空格。
PCT/CN2017/106483 2016-10-24 2017-10-17 一种条形码的识别方法和装置 WO2018077059A1 (zh)

Priority Applications (9)

Application Number Priority Date Filing Date Title
KR1020197014605A KR102194567B1 (ko) 2016-10-24 2017-10-17 바코드 식별을 위한 방법 및 장치
PL17865471T PL3531335T3 (pl) 2016-10-24 2017-10-17 Sposób i urządzenie do identyfikowania kodów kreskowych
SG11201903685PA SG11201903685PA (en) 2016-10-24 2017-10-17 Method and apparatus for barcode identification
ES17865471T ES2808953T3 (es) 2016-10-24 2017-10-17 Procedimiento y aparato de identificación de código de barras
MYPI2019002299A MY193086A (en) 2016-10-24 2017-10-17 Method and apparatus for barcode identification
JP2019542767A JP2019537177A (ja) 2016-10-24 2017-10-17 バーコード識別のための方法および装置
EP17865471.1A EP3531335B1 (en) 2016-10-24 2017-10-17 Barcode identification method and apparatus
US16/393,648 US10726223B2 (en) 2016-10-24 2019-04-24 Method and apparatus for barcode identifcation
PH12019500901A PH12019500901A1 (en) 2016-10-24 2019-04-24 Method and apparatus for barcode identification

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610939696.3 2016-10-24
CN201610939696.3A CN107016316B (zh) 2016-10-24 2016-10-24 一种条形码的识别方法和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/393,648 Continuation US10726223B2 (en) 2016-10-24 2019-04-24 Method and apparatus for barcode identifcation

Publications (1)

Publication Number Publication Date
WO2018077059A1 true WO2018077059A1 (zh) 2018-05-03

Family

ID=59439485

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/106483 WO2018077059A1 (zh) 2016-10-24 2017-10-17 一种条形码的识别方法和装置

Country Status (12)

Country Link
US (1) US10726223B2 (zh)
EP (1) EP3531335B1 (zh)
JP (1) JP2019537177A (zh)
KR (1) KR102194567B1 (zh)
CN (2) CN107016316B (zh)
ES (1) ES2808953T3 (zh)
MY (1) MY193086A (zh)
PH (1) PH12019500901A1 (zh)
PL (1) PL3531335T3 (zh)
SG (1) SG11201903685PA (zh)
TW (1) TWI683258B (zh)
WO (1) WO2018077059A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016316B (zh) * 2016-10-24 2020-01-31 阿里巴巴集团控股有限公司 一种条形码的识别方法和装置
CN111144161A (zh) * 2020-04-03 2020-05-12 支付宝(杭州)信息技术有限公司 条形码的识别方法及装置、商品信息确定方法及支付方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120080515A1 (en) * 2010-09-30 2012-04-05 Apple Inc. Barcode Recognition Using Data-Driven Classifier
CN102737214A (zh) * 2011-04-15 2012-10-17 上海真石信息技术有限公司 条形码图像阀值频率手机识别技术
CN104361309A (zh) * 2014-12-05 2015-02-18 网易宝有限公司 条形码识别方法和设备
CN107016316A (zh) * 2016-10-24 2017-08-04 阿里巴巴集团控股有限公司 一种条形码的识别方法和装置

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4873426A (en) 1988-08-03 1989-10-10 Image Business Systems Corporation Technique for reading bar codes
JP3376175B2 (ja) 1995-07-06 2003-02-10 富士通株式会社 バーコード認識装置
JP3758266B2 (ja) 1997-01-08 2006-03-22 株式会社デンソー コード読取装置
JP2005165948A (ja) * 2003-12-05 2005-06-23 Toshiba Social Automation Systems Co Ltd バーコード読み取り方法及びバーコード読み取り装置
CN100479331C (zh) * 2004-03-30 2009-04-15 深圳市朗科科技股份有限公司 条码的解码方法
GB2424109B (en) 2005-03-08 2008-02-27 Roke Manor Research Information encoding methods, and sets of graphical codes
CN101093547B (zh) * 2007-05-18 2010-06-09 上海邮政科学研究院 基于高度参数的条码和数字协同识别物品的方法
CN100456314C (zh) * 2007-05-31 2009-01-28 中国农业大学 基于聊天用摄像头的快速响应矩阵码识读方法
JP5092732B2 (ja) * 2007-12-19 2012-12-05 富士ゼロックス株式会社 コード認識装置及びプログラム
WO2010014084A1 (en) * 2008-07-30 2010-02-04 Optoelectronics Co., Ltd. One dimensional barcode reader using two dimensional image sensor
CN101556618A (zh) * 2009-05-07 2009-10-14 中兴通讯股份有限公司 流媒体播放方法及终端
US8254725B2 (en) * 2009-07-28 2012-08-28 Ncr Corporation Apparatus, method and system for elongating pixel data
CN101882207B (zh) * 2010-06-01 2012-06-20 福建新大陆电脑股份有限公司 Data Matrix码条码解码芯片及其解码方法
JP2012198763A (ja) * 2011-03-22 2012-10-18 Denso Wave Inc コードリーダ
CN102521558B (zh) * 2011-11-18 2014-04-02 深圳市宝捷信科技有限公司 一种条码识别方法及装置
CN103136500A (zh) * 2011-11-24 2013-06-05 成绵广 分类方法
CN102779275B (zh) * 2012-07-04 2015-06-17 广州广电运通金融电子股份有限公司 一种纸类字符识别方法及相关装置
CN103914680B (zh) * 2013-01-07 2018-03-23 上海宝信软件股份有限公司 一种喷印字符图像识别与校验系统及方法
US9324052B2 (en) * 2014-03-28 2016-04-26 Mckesson Medical-Surgical Minnesota Supply Inc. System, method, and apparatus for barcode identification workflow
CN104112153B (zh) 2014-07-17 2017-10-10 上海透云物联网科技有限公司 基于移动终端的条维码识别方法及其系统
CN105991670B (zh) * 2015-01-28 2020-02-14 中兴通讯股份有限公司 数据分享方法、数据分享装置及终端
CN104992136B (zh) 2015-07-29 2018-08-03 北京京东尚科信息技术有限公司 识别条形码的方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120080515A1 (en) * 2010-09-30 2012-04-05 Apple Inc. Barcode Recognition Using Data-Driven Classifier
CN102737214A (zh) * 2011-04-15 2012-10-17 上海真石信息技术有限公司 条形码图像阀值频率手机识别技术
CN104361309A (zh) * 2014-12-05 2015-02-18 网易宝有限公司 条形码识别方法和设备
CN107016316A (zh) * 2016-10-24 2017-08-04 阿里巴巴集团控股有限公司 一种条形码的识别方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3531335A4 *

Also Published As

Publication number Publication date
MY193086A (en) 2022-09-26
EP3531335A1 (en) 2019-08-28
SG11201903685PA (en) 2019-05-30
KR20190071780A (ko) 2019-06-24
PH12019500901A1 (en) 2019-12-02
US10726223B2 (en) 2020-07-28
US20190251313A1 (en) 2019-08-15
KR102194567B1 (ko) 2020-12-28
JP2019537177A (ja) 2019-12-19
TWI683258B (zh) 2020-01-21
ES2808953T3 (es) 2021-03-02
CN111274841A (zh) 2020-06-12
CN111274841B (zh) 2023-05-12
CN107016316A (zh) 2017-08-04
PL3531335T3 (pl) 2020-11-02
TW201816659A (zh) 2018-05-01
CN107016316B (zh) 2020-01-31
EP3531335A4 (en) 2019-08-28
EP3531335B1 (en) 2020-07-22

Similar Documents

Publication Publication Date Title
CN110275958B (zh) 网站信息识别方法、装置和电子设备
WO2018040944A1 (zh) 恶意地址/恶意订单的识别系统、方法及装置
CN107785021B (zh) 语音输入方法、装置、计算机设备和介质
CN105224600B (zh) 一种样本相似度的检测方法及装置
CN111352907A (zh) 流水文件解析方法、装置、计算机设备和存储介质
CN106874253A (zh) 识别敏感信息的方法及装置
JP6161227B2 (ja) 入力リソースプッシュ方法、システム、コンピューター記憶媒体及びデバイス
US20150186662A1 (en) Method and apparatus for input verification
CN104994128B (zh) 一种数据编码类型识别及转码方法和装置
WO2019179028A1 (zh) 电子装置、基于动态图片的用户验证方法及存储介质
US10606845B2 (en) Detecting leading session of application
US20160132708A1 (en) Displaying method and decoding method for a dynamic recognizable two-dimensional code
CN111444349A (zh) 信息抽取方法、装置、计算机设备和存储介质
CN111273891A (zh) 基于规则引擎的业务决策方法、装置及终端设备
WO2018077059A1 (zh) 一种条形码的识别方法和装置
CN110222790B (zh) 用户身份识别方法、装置及服务器
CN113010785A (zh) 用户推荐方法及设备
CN112182520B (zh) 非法账号的识别方法、装置、可读介质及电子设备
CN110598115A (zh) 一种基于人工智能多引擎的敏感网页识别方法及系统
CN110990558B (zh) 电子书内容展示方法、计算设备及计算机存储介质
CN111767544B (zh) 多频重放攻击漏洞确定方法、装置、设备及可读存储介质
WO2019062013A1 (zh) 电子装置、用户分群的方法、系统及计算机可读存储介质
CN113508371B (zh) 用于改进计算机标识的系统和方法
CN107818483B (zh) 网络卡券推荐方法及系统
CN110598211A (zh) 文章的识别方法和装置、存储介质及电子装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17865471

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2019542767

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 20197014605

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2017865471

Country of ref document: EP

Effective date: 20190524