CN114386552A - Bar code generating method, bar code reading method, bar code generating device, bar code reading device and computer readable storage medium - Google Patents

Bar code generating method, bar code reading method, bar code generating device, bar code reading device and computer readable storage medium Download PDF

Info

Publication number
CN114386552A
CN114386552A CN202111628221.XA CN202111628221A CN114386552A CN 114386552 A CN114386552 A CN 114386552A CN 202111628221 A CN202111628221 A CN 202111628221A CN 114386552 A CN114386552 A CN 114386552A
Authority
CN
China
Prior art keywords
color
bar code
colors
barcode
data
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.)
Granted
Application number
CN202111628221.XA
Other languages
Chinese (zh)
Other versions
CN114386552B (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.)
Alva Systems
Original Assignee
Alva Systems
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 Alva Systems filed Critical Alva Systems
Priority to CN202111628221.XA priority Critical patent/CN114386552B/en
Publication of CN114386552A publication Critical patent/CN114386552A/en
Application granted granted Critical
Publication of CN114386552B publication Critical patent/CN114386552B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06046Constructional details
    • G06K19/0614Constructional details the marking being selective to wavelength, e.g. color barcode or barcodes only visible under UV or IR
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

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

Abstract

The embodiment of the disclosure provides a barcode generating method, a barcode reading method, a barcode generating device, a barcode reading device and a computer readable storage medium. The method comprises the following steps: selecting a printing primary color; combining the printing primary colors to obtain a plurality of colors as preset colors of the bar code ribbon and recording the combination coefficients of the colors; selecting a corresponding number of available colors from the preset colors to be distributed to the corresponding color bands according to the number of colors required by the bar code color bands; generating a bar code data area and a check area; wherein the data area comprises a data ribbon of encoded data identifying a barcode; the check area includes a process color patch. In this way, the interference of environmental factors can be reduced, correction is not needed, the calculation amount is reduced, and the accuracy of reading the bar code is improved.

Description

Bar code generating method, bar code reading method, bar code generating device, bar code reading device and computer readable storage medium
Technical Field
The present disclosure relates to the field of image generation and recognition technologies, and in particular, to the field of barcode generation and reading methods and apparatuses, and computer-readable storage media.
Background
In the image generation and identification process, the image of the bar code can be shot by the camera for identification, and the information corresponding to the bar code is judged. However, the method needs strict illumination control conditions and reduces the interference of the camera, so that the color of the bar code can be accurately restored. The obtained image also needs to be corrected when the gray bar code is identified, the processing steps are complex, and the calculation amount is large.
Disclosure of Invention
The disclosure provides methods, devices, equipment and storage media for generating and reading bar codes and computer readable storage media.
According to a first aspect of the present disclosure, a barcode generation method is provided. The method comprises the following steps:
selecting a printing primary color;
combining the printing primary colors to obtain a plurality of colors as preset colors of the bar code ribbon and recording the combination coefficients of the colors;
selecting a corresponding number of available colors from the preset colors to be distributed to the corresponding color bands according to the number of colors required by the bar code color bands;
generating a bar code data area and a check area; wherein the data area comprises a data ribbon of encoded data identifying a barcode; the check area includes a process color patch.
According to a second aspect of the present disclosure, a barcode reading method is provided. The barcode generated by the barcode generating method comprises the following steps:
acquiring an image of a bar code, extracting the colors of each data color band and each printing primary color block of the bar code from the image, and judging the color of each printing primary color block;
approximating the color of each data color band in the image by the combination of the colors of the color blocks of the printing primary colors, and respectively obtaining the fitting coefficient of each data color band;
and comparing the fitting coefficient of each data color bar with a preset bar code color bar combination coefficient, and taking the available color corresponding to the bar code color bar combination coefficient closest to the fitting coefficient as the color reading result of the corresponding data color bar.
According to a third aspect of the present disclosure, a barcode reading apparatus is provided. The device includes:
the extraction module is used for acquiring an image of a bar code and extracting the colors of each data color band and each printing primary color block of the bar code from the image; judging the color of each primary color block;
the fitting module is used for approximating the colors of the data color bands in the image by using the combination of the colors of the printing primary color blocks to respectively obtain the fitting coefficients of the data color bands;
and the judging module compares the fitting coefficient of each data color band with a preset bar code color band combination coefficient, and takes the available color corresponding to the bar code color band combination coefficient closest to the fitting coefficient as a color interpretation result of the corresponding data color band.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising a memory having stored thereon a computer program and a processor that, when executing the program, implements a method according to the first and/or second aspect of the present disclosure.
According to a fifth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method as according to the first and/or second aspect of the present disclosure.
According to the embodiment of the disclosure, the accuracy and stability of reading the bar code can be remarkably improved.
It should be understood that the statements herein reciting aspects are not intended to limit the critical or essential features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. The accompanying drawings are included to provide a further understanding of the present disclosure, and are not intended to limit the disclosure thereto, and the same or similar reference numerals will be used to indicate the same or similar elements, where:
FIG. 1 shows a flow diagram of an exemplary barcode generation method according to an embodiment of the present disclosure;
FIG. 2 shows a flow diagram of an exemplary barcode reading method according to an embodiment of the present disclosure;
FIG. 3 shows a block diagram of an exemplary barcode reading apparatus according to an embodiment of the present disclosure;
FIG. 4 illustrates a block diagram of an exemplary electronic device capable of implementing embodiments of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
According to some embodiments of the disclosure, the colors of the bar code ribbon are obtained by combining the printing primary colors, and the bar code data area and the verification area are generated, so that the environment of the generated bar code data area is the same as that of the verification area in the reading process, the problem of wrong bar code ribbon interpretation caused by the influence of ambient light or color cast of a camera is effectively solved, the accuracy is improved, the obtained image does not need to be corrected, and the calculation amount is reduced.
Fig. 1 shows a flow diagram of an exemplary barcode generation method 100 according to an embodiment of the present disclosure. The barcode generation method 100 includes:
step S110: the process color is selected.
In some embodiments, the process color patches are process color patches printed in three primary colors, four primary colors, or six primary color patches printed in three primary colors. And more color combinations can be constructed by using various printing primary colors, the color types of the bar code color bands are enriched, and the discrimination between the color bands is increased.
In some embodiments, the three primary colors are printed magenta, yellow, and cyan, the four primary colors are printed magenta, yellow, cyan, and black, and the six primary colors are printed cyan, magenta, yellow, black, orange, and green.
Step S120: and combining the printing primary colors to obtain a plurality of colors as preset colors of the bar code ribbon, and recording the combination coefficients of the colors.
In some embodiments, the printing primary colors are combined in a convex linear mode to obtain a plurality of colors as the preset colors of the bar code ribbon.
Assuming that x1, x 2., xn is a set of color combinations, n represents a color type, a1, a 2., an is n constants, each of which is not less than 0, and satisfies a1+. + an ═ 1, then a1x1+. + an xn is called a convex linear combination of x 1., xn.
The method for carrying out convex linear combination on the printing primary colors can set more colors as the preset colors or the optional colors of the bar code ribbon, thereby being convenient for identifying various colors possibly appearing on the bar code ribbon and improving the reading accuracy.
Step S130: and selecting a corresponding number of available colors from the preset colors to be distributed to the corresponding color bands according to the number of colors required by the bar code color bands.
The main content of the bar code is that various color values established according to the coding rule correspond to various numbers and letter color bar combinations, and whether the numbers or letter characters represented by the corresponding data color bars are displayed can be set according to requirements when the bar code is printed. In practical application, the barcode coding can be performed by using a combination of numbers 0-9, and a designated color value is correspondingly set for each number. The coding rules are formulated according to the applied industry, the article category and the user requirements. The corresponding data bands may also be marked with letters or a combination of numbers and letters as desired.
For example, in library applications, a combination of 9 digits of 1-9 is selected for encoding, and books are classified, managed and sorted, and the encoding rule is as follows:
corresponding to a book scene, 1-3 positions on the bar code are used for corresponding to each branch hall, 4 th and 5 th positions are used for corresponding to the classification of books, and 6 th to 9 th positions correspond to a book storage bookshelf and a storage position sequence on the bookshelf.
In some embodiments, bar code ribbons with different widths and different colors can be arranged, and the information of the bar code ribbons is identified through the colors and the widths, so that the information amount of the bar codes is increased. In this case, in addition to the steps mentioned in step S130, at least the following steps need to be added:
setting the range of different bar code ribbon widths, distributing the widths to corresponding ribbons, and recording preset ribbon color and width information.
At this time, the barcode ribbon includes two kinds of information, namely color and width, and the contents of the two kinds of information, for example, one represents position information and the other represents category information, can be set according to actual needs.
In step S130, at least the following two cases may also occur:
(1) the colors of the bar code color bands are different from each other, and the number of the colors required by the bar code color bands is the number of the bar code color bands;
(2) at least 2 color bands with the same color exist in the bar code color bands, and at the moment, the color is selected from preset colors according to the color types of the color bands and is distributed to the corresponding color bands.
In order to further improve the discrimination of the colors of the bar code ribbons and avoid the problems of similar colors and difficult discrimination of images acquired in the later period, in some embodiments, the N groups of convex linear combination coefficients with the largest distance in any convex linear combination are taken as the colors of the bar code ribbons, and N is the number of the bar code ribbons.
The maximum distance means that the distance of the convex linear combination coefficient in the space is larger, which means that the colors corresponding to different convex linear combination coefficients have larger difference, and after the convex linear combination coefficients are distributed to corresponding color bands, the color difference between the color bands is obvious, the colors of the color bands in the obtained barcode color band image also have obvious difference, and the identification accuracy is improved.
Step S140: generating a bar code data area and a check area; wherein the data area comprises a data ribbon of encoded data identifying a barcode; the check area includes a process color patch.
In some embodiments, color and position information of each of the primary color patches printed in the verification area is recorded, or a color difference, such as a luminance or pixel difference, of each of the primary color patches printed in the verification area is recorded.
In some embodiments, the colors in the data ribbon correspond to respective characters, facilitating storage of image information.
The verification area is an independent area and is positioned on one side of the bar code data area, such as the upper side, the lower side, the left side or the right side of the bar code data area, or each printing primary color block in the verification area is positioned on different corners of the bar code data area. If the number of the printing primary color blocks in the verification area is 3, the printing primary color blocks are distributed on 3 corners of the bar code data area, if the number of the printing primary color blocks in the verification area is 4, the printing primary color blocks are distributed on 4 corners of the bar code data area, if the number of the printing primary color blocks in the verification area is 6, the printing primary color blocks are distributed on 4 corners of the bar code data area, and at least one corner contains more than 2 color blocks.
Fig. 2 shows a flow diagram of an exemplary barcode reading method 200 according to an embodiment of the present disclosure. The barcode reading method 200 includes:
step S210: acquiring an image of a bar code, extracting the colors of each data color band and each printing primary color block of the bar code from the image, and judging the color of each printing primary color block;
in some embodiments, the method of determining the color of each of the primary color patches includes one of the following methods:
(1) and determining the color of each printing primary color lump in the acquired image according to the color and the position information of each printing primary color lump recorded in the bar code generation method, wherein the method can eliminate the color change caused by light or a camera.
(2) The color of each of the primary color patches of the acquired image is directly identified. Although the situation of color change may occur, because the size of the bar code is not large, the change of the color of each printing primary color block on the bar code and the change of the color of the bar code ribbon caused by the influence of the environment are approximately the same, even if the color of each printing primary color block generates larger change, the real color of the bar code ribbon can be directly read through the subsequent processing.
(3) And judging the color difference, such as brightness or pixel difference, of each printing primary color lump on the acquired image, comparing the color difference with the brightness or pixel difference of each printing primary color lump in a pre-recorded checking area, and determining the color of each printing primary color lump on the acquired image according to the sequence of the brightness or the pixel from large to small or from small to large.
In some embodiments, the process color patches are process color patches printed in three primary colors, four primary colors, or six primary color patches printed in three primary colors. And more color combinations can be constructed by using various printing primary colors, the color types of the bar code color bands are enriched, and the discrimination between the color bands is increased.
In some more specific embodiments, the printing of the three primary colors magenta, yellow, and cyan, the printing of the four primary colors magenta, yellow, cyan, and black, and the printing of the six primary colors cyan, magenta, yellow, black, orange, and green.
Step S220: and approximating the colors of the data color bands in the image by using the combination of the colors of the color blocks of the printing primary colors, and respectively obtaining the fitting coefficients of the data color bands.
In some embodiments, the printing primary colors are combined in a convex linear mode to obtain a plurality of colors as the preset colors of the bar code ribbon.
In some embodiments, the obtaining method of the fitting coefficient includes performing convex linear fitting on the color of each primary color block to make the color obtained by the convex linear fitting approach to the color of each data color band in the image, so as to obtain the convex linear fitting coefficient of each data color band.
In some embodiments, when the data bands include color and width information, the color of each of the process color patches is convex-linear fitted, such that the color obtained by the convex-linear fitting approximates the color of each of the data bands in the image, thereby obtaining a convex-linear fitting coefficient for each of the data bands. Identifying width information of each data band on the acquired image.
Step S230: and comparing the fitting coefficient of each data color bar with a preset bar code color bar combination coefficient, and taking the available color corresponding to the bar code color bar combination coefficient closest to the fitting coefficient as the color reading result of the corresponding data color bar.
Since the available color, combination coefficient and width data of the bar code color bands are prestored when the bar codes are generated, the fitting coefficient of each data color band can be directly compared with the preset bar code color band combination coefficient, or the fitting coefficient and the width information of each data color band can be compared with the preset bar code color band combination coefficient and the width information to be used as the reading result of the corresponding data color band.
In some embodiments of the disclosure, the colors of each data color bar and each printing primary color block of the barcode are extracted from one image, and because the conditions of the photographing process are the same and the barcode is smaller, the changes of each part of the colors on the barcode due to the influence of the environment are approximately the same and can be eliminated through subsequent processing, thereby reducing the interference of light and camera factors, directly reading the real color information of the barcode color bar, needing no extra correction balancing step and reducing the computation amount. In actual practice, the fitting coefficients and the combining coefficients may be the same or different. Therefore, in order to determine the color of the bar code, the fitting coefficient can be compared with a preset bar code ribbon combination coefficient, and the available color corresponding to the bar code ribbon combination coefficient closest to the fitting coefficient is taken as the color reading result of the corresponding data ribbon, so that the reading accuracy can be further improved.
Some embodiments further comprise a barcode recognition step after step S230: and obtaining the identification result of the bar code according to the color reading result of the corresponding data color band. And integrating information obtained by the color reading result and storing or analyzing the information as bar code information.
In some embodiments, the barcode identification result is obtained according to the obtained color and/or width information of each data ribbon and the barcode encoding characters.
In some embodiments, the barcode is identified based on the color and width reading of the corresponding data bar. The identification result comprises character data, the character data can reflect bar code ribbon information, corresponding to book scenes, 1-3 bits on a bar code are used for corresponding to each branch hall, 4 th and 5 th bits are used for corresponding to book classification, and 6-9 th bits correspond to book storage bookshelves and storage position sequences on the bookshelves.
According to the embodiment of the disclosure, the following technical effects are achieved:
ambient light changes or camera color cast can be viewed as an additive offset in the original color. The method comprises the steps of configuring printing primary color blocks on a bar code, enabling the size of the bar code to be small, enabling the color deviation of the printing primary color blocks to be approximately equal to the color deviation of a bar code ribbon, enabling the deviation to be automatically eliminated in convex linear fitting, and selecting a combination coefficient closest to a fitting coefficient as a bar code ribbon identification result by combining a comparison result of the combination coefficients, so that the problem of bar code ribbon reading errors caused by ambient light influence or camera color deviation is effectively solved.
It is noted that while for simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present disclosure is not limited by the order of acts, as some steps may, in accordance with the present disclosure, occur in other orders and concurrently. Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that acts and modules referred to are not necessarily required by the disclosure.
The above is a description of embodiments of the method, and the embodiments of the apparatus are further described below.
Fig. 3 shows a block diagram of an exemplary barcode reading apparatus 300 according to an embodiment of the present disclosure.
As shown in fig. 3, the apparatus 300 includes:
the extracting module 310 is configured to obtain an image of a barcode, extract colors of each data ribbon and each printing primary color block of the barcode from the image, and determine a color of each printing primary color block;
the fitting module 320 is used for approximating the colors of the data color bands in the image by using the combination of the colors of the printing primary color blocks to respectively obtain the fitting coefficients of the data color bands;
the determining module 330 compares the fitting coefficient of each data ribbon with a preset barcode ribbon combination coefficient, and takes an available color corresponding to the closest barcode ribbon combination coefficient as a color interpretation result of the corresponding data ribbon.
The barcode reading device recorded in the embodiment can reduce the calculation amount, reduce the environmental interference and accurately read the barcode information.
In the extraction module 310 of some embodiments, the method of determining the color of each of the printing process color patches includes one of the following methods:
(1) and determining the color of each printing primary color lump in the acquired image according to the color and the position information of each printing primary color lump recorded in the bar code generation method, wherein the method can eliminate the color change caused by light or a camera.
(2) The color of each of the primary color patches of the acquired image is directly identified. Although a case of color change may occur, since the change is small, the color of each of the primary color patches of printing is not completely changed, and thus each color can be distinguished from the image.
(3) And judging the color difference, such as brightness or pixel difference, of each printing primary color lump on the acquired image, comparing the color difference with the brightness or pixel difference of each printing primary color lump in a pre-recorded checking area, and determining the color of each printing primary color lump on the acquired image according to the sequence of the brightness or the pixel from large to small or from small to large.
In the extraction module 310 of some embodiments, the process color patches are process color patches. And more color combinations can be constructed by using various printing primary colors, the color types of the bar code color bands are enriched, and the discrimination between the color bands is increased.
In the fitting module 320 of some embodiments, the printing primaries are convexly and linearly combined to obtain a plurality of colors as the preset color of the barcode ribbon.
In some embodiments, the obtaining method of the fitting coefficient includes performing convex linear fitting on the color of each primary color block to make the color obtained by the convex linear fitting approach to the color of each data color band in the image, so as to obtain the convex linear fitting coefficient of each data color band.
In some embodiments, when the data bands include color and width information, the color of each of the process color patches is convex-linear fitted, such that the color obtained by the convex-linear fitting approximates the color of each of the data bands in the image, thereby obtaining a convex-linear fitting coefficient for each of the data bands. Identifying width information of each data band on the acquired image.
In the determining module 330 of some embodiments, since the available colors, combination coefficients, and width data of the barcode ribbons are pre-stored when the barcode is generated, the fitting coefficients of the data ribbons may be directly compared with the preset barcode ribbon combination coefficients, or the fitting coefficients and the width information of the data ribbons may be compared with the preset barcode ribbon combination coefficients and the width information to obtain the color reading result of the corresponding data ribbons.
In some embodiments of the disclosure, the colors of each data color bar and each printing primary color block of the barcode are extracted from one image, and because the conditions of the photographing process are the same and the barcode is smaller, the changes of each part of the colors on the barcode due to the influence of the environment are approximately the same and can be eliminated through subsequent processing, thereby reducing the interference of light and camera factors, directly reading the real color information of the barcode color bar, needing no extra correction balancing step and reducing the computation amount. In actual practice, the fitting coefficients and the combining coefficients may be the same or different. Therefore, in order to determine the color of the bar code, the fitting coefficient can be compared with a preset bar code ribbon combination coefficient, and the available color corresponding to the bar code ribbon combination coefficient closest to the fitting coefficient is taken as the color reading result of the corresponding data ribbon, so that the reading accuracy can be further improved.
In some embodiments, the determining module 330 may obtain the barcode identification result according to the color reading result of the color block data ribbon corresponding to the data. And integrating information obtained by the color reading result and storing or analyzing the information as bar code information.
In some embodiments, the determining module 330 may obtain the barcode identification result according to the obtained color and/or width information of each data stripe and the barcode encoding characters.
In some embodiments, the determining module 330 obtains the barcode identification result according to the color and width reading result of the corresponding data ribbon. The identification result comprises character data, the character data can reflect bar code ribbon information, corresponding to book scenes, 1-3 bits on a bar code are used for corresponding to each branch hall, 4 th and 5 th bits are used for corresponding to book classification, and 6-9 th bits correspond to book storage bookshelves and storage position sequences on the bookshelves.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the described module may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
The present disclosure also provides an electronic device and a computer-readable storage medium according to an embodiment of the present disclosure.
Embodiments of the present disclosure provide an electronic device comprising a memory having stored thereon a computer program and a processor that when executed implements a barcode generation method 100 and/or a barcode reading method 200 according to the present disclosure.
Embodiments of the present disclosure provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements barcode generation method 100 and/or barcode reading method 200 as according to the present disclosure.
FIG. 4 shows a schematic block diagram of an electronic device 400 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
The device 400 comprises a computing unit 401 which may perform various suitable actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
A number of components in device 400 are connected to I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, or the like; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408 such as a magnetic disk, optical disk, or the like; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 401 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 401 performs the various methods and processes described above, such as the barcode generation method 100 and/or the barcode reading method 200. For example, in some embodiments, barcode generation method 100 and/or barcode reading method 200 may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 400 via the ROM 402 and/or the communication unit 409. When loaded into RAM 403 and executed by computing unit 401, may perform one or more steps of barcode generation method 100 and/or barcode reading method 200 described above. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the barcode generation method 100 and/or the barcode reading method 200 by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (10)

1. A barcode generating method is characterized by comprising the following steps:
selecting a printing primary color;
combining the printing primary colors to obtain a plurality of colors as preset colors of the bar code ribbon and recording the combination coefficients of the colors;
selecting a corresponding number of available colors from the preset colors to be distributed to the corresponding color bands according to the number of colors required by the bar code color bands;
generating a bar code data area and a check area; wherein the data area comprises a data ribbon of encoded data identifying a barcode; the check area includes a process color patch.
2. The barcode generation method of claim 1, wherein colors in the data ribbon correspond to respective characters.
3. The barcode generation method of claim 1, wherein the primary color blocks are three primary colors, four primary colors, or six primary color blocks.
4. The barcode generating method according to claim 1, wherein a plurality of colors obtained by convexly and linearly combining the printing process colors are used as the preset barcode ribbon color.
5. The barcode generation method according to claim 4, wherein the N sets of convex linear combination coefficients with the largest distance in any convex linear combination are taken as the barcode bar color, where N is the number of barcode bars.
6. A barcode reading method, wherein the barcode is generated by the barcode generating method according to any one of claims 1 to 5, comprising the steps of:
acquiring an image of a bar code, extracting the colors of each data color band and each printing primary color block of the bar code from the image, and judging the color of each printing primary color block;
approximating the color of each data color band in the image by the combination of the colors of the color blocks of the printing primary colors, and respectively obtaining the fitting coefficient of each data color band;
and comparing the fitting coefficient of each data color bar with a preset bar code color bar combination coefficient, and taking the available color corresponding to the bar code color bar combination coefficient closest to the fitting coefficient as the color reading result of the corresponding data color bar.
7. The barcode reading method according to claim 6, further comprising a barcode recognition step after step S220: and obtaining the identification result of the bar code according to the color reading result of the corresponding data color band.
8. A barcode reading apparatus, comprising:
the extraction module is used for acquiring an image of a bar code, extracting the colors of each data ribbon and each printing primary color block of the bar code from the image and judging the color of each printing primary color block;
the fitting module is used for approximating the colors of the data color bands in the image by using the combination of the colors of the printing primary color blocks to respectively obtain the fitting coefficients of the data color bands;
and the judging module compares the fitting coefficient of each data color band with a preset bar code color band combination coefficient, and takes the available color corresponding to the bar code color band combination coefficient closest to the fitting coefficient as a color interpretation result of the corresponding data color band.
9. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program, wherein the processor, when executing the program, implements the method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202111628221.XA 2021-12-28 2021-12-28 Bar code generating and reading method and device and computer readable storage medium Active CN114386552B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111628221.XA CN114386552B (en) 2021-12-28 2021-12-28 Bar code generating and reading method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111628221.XA CN114386552B (en) 2021-12-28 2021-12-28 Bar code generating and reading method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114386552A true CN114386552A (en) 2022-04-22
CN114386552B CN114386552B (en) 2024-03-15

Family

ID=81197913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111628221.XA Active CN114386552B (en) 2021-12-28 2021-12-28 Bar code generating and reading method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114386552B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008058480A1 (en) * 2006-11-16 2008-05-22 Shenzhen Mpr Technology Co., Ltd Two-dimension code, decoding method thereof and printing publication for applying two-dimension code
CN102087698A (en) * 2011-03-03 2011-06-08 北京天地融科技有限公司 Method and system for transmitting information and device for displaying and reading bar code
CN102971744A (en) * 2010-06-29 2013-03-13 锡克拜控股有限公司 Method and device for measuring optical properties of an optically variable marking applied to an object
CN105320979A (en) * 2014-05-29 2016-02-10 柯尼卡美能达美国研究所有限公司 High capacity 2d color barcode and method for decoding the same
CN107862234A (en) * 2017-10-23 2018-03-30 广东数相智能科技有限公司 A kind of recognition methods of color bar code, electronic equipment and storage medium
CN107871151A (en) * 2017-10-23 2018-04-03 广东数相智能科技有限公司 A kind of color bar code and its production method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008058480A1 (en) * 2006-11-16 2008-05-22 Shenzhen Mpr Technology Co., Ltd Two-dimension code, decoding method thereof and printing publication for applying two-dimension code
CN102971744A (en) * 2010-06-29 2013-03-13 锡克拜控股有限公司 Method and device for measuring optical properties of an optically variable marking applied to an object
CN102087698A (en) * 2011-03-03 2011-06-08 北京天地融科技有限公司 Method and system for transmitting information and device for displaying and reading bar code
CN105320979A (en) * 2014-05-29 2016-02-10 柯尼卡美能达美国研究所有限公司 High capacity 2d color barcode and method for decoding the same
CN107862234A (en) * 2017-10-23 2018-03-30 广东数相智能科技有限公司 A kind of recognition methods of color bar code, electronic equipment and storage medium
CN107871151A (en) * 2017-10-23 2018-04-03 广东数相智能科技有限公司 A kind of color bar code and its production method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
唐远林等: "《新编大学物理实验 下 综合提高应用性实验》", 重庆大学出版社, pages: 148 *

Also Published As

Publication number Publication date
CN114386552B (en) 2024-03-15

Similar Documents

Publication Publication Date Title
KR102075088B1 (en) Apparatus and method for extracting object
EP3690801A1 (en) Image processing method and device, storage medium and computer device
CN110390327B (en) Foreground extraction method and device, computer equipment and storage medium
US20220189083A1 (en) Training method for character generation model, character generation method, apparatus, and medium
CN113301409B (en) Video synthesis method and device, electronic equipment and readable storage medium
US8249363B2 (en) Image comparison system and method
CN111724396A (en) Image segmentation method and device, computer-readable storage medium and electronic device
CN113902696A (en) Image processing method, image processing apparatus, electronic device, and medium
CN113888560A (en) Method, apparatus, device and storage medium for processing image
CN114140358A (en) Image display method, device, terminal and storage medium
CN113923474A (en) Video frame processing method and device, electronic equipment and storage medium
US6339432B1 (en) Using alpha values to control pixel blending
CN110400355B (en) Method and device for determining monochrome video, electronic equipment and storage medium
CN114386552B (en) Bar code generating and reading method and device and computer readable storage medium
CN112258541A (en) Video boundary detection method, system, device and storage medium
CN109559707B (en) Gamma value processing method and device of display panel and display equipment
CN113038184B (en) Data processing method, device, equipment and storage medium
CN113112472B (en) Image processing method and device
CN115374517A (en) Testing method and device for wiring software, electronic equipment and storage medium
CN111680628B (en) Text frame fusion method, device, equipment and storage medium
CN113657408A (en) Method and device for determining image characteristics, electronic equipment and storage medium
CN113259745B (en) Video playing page processing method and device, electronic equipment and storage medium
CN112053277B (en) Method, device, equipment and storage medium for changing image skin
EP3742392A1 (en) Aspect ratio error recognition
US20230015096A1 (en) Picture processing method and apparatus, electronic device and storage medium

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