CN117574930B - Method and device for generating three-dimensional bar code information, electronic equipment and readable medium - Google Patents

Method and device for generating three-dimensional bar code information, electronic equipment and readable medium Download PDF

Info

Publication number
CN117574930B
CN117574930B CN202410052300.8A CN202410052300A CN117574930B CN 117574930 B CN117574930 B CN 117574930B CN 202410052300 A CN202410052300 A CN 202410052300A CN 117574930 B CN117574930 B CN 117574930B
Authority
CN
China
Prior art keywords
bar code
uplink
laser line
code image
pixel
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.)
Active
Application number
CN202410052300.8A
Other languages
Chinese (zh)
Other versions
CN117574930A (en
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.)
Hangzhou Innovation Research Institute of Beihang University
Original Assignee
Hangzhou Innovation Research Institute of Beihang University
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 Hangzhou Innovation Research Institute of Beihang University filed Critical Hangzhou Innovation Research Institute of Beihang University
Priority to CN202410052300.8A priority Critical patent/CN117574930B/en
Publication of CN117574930A publication Critical patent/CN117574930A/en
Application granted granted Critical
Publication of CN117574930B publication Critical patent/CN117574930B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06K7/143Glyph-codes
    • 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
    • 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/146Methods for optical code recognition the method including quality enhancement steps

Abstract

The embodiment of the disclosure discloses a method, a device, an electronic device and a readable medium for generating stereoscopic bar code information. One embodiment of the method comprises the following steps: projecting a double-line parallel laser beam onto a target stereoscopic bar code pattern; image acquisition is carried out on the target three-dimensional bar code pattern; performing bar code image segmentation processing on the stereoscopic bar code image to generate an uplink bar code image and a downlink bar code image; carrying out laser line refinement treatment on the uplink bar code image; carrying out laser line refinement treatment on the downlink bar code image; performing straight line fitting treatment on the laser line refined uplink bar code pixel points; performing straight line fitting treatment on the laser line refined downlink bar code pixel points; generating an uplink pixel distance set; generating a downlink pixel distance set; combining the character strings to be decoded corresponding to the uplink bar code image with the character strings to be decoded corresponding to the downlink bar code image; generating stereoscopic bar code information. This embodiment improves the decoding accuracy of the bar code.

Description

Method and device for generating three-dimensional bar code information, electronic equipment and readable medium
Technical Field
Embodiments of the present disclosure relate to the field of cross-application of laser measurement technology in combination with barcode technology, and in particular, to a method, an apparatus, an electronic device, and a readable medium for generating stereoscopic barcode information.
Background
The bar code technology is an automatic recognition technology of bar patterns integrating computer, optics and signal processing, and is a rapid, accurate and reliable data acquisition means. The bottleneck problems of data input and data acquisition are effectively solved, and favorable technical support is provided for application such as logistics control, production process control, product quality tracking, unmanned retail and the like. Bar code technology has been widely studied and applied both at home and abroad. Currently, in generating barcode information, the following methods are generally adopted: firstly, a printed bar code label (usually arranged in series) is adhered to the surface of a material or printed on the surface of the material in series (one row), then, an image sensor on a scanning device is used for scanning (scanning one by one in series) one-dimensional bar codes, black and white bars and gaps of the bar codes reflect light with different intensities, the scanning device senses the reflected light signals and converts the reflected light signals into electric signals, and finally, a decoder converts the electric signals into corresponding bar code information by analyzing the width and the interval of the bars and the gaps.
However, when barcode information is generated in the above manner, there are often the following technical problems:
under the condition that high-contrast black-and-white alternate bar code labels are adhered to or printed on the surface of a material under the conventional (e.g. normal temperature) condition, the existing bar code scanner has higher working efficiency, and can meet most of scene requirements. In some application scenarios with complex conditions (such as high temperature, greasy dirt, multiple dust, etc.), the decoding accuracy of the bar code is low and the application range of the bar code is small due to the high damage of the complex environment to the bar code (high damage probability of the bar code label). Meanwhile, due to the limitation of the structure of the material (such as a cylindrical object structure), the bar codes are arranged on the surface of the material in a serial mode, so that the scanning field of scanning equipment is limited, the bar code area is not scanned fully, and the decoding accuracy of the bar codes is lower, namely, the generated bar code information has more error content or the bar code information cannot be identified.
The above information disclosed in this background section is only for enhancement of understanding of the background of the inventive concept and, therefore, may contain information that does not form the prior art that is already known to those of ordinary skill in the art in this country.
Disclosure of Invention
The disclosure is in part intended to introduce concepts in a simplified form that are further described below in the detailed description. The disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose a stereoscopic barcode information generation method, apparatus, electronic device, and computer readable medium to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a stereoscopic barcode information generation method, the method comprising: projecting the emitted double-line parallel laser beams onto a target stereoscopic bar code pattern by using an associated double-line parallel laser transmitter, wherein the target stereoscopic bar code on the target stereoscopic bar code pattern is in upper and lower two rows and is respectively projected by two laser beams of the double-line parallel laser beams at the same time; image acquisition is carried out on the target stereoscopic bar code pattern through associated image acquisition equipment, so that a stereoscopic bar code image is obtained; performing bar code image segmentation processing on the stereoscopic bar code image to generate an uplink bar code image and a downlink bar code image; performing laser line refinement treatment on the uplink bar code image to obtain an uplink bar code image subjected to laser line refinement treatment as a laser line refinement uplink bar code image; performing laser line refinement treatment on the downlink bar code image to obtain a downlink bar code image subjected to the laser line refinement treatment as a laser line refined downlink bar code image; performing straight line fitting treatment on each laser line refined uplink bar code pixel point meeting a preset threshold condition in the laser line refined uplink bar code image to generate an uplink fitting straight line; performing straight line fitting treatment on each laser line refined downlink bar code pixel point meeting a preset threshold condition in the laser line refined downlink bar code image to generate a downlink fitting straight line; refining an uplink bar code image and the uplink fitting straight line according to the laser line to generate an uplink pixel distance set; refining a downlink bar code image and the downlink fitting straight line according to the laser line to generate a downlink pixel distance set; generating a character string to be decoded corresponding to the uplink bar code image according to the uplink pixel distance set; generating a character string to be decoded corresponding to the downlink bar code image according to the downlink pixel distance set; combining the character strings to be decoded corresponding to the uplink bar code image and the character strings to be decoded corresponding to the downlink bar code image to generate a three-dimensional bar code character string to be decoded; and generating the stereoscopic bar code information according to the character string to be decoded of the stereoscopic bar code.
In a second aspect, some embodiments of the present disclosure provide a stereoscopic barcode information generation apparatus, the apparatus including: a projection unit configured to project the emitted two-line parallel laser beams onto a target stereoscopic barcode pattern using an associated two-line parallel laser emitter, wherein the target stereoscopic barcode on the target stereoscopic barcode pattern is in two upper and lower rows and is simultaneously projected by two laser beams of the two-line parallel laser beams, respectively; the image acquisition unit is configured to acquire images of the target stereoscopic bar code patterns through associated image acquisition equipment to obtain stereoscopic bar code images; a first division processing unit configured to perform a bar code image division process on the stereoscopic bar code image to generate an upstream bar code image and a downstream bar code image; the second segmentation processing unit is configured to perform laser line refinement processing on the uplink bar code image to obtain an uplink bar code image subjected to the laser line refinement processing as a laser line refined uplink bar code image; the third segmentation processing unit is configured to perform laser line refinement processing on the downlink bar code image to obtain a downlink bar code image subjected to the laser line refinement processing as a laser line refined downlink bar code image; the first fitting processing unit is configured to perform straight line fitting processing on each laser line refined uplink bar code pixel point meeting a preset threshold condition in the laser line refined uplink bar code image so as to generate an uplink fitting straight line; the second fitting processing unit is configured to perform straight line fitting processing on each laser line refined downlink bar code pixel point meeting a preset threshold condition in the laser line refined downlink bar code image so as to generate a downlink fitting straight line; the first generating unit is configured to refine the uplink bar code image and the uplink fitting straight line according to the laser line and generate an uplink pixel distance set; the second generating unit is configured to refine the downlink bar code image and the downlink fitting straight line according to the laser line and generate a downlink pixel distance set; a third generating unit configured to generate a character string to be decoded corresponding to the uplink barcode image according to the uplink pixel distance set; a fourth generating unit configured to generate a character string to be decoded corresponding to the downlink barcode image according to the downlink pixel distance set; the combination unit is configured to carry out combination processing on the character string to be decoded corresponding to the uplink bar code image and the character string to be decoded corresponding to the downlink bar code image so as to generate a three-dimensional bar code character string to be decoded; and a fifth generating unit configured to generate stereoscopic barcode information according to the stereoscopic barcode to-be-decoded character string.
In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors causes the one or more processors to implement the method described in any of the implementations of the first aspect above.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
The above embodiments of the present disclosure have the following advantages: by the method for generating the stereoscopic bar code information, which is disclosed by some embodiments, the decoding accuracy of the bar code can be improved. Specifically, the reason for the lower decoding accuracy of the bar code is that: under the condition that high-contrast black-and-white alternate bar code labels are adhered to or printed on the surface of a material under the conventional (e.g. normal temperature) condition, the existing bar code scanner has higher working efficiency, and can meet most of scene requirements. In some application scenarios with complex conditions (such as high temperature, greasy dirt, multiple dust, etc.), the decoding accuracy of the bar code is low and the application range of the bar code is small due to the fact that the damage of the complex environment to the bar code (the damage probability of the bar code label is high) is large. Meanwhile, due to the limitation of the structure of the material (such as a cylindrical object structure), the bar codes are arranged on the surface of the material in a serial mode, so that the scanning field of scanning equipment is limited, the bar code area is not scanned fully, and the decoding accuracy of the bar codes is lower, namely, the generated bar code information has more error content or the bar code information cannot be identified. Based on this, the stereoscopic barcode information generation method of some embodiments of the present disclosure first projects the emitted two-line parallel laser beam onto the target stereoscopic barcode pattern using the associated two-line parallel laser emitter. The target stereoscopic bar code on the target stereoscopic bar code pattern is in an upper row and a lower row, and is respectively projected by two laser beams of the double-line parallel laser beams. Thus, a double-line parallel laser beam can be projected onto the target stereoscopic barcode pattern, and thus can be used to collect 3D structural information of the barcode. And then, carrying out image acquisition on the target stereoscopic bar code pattern through the associated image acquisition equipment to obtain a stereoscopic bar code image. Thereby, a stereoscopic barcode image having 3D structure information can be obtained. And then, carrying out bar code image segmentation processing on the stereoscopic bar code image so as to generate an uplink bar code image and a downlink bar code image. Thus, by image-dividing the stereoscopic barcode image, an upstream barcode image and a downstream barcode image in which barcodes are arranged in parallel can be obtained. And thus can be used for parallel synchronous decoding of stereoscopic barcodes. And then, carrying out laser line thinning processing on the uplink bar code image to obtain an uplink bar code image subjected to laser line thinning processing as a laser line thinning uplink bar code image. Thus, a laser line refined uplink bar code image representing the binarized gray scale image can be obtained. Along with the laser line thinning processing is carried out on the downlink bar code image, the downlink bar code image after the laser line thinning processing is obtained and is used as the laser line thinning downlink bar code image. Thus, a laser line refined downlink bar code image representing the binarized gray level map can be obtained. And then, carrying out straight line fitting processing on each laser line refined uplink bar code pixel point meeting a preset threshold condition in the laser line refined uplink bar code image so as to generate an uplink fitting straight line. Therefore, an uplink fitting straight line can be obtained, and the method can be used for determining the brightness of the pixels in the laser line refined uplink bar code image. And secondly, performing straight line fitting processing on each laser line refined downlink bar code pixel point meeting a preset threshold condition in the laser line refined downlink bar code image so as to generate a downlink fitting straight line. Therefore, a downlink fitting straight line can be obtained, and the method can be used for determining the pixel brightness of the pixels in the laser line refinement downlink bar code image. And then, refining the uplink bar code image and the uplink fitting straight line according to the laser line to generate an uplink pixel distance set. Therefore, the uplink pixel distance set can be obtained, and the method can be used for distinguishing the corresponding pixel areas in the laser line refined uplink bar code image. And then, refining the downlink bar code image and the downlink fitting straight line according to the laser line to generate a downlink pixel distance set. Therefore, a downlink pixel distance set can be obtained, and the method can be used for distinguishing the corresponding pixel areas in the laser line refined downlink bar code image. And then, generating a character string to be decoded corresponding to the uplink bar code image according to the uplink pixel distance set. Therefore, the character string to be decoded corresponding to the uplink bar code image which can be identified by the machine can be obtained. And generating a character string to be decoded corresponding to the downlink bar code image according to the downlink pixel distance set. Therefore, the character string to be decoded corresponding to the downlink bar code image can be obtained. And then, combining the character string to be decoded corresponding to the uplink bar code image with the character string to be decoded corresponding to the downlink bar code image to generate a three-dimensional bar code character string to be decoded. Therefore, the character string to be decoded of the stereoscopic bar code which can be recognized by the machine after parallel synchronous decoding can be obtained. And finally, generating the stereoscopic bar code information according to the character string to be decoded of the stereoscopic bar code. Thus, stereoscopic barcode information recognizable to the user can be obtained. Thereby completing parallel decoding of the bar code. Also because the identified object is a three-dimensional bar code pattern, the damage of the complex environment to the bar code (the damage probability of the bar code label is smaller) can be reduced, and the decoding accuracy of the bar code can be improved. In addition, the three-dimensional bar codes are arranged on the surface of the material in a parallel mode, so that on one hand, the bar codes can be decoded in parallel, and the decoding speed is improved; on the other hand, the limitation of the structure of the material can be weakened, the scanning field of the scanning equipment (namely, the scanning area of the bar code) is increased, the decoding accuracy of the bar code is further improved, and the occurrence of the conditions that the error content of the generated bar code information or the bar code information cannot be identified is reduced.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a flow chart of some embodiments of a stereoscopic barcode information generation method according to the present disclosure;
FIG. 2 is a target stereoscopic barcode engraved on a target stereoscopic barcode pattern according to the present disclosure;
FIG. 3 is a stereoscopic barcode image with 3D structural information captured based on an image capture device according to the present disclosure;
FIG. 4 is a laser line refined bar code image (including laser line refined up-going and down-going bar code images) obtained after laser line refinement processing in accordance with the present disclosure;
FIG. 5 is a schematic structural view of some embodiments of a stereoscopic barcode information generation apparatus according to the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates a flow 100 of some embodiments of a stereoscopic barcode information generation method according to the present disclosure. The method for generating the stereoscopic bar code information comprises the following steps:
Step 101, projecting the emitted double-line parallel laser beams onto the target stereoscopic barcode pattern using the associated double-line parallel laser transmitters.
In some embodiments, an executing subject (e.g., computing device) of the stereoscopic barcode information generation method may utilize an associated two-line parallel laser transmitter to project the emitted two-line parallel laser beams onto a target stereoscopic barcode pattern. The target stereoscopic bar code on the target stereoscopic bar code pattern is in an upper row and a lower row, and is respectively projected by two laser beams of the double-line parallel laser beams. As an example, the target stereoscopic barcode on the target stereoscopic barcode pattern described above may be as shown with reference to fig. 2. The associated dual line parallel laser emitters may be laser emitters capable of emitting dual line parallel laser lines. The target stereoscopic barcode pattern may be a 3D barcode pattern engraved on the surface of the target object. The target object is not particularly limited herein. For example, the target object may be a hub of a high-speed railway vehicle. The 3D barcode on the 3D barcode pattern may include: bar code bar height, bar code bar width, and bar code bar depth. For example, the bar code bar height may be 10 millimeters. The bar code may have a bar width of 0.8 mm. The bar code may have a bar depth of 1 mm.
Further, in the process of solving the above technical problems by adopting the technical solution, the inventor finds that the diversity requirement of users on the decoding modes of the bar code (different decoding modes are needed to be decoded by different encoding modes) is high. The conventional technical scheme for meeting the requirement of users on the diversity of the bar code decoding modes is to increase the variety of bar code scanning equipment (one coding and decoding mode corresponds to one scanning equipment). However, this approach is prone to waste of bar code scanning device resources. Therefore, the inventor considers the requirement of users for the diversity of the bar code decoding modes and the requirement of reducing the waste of the bar code scanning equipment resources, decides to set the encoding and decoding modes of the bar codes to be of an indefinite length structure so as to achieve the identification of bar codes with various length requirements, improve the compatibility of the bar code scanning equipment, meet the requirement of users for the diversity of the bar code decoding modes and reduce the waste of the bar code scanning equipment resources.
In some alternative implementations of some embodiments, the target stereoscopic barcode pattern described above may be generated by:
first, obtaining a character string to be encoded. In practice, the executing body may acquire the character string to be encoded from the information database to be encoded. The character string to be encoded may be a character string waiting to be encoded to form a bar code. For example, the character string to be encoded may be ABCD1234ABCD. The information database to be encoded may be an information database storing character strings to be encoded.
And secondly, determining the effective data character quantity information corresponding to the character string to be encoded. In practice, the execution body may determine the number of characters to be encoded included in the character string to be encoded as valid data character number information.
And thirdly, carrying out upward rounding processing on one half of the effective data character quantity information to obtain uplink effective data character quantity information. In practice, the execution body may perform the upward rounding process on one half of the valid data character number information, to obtain valid data character number information after the upward rounding process as uplink valid data character number information.
And step four, determining the absolute value of the difference between the effective data character quantity information and the uplink effective data character quantity information as downlink effective data character quantity information.
And fifthly, determining each character to be encoded, which corresponds to the character number information of the uplink valid data and meets the preset uplink position condition, in the character string to be encoded as an uplink character string to be encoded. The preset uplink position condition may be that a position number of the character to be encoded in the character string to be encoded is less than or equal to the uplink valid data character number information. The position number is the number of the position of the character to be coded in the character string to be coded. For example, the character string to be encoded may be ABCD1234ABCD. The position number of the character a to be encoded may be 1.
And sixthly, determining each character to be encoded, which corresponds to the character quantity information of the downlink effective data and meets the preset downlink position condition, in the character string to be encoded as a downlink character string to be encoded. The preset downlink position condition may be that the position number of the character to be encoded in the character string to be encoded is greater than the number of the uplink valid data characters.
And seventh, determining an uplink character information set to be encoded corresponding to the character string to be encoded according to the uplink character string to be encoded and a preset character set. In practice, first, for each uplink character to be encoded in the uplink character string, the execution body may determine, as uplink character information to be encoded, a subscript of a preset character corresponding to the uplink character to be encoded in a preset character set, and then may determine, as an uplink character information set, each determined uplink character information to be encoded. The preset character set may be a preset character set. Here, the predetermined character set may be {0,1,2,3,4,5,6,7,8,9, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z }. The upstream to-be-encoded string may be ABCD12. The set of uplink character information to be encoded corresponding to the uplink character string to be encoded may be {37, 38, 39, 40,2,3}.
And eighth step, determining a downlink character information set to be encoded corresponding to the character string to be encoded according to the downlink character string to be encoded and the preset character set. In practice, first, for each downlink character to be encoded in the downlink character string, the execution body may determine, as downlink character information, a subscript of a preset character in a preset character set corresponding to the downlink character to be encoded, and then may determine, as a downlink character information set, each determined downlink character information to be encoded. The downlink character string to be encoded may be 34abcd. The downlink character information set corresponding to the downlink character string to be encoded may be {4,5, 11, 12, 13, 14}.
And a ninth step of performing binary conversion processing on each piece of uplink character information to be encoded included in the uplink character information set to obtain each piece of uplink character information to be encoded after binary conversion processing as a binary uplink character information set to be encoded.
And tenth, performing binary conversion processing on each piece of downlink character information to be coded included in the downlink character information set to obtain each piece of downlink character information to be coded after binary conversion processing as a binary downlink character information set to be coded.
Eleventh, binary encoding is carried out on the effective data character quantity information, and the effective data character quantity information after binary encoding is obtained and is used as binary effective data character information.
And twelfth, determining check bit sum information corresponding to the character information set to be encoded according to the character information set to be encoded. In practice, first, for each character information to be encoded in the set of character information to be encoded, the execution body may determine the square of the character information to be encoded as the first character information to be encoded. Then, the sum of the determined respective first character information to be encoded may be determined as check bit sum information. For example, the set of character information to be encoded may be {37, 38, 39, 40,2,3,4,5, 11, 12, 13, 14}. The checksum information may be 6618.
Thirteenth step, generating check information according to the check bit sum information and a preset check threshold. The preset verification threshold may be a preset verification threshold. Here, the preset verification threshold may be 256. In practice, the execution body may determine the remainder of the checksum information and the preset checksum threshold as the checksum information. Here, the checksum information may be a dividend. The preset verification threshold may be a divisor.
And fourteenth step, performing binary conversion processing on the check information according to a preset check bit threshold value to obtain the check information after binary conversion processing as binary check information. The preset check bit threshold may be a preset check bit threshold. Here, the preset check bit threshold may be 8. In practice, the execution body may convert the verification information into binary information corresponding to the preset threshold number of the verification bits, and obtain the verification information after the binary conversion processing as binary verification information. For example, the verification information may be 218. The binary check information may be 11011010.
Fifteenth, generating an uplink bar code coding information set according to preset starting character information, the binary effective data character information and the two uplink character information sets to be coded. In practice, the execution body may perform a combination process on the preset start character information, the binary valid data character information, and the two uplink character information sets to be encoded, so as to generate an uplink barcode encoding information set. Here, the manner of the combining process may be splicing. The splicing sequence can be { preset beginning character information + binary effective data character information + two uplink character information sets to be encoded }.
Sixteenth, generating a downlink bar code coding information set according to the binary downlink character information set to be coded and the binary verification information. In practice, the execution body may perform a combination process on the binary downlink character information set to be encoded and the binary verification information to generate a downlink barcode encoding information set. Here, the manner of the combining process may be splicing. The concatenation order may be { binary downlink character information set to be encoded+binary check information }.
Seventeenth, for each piece of uplink barcode coded information in the uplink barcode coded information set, performing the steps of:
and a first sub-step, responding to the fact that the uplink bar code coding information meets the preset character condition, taking a preset height threshold value as the bar code height, taking a preset width threshold value as the bar code width and taking a preset depth threshold value as the bar code bar depth, and carrying out laser engraving processing on a bar area corresponding to the uplink bar code coding information by using the associated laser engraving equipment. The strip-shaped area is a blank strip-shaped area on the surface of the target object. Here, the preset character condition may be that the uplink barcode encoding information is equal to the first preset character. The first preset character may be 0. The preset height threshold may be a preset height threshold. Here, the preset height threshold may be 20 mm. The preset width threshold may be a preset width threshold. Here, the preset width threshold may be 0.8 mm. The preset depth threshold may be a preset depth. Here, the preset depth threshold may be 1 millimeter. The above-described associated laser engraving apparatus may be an apparatus capable of performing laser engraving on the surface of the target object. For example, the above-described associated laser engraving device may be a laser marking machine.
And a second sub-step of performing area white processing on a bar area corresponding to the uplink bar code coding information by taking the preset height threshold value as the bar code height and the preset width threshold value as the bar code width in response to determining that the uplink bar code coding information does not meet the preset character condition. Here, the area-blank processing may be performed on the bar-shaped area corresponding to the binary bar-code encoded information by adjusting the power of the laser of the associated laser engraving apparatus (reducing the laser power) or turning off the laser.
Eighteenth, for each piece of downstream barcode coded information in the set of downstream barcode coded information, performing the steps of:
and a first sub-step, responding to the fact that the downlink bar code coding information meets the preset character condition, taking a preset height threshold value as the bar code height, taking a preset width threshold value as the bar code width and taking a preset depth threshold value as the bar code bar depth, and carrying out laser engraving processing on a bar area corresponding to the downlink bar code coding information by using an associated laser engraving device.
And a second sub-step of performing area white processing on a bar area corresponding to the downlink bar code coding information by taking the preset height threshold value as the bar code height and the preset width threshold value as the bar code width in response to determining that the downlink bar code coding information does not meet the preset character condition.
Nineteenth, shooting each bar-shaped area subjected to laser engraving processing and each bar-shaped area subjected to area white processing by using an associated image acquisition device, and obtaining a bar-code image as a stereoscopic bar-code image.
And twenty-step, determining the patterns which are displayed in the stereoscopic bar code image and correspond to the bar areas subjected to the laser engraving treatment and the bar areas subjected to the area blank treatment as target stereoscopic bar code patterns. Here, the pattern corresponding to each of the stripe-shaped regions after the laser engraving process and each of the stripe-shaped regions after the region-leaving process may be a pattern formed by splicing together each of the stripe-shaped regions after the laser engraving process and each of the stripe-shaped regions after the region-leaving process.
The first to twentieth steps and related matters are taken as an invention point of the embodiments of the disclosure, which solves the technical problems that the variety of the barcode scanning device is increased, thereby wasting resources of the barcode scanning device, and the diversity requirement of users on the barcode decoding modes (different decoding modes are needed to be decoded by different encoding modes) cannot be better met. The factors that cause the waste of bar code scanning equipment resources and can not better satisfy the requirement of users for the diversity of bar code decoding modes often are as follows: different coding modes need to be decoded by different decoding modes, and in order to decode the bar codes with different coding length requirements, different kinds of bar code scanning equipment needs to be added, so that the waste of bar code scanning equipment resources is caused, and the diversity requirements of users on the bar code decoding modes can not be well met. If the factors are solved, the effects of reducing the types of the bar code scanning equipment, reducing the waste of the bar code scanning equipment resources and simultaneously better meeting the diversity requirements of users on the bar code decoding modes can be achieved. In order to achieve the effect, the encoding and decoding structure of the bar code is set to be a structure with an indefinite length and applicable to various bar code length requirements, namely, a structure of 'start characters (preset start character information) +number of effective data characters (binary effective data character information) +bar code data (binary to-be-encoded character information set+binary to-be-encoded character information set) +check bits (binary check information)' is adopted, so that the bar codes with various length requirements can be identified, the compatibility of bar code scanning equipment is improved, the requirement of users on the diversity of bar code decoding modes is met, and the waste of bar code scanning equipment resources is reduced.
And 102, performing image acquisition on the target stereoscopic bar code pattern through the associated image acquisition equipment to obtain a stereoscopic bar code image.
In some embodiments, the executing body may perform image acquisition on the target stereoscopic barcode pattern through an associated image acquisition device to obtain a stereoscopic barcode image. The associated image capturing device may be a device capable of capturing an image of a barcode pattern. For example, the associated image capture device may be an industrial camera. The stereoscopic barcode image may be a barcode image having 3D structure information. As an example, the stereoscopic barcode image described above may refer to fig. 3. The 3D structure information may include structure information of bar code bar height, bar code bar width, and bar code bar depth. In practice, the execution body may perform image acquisition on the target stereoscopic barcode pattern by using a wired connection manner or a wireless connection manner through an associated image acquisition device, so as to obtain a stereoscopic barcode image.
And 103, performing bar code image segmentation processing on the stereoscopic bar code image to generate an uplink bar code image and a downlink bar code image.
In some embodiments, the execution body may perform a barcode image segmentation process on the stereoscopic barcode image to generate an upstream barcode image and a downstream barcode image.
In some optional implementations of some embodiments, the executing entity may perform a barcode image segmentation process on the stereoscopic barcode image to generate an upstream barcode image and a downstream barcode image by:
and a first step of determining an image inclination angle corresponding to the stereoscopic bar code image according to the stereoscopic bar code image. In practice, the execution subject may determine the image inclination angle corresponding to the stereoscopic barcode image using a principal component analysis algorithm.
And secondly, performing image rotation processing on the stereoscopic bar code image according to the image inclination angle to obtain the stereoscopic bar code image after the image rotation processing as a rotated bar code image. In practice, the execution body may perform image rotation processing corresponding to the image inclination angle on the stereoscopic barcode image in a clockwise direction, to obtain the stereoscopic barcode image after the image rotation processing as a rotated barcode image.
And thirdly, carrying out graying treatment on the rotary bar code image to obtain a rotary bar code image after graying treatment as a gray bar code image.
And fourthly, carrying out histogram projection processing on the gray bar code image according to the horizontal direction to obtain a one-dimensional brightness histogram. Wherein the brightness in the one-dimensional brightness histogram represents the brightness distribution of the gray-scale bar code image in the horizontal direction. It can be understood that the one-dimensional luminance in the one-dimensional luminance histogram is the same as the sum of the respective gray values corresponding to the respective gray barcode pixels located in the same line in the gray barcode image.
And fifthly, determining two pixel points with maximum brightness in the one-dimensional brightness histogram as a target point group.
And sixthly, determining two gray scale bar code pixel horizontal lines corresponding to the target point group in the gray scale bar code image as a target laser line group. The target laser line group comprises an uplink target laser line and a downlink target laser line, and the distance from the uplink target laser line to the upper boundary of the gray scale bar code image is smaller than the distance from the downlink target laser line to the upper boundary of the gray scale bar code image. The pixel horizontal line may be a pixel horizontal line formed by each gray-scale bar code pixel located in the same line in the gray-scale bar code image.
And seventhly, taking the uplink target laser line as a center, taking a preset height threshold value as a segmentation height, and performing upper and lower image segmentation processing on the gray scale bar code image to obtain a gray scale bar code image after the upper and lower image segmentation processing as an uplink bar code image. The preset height threshold may be a preset height threshold. Here, the preset height threshold may be 100 pixels.
And eighth, taking the downlink target laser line as a center, taking the preset height threshold value as a segmentation height, and performing upper and lower image segmentation processing on the gray scale bar code image to obtain a gray scale bar code image after the upper and lower image segmentation processing as a downlink bar code image.
And 104, performing laser line thinning processing on the uplink bar code image to obtain the uplink bar code image subjected to the laser line thinning processing as a laser line thinned uplink bar code image.
In some embodiments, the execution body may perform laser line refinement on the uplink barcode image, so as to obtain the uplink barcode image after the laser line refinement as the laser line refinement uplink barcode image.
In some optional implementations of some embodiments, the executing body may perform laser line refinement processing on the uplink barcode image by using the uplink barcode image after the laser line refinement processing as a laser line refined uplink barcode image:
The first step, according to a preset gray threshold, binarizing the uplink bar code image to obtain a binarized uplink bar code image serving as a binarized uplink bar code image. The preset gray threshold may be a preset gray threshold. Here, the preset gray threshold may be 64. In practice, first, for each pixel in the uplink barcode image, in response to the gray value corresponding to the pixel being greater than a preset gray threshold, the executing body may update the gray value corresponding to the pixel to a first preset gray threshold. Then, in response to the gray value corresponding to the pixel point being smaller than the preset gray threshold, the executing body may update the gray value corresponding to the pixel point to a second preset gray threshold. And finally, determining the image formed by each pixel point after gray value updating as a binarized uplink bar code image. The first preset gray threshold may be a preset threshold. The second preset gray threshold may be a preset threshold. Here, the first preset gray-scale threshold may be a preset threshold value of 255. The second preset gray threshold may be 0.
And a second step of filtering the binarized uplink bar code image to obtain a binarized uplink bar code image after filtering as a filtered uplink bar code image. In practice, the executing body may perform filtering processing on the binarized uplink barcode image by using a median filter of 3*3, so as to obtain a binarized uplink barcode image after the filtering processing as a filtered uplink barcode image.
Third, for each column of the filtered upstream bar code pixel sequence in the filtered upstream bar code image, the following updating steps are executed:
and a first updating step, namely determining a laser line starting point and a laser line ending point corresponding to the filtered uplink bar code pixel point sequence. In practice, first, the executing body may scan the filter uplink barcode pixels in the filter uplink barcode pixel sequence in order from top to bottom, and determine the first scanned filter uplink barcode pixel in the filter uplink barcode pixel sequence with a gray value of 255 as a laser line starting point. Then, the scanning is sequentially carried out, and the pixel point of the filtered uplink bar code with the gray value of 0 scanned for the first time is determined as the ending point of the laser line.
And a second updating step, namely determining laser line center coordinate information corresponding to the filter uplink bar code pixel point sequence according to the laser line starting point and the laser line ending point corresponding to the filter uplink bar code pixel point sequence. In practice, the execution body may determine the laser line center coordinate information by the following formula:
wherein, the aboveRepresenting laser line center coordinate information. Above->And the ordinate information corresponding to the laser line center coordinate information is represented. Here, the coordinates of the starting point of the laser line may be expressed as +.>. The coordinates of the above-mentioned laser line termination point can be expressed as +.>. Above->And the abscissa information corresponding to the laser line center coordinate information is represented. May also be expressed as the abscissa of the laser line start point and the abscissa of the laser line end point. Above->The ordinate of the starting point of the laser line may be represented. Above->The ordinate of the laser line termination point may be represented. Above->Representing the ordinate variable. Above->Representing the filtered upstream bar code pixels in the filtered upstream bar code image. Above->Representing the ordinate of the filtered up-link bar code pixel points. Above->And represents the abscissa of the filtered upstream bar code pixel.
And a second updating step, namely updating the pixel value of the pixel point corresponding to the laser line center coordinate information into a first pixel threshold value. Here, the first pixel threshold may be 255.
And a third updating step, namely updating the pixel value of each pixel point except the pixel point corresponding to the laser line center coordinate information in the filtering uplink bar code pixel point sequence into a second pixel threshold value. Wherein the second pixel threshold is smaller than the first pixel threshold. The second pixel threshold may be 0.
And fourthly, determining the bar code image formed by the pixel point sequence of the filtering uplink bar code of each column after updating the pixel value as the laser line refined uplink bar code image. As an example, the laser line refined uplink barcode image described above may refer to fig. 4. Thus, by performing the thinning process on the laser line, the fitting effect of the straight line can be further improved.
And 105, performing laser line thinning processing on the downlink bar code image to obtain the downlink bar code image subjected to the laser line thinning processing as a laser line thinning downlink bar code image.
In some embodiments, the executing body may perform laser line refinement on the downstream barcode image, so as to obtain a downstream barcode image after the laser line refinement as a laser line refined downstream barcode image.
In some optional implementations of some embodiments, the executing body may perform laser line refinement on the downstream barcode image by performing the following steps to obtain a downstream barcode image after the laser line refinement as a laser line refined downstream barcode image:
The first step, according to the preset gray threshold, binarizing the downlink bar code image to obtain a binarized downlink bar code image serving as a binarized downlink bar code image. In practice, first, for each pixel in the downlink barcode image, in response to the gray value corresponding to the pixel being greater than a preset gray threshold, the execution body may update the gray value corresponding to the pixel to a first preset gray threshold. Then, in response to the gray value corresponding to the pixel point being smaller than the preset gray threshold, the executing body updates the gray value corresponding to the pixel point to a second preset gray threshold. And finally, determining the image formed by each pixel point after gray value updating as a binarized downlink bar code image.
And secondly, filtering the binarized downlink bar code image to obtain a binarized downlink bar code image after filtering as a filtered downlink bar code image. In practice, the executing body may perform filtering processing on the binarized downstream bar code image by using a median filter of 3*3, so as to obtain a binarized downstream bar code image after the filtering processing as a filtered downstream bar code image.
Third, for each column of the filtered downstream barcode pixel sequences in the filtered downstream barcode image, the following updating steps are executed:
and a first updating step, namely determining a laser line starting point and a laser line ending point corresponding to the filtered downlink bar code pixel point sequence. In practice, the manner of determining the laser line start point and the laser line end point corresponding to the filter downlink barcode pixel point sequence by the execution body is the same as the manner of determining the laser line start point and the laser line end point corresponding to the filter uplink barcode pixel point sequence, and will not be described herein.
And a second updating step, namely determining laser line center coordinate information corresponding to the filter downlink bar code pixel point sequence according to the laser line starting point and the laser line ending point corresponding to the filter downlink bar code pixel point sequence. In practice, the manner of determining the laser line center coordinate information corresponding to the filter downlink barcode pixel point sequence by the execution body is the same as the manner of determining the laser line center coordinate information corresponding to the filter uplink barcode pixel point sequence, and is not described herein.
And a third updating step, namely updating the pixel value of the pixel point corresponding to the laser line center coordinate information into a first pixel threshold value.
And a fourth updating step, namely updating the pixel value of each pixel point except the pixel point corresponding to the laser line center coordinate information in the filtering downlink bar code pixel point sequence into a second pixel threshold value.
And fourthly, determining the bar code image formed by the pixel point sequence of the filtering downlink bar code of each column after updating the pixel value as a laser line refined downlink bar code image. As an example, the above-described laser line refined downstream bar code image may be referred to in fig. 4. Thus, by performing the thinning process on the laser line, the fitting effect of the straight line can be further improved.
And 106, performing straight line fitting processing on each laser line refined uplink bar code pixel point meeting a preset threshold condition in the laser line refined uplink bar code image to generate an uplink fitting straight line.
In some embodiments, the executing body may perform a line fitting process on each laser line refined uplink barcode pixel point in the laser line refined uplink barcode image that meets a preset threshold condition, so as to generate an uplink fitting line. The uplink fitting straight line can represent the linear relation of each laser line refinement uplink bar code pixel point meeting a preset threshold condition in the laser line refinement uplink bar code image. The preset threshold condition may be that a pixel value of the pixel point of the laser line refinement uplink bar code is equal to a first preset pixel threshold. Here, the first preset pixel threshold may be 255. In practice, first, the executing body may perform a straight line fitting process on each laser line refined uplink barcode pixel point in the laser line refined uplink barcode image, where the laser line refined uplink barcode pixel point meets a preset threshold condition, by using a least square algorithm, so as to obtain a straight line after the fitting process as a gray level fitting straight line.
And 107, performing straight line fitting processing on each laser line refined downlink bar code pixel point meeting a preset threshold condition in the laser line refined downlink bar code image to generate a downlink fitting straight line.
In some embodiments, the executing body may perform a straight line fitting process on each laser line refined downlink barcode pixel point in the laser line refined downlink barcode image that meets a preset threshold condition, so as to generate a downlink fitting straight line. The downlink fitting straight line can represent the linear relation of each laser line refinement downlink bar code pixel point meeting a preset threshold condition in the laser line refinement downlink bar code image. The preset threshold condition may be that a pixel value of a pixel point of the laser line refinement downlink barcode is equal to a first preset pixel threshold. Here, the first preset pixel threshold may be 255. In practice, first, the executing body may perform a straight line fitting process on each laser line refined downlink barcode pixel point in the laser line refined downlink barcode image, where the laser line refined downlink barcode pixel point meets a preset threshold condition, by using a least square algorithm, so as to obtain a straight line after the fitting process as a downlink fitting straight line.
And step 108, refining the uplink bar code image and the uplink fitting straight line according to the laser line, and generating an uplink pixel distance set.
In some embodiments, the execution body may generate the upstream pixel distance set according to the laser line refinement upstream bar code image and the upstream fitting line.
In some optional implementations of some embodiments, the performing body may generate the upstream pixel distance set by refining the upstream barcode image and the upstream fitting line according to the laser line by:
and a first step of determining the distance between each laser line refinement uplink bar code pixel point in the laser line refinement uplink bar code image and the uplink fitting straight line as the uplink pixel distance. In practice, the executing body may determine, by using a point-to-line distance formula, a distance between a laser line refined uplink barcode pixel point and the uplink fitting line as an uplink pixel distance.
And a second step of determining each determined upstream pixel distance as an upstream pixel distance set.
And step 109, refining the downlink bar code image and the downlink fitting straight line according to the laser line, and generating a downlink pixel distance set.
In some embodiments, the executing entity may generate a downstream set of pixel distances based on the laser line refinement downstream barcode image and the downstream fit line. In practice, according to the above-mentioned laser line refines the bar code image of descending and above-mentioned descending fit straight line, the above-mentioned execution main body can produce the downstream pixel distance set through the following steps:
and determining the distance between each laser line refinement downlink bar code pixel point in the laser line refinement downlink bar code image and the downlink fitting straight line as a downlink pixel distance. In practice, the executing body may determine, by using a point-to-line distance formula, a distance between a laser line refined downlink barcode pixel point and the downlink fitting line as a downlink pixel distance.
And a second step of determining each determined downstream pixel distance as a downstream pixel distance set.
And 110, generating a character string to be decoded corresponding to the uplink bar code image according to the uplink pixel distance set.
In some embodiments, according to the set of upstream pixel distances, the executing entity may generate a character string to be decoded corresponding to the upstream barcode image.
In some optional implementations of some embodiments, according to the set of upstream pixel distances, the executing entity may generate the to-be-decoded character string corresponding to the upstream barcode image by:
the first step, for each upstream pixel distance in the upstream pixel distance set, performs the following steps:
and a first sub-step of determining an upstream pixel region corresponding to the upstream pixel distance according to the upstream pixel distance. In practice, first, the execution body may determine the laser line refinement uplink barcode pixel point corresponding to the uplink pixel distance as the uplink pixel point. Then, the area corresponding to the upstream pixel point may be determined as the upstream pixel area.
And a second sub-step of determining the upstream pixel region as a first preset character region in response to determining that the upstream pixel distance satisfies a preset pixel distance condition. The first preset character area is a stereoscopic image area engraved by the laser engraving equipment. The preset pixel distance condition may be that the uplink pixel distance is greater than the first preset pixel distance and less than the second preset pixel distance. Here, the first preset pixel distance may be a preset pixel distance. For example, the first preset pixel distance may be 6. The second preset pixel distance may be a preset pixel distance. For example, the second preset pixel distance may be 20. Here, the first preset character region may be a region in which a character is 0 in the binary-coded character. In practice, in response to determining that the upstream pixel distance satisfies a preset pixel distance condition, the execution body may determine the upstream pixel region as a first preset character region.
And a third sub-step of determining the upstream pixel region as a second preset character region in response to determining that the upstream pixel distance does not satisfy the preset pixel distance condition. The second preset character area is a blank area which is not engraved by the laser engraving equipment. Here, the second preset character area may be an area with a character of 1 in the binary coded character. In practice, in response to determining that the upstream pixel distance does not satisfy the preset pixel distance condition, the execution body may determine the upstream pixel region as a second preset character region.
And a second step of determining a character string to be decoded corresponding to the uplink bar code image according to the determined first preset character areas and the determined second preset character areas. In practice, according to the determined first preset character areas and the determined second preset character areas, the execution body may determine the character string to be decoded corresponding to the uplink barcode image by:
and a first step of determining, as first characters, characters corresponding to the first preset character areas for each of the first preset character areas. Here, the first character may be 0.
And a second step of carrying out sorting processing on each determined first character to obtain each first character after sorting processing as a first character string. In practice, the execution body may perform the sorting process on each first character according to the positional relationship of each laser line refinement uplink barcode pixel point corresponding to each first character, so as to obtain each first character after the sorting process as a first character string.
And a third step of determining, for each of the second preset character areas, a character corresponding to the second preset character area as a second character. Here, the second character may be 1.
And a fourth step of performing sorting processing on the determined second characters to obtain sorted second characters serving as second character strings. In practice, the executing body may perform sorting processing on each second character according to the positional relationship of each laser line refinement uplink barcode pixel point corresponding to each second character, so as to obtain each second character after sorting processing as a second character string.
And fifthly, sequencing the first character string and the second character string to generate character strings to be decoded corresponding to the uplink bar code image. In practice, the execution body may refine the position relationship of the uplink barcode pixel points according to the laser lines corresponding to the first character string and the second character string, and perform sorting processing on the first character string and the second character string, so as to obtain a character string to be decoded corresponding to the uplink barcode image.
And step 111, generating a character string to be decoded corresponding to the downlink bar code image according to the downlink pixel distance set.
In some embodiments, according to the set of downlink pixel distances, the executing entity may generate a character string to be decoded corresponding to the downlink barcode image.
In some optional implementations of some embodiments, according to the set of downstream pixel distances, the executing entity may generate the character string to be decoded corresponding to the downstream barcode image by:
the first step, for each downlink pixel distance in the downlink pixel distance set, performs the following steps:
and a first sub-step of determining a downlink pixel region corresponding to the downlink pixel distance according to the downlink pixel distance. First, the execution body may determine the laser line refinement downlink barcode pixel point corresponding to the downlink pixel distance as a downlink pixel point. Then, the area corresponding to the downstream pixel point may be determined as a downstream pixel area.
And a second sub-step of determining the downstream pixel region as a third preset character region in response to determining that the downstream pixel distance satisfies the preset pixel distance condition. The third preset character area is a stereoscopic image area engraved by the laser engraving equipment. The preset pixel distance condition may be that the downlink pixel distance is greater than the first preset pixel distance and less than the second preset pixel distance. Here, the first preset pixel distance may be a preset pixel distance. For example, the first preset pixel distance may be 6. The second preset pixel distance may be a preset pixel distance. For example, the second preset pixel distance may be 20. Here, the third preset character region may be a region in which a character is 0 in the binary-coded character. In practice, in response to determining that the downstream pixel distance satisfies a preset pixel distance condition, the execution body may determine the downstream pixel region as a third preset character region.
And a third sub-step of determining the downstream pixel region as a fourth preset character region in response to determining that the downstream pixel distance does not satisfy the preset pixel distance condition. The fourth preset character area is a blank area which is not engraved by the laser engraving equipment.
And a second step of determining a character string to be decoded corresponding to the downlink bar code image according to the determined third preset character areas and the determined fourth preset character areas. In practice, according to the determined third preset character areas and the determined fourth preset character areas, the execution body may determine the character string to be decoded corresponding to the downlink barcode image by:
and a first step of determining, as a third character, a character corresponding to each of the third preset character areas. Here, the third preset character may be 0.
And a second step of performing sorting processing on each determined third character to obtain each third character after sorting processing as a third character string. In practice, the executing body may perform sorting processing on each third character according to the positional relationship of each laser line refinement downlink barcode pixel point corresponding to each third character, so as to obtain each third character after sorting processing as a third character string.
And a third step of determining, for each of the fourth preset character areas, a character corresponding to the fourth preset character area as a fourth character. Here, the fourth character may be 1.
And a fourth step of performing sorting processing on each determined fourth character to obtain each fourth character after sorting processing as a fourth character string. In practice, the executing body may perform sorting processing on each fourth character according to the positional relationship of each laser line refinement downlink barcode pixel point corresponding to each fourth character, so as to obtain each fourth character after sorting processing as a fourth character string.
And fifth, sorting the third character string and the fourth character string to generate character strings to be decoded corresponding to the downlink bar code image. In practice, the executing body may refine the position relationship of the downlink barcode pixel points according to the laser lines corresponding to the third character string and the fourth character string, and perform sorting processing on the third character string and the fourth character string, so as to obtain a character string to be decoded corresponding to the downlink barcode image.
And 112, combining the character string to be decoded corresponding to the uplink bar code image and the character string to be decoded corresponding to the downlink bar code image to generate a three-dimensional bar code character string to be decoded.
In some embodiments, the executing body may perform a combination process on the to-be-decoded character string corresponding to the uplink barcode image and the to-be-decoded character string corresponding to the downlink barcode image, so as to generate a stereoscopic barcode to-be-decoded character string. In practice, the execution body may perform a combination process on the to-be-decoded character string corresponding to the uplink barcode image and the to-be-decoded character string corresponding to the downlink barcode image, so as to generate a stereoscopic barcode to-be-decoded character string. Here, the combination may be splicing. For example, the character string to be decoded corresponding to the uplink barcode image may be 100101 100110 100111 101000 000010 000011. The character string to be decoded corresponding to the downlink barcode image may be 000100 000101 001011 001100 001101 001110. The character string to be decoded of the stereoscopic barcode may be 100101 100110 100111 101000 000010 000011 000100 000101 001011 001100 001101 001110.
And step 113, generating the stereoscopic bar code information according to the character string to be decoded of the stereoscopic bar code.
In some embodiments, the executing entity may generate the stereoscopic barcode information according to the stereoscopic barcode to-be-decoded character string.
In some optional implementations of some embodiments, according to the to-be-decoded string of the stereoscopic barcode, the executing entity may generate stereoscopic barcode information by:
and determining each stereoscopic bar code character to be decoded, which meets the preset starting character position condition, in the stereoscopic bar code character string to be decoded as a starting character set. The preset starting character position condition may be a preset starting character position condition. Here, it is described. The preset starting character position condition may be that the position of the character to be decoded of the stereoscopic barcode is located in the first 4 bits of the character string to be decoded of the stereoscopic barcode.
And secondly, determining each three-dimensional bar code character to be decoded, which satisfies the position condition of the preset effective data character quantity, in the three-dimensional bar code character string to be decoded as an effective character quantity information set. The preset valid data character number position condition may be that the position of the character to be decoded of the stereoscopic barcode is located in the fifth bit to the twelfth bit in the string of the stereoscopic barcode to be decoded.
And thirdly, determining each three-dimensional bar code character to be decoded, which satisfies the position condition of a preset check character, in the three-dimensional bar code character string to be decoded as a check character set. The preset check character position condition may be a preset check character position condition. Here, the preset check character position condition may be that the barcode symbol position to be decoded is located in the last 8 bits of the barcode string to be decoded.
And step four, deleting the starting character set, the effective character quantity information set and the check character set in the character string to be decoded of the stereoscopic bar code to obtain the character string to be decoded of the stereoscopic bar code after deleting as a data character string to be decoded.
Fifthly, generating the stereoscopic bar code information according to the preset character set and the data character string to be decoded. In practice, according to a preset character set and the to-be-decoded data character string, the execution body may generate the stereoscopic barcode information by:
the first step is to segment the data character string to be decoded according to a preset segmentation threshold value so as to generate a segmented character string set. The preset dividing threshold may be a preset dividing threshold. Here, it is described. The preset division threshold may be 6. In practice, the execution body may divide the data character string to be decoded into a group of continuous data characters to be decoded corresponding to a preset threshold number, so as to obtain the data character string to be decoded after the division processing as a division character string set.
And a second step of performing conversion processing on the divided character strings for each divided character string in the divided character string set to generate converted character information. The conversion process may be a binary conversion process of data. The above-described binary conversion process may include, but is not limited to: binary conversion processing, octal conversion processing, decimal conversion processing, and hexadecimal conversion processing. Here, the above-described binary conversion process may be a decimal conversion process. In practice, for each of the divided strings in the divided string set, the execution body may perform decimal conversion processing on the divided string to obtain the divided string after decimal conversion processing as the converted character information.
And a third step of determining each of the generated conversion character information as a conversion character information set.
And a fourth step of determining, as barcode characters, preset characters in the preset character set satisfying a matching condition corresponding to the converted character information for each converted character information in the converted character information set. Here, the matching condition corresponding to the converted character information may be that the converted character information is equal to a subscript of a preset character in the preset character set.
And fifthly, determining the stereoscopic bar code information according to the determined bar code characters. In practice, first, the execution subject may determine the stereoscopic barcode information by determining the position of each barcode character and then looking up a meaning comparison table corresponding to the character at the position. Specifically, each of the barcode characters described above may be ABCD1234ABCD. The first bit a may characterize the company name. The second bit B may characterize the factory name. The third and fourth bits may characterize the equipment lot. The last eight bits 1234abcd may characterize the device name. For example, the one-dimensional bar code information may be a 56 th lot of high-speed rail car hubs manufactured by company a, company B, factory. The meaning comparison table may be a preset comparison table storing the meaning of the bar code character.
Optionally, the executing body further transmits the generated stereoscopic barcode information to an associated display terminal to display the stereoscopic barcode information. The associated display terminal may be a display terminal capable of displaying the stereoscopic barcode information. For example, the associated display terminal may be a touch screen display.
The above embodiments of the present disclosure have the following advantages: by the method for generating the stereoscopic bar code information, which is disclosed by some embodiments, the decoding accuracy of the bar code can be improved. Specifically, the reason for the lower decoding accuracy of the bar code is that: under the condition that high-contrast black-and-white alternate bar code labels are adhered to or printed on the surface of a material under the conventional (e.g. normal temperature) condition, the existing bar code scanner has higher working efficiency, and can meet most of scene requirements. In some application scenarios with complex conditions (such as high temperature, greasy dirt, multiple dust, etc.), the decoding accuracy of the bar code is low and the application range of the bar code is small due to the fact that the damage of the complex environment to the bar code (the damage probability of the bar code label is high) is large. Meanwhile, due to the limitation of the structure of the material (such as a cylindrical object structure), the bar codes are arranged on the surface of the material in a serial mode, so that the scanning field of scanning equipment is limited, the bar code area is not scanned fully, and the decoding accuracy of the bar codes is lower, namely, the generated bar code information has more error content or the bar code information cannot be identified. Based on this, the stereoscopic barcode information generation method of some embodiments of the present disclosure first projects the emitted two-line parallel laser beam onto the target stereoscopic barcode pattern using the associated two-line parallel laser emitter. The target stereoscopic bar code on the target stereoscopic bar code pattern is in an upper row and a lower row, and is respectively projected by two laser beams of the double-line parallel laser beams. Thus, a double-line parallel laser beam can be projected onto the target stereoscopic barcode pattern, and thus can be used to collect 3D structural information of the barcode. And then, carrying out image acquisition on the target stereoscopic bar code pattern through the associated image acquisition equipment to obtain a stereoscopic bar code image. Thereby, a stereoscopic barcode image having 3D structure information can be obtained. And then, carrying out bar code image segmentation processing on the stereoscopic bar code image so as to generate an uplink bar code image and a downlink bar code image. Thus, by image-dividing the stereoscopic barcode image, an upstream barcode image and a downstream barcode image in which barcodes are arranged in parallel can be obtained. And thus can be used for parallel synchronous decoding of stereoscopic barcodes. And then, carrying out laser line thinning processing on the uplink bar code image to obtain an uplink bar code image subjected to laser line thinning processing as a laser line thinning uplink bar code image. Thus, a laser line refined uplink bar code image representing the binarized gray scale image can be obtained. Along with the laser line thinning processing is carried out on the downlink bar code image, the downlink bar code image after the laser line thinning processing is obtained and is used as the laser line thinning downlink bar code image. Thus, a laser line refined downlink bar code image representing the binarized gray level map can be obtained. And then, carrying out straight line fitting processing on each laser line refined uplink bar code pixel point meeting a preset threshold condition in the laser line refined uplink bar code image so as to generate an uplink fitting straight line. Therefore, an uplink fitting straight line can be obtained, and the method can be used for determining the brightness of the pixels in the laser line refined uplink bar code image. And secondly, performing straight line fitting processing on each laser line refined downlink bar code pixel point meeting a preset threshold condition in the laser line refined downlink bar code image so as to generate a downlink fitting straight line. Therefore, a downlink fitting straight line can be obtained, and the method can be used for determining the pixel brightness of the pixels in the laser line refinement downlink bar code image. And then, refining the uplink bar code image and the uplink fitting straight line according to the laser line to generate an uplink pixel distance set. Therefore, the uplink pixel distance set can be obtained, and the method can be used for distinguishing the corresponding pixel areas in the laser line refined uplink bar code image. And then, refining the downlink bar code image and the downlink fitting straight line according to the laser line to generate a downlink pixel distance set. Therefore, a downlink pixel distance set can be obtained, and the method can be used for distinguishing the corresponding pixel areas in the laser line refined downlink bar code image. And then, generating a character string to be decoded corresponding to the uplink bar code image according to the uplink pixel distance set. Therefore, the character string to be decoded corresponding to the uplink bar code image which can be identified by the machine can be obtained. And generating a character string to be decoded corresponding to the downlink bar code image according to the downlink pixel distance set. Therefore, the character string to be decoded corresponding to the downlink bar code image can be obtained. And then, combining the character string to be decoded corresponding to the uplink bar code image with the character string to be decoded corresponding to the downlink bar code image to generate a three-dimensional bar code character string to be decoded. Therefore, the character string to be decoded of the stereoscopic bar code which can be recognized by the machine after parallel synchronous decoding can be obtained. And finally, generating the stereoscopic bar code information according to the character string to be decoded of the stereoscopic bar code. Thus, stereoscopic barcode information recognizable to the user can be obtained. Thereby completing parallel decoding of the bar code. Also because the identified object is a three-dimensional bar code pattern, the damage of the complex environment to the bar code (the damage probability of the bar code label is smaller) can be reduced, and the decoding accuracy of the bar code can be improved. In addition, the three-dimensional bar codes are arranged on the surface of the material in a parallel mode, so that on one hand, the bar codes can be decoded in parallel, and the decoding speed is improved; on the other hand, the limitation of the structure of the material can be weakened, the scanning field of the scanning equipment (namely, the scanning area of the bar code) is increased, the decoding accuracy of the bar code is further improved, and the occurrence of the conditions that the error content of the generated bar code information or the bar code information cannot be identified is reduced.
With further reference to fig. 5, as an implementation of the method shown in the above figures, the present disclosure provides some embodiments of a stereoscopic barcode information generation apparatus, which correspond to those method embodiments shown in fig. 1, and which are particularly applicable in various electronic devices.
As shown in fig. 5, the stereoscopic barcode information generation apparatus 500 of some embodiments includes: the projection unit 501, the image acquisition unit 502, the first division processing unit 503, the second division processing unit 504, the third division processing unit 505, the first fitting processing unit 506, the second fitting processing unit 507, the first generation unit 508, the second generation unit 509, the third generation unit 510, the fourth generation unit 511, the combination unit 512, and the fifth generation unit 513. Wherein the projection unit 501 is configured to project the emitted two-line parallel laser beams onto the target stereoscopic barcode pattern by using the associated two-line parallel laser emitters, wherein the target stereoscopic barcode on the target stereoscopic barcode pattern is in two upper and lower rows and is simultaneously projected by two laser beams of the two-line parallel laser beams respectively; the image acquisition unit 502 is configured to acquire images of the target stereoscopic barcode patterns through associated image acquisition devices, so as to obtain stereoscopic barcode images; the first division processing unit 503 is configured to perform a bar code image division process on the above-described stereoscopic bar code image to generate an upstream bar code image and a downstream bar code image; the second segmentation processing unit 504 is configured to perform laser line refinement processing on the uplink barcode image, so as to obtain an uplink barcode image after the laser line refinement processing as a laser line refined uplink barcode image; the third segmentation processing unit 505 is configured to perform laser line refinement processing on the downlink barcode image, so as to obtain a downlink barcode image after the laser line refinement processing as a laser line refinement downlink barcode image; the first fitting processing unit 506 is configured to perform a straight line fitting process on each laser line refined uplink barcode pixel point in the laser line refined uplink barcode image that meets a preset threshold condition, so as to generate an uplink fitting straight line; the second fitting processing unit 507 is configured to perform straight line fitting processing on each laser line refined downlink barcode pixel point in the laser line refined downlink barcode image, where the laser line refined downlink barcode pixel point meets a preset threshold condition, so as to generate a downlink fitting straight line; the first generating unit 508 is configured to refine the uplink barcode image and the uplink fitting line according to the laser line, and generate an uplink pixel distance set; the second generating unit 509 is configured to refine the downlink barcode image and the downlink fitting line according to the laser line, and generate a downlink pixel distance set; the third generating unit 510 is configured to generate a character string to be decoded corresponding to the uplink barcode image according to the uplink pixel distance set; the fourth generating unit 511 is configured to generate a character string to be decoded corresponding to the downlink barcode image according to the downlink pixel distance set; the combining unit 512 is configured to combine the character string to be decoded corresponding to the uplink barcode image and the character string to be decoded corresponding to the downlink barcode image to generate a stereoscopic barcode character string to be decoded; the fifth generation unit 513 is configured to generate stereoscopic barcode information from the stereoscopic barcode to-be-decoded character string described above.
It will be appreciated that the elements described in the apparatus 500 correspond to the various steps in the method described with reference to fig. 1. Thus, the operations, features and resulting benefits described above with respect to the method are equally applicable to the apparatus 500 and the units contained therein, and are not described in detail herein.
Referring now to FIG. 6, a schematic diagram of an electronic device (e.g., computing device) 600 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 6 is merely an example and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 6, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 6 may represent one device or a plurality of devices as needed.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via communications device 609, or from storage device 608, or from ROM 602. The above-described functions defined in the methods of some embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that, the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (Hyper Text Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: projecting the emitted double-line parallel laser beams onto a target stereoscopic bar code pattern by using an associated double-line parallel laser transmitter, wherein the target stereoscopic bar code on the target stereoscopic bar code pattern is in upper and lower two rows and is respectively projected by two laser beams of the double-line parallel laser beams at the same time; image acquisition is carried out on the target stereoscopic bar code pattern through associated image acquisition equipment, so that a stereoscopic bar code image is obtained; performing bar code image segmentation processing on the stereoscopic bar code image to generate an uplink bar code image and a downlink bar code image; performing laser line refinement treatment on the uplink bar code image to obtain an uplink bar code image subjected to laser line refinement treatment as a laser line refinement uplink bar code image; performing laser line refinement treatment on the downlink bar code image to obtain a downlink bar code image subjected to the laser line refinement treatment as a laser line refined downlink bar code image; performing straight line fitting treatment on each laser line refined uplink bar code pixel point meeting a preset threshold condition in the laser line refined uplink bar code image to generate an uplink fitting straight line; performing straight line fitting treatment on each laser line refined downlink bar code pixel point meeting a preset threshold condition in the laser line refined downlink bar code image to generate a downlink fitting straight line; refining an uplink bar code image and the uplink fitting straight line according to the laser line to generate an uplink pixel distance set; refining a downlink bar code image and the downlink fitting straight line according to the laser line to generate a downlink pixel distance set; generating a character string to be decoded corresponding to the uplink bar code image according to the uplink pixel distance set; generating a character string to be decoded corresponding to the downlink bar code image according to the downlink pixel distance set; combining the character strings to be decoded corresponding to the uplink bar code image and the character strings to be decoded corresponding to the downlink bar code image to generate a three-dimensional bar code character string to be decoded; and generating the stereoscopic bar code information according to the character string to be decoded of the stereoscopic bar code.
Computer program code for carrying out operations for some embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: the processor comprises a projection unit, an image acquisition unit, a first segmentation processing unit, a second segmentation processing unit, a third segmentation processing unit, a first fitting processing unit, a second fitting processing unit, a first generation unit, a second generation unit, a third generation unit, a fourth generation unit, a combination unit and a fifth generation unit. Where the names of the units do not constitute a limitation of the unit itself in some cases, for example, the projection unit may also be described as "a unit that projects a transmitted two-line parallel laser beam onto a target stereoscopic barcode pattern with an associated two-line parallel laser transmitter".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.

Claims (9)

1. A stereoscopic barcode information generation method, comprising:
projecting the emitted double-line parallel laser beams onto a target stereoscopic bar code pattern by using an associated double-line parallel laser transmitter, wherein the target stereoscopic bar code on the target stereoscopic bar code pattern is in an upper row and a lower row and is respectively projected by two laser beams of the double-line parallel laser beams at the same time;
image acquisition is carried out on the target stereoscopic bar code pattern through associated image acquisition equipment, so that a stereoscopic bar code image is obtained;
performing bar code image segmentation processing on the stereoscopic bar code image to generate an uplink bar code image and a downlink bar code image;
Performing laser line refinement treatment on the uplink bar code image to obtain an uplink bar code image subjected to laser line refinement treatment as a laser line refinement uplink bar code image;
performing laser line refinement treatment on the downlink bar code image to obtain a downlink bar code image subjected to laser line refinement treatment as a laser line refinement downlink bar code image;
performing straight line fitting treatment on each laser line refined uplink bar code pixel point meeting a preset threshold condition in the laser line refined uplink bar code image to generate an uplink fitting straight line;
performing straight line fitting treatment on each laser line refined downlink bar code pixel point meeting a preset threshold condition in the laser line refined downlink bar code image so as to generate a downlink fitting straight line;
refining an uplink bar code image and the uplink fitting straight line according to the laser line to generate an uplink pixel distance set;
refining a downlink bar code image and the downlink fitting straight line according to the laser line to generate a downlink pixel distance set;
generating a character string to be decoded corresponding to the uplink bar code image according to the uplink pixel distance set;
generating a character string to be decoded corresponding to the downlink bar code image according to the downlink pixel distance set;
Combining the character strings to be decoded corresponding to the uplink bar code image and the character strings to be decoded corresponding to the downlink bar code image to generate a three-dimensional bar code character string to be decoded;
generating three-dimensional bar code information according to the character string to be decoded of the three-dimensional bar code;
the bar code image segmentation processing is performed on the stereoscopic bar code image to generate an uplink bar code image and a downlink bar code image, and the bar code image segmentation processing comprises the following steps:
determining an image inclination angle corresponding to the stereoscopic bar code image according to the stereoscopic bar code image;
performing image rotation processing on the stereoscopic bar code image according to the image inclination angle to obtain the stereoscopic bar code image subjected to the image rotation processing as a rotary bar code image;
carrying out graying treatment on the rotary bar code image to obtain a rotary bar code image after graying treatment as a gray bar code image;
performing histogram projection processing on the gray bar code image according to the horizontal direction to obtain a one-dimensional brightness histogram, wherein brightness in the one-dimensional brightness histogram represents brightness distribution of the gray bar code image corresponding to the horizontal direction;
Determining two pixel points with maximum brightness in the one-dimensional brightness histogram as a target point group;
determining two gray scale bar code pixel horizontal lines corresponding to the target point group in the gray scale bar code image as a target laser line group, wherein the target laser line group comprises an uplink target laser line and a downlink target laser line, and the distance from the uplink target laser line to the upper boundary of the gray scale bar code image is smaller than the distance from the downlink target laser line to the upper boundary of the gray scale bar code image;
taking the uplink target laser line as a center, taking a preset height threshold value as a segmentation height, and performing upper and lower image segmentation processing on the gray scale bar code image to obtain a gray scale bar code image subjected to the upper and lower image segmentation processing as an uplink bar code image;
taking the downlink target laser line as a center, taking the preset height threshold value as a segmentation height, and performing upper and lower image segmentation processing on the gray scale bar code image to obtain a gray scale bar code image subjected to the upper and lower image segmentation processing as a downlink bar code image;
the laser line refining treatment comprises the following steps: according to a preset gray threshold, performing binarization processing and filtering processing on the uplink bar code image to obtain a filtered uplink bar code image; for each column of filtered upstream bar code pixel sequences in the filtered upstream bar code image, performing the following updating steps: determining a laser line starting point and a laser line ending point corresponding to the filter uplink bar code pixel point sequence; according to the laser line starting point and the laser line ending point corresponding to the filter uplink bar code pixel point sequence, determining laser line center coordinate information corresponding to the filter uplink bar code pixel point sequence according to the following formula:
Wherein, said->Representing laser line center coordinate information, saidIndicating ordinate information corresponding to the central coordinate information of the laser line, the coordinates of the starting point of the laser line being indicated as +.>The coordinates of the end point of the laser line are expressed as +.>Said->The abscissa information corresponding to the central coordinate information of the laser line is also indicated as the abscissa of the starting point of the laser line and the abscissa of the ending point of the laser line, and the +.>An ordinate representing the starting point of the laser line, said +.>The ordinate representing the end point of the laser line, said +.>Representing the ordinate variable, said ++>Representing a filtered upstream bar code pixel in a filtered upstream bar code image, said +.>Representing the ordinate of the pixel point of the filter uplink bar code, said +.>The abscissa of the pixel point of the filter uplink bar code is represented; updating the pixel value of the pixel point corresponding to the laser line center coordinate information into a first pixel threshold value; and updating the pixel values of all the pixel points except the pixel point corresponding to the laser line center coordinate information in the filtering uplink bar code pixel point sequence to be a second pixel threshold value.
2. The method of claim 1, wherein the performing laser line refinement on the uplink barcode image to obtain the laser line refined uplink barcode image as the laser line refined uplink barcode image includes:
According to a preset gray threshold, performing binarization processing on the uplink bar code image to obtain a binarized uplink bar code image serving as a binarized uplink bar code image;
filtering the binarized uplink bar code image to obtain a filtered binarized uplink bar code image serving as a filtered uplink bar code image;
for each column of the filtered upstream bar code pixel point sequence in the filtered upstream bar code image, the following updating steps are executed:
determining a laser line starting point and a laser line ending point corresponding to the filter uplink bar code pixel point sequence;
determining laser line center coordinate information corresponding to the filter uplink bar code pixel point sequence according to a laser line starting point and a laser line ending point corresponding to the filter uplink bar code pixel point sequence;
updating the pixel value of the pixel point corresponding to the laser line center coordinate information into a first pixel threshold value;
updating the pixel value of each pixel point except the pixel point corresponding to the laser line center coordinate information in the filtering uplink bar code pixel point sequence to be a second pixel threshold value, wherein the second pixel threshold value is smaller than the first pixel threshold value;
And determining a bar code image formed by the pixel point sequences of the filtering uplink bar code of each column after updating the pixel value as a laser line refined uplink bar code image.
3. The method of claim 2, wherein the performing laser line refinement on the downstream barcode image to obtain a downstream barcode image after the laser line refinement as a laser line refined downstream barcode image includes:
according to the preset gray threshold, carrying out binarization processing on the downlink bar code image to obtain a downlink bar code image after binarization processing as a binarized downlink bar code image;
filtering the binarized downlink bar code image to obtain a binarized downlink bar code image after filtering as a filtered downlink bar code image;
for each column of the filtered downstream barcode pixel sequences in the filtered downstream barcode image, performing the following updating steps:
determining a laser line starting point and a laser line ending point corresponding to the filtered downlink bar code pixel point sequence;
determining laser line center coordinate information corresponding to the filter downlink bar code pixel point sequence according to a laser line starting point and a laser line ending point corresponding to the filter downlink bar code pixel point sequence;
Updating the pixel value of the pixel point corresponding to the laser line center coordinate information into a first pixel threshold value;
updating the pixel values of all the pixel points except the pixel point corresponding to the laser line center coordinate information in the filtering downlink bar code pixel point sequence to be a second pixel threshold value;
and determining a bar code image formed by the pixel point sequences of the downlink bar code with the filter columns after the pixel value updating as a laser line thinned downlink bar code image.
4. The method of claim 1, wherein the refining the upstream barcode image and the upstream fitting line from the laser line to generate an upstream set of pixel distances comprises:
for each laser line refined uplink bar code pixel point in the laser line refined uplink bar code image, determining the distance between the laser line refined uplink bar code pixel point and the uplink fitting straight line as an uplink pixel distance;
each determined upstream pixel distance is determined as a set of upstream pixel distances.
5. The method of claim 1, wherein the generating, according to the set of upstream pixel distances, a character string to be decoded corresponding to the upstream barcode image includes:
For each upstream pixel distance in the set of upstream pixel distances, performing the steps of:
determining an uplink pixel region corresponding to the uplink pixel distance according to the uplink pixel distance;
determining the uplink pixel region as a first preset character region in response to determining that the uplink pixel distance meets a preset pixel distance condition, wherein the first preset character region is a stereoscopic image region engraved by laser engraving equipment;
in response to determining that the uplink pixel distance does not meet the preset pixel distance condition, determining the uplink pixel region as a second preset character region, wherein the second preset character region is a blank region which is not engraved by the laser engraving equipment;
and determining the character string to be decoded corresponding to the uplink bar code image according to the determined first preset character areas and the determined second preset character areas.
6. The method of claim 1, wherein the generating the stereoscopic barcode information from the stereoscopic barcode string to be decoded comprises:
determining each stereoscopic bar code character to be decoded, which meets the preset starting character position condition, in the stereoscopic bar code character string to be decoded as a starting character set;
Determining each three-dimensional bar code character to be decoded, which satisfies the position condition of the preset effective data character quantity, in the three-dimensional bar code character string to be decoded as an effective character quantity information set;
determining each three-dimensional bar code character to be decoded, which meets the position condition of a preset check character, in the three-dimensional bar code character string to be decoded as a check character set;
deleting a start character set, an effective character quantity information set and a check character set in the three-dimensional bar code character string to be decoded to obtain a three-dimensional bar code character string to be decoded after deletion as a data character string to be decoded;
and generating the stereoscopic bar code information according to a preset character set and the data character string to be decoded.
7. A stereoscopic barcode information generation apparatus comprising:
a projection unit configured to project the emitted two-line parallel laser beams onto a target stereoscopic barcode pattern using an associated two-line parallel laser emitter, wherein the target stereoscopic barcode on the target stereoscopic barcode pattern is in two upper and lower rows and is simultaneously projected by two laser beams of the two-line parallel laser beams, respectively;
the image acquisition unit is configured to acquire images of the target stereoscopic bar code patterns through associated image acquisition equipment to obtain stereoscopic bar code images;
A first division processing unit configured to perform a bar code image division process on the stereoscopic bar code image to generate an upstream bar code image and a downstream bar code image;
the second segmentation processing unit is configured to perform laser line refinement processing on the uplink bar code image to obtain an uplink bar code image subjected to the laser line refinement processing as a laser line refined uplink bar code image;
the third segmentation processing unit is configured to perform laser line refinement processing on the downlink bar code image to obtain a downlink bar code image subjected to the laser line refinement processing as a laser line refined downlink bar code image;
the first fitting processing unit is configured to perform straight line fitting processing on each laser line refined uplink bar code pixel point meeting a preset threshold condition in the laser line refined uplink bar code image so as to generate an uplink fitting straight line;
the second fitting processing unit is configured to perform straight line fitting processing on each laser line refined downlink bar code pixel point meeting a preset threshold condition in the laser line refined downlink bar code image so as to generate a downlink fitting straight line;
the first generation unit is configured to refine an uplink bar code image and the uplink fitting straight line according to the laser line and generate an uplink pixel distance set;
The second generating unit is configured to refine the downlink bar code image and the downlink fitting straight line according to the laser line and generate a downlink pixel distance set;
the third generating unit is configured to generate a character string to be decoded corresponding to the uplink bar code image according to the uplink pixel distance set;
a fourth generating unit, configured to generate a character string to be decoded corresponding to the downlink barcode image according to the downlink pixel distance set;
the combination unit is configured to carry out combination processing on the character strings to be decoded corresponding to the uplink bar code image and the character strings to be decoded corresponding to the downlink bar code image so as to generate three-dimensional bar code character strings to be decoded;
a fifth generating unit configured to generate stereoscopic barcode information according to the stereoscopic barcode string to be decoded;
the bar code image segmentation processing is performed on the stereoscopic bar code image to generate an uplink bar code image and a downlink bar code image, and the bar code image segmentation processing comprises the following steps:
determining an image inclination angle corresponding to the stereoscopic bar code image according to the stereoscopic bar code image;
performing image rotation processing on the stereoscopic bar code image according to the image inclination angle to obtain the stereoscopic bar code image subjected to the image rotation processing as a rotary bar code image;
Carrying out graying treatment on the rotary bar code image to obtain a rotary bar code image after graying treatment as a gray bar code image;
performing histogram projection processing on the gray bar code image according to the horizontal direction to obtain a one-dimensional brightness histogram, wherein brightness in the one-dimensional brightness histogram represents brightness distribution of the gray bar code image corresponding to the horizontal direction;
determining two pixel points with maximum brightness in the one-dimensional brightness histogram as a target point group;
determining two gray scale bar code pixel horizontal lines corresponding to the target point group in the gray scale bar code image as a target laser line group, wherein the target laser line group comprises an uplink target laser line and a downlink target laser line, and the distance from the uplink target laser line to the upper boundary of the gray scale bar code image is smaller than the distance from the downlink target laser line to the upper boundary of the gray scale bar code image;
taking the uplink target laser line as a center, taking a preset height threshold value as a segmentation height, and performing upper and lower image segmentation processing on the gray scale bar code image to obtain a gray scale bar code image subjected to the upper and lower image segmentation processing as an uplink bar code image;
Taking the downlink target laser line as a center, taking the preset height threshold value as a segmentation height, and performing upper and lower image segmentation processing on the gray scale bar code image to obtain a gray scale bar code image subjected to the upper and lower image segmentation processing as a downlink bar code image;
the laser line refining treatment comprises the following steps: according to a preset gray threshold, performing binarization processing and filtering processing on the uplink bar code image to obtain a filtered uplink bar code image; for each column of filtered upstream bar code pixel sequences in the filtered upstream bar code image, performing the following updating steps: determining a laser line starting point and a laser line ending point corresponding to the filter uplink bar code pixel point sequence; according to the laser line starting point and the laser line ending point corresponding to the filter uplink bar code pixel point sequence, determining laser line center coordinate information corresponding to the filter uplink bar code pixel point sequence according to the following formula:
wherein, said->Representing laser line center coordinate information, saidIndicating ordinate information corresponding to the central coordinate information of the laser line, the coordinates of the starting point of the laser line being indicated as +.>The coordinates of the end point of the laser line are expressed as +. >Said->The abscissa information corresponding to the central coordinate information of the laser line is also indicated as the abscissa of the starting point of the laser line and the abscissa of the ending point of the laser line, and the information isAn ordinate representing the starting point of the laser line, said +.>The ordinate representing the end point of the laser line, said +.>Representing the ordinate variable, said ++>Representing a filtered upstream bar code pixel in a filtered upstream bar code image, said +.>Representing the ordinate of the pixel point of the filter uplink bar code, said +.>The abscissa of the pixel point of the filter uplink bar code is represented; updating the pixel value of the pixel point corresponding to the laser line center coordinate information into a first pixel threshold value; sequencing the pixel points of the filtering uplink bar codeAnd updating the pixel values of all the pixel points except the pixel point corresponding to the laser line center coordinate information in the column to be a second pixel threshold value.
8. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1 to 6.
9. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1 to 6.
CN202410052300.8A 2024-01-15 2024-01-15 Method and device for generating three-dimensional bar code information, electronic equipment and readable medium Active CN117574930B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410052300.8A CN117574930B (en) 2024-01-15 2024-01-15 Method and device for generating three-dimensional bar code information, electronic equipment and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410052300.8A CN117574930B (en) 2024-01-15 2024-01-15 Method and device for generating three-dimensional bar code information, electronic equipment and readable medium

Publications (2)

Publication Number Publication Date
CN117574930A CN117574930A (en) 2024-02-20
CN117574930B true CN117574930B (en) 2024-04-12

Family

ID=89888470

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410052300.8A Active CN117574930B (en) 2024-01-15 2024-01-15 Method and device for generating three-dimensional bar code information, electronic equipment and readable medium

Country Status (1)

Country Link
CN (1) CN117574930B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05242278A (en) * 1992-02-27 1993-09-21 Olympus Optical Co Ltd Symbol information reader
US5600119A (en) * 1988-10-21 1997-02-04 Symbol Technologies, Inc. Dual line laser scanning system and scanning method for reading multidimensional bar codes
US8079525B1 (en) * 2011-02-24 2011-12-20 Psion Inc. System and method for decoding barcodes captured with a color image sensor
CN107633192A (en) * 2017-08-22 2018-01-26 电子科技大学 Bar code segmentation and reading method under a kind of complex background based on machine vision
CN110414650A (en) * 2019-07-31 2019-11-05 上海木木机器人技术有限公司 A kind of information acquisition method and system based on reflective encoder label
CN110457972A (en) * 2019-08-05 2019-11-15 网易(杭州)网络有限公司 Two-dimensional code identification method and device, storage medium, electronic equipment
CN111222611A (en) * 2020-01-18 2020-06-02 江苏提米智能科技有限公司 Stacking type three-dimensional code encoding method, encoding device, decoding method, decoding device and storage medium based on colors
CN111368574A (en) * 2020-03-06 2020-07-03 联想(北京)有限公司 Bar code identification method and device
CN111783495A (en) * 2020-06-30 2020-10-16 创新奇智(南京)科技有限公司 Bar code identification method and device, electronic equipment and storage medium
CN111797647A (en) * 2020-07-08 2020-10-20 北京京东振世信息技术有限公司 Bar code decoding method and device
CN113111674A (en) * 2021-04-12 2021-07-13 广东奥普特科技股份有限公司 Aztec code positioning and decoding method, system, equipment and storage medium
CN114782450A (en) * 2022-06-23 2022-07-22 北京航空航天大学杭州创新研究院 Hole filling equipment control method, device, equipment and computer readable medium
CN116306731A (en) * 2023-02-06 2023-06-23 深圳市九牛一毛智能物联科技有限公司 Method and device for identifying bar codes, electronic equipment and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5600119A (en) * 1988-10-21 1997-02-04 Symbol Technologies, Inc. Dual line laser scanning system and scanning method for reading multidimensional bar codes
JPH05242278A (en) * 1992-02-27 1993-09-21 Olympus Optical Co Ltd Symbol information reader
US8079525B1 (en) * 2011-02-24 2011-12-20 Psion Inc. System and method for decoding barcodes captured with a color image sensor
CN107633192A (en) * 2017-08-22 2018-01-26 电子科技大学 Bar code segmentation and reading method under a kind of complex background based on machine vision
CN110414650A (en) * 2019-07-31 2019-11-05 上海木木机器人技术有限公司 A kind of information acquisition method and system based on reflective encoder label
CN110457972A (en) * 2019-08-05 2019-11-15 网易(杭州)网络有限公司 Two-dimensional code identification method and device, storage medium, electronic equipment
CN111222611A (en) * 2020-01-18 2020-06-02 江苏提米智能科技有限公司 Stacking type three-dimensional code encoding method, encoding device, decoding method, decoding device and storage medium based on colors
CN111368574A (en) * 2020-03-06 2020-07-03 联想(北京)有限公司 Bar code identification method and device
CN111783495A (en) * 2020-06-30 2020-10-16 创新奇智(南京)科技有限公司 Bar code identification method and device, electronic equipment and storage medium
CN111797647A (en) * 2020-07-08 2020-10-20 北京京东振世信息技术有限公司 Bar code decoding method and device
CN113111674A (en) * 2021-04-12 2021-07-13 广东奥普特科技股份有限公司 Aztec code positioning and decoding method, system, equipment and storage medium
CN114782450A (en) * 2022-06-23 2022-07-22 北京航空航天大学杭州创新研究院 Hole filling equipment control method, device, equipment and computer readable medium
CN116306731A (en) * 2023-02-06 2023-06-23 深圳市九牛一毛智能物联科技有限公司 Method and device for identifying bar codes, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种基于图像处理的一维条码快速定位技术;纪琴琴,黄鲁;中国科学院大学学报;20190930;第36卷(第5期);716-720 *

Also Published As

Publication number Publication date
CN117574930A (en) 2024-02-20

Similar Documents

Publication Publication Date Title
CN109059922B (en) Mobile robot positioning method, device and system
CN109308681B (en) Image processing method and device
JP6565786B2 (en) Optical symbol, display medium, article and generating device
CN112541369B (en) Information code identification method and system
JP2007213359A (en) Two-dimensional code detection system and two-dimensional code detection program
CN113252053B (en) High-precision map generation method and device and electronic equipment
CN111598076B (en) Method and device for detecting and processing date in label image
CN110866900A (en) Water body color identification method and device
CN112818852A (en) Seal checking method, device, equipment and storage medium
CN116978011A (en) Image semantic communication method and system for intelligent target recognition
CN117574930B (en) Method and device for generating three-dimensional bar code information, electronic equipment and readable medium
CN111797642B (en) Bar code identification method and terminal
CN111507119A (en) Identification code identification method and device, electronic equipment and computer readable storage medium
CN112446843A (en) Image reconstruction method, system, device and medium based on multiple depth maps
CN102710978B (en) The cursor-moving method of television set and device
CN115359502A (en) Image processing method, device, equipment and storage medium
CN113345101B (en) Three-dimensional point cloud labeling method, device, equipment and storage medium
CN110969042A (en) Two-dimensional code identification method and device and hardware device
CN114429631A (en) Three-dimensional object detection method, device, equipment and storage medium
CN109409247B (en) Traffic sign identification method and device
CN117574931B (en) One-dimensional bar code information generation method based on 3D structure and laser decoding equipment
CN107197274B (en) Visual asynchronous stream coding and decoding method
US10121040B2 (en) Recognition apparatus, recognition method, storage medium, management system, and conveyance system
CN111274863A (en) Text prediction method based on text peak probability density
CN114001671B (en) Laser data extraction method, data processing method and three-dimensional scanning 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
GR01 Patent grant
GR01 Patent grant