CN111801675A - One-dimensional code identification method, terminal, device and device with storage function - Google Patents

One-dimensional code identification method, terminal, device and device with storage function Download PDF

Info

Publication number
CN111801675A
CN111801675A CN201880088571.1A CN201880088571A CN111801675A CN 111801675 A CN111801675 A CN 111801675A CN 201880088571 A CN201880088571 A CN 201880088571A CN 111801675 A CN111801675 A CN 111801675A
Authority
CN
China
Prior art keywords
dimensional code
bars
spaces
determining
code
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201880088571.1A
Other languages
Chinese (zh)
Inventor
韩琨
阳光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen A&E Intelligent Technology Institute Co Ltd
Original Assignee
Shenzhen A&E Intelligent Technology Institute Co Ltd
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 Shenzhen A&E Intelligent Technology Institute Co Ltd filed Critical Shenzhen A&E Intelligent Technology Institute Co Ltd
Publication of CN111801675A publication Critical patent/CN111801675A/en
Pending legal-status Critical Current

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

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Character Discrimination (AREA)

Abstract

The application discloses a one-dimensional code identification method, a one-dimensional code identification terminal, a one-dimensional code identification device and a device with a storage function, wherein the method comprises the steps of judging whether the total number of bars and spaces in a one-dimensional code is greater than a preset value or not by acquiring the total number of bars and spaces in the one-dimensional code; if the total number of the bars and the spaces is larger than a preset value: and selecting the bars and spaces of the one-dimensional code according to a preset method so as to reduce the total number of the bars and spaces of the one-dimensional code, wherein the selected bars and spaces are used for decoding the one-dimensional code. Through the mode, the method and the device can optimize the selection of the bars and the spaces of the one-dimensional codes, exclude the bars and the spaces with lower similarity, reduce the input of decoding of the one-dimensional codes, improve the identification precision and speed of the one-dimensional codes, and realize efficient decoding of different one-dimensional codes.

Description

One-dimensional code identification method, terminal, device and device with storage function [ technical field ] A method for producing a semiconductor device
The present application relates to the field of one-dimensional code technologies, and in particular, to a one-dimensional code identification method, a terminal, a device, and a device with a storage function.
[ background of the invention ]
One-dimensional codes are labels consisting of a set of regularly arranged bars, spaces and corresponding characters. The "bar" refers to the part with low light reflectivity, generally black vertical line, and the "empty" refers to the part with high light reflectivity, generally white vertical line, the combination of bar and empty expresses certain information, which can be read by special equipment and converted into binary and decimal information compatible with computer. Each different type of one-dimensional code has its own characteristics, for example, the number of characters supported by some one-dimensional codes is not fixed, the number of character coding patterns combined by some modules of one-dimensional codes is very large, some one-dimensional codes only support two kinds of widths, some one-dimensional codes support four kinds of widths, and the like.
There are two types of one-dimensional code recognition methods based on images: one class aims at the fixed-length one-dimensional code with less coding patterns (or called templates) and can achieve higher robustness under the conditions of blurring, noise and the like, but the method only aims at the fixed-length one-dimensional code with less coding patterns and cannot be applied to the complex variable-length one-dimensional code or the condition of many coding patterns. The other method carries out binarization or edge extraction on all the one-dimensional codes, and carries out identification on the basis of the binarization result or the extracted edge section and space, but the method has poor robustness and high requirement on image quality.
Therefore, a method for efficiently decoding different one-dimensional codes is urgently needed.
[ summary of the invention ]
The technical problem mainly solved by the application is to provide a one-dimensional code identification method, a terminal and a device capable of efficiently decoding different one-dimensional codes.
In order to solve the above main technical problem, a technical solution provided by the present application is: provided is a method for identifying a one-dimensional code, comprising the following steps: positioning a one-dimensional code; acquiring the total number of bars and spaces in the one-dimensional code; judging whether the total number of the strips and the spaces is greater than a preset value; if the total number of the bars and the spaces is larger than a preset value: selecting the bars and spaces of the one-dimensional code according to a preset method so as to reduce the total number of the bars and spaces of the one-dimensional code, wherein the selected bars and spaces are used for decoding the one-dimensional code; decoding the one-dimensional code according to the selected bars and spaces.
In order to solve the above main technical problem, another technical solution provided by the present application is: provided is an identification terminal of a one-dimensional code, including: an image collector and a processor; the image collector is used for collecting one-dimensional code images and sending the collected one-dimensional code images to the processor; the processor is coupled with the image collector and executes the following steps when executing the program: positioning the one-dimensional code according to the one-dimensional code image; acquiring the total number of bars and spaces in the one-dimensional code; judging whether the total number of the strips and the blanks is greater than a preset value or not; if the total number of the bars and the spaces is larger than a preset value: selecting the bars and spaces of the one-dimensional code according to a preset method so as to reduce the total number of the bars and spaces of the one-dimensional code, wherein the selected bars and spaces are used for decoding the one-dimensional code; the one-dimensional code is then decoded from the selected bars and spaces.
In order to solve the above main technical problem, the present application provides another technical solution: the device with the storage function stores program data, and the program data can be executed to realize the steps in the one-dimensional code identification method.
The beneficial effect of this application is: different from the situation of the prior art, the one-dimensional code identification technical scheme provided by the application can optimize the selection of the bars and the spaces of the one-dimensional code and reduce the input of the one-dimensional code decoding, thereby reducing the noise and the interference with the input of the one-dimensional code.
[ description of the drawings ]
Fig. 1 is a schematic flowchart of an embodiment of a one-dimensional code recognition method according to the present application;
FIG. 2 is an exemplary diagram of a one-dimensional code;
fig. 3 is a schematic structural diagram of an embodiment of a one-dimensional code identification terminal according to the present application;
FIG. 4 is a schematic structural diagram of an embodiment of a one-dimensional code recognition apparatus according to the present application;
FIG. 5 is a schematic structural diagram of an embodiment of the optimization unit shown in FIG. 4;
FIG. 6 is a schematic structural diagram of another embodiment of the optimization unit shown in FIG. 4;
FIG. 7 is a schematic structural diagram of another embodiment of a one-dimensional code recognition apparatus according to the present application;
FIG. 8 is a schematic block diagram of one embodiment of a type-determining subunit of FIG. 7 of the present application;
fig. 9 is a schematic structural diagram of an embodiment of a device with a storage function according to the present application.
[ detailed description ] embodiments
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art without any creative effort based on the embodiments in the present application belong to the protection scope of the present application.
Referring to fig. 1, fig. 1 is a schematic flow chart of an embodiment of a one-dimensional code identification method according to the present application, where the one-dimensional code identification method of the present embodiment includes the following steps:
step S101: and positioning the one-dimensional code.
Referring to fig. 2, fig. 2 is an exemplary diagram of a one-dimensional code. In general, the order of composition of a complete one-dimensional code is: pre-shadow 201, start 202, data 203, check 204, stop 205, post-shadow 206.
Specifically, the quiet zone refers to a blank zone with the same reflectivity as the space outside the left end and the right end of the one-dimensional code, which enables the one-dimensional code reader to enter a state of being ready for reading, when the two one-dimensional codes are close to each other, the blank zone is helpful for distinguishing the two one-dimensional codes, and the width of the blank zone is usually not less than 6mm or 10 times of the width of the module.
The basic unit constituting a one-dimensional code is a module, which refers to the narrowest bar or space in the one-dimensional code, and the width of the module is usually in mm or mil (thousandth of an inch). One bar or space constituting a one-dimensional code is called a unit, the number of modules included in one unit is determined by a coding mode, in some code systems, such as an EAN code, all units are composed of one or more modules; in other code systems, such as code 39, all cells have only two widths, i.e., wide cells and narrow cells, and the narrow cells are a module.
The start/end characters, which are a plurality of bars and spaces located at the beginning and the end of the one-dimensional code, mark the beginning and the end of the one-dimensional code and provide code system identification information and reading direction information.
The data character, the bar and space structure in the middle of the one-dimensional code, it contains the specific information expressed by the one-dimensional code. The check character, usually the last element in the data symbol, is used to check the correctness of the value or parity expressed by the data symbol. Some one-dimensional codes may not contain a check symbol.
In a specific implementation scenario, an image of the one-dimensional code is acquired by an image collector, such as a scanner or a camera, and then the one-dimensional code in the image is located, that is, the position of the one-dimensional code in the image is identified, and the non-one-dimensional code is ignored. One-dimensional codes in the image can be located using, for example, a gradient-based method or a morphology-based method. Other general positioning methods for images may also be used, and are not limited herein. In other implementation scenarios, a one-dimensional code quality evaluation system can be added before positioning the effective area of the one-dimensional code, and the one-dimensional code image which does not meet the standard, such as a set evaluation threshold or a set condition, is not subjected to positioning identification, so that the error code condition is further eliminated, and the accuracy is improved.
Step S102: and acquiring the total number of bars and spaces in the one-dimensional code.
Positioning the one-dimensional code allows the one-dimensional code to be separated from the acquired image for further identification and analysis of the one-dimensional code. Because the bar and the space have different colors, different gray levels and regular shapes, the bar and the space of the one-dimensional code can be identified by using a gray level identification method or other image characteristic identification methods, and the number of the identified bars, the number of the spaces and the total number of the bars and the spaces can be obtained.
Step S103: and judging whether the total number of the strips and the blanks is greater than a preset value or not.
The preset value may be set according to actual needs, or the type of the one-dimensional code may be determined before step S103, and the corresponding preset value is selected according to the type, for example, if it is determined that the obtained one-dimensional code is EAN-13 one-dimensional code, the preset value may be the total number of bars and spaces of the standard EAN-13 one-dimensional code, or, for example, if it is determined that the obtained one-dimensional code is EAN-128 one-dimensional code, the preset value may be the total number of bars and spaces of the standard EAN-128 one-dimensional code.
Step S104: and if the total number of the bars and the spaces is larger than a preset value, selecting the bars and the spaces of the one-dimensional code according to a preset method so as to reduce the total number of the bars and the spaces of the one-dimensional code, wherein the selected bars and the spaces are used for decoding the one-dimensional code.
Selecting the bars and spaces of the one-dimensional code according to a preset method, that is, optimizing the selection of the bars and spaces of the one-dimensional code, specifically, optimizing the selection of the bars and spaces of the one-dimensional code may include: classifying the bars and spaces according to their widths; respectively carrying out similarity matching on the bars and spaces of each type and reference bars and reference spaces of the same type; and selecting bars with the similarity greater than or equal to a first preset threshold after the similarity matching, and selecting bars with the similarity greater than or equal to a second preset threshold. The widths of bars and spaces of different types of one-dimensional codes are usually different, the widths of the bars and spaces of the existing standard one-dimensional codes can be classified in advance to obtain different classes, the bars or spaces in each class classified in advance are used as reference bars and reference spaces, then the bars and spaces of the current one-dimensional codes are classified according to the widths of the bars and spaces of the current one-dimensional codes, the classes of the bars and spaces of the current one-dimensional codes and the classes classified in advance, then the bars of the current one-dimensional codes and the reference bars of the same class are subjected to similarity matching, the spaces of the current one-dimensional codes and the reference spaces of the same class are subjected to similarity matching, and the bars with the similarity larger than a first preset threshold and the spaces with the similarity larger than a second preset threshold are selected as optimization results.
In another embodiment, the selecting the bars and spaces of the one-dimensional code according to a preset method, that is, optimizing the selection of the bars and spaces of the one-dimensional code, may include: performing similarity matching on the combination of the bars and the spaces in the one-dimensional code and the combination of the bars and the spaces corresponding to the reference characters, wherein the combination of the bars and the spaces in the one-dimensional code is a combination of the bars and the spaces which are continuously arranged; a combination of bars and spaces with a similarity greater than or equal to a third preset threshold is selected. In the general one-dimensional code compilation, different continuous bar and space combinations represent a character, that is, a character corresponds to a group of bar and space combinations, the compilation according to the existing standard one-dimensional code can be performed first, the compiled character is used as a reference character, the reference character corresponds to a group of bar and space combinations, that is, a reference combination, then the continuous bar and space combinations in the current one-dimensional code are subjected to similarity matching with the reference combination corresponding to the reference character, and the bar and space combinations with the similarity larger than a third preset threshold are selected as an optimization result.
In a specific implementation scenario, before the selecting of the optimization bars and spaces, the method may further include: determining the type of the one-dimensional code; then, the categories and widths of the reference bars and the reference spaces can be determined according to the types of the one-dimensional codes, or the reference characters can be determined according to the types of the one-dimensional codes, so that the times of similarity matching can be reduced, the one-dimensional code identification efficiency is improved, and the false identification is reduced.
Different types of one-dimensional codes have different type characteristics, such as length of one-dimensional code, start code of one-dimensional code, width types of bars and spaces supported by one-dimensional code, and the like. In a specific implementation scenario, determining the type of the one-dimensional code includes: judging whether the one-dimensional code is a fixed-length one-dimensional code; if the one-dimensional code is a fixed-length one-dimensional code, acquiring the length of the one-dimensional code, and determining the type of the one-dimensional code according to the length; if the one-dimensional code is a variable-length one-dimensional code, acquiring a start code of the one-dimensional code and the width of the one-dimensional code, and determining the type of the one-dimensional code according to the start code and the width.
In a specific implementation scenario, determining whether the one-dimensional code is a fixed-length one-dimensional code includes: and acquiring a code system of the one-dimensional code, and judging whether the one-dimensional code is a fixed-length one-dimensional code or not according to the code system. Or when the targeted one-dimensional codes are limited, whether the one-dimensional codes are fixed-length one-dimensional codes can be determined according to the lengths of the one-dimensional codes, and if the lengths of the one-dimensional codes are the same as the lengths of certain fixed-length one-dimensional codes, the one-dimensional codes can be determined to be fixed-length one-dimensional codes.
The values of the first preset threshold, the second preset threshold and the third preset threshold may be set according to actual conditions, and are not limited herein. And the widths of the bars and the spaces selected after optimization are used as the input of decoding and identifying the one-dimensional code, and the one-dimensional code is decoded, so that the decoding efficiency is improved.
Step S105: a one-dimensional code is decoded based on the selected bars and spaces.
The selected bars and spaces are used as the input of the one-dimensional code decoding, and the bar codes can be identified by using the gray information of the bars and spaces instead of the information obtained by the binarization of the one-dimensional code or the edge extraction of the one-dimensional code in combination with the positioning of the one-dimensional code, so that the robustness of the bar code identification is improved, and particularly, the bar code identification has better robustness under the conditions of image blurring, noise, lighting influence and the like. The one-dimensional code decoding based on the gray scale information of the bars and spaces in particular may use the existing related art.
The beneficial effect of this embodiment is: different from the situation in the prior art, the identification method for the one-dimensional code provided by this embodiment optimizes the selection of the bars and spaces of the one-dimensional code, reduces the input of the one-dimensional code decoding, thereby reducing the noise and interference with the input of the one-dimensional code.
In order to realize the efficient decoding of the one-dimensional codes with different characteristics, the application also provides a one-dimensional code identification terminal.
In a specific implementation scenario, please refer to fig. 3, and fig. 3 is a schematic structural diagram of an embodiment of a one-dimensional code identification terminal according to the present application. The one-dimensional code identification terminal 30 comprises an image collector 31 and a processor 32, wherein the processor 32 is coupled with the image collector 31. The image collector 31 is configured to collect an image of the one-dimensional code, and send the collected image of the one-dimensional code to the processor 32. The processor 32, when executing the program, performs the one-dimensional code recognition method as described above from the acquired image.
In one embodiment, processor 32, when executing a program, performs the following steps: positioning the one-dimensional code according to the image; acquiring the total number of bars and spaces in the one-dimensional code; judging whether the total number of the strips and the blanks is greater than a preset value or not; if the total number of the bars and the spaces is larger than a preset value, selecting the bars and the spaces of the one-dimensional code according to a preset method so as to reduce the total number of the bars and the spaces of the one-dimensional code, wherein the selected bars and the spaces are used for decoding the one-dimensional code; a one-dimensional code is decoded based on the selected bars and spaces. The image of the one-dimensional code is taken through the image collector 31, and then the one-dimensional code in the image is located, namely the position of the one-dimensional code in the image is identified, and the part of the non-one-dimensional code is ignored. Positioning the one-dimensional code allows the one-dimensional code to be separated from the acquired image for further identification and analysis of the one-dimensional code.
In an embodiment, the processor 32 is specifically configured to perform the step of selecting bars and spaces of the one-dimensional code according to a preset method: classifying the bars and spaces according to their widths; respectively carrying out similarity matching on the bars and spaces of each type and the reference bars and reference spaces of the same type; and selecting bars with the similarity greater than or equal to a first preset threshold after the similarity matching, and selecting bars with the similarity greater than or equal to a second preset threshold.
In an embodiment, the processor 32 is specifically configured to perform the step of selecting bars and spaces of the one-dimensional code according to a preset method: matching similarity between the combination of the bars and the spaces in the one-dimensional code and the combination of the bars and the spaces corresponding to the reference characters, wherein the combination of the bars and the spaces in the one-dimensional code is a combination of the bars and the spaces which are continuously arranged; a combination of bars and spaces with a similarity greater than or equal to a third preset threshold is selected.
In an embodiment, the processor 32 is further configured to perform, before being configured to perform the selecting of the bars and spaces of the one-dimensional code according to a preset method: determining the type of the one-dimensional code; the widths of the reference bars and the reference spaces are determined according to the type of the one-dimensional code, or the reference characters are determined according to the type of the one-dimensional code.
In an embodiment, the processor 32, when being configured to perform the step of determining the type of one-dimensional code, is specifically configured to perform: judging whether the one-dimensional code is a fixed-length one-dimensional code; if the one-dimensional code is a fixed-length one-dimensional code, acquiring the length of the one-dimensional code, and determining the type of the one-dimensional code according to the length; if the one-dimensional code is a variable-length one-dimensional code, acquiring a start code of the one-dimensional code and the width of the one-dimensional code, and determining the type of the one-dimensional code according to the start code and the width.
In an embodiment, the processor 32 is specifically configured to perform the step of determining whether the one-dimensional code is a fixed-length one-dimensional code: acquiring a code system of the one-dimensional code; and judging whether the one-dimensional code is a fixed-length one-dimensional code or not according to the code system.
In one embodiment, the identification terminal further comprises a memory coupled to the processor 32, the memory storing data processed by the processor 32.
In order to realize the efficient decoding of the one-dimensional codes with different characteristics, the application also provides a one-dimensional code identification device.
In a specific implementation scenario, please refer to fig. 4, where fig. 4 is a schematic structural diagram of an embodiment of a one-dimensional code recognition apparatus according to the present application. The recognition device 40 includes: a positioning unit 41 for positioning the one-dimensional code; the acquisition unit 42 is in signal connection with the positioning unit 41, and is used for acquiring the total number of bars and spaces in the one-dimensional code according to the positioned one-dimensional code; the judging unit 43, the judging unit 43 is in signal connection with the acquiring unit 42, and is configured to receive the total number of the bars and the spaces acquired by the acquiring unit 42, and judge whether the total number of the bars and the spaces is greater than a preset value; the optimizing unit 44 is in signal connection with the judging unit 43, and is configured to select the bars and spaces of the one-dimensional code according to a preset method if the judging unit 43 judges that the total number of the bars and spaces is greater than a preset value, so as to reduce the total number of the bars and spaces of the one-dimensional code, and the selected bars and spaces are used for decoding the one-dimensional code; a decoding unit 45, the decoding unit 45 being in signal connection with the optimizing unit 44 for decoding the one-dimensional code according to the bars and spaces selected by the optimizing unit 44.
In a specific implementation scenario, please refer to fig. 5, fig. 5 is a schematic structural diagram of an embodiment of the optimization unit in fig. 4 of the present application, and the optimization unit 44 includes: a classification subunit 51 for classifying the bars and spaces according to their widths; a matching subunit 52, in which the matching subunit 52 is in signal connection with the classifying subunit 51, and is configured to perform similarity matching between the bars and spaces of each class and the reference bars and reference spaces of the same class according to the classification result of the classifying subunit 51; and the first selecting subunit 53, where the first selecting subunit 53 is in signal connection with the matching subunit 52, and is configured to select, according to the matching result of the matching subunit 52, a bar whose similarity is greater than or equal to a first preset threshold after the similarity matching, and a null whose similarity is greater than or equal to a second preset threshold.
In a specific implementation scenario, please refer to fig. 6, and fig. 6 is a schematic structural diagram of another embodiment of the optimization unit in fig. 4 according to the present application. The optimization unit 44 includes: a combination matching subunit 61, configured to perform similarity matching on the combination of bars and spaces in the one-dimensional code and the combination of bars and spaces corresponding to the reference character, where the combination of bars and spaces in the one-dimensional code is a combination of bars and spaces arranged consecutively; and the second selection subunit 62, the second selection subunit 62 being in signal connection with the combination matching subunit 61 and being configured to select, according to the matching result of the combination matching subunit 61, a combination of bars and spaces whose similarity is greater than or equal to a third preset threshold.
In a specific implementation scenario, please refer to fig. 7, and fig. 7 is a schematic structural diagram of another embodiment of a one-dimensional code recognition apparatus according to the present application. The recognition device 40 further comprises a determination unit 86, the determination unit 86 is in signal connection with the judgment unit 43 and the optimization unit 44, and the determination unit 86 comprises: a type determination subunit 861 for determining the type of the one-dimensional code; a reference quantity determining subunit 862 for determining widths of the reference bar and the reference space according to the type of the one-dimensional code, or determining the reference character according to the type of the one-dimensional code.
In a specific implementation scenario, please refer to fig. 8, and fig. 8 is a schematic structural diagram of an embodiment of the type-determining subunit of fig. 7 according to the present application. The type determination subunit 861 further includes: a fixed length judging module 72, configured to judge whether the one-dimensional code is a fixed length one-dimensional code; a first determining module 76, configured to obtain the length of the one-dimensional code if the one-dimensional code is a fixed-length one-dimensional code, and determine the type of the one-dimensional code according to the length; and a second determining module 74, configured to, if the one-dimensional code is a variable-length one-dimensional code, obtain a start code of the one-dimensional code and a width of the one-dimensional code, and determine a type of the one-dimensional code according to the start code and the width.
In a specific implementation scenario, please refer to fig. 8, and fig. 8 is a schematic structural diagram of an embodiment of the type-determining subunit in fig. 7. The fixed length determining module 72 further includes: a code system obtaining submodule 77 for obtaining a code system of the one-dimensional code; and the judging submodule 73 is in signal connection with the code system acquiring submodule 77, and the judging submodule 73 is configured to judge whether the one-dimensional code is the fixed-length one-dimensional code according to the code system acquired by the code system acquiring submodule 77.
In order to realize efficient decoding of one-dimensional codes with different characteristics, the application provides a device with a storage function, so as to realize the one-dimensional code identification method. In a specific implementation scenario, please refer to fig. 9, and fig. 9 is a schematic structural diagram of an embodiment of a device with a storage function according to the present application. The storage device 90 stores at least one program or instruction 901, and the program or instruction 901 is used to execute any one of the above-mentioned one-dimensional code recognition methods. In one embodiment, the apparatus having a storage function may be a storage device in a mobile device.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The beneficial effect of this embodiment is: different from the prior art, the one-dimensional code identification technical scheme provided by this embodiment can optimize the selection of the bars and spaces of the one-dimensional code by judging whether the total number of the bars and spaces is greater than a preset value, and exclude the one-dimensional code with lower similarity, so as to reduce the total number of the bars and spaces of the one-dimensional code, and improve the accuracy and speed of one-dimensional code identification, thereby realizing efficient decoding of different one-dimensional codes.
The above description is only for the purpose of illustrating embodiments of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application or are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (20)

  1. A one-dimensional code recognition method is characterized by comprising the following steps:
    positioning a one-dimensional code;
    acquiring the total number of bars and spaces in the one-dimensional code;
    judging whether the total number of the strips and the spaces is greater than a preset value;
    if the total number of the bars and the spaces is larger than the preset value, selecting the bars and the spaces of the one-dimensional code according to a preset method so as to reduce the total number of the bars and the spaces of the one-dimensional code, wherein the selected bars and the spaces are used for decoding the one-dimensional code;
    decoding the one-dimensional code according to the selected bars and spaces.
  2. The identification method according to claim 1, wherein the selecting the bars and spaces of the one-dimensional code according to a preset method comprises:
    classifying the bars and spaces according to their widths;
    respectively carrying out similarity matching on the bars and spaces of each type and reference bars and reference spaces of the same type;
    and selecting bars with the similarity greater than or equal to a first preset threshold after the similarity matching, and selecting bars with the similarity greater than or equal to a second preset threshold.
  3. The identification method according to claim 1, wherein the selecting the bars and spaces of the one-dimensional code according to a preset method comprises: performing similarity matching on the combination of the bars and the spaces in the one-dimensional code and the combination of the bars and the spaces corresponding to the reference characters, wherein the combination of the bars and the spaces in the one-dimensional code is a combination of the bars and the spaces which are continuously arranged;
    a combination of bars and spaces with a similarity greater than or equal to a third preset threshold is selected.
  4. The identification method according to any one of claims 1 to 3, wherein before the selecting the bars and spaces of the one-dimensional code according to a preset method, further comprises:
    determining the type of the one-dimensional code;
    and determining the widths of the reference bars and the reference spaces according to the type of the one-dimensional code or determining reference characters according to the type of the one-dimensional code.
  5. The method of claim 4, wherein the determining the type of the one-dimensional code comprises:
    judging whether the one-dimensional code is a fixed-length one-dimensional code;
    if the one-dimensional code is a fixed-length one-dimensional code, acquiring the length of the one-dimensional code, and determining the type of the one-dimensional code according to the length;
    if the one-dimensional code is a variable-length one-dimensional code, acquiring a start code of the one-dimensional code and the width of the one-dimensional code, and determining the type of the one-dimensional code according to the start code and the width.
  6. The identification method according to claim 5, wherein said determining whether the one-dimensional code is a fixed-length one-dimensional code comprises:
    acquiring a code system of the one-dimensional code;
    and judging whether the one-dimensional code is a fixed-length one-dimensional code or not according to the code system.
  7. A one-dimensional code recognition terminal, comprising: an image collector and a processor;
    the image collector is used for collecting the image of the one-dimensional code and sending the collected image of the one-dimensional code to the processor;
    the processor is coupled with the image collector and executes the following steps when executing a program:
    positioning the one-dimensional code according to the image;
    acquiring the total number of bars and spaces in the one-dimensional code;
    judging whether the total number of the strips and the spaces is greater than a preset value;
    if the total number of the bars and the spaces is larger than the preset value, selecting the bars and the spaces of the one-dimensional code according to a preset method so as to reduce the total number of the bars and the spaces of the one-dimensional code, wherein the selected bars and the spaces are used for decoding the one-dimensional code;
    decoding the one-dimensional code according to the selected bars and spaces.
  8. The terminal according to claim 7, wherein the processor, when configured to perform the step of selecting bars and spaces of the one-dimensional code according to a preset method, is specifically configured to perform:
    classifying the bars and spaces according to their widths;
    respectively carrying out similarity matching on the bars and spaces of each type and reference bars and reference spaces of the same type;
    and selecting bars with the similarity greater than or equal to a first preset threshold after the similarity matching, and selecting bars with the similarity greater than or equal to a second preset threshold.
  9. The terminal according to claim 7, wherein the processor, when configured to perform the step of selecting bars and spaces of the one-dimensional code according to a preset method, is specifically configured to perform:
    performing similarity matching on the combination of the bars and the spaces in the one-dimensional code and the combination of the bars and the spaces corresponding to the reference characters, wherein the combination of the bars and the spaces in the one-dimensional code is a combination of the bars and the spaces which are continuously arranged;
    a combination of bars and spaces with a similarity greater than or equal to a third preset threshold is selected.
  10. The terminal according to any of claims 7-9, wherein the processor, before being configured to perform the selecting the bars and spaces of the one-dimensional code according to a preset method, is further configured to perform:
    determining the type of the one-dimensional code;
    and determining the widths of the reference bar and the reference space according to the type of the one-dimensional code, or determining the reference character according to the type of the one-dimensional code.
  11. The terminal according to claim 10, wherein the processor, when being configured to perform the step of determining the type of the one-dimensional code, is specifically configured to perform:
    judging whether the one-dimensional code is a fixed-length one-dimensional code;
    if the one-dimensional code is a fixed-length one-dimensional code, acquiring the length of the one-dimensional code, and determining the type of the one-dimensional code according to the length;
    if the one-dimensional code is a variable-length one-dimensional code, acquiring a start code of the one-dimensional code and the width of the one-dimensional code, and determining the type of the one-dimensional code according to the start code and the width.
  12. The terminal according to claim 10, wherein the processor, when configured to execute the step of determining whether the one-dimensional code is a fixed-length one-dimensional code, is specifically configured to execute:
    acquiring a code system of the one-dimensional code;
    and judging whether the one-dimensional code is a fixed-length one-dimensional code or not according to the code system.
  13. The terminal of claim 7, wherein the identification terminal further comprises a memory coupled to the processor, the memory storing data processed by the processor.
  14. A one-dimensional code recognition apparatus, comprising:
    the positioning unit is used for positioning the one-dimensional code;
    the acquisition unit is in signal connection with the positioning unit and is used for acquiring the total number of bars and spaces in the one-dimensional code according to the positioned one-dimensional code;
    the judging unit is in signal connection with the acquiring unit and is used for receiving the total number of the bars and the spaces acquired by the acquiring unit and judging whether the total number of the bars and the spaces is greater than a preset value or not;
    the optimization unit is in signal connection with the judgment unit and is used for selecting the bars and the spaces of the one-dimensional code according to a preset method to reduce the total number of the bars and the spaces of the one-dimensional code if the judgment unit judges that the total number of the bars and the spaces is greater than the preset value, and the selected bars and the spaces are used for decoding the one-dimensional code;
    and the decoding unit is in signal connection with the optimization unit and is used for decoding the one-dimensional code according to the bars and the spaces selected by the optimization unit.
  15. The apparatus of claim 14, wherein the optimization unit comprises:
    a classification subunit, configured to classify the bars and spaces according to their widths;
    the matching subunit is in signal connection with the classification subunit and is used for respectively carrying out similarity matching on the bars and spaces of each class and the reference bars and reference spaces of the same class according to the classification result of the classification subunit;
    and the selection subunit is in signal connection with the matching subunit and is used for selecting the bar with the similarity larger than or equal to a first preset threshold value after the similarity matching and the blank with the similarity larger than or equal to a second preset threshold value according to the matching result of the matching subunit.
  16. An apparatus according to claim 14, characterized in that the optimization unit comprises:
    a combination matching subunit, configured to perform similarity matching on the combination of bars and spaces in the one-dimensional code and the combination of bars and spaces corresponding to the reference character, where the combination of bars and spaces in the one-dimensional code is a combination of bars and spaces arranged consecutively;
    and the second selection subunit is in signal connection with the combination matching subunit and is used for selecting the combination of bars and spaces with the similarity greater than or equal to a third preset threshold according to the matching result of the combination matching subunit.
  17. The apparatus according to any one of claims 14-16, further comprising a determining unit in signal connection with the determining unit and the optimizing unit, the determining unit comprising:
    a type determining subunit, configured to determine a type of the one-dimensional code;
    and the reference quantity determining subunit is used for determining the widths of the reference bar and the reference space according to the type of the one-dimensional code, or determining the reference character according to the type of the one-dimensional code.
  18. The apparatus according to any of the claims 17, wherein the type determination subunit further comprises:
    the fixed-length judging module is used for judging whether the one-dimensional code is a fixed-length one-dimensional code;
    the first determining module is used for acquiring the length of the one-dimensional code if the one-dimensional code is a fixed-length one-dimensional code, and determining the type of the one-dimensional code according to the length;
    and the second determining module is used for acquiring a start code of the one-dimensional code and the width of the one-dimensional code if the one-dimensional code is a variable-length one-dimensional code, and determining the type of the one-dimensional code according to the start code and the width.
  19. The apparatus of claim 18, wherein the fixed-length determining module further comprises:
    a code system obtaining submodule for obtaining a code system of the one-dimensional code;
    and the judgment submodule is in signal connection with the code system acquisition submodule and is used for judging whether the one-dimensional code is a fixed-length one-dimensional code according to the code system acquired by the code system acquisition submodule.
  20. An apparatus having a storage function, characterized in that program data are stored, which program data can be executed to implement the steps in the method according to any of claims 1-6.
CN201880088571.1A 2018-08-14 2018-08-14 One-dimensional code identification method, terminal, device and device with storage function Pending CN111801675A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/100516 WO2020034103A1 (en) 2018-08-14 2018-08-14 One-dimensional code recognition method, terminal and device, and device having storage function

Publications (1)

Publication Number Publication Date
CN111801675A true CN111801675A (en) 2020-10-20

Family

ID=69524948

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201880088571.1A Pending CN111801675A (en) 2018-08-14 2018-08-14 One-dimensional code identification method, terminal, device and device with storage function

Country Status (2)

Country Link
CN (1) CN111801675A (en)
WO (1) WO2020034103A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6062481A (en) * 1986-04-18 2000-05-16 Cias, Inc. Optimal error-detecting, error-correcting and other coding and processing, particularly for bar codes, and applications therefor such as counterfeit detection
US20070098443A1 (en) * 2005-11-01 2007-05-03 Aetas System Incorporated Positioning apparatus and method thereof
CN101882202A (en) * 2010-06-01 2010-11-10 福建新大陆电脑股份有限公司 Sign character extracting module and method
CN201946007U (en) * 2010-06-01 2011-08-24 福建新大陆电脑股份有限公司 Symbol and character extraction module
CN103632183A (en) * 2013-10-31 2014-03-12 季争鸣 Four-unit bar and blank crossed bar code and application of four-unit bar and blank crossed bar code
CN105894074A (en) * 2016-04-15 2016-08-24 大连声鹭科技有限公司 Anti-counterfeiting bar code label, anti-counterfeiting bar code label information acquisition device, acquisition method, and anti-counterfeiting verification system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101710381A (en) * 2009-12-28 2010-05-19 天津优尼莱博泰克电子科技发展有限公司 High-performance one-dimensional bar code decoding method
CN107016388B (en) * 2017-03-02 2019-11-15 浙江华睿科技有限公司 A kind of localization method and device in one-dimension code region
CN108009455B (en) * 2017-11-07 2019-04-30 深圳市华汉伟业科技有限公司 A kind of coding/decoding method and device of the scanning signal of bar code

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6062481A (en) * 1986-04-18 2000-05-16 Cias, Inc. Optimal error-detecting, error-correcting and other coding and processing, particularly for bar codes, and applications therefor such as counterfeit detection
US20070098443A1 (en) * 2005-11-01 2007-05-03 Aetas System Incorporated Positioning apparatus and method thereof
CN101882202A (en) * 2010-06-01 2010-11-10 福建新大陆电脑股份有限公司 Sign character extracting module and method
CN201946007U (en) * 2010-06-01 2011-08-24 福建新大陆电脑股份有限公司 Symbol and character extraction module
CN103632183A (en) * 2013-10-31 2014-03-12 季争鸣 Four-unit bar and blank crossed bar code and application of four-unit bar and blank crossed bar code
CN105894074A (en) * 2016-04-15 2016-08-24 大连声鹭科技有限公司 Anti-counterfeiting bar code label, anti-counterfeiting bar code label information acquisition device, acquisition method, and anti-counterfeiting verification system

Also Published As

Publication number Publication date
WO2020034103A1 (en) 2020-02-20

Similar Documents

Publication Publication Date Title
EP3493101B1 (en) Image recognition method, terminal, and nonvolatile storage medium
US8326037B1 (en) Methods and apparatus for locating an object in an image
CN101908136B (en) Table identifying and processing method and system
US10621470B2 (en) Methods for optical character recognition (OCR)
CN102236800B (en) The word identification of the text of experience OCR process
CN108229232B (en) Method and device for scanning two-dimensional codes in batch
CN111783495A (en) Bar code identification method and device, electronic equipment and storage medium
CN109508571B (en) Strip-space positioning method and device, electronic equipment and storage medium
CN118428382B (en) Bar code identification method, terminal and system
CN115578739A (en) Training method and device for realizing IA classification model by combining RPA and AI
CN113643274B (en) Method and device for screening two-dimensional code candidate areas
CN113283514B (en) Unknown class classification method, device and medium based on deep learning
CN116739022B (en) Decoding method and device for bar code image and electronic equipment
CN104217189A (en) Self-learning identification method of barcode used for test strip
CN109145879B (en) Method, equipment and storage medium for identifying printing font
CN101882201B (en) Barcode decoding chip and method
CN111652013B (en) Text filtering method, text filtering device, text filtering equipment and storage medium
CN111801675A (en) One-dimensional code identification method, terminal, device and device with storage function
Lin et al. Multi-symbology and multiple 1d/2d barcodes extraction framework
CN113743145B (en) Code acquisition system and method
CN116167394A (en) Bar code recognition method and system
CN109697382B (en) Linear bar code edge distortion processing method and equipment
JPS60153574A (en) Character reading system
RU2582064C1 (en) Methods and systems for effective automatic recognition of symbols using forest solutions
CN113610043A (en) Industrial drawing table structured recognition method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201020