CN112836779A - One-dimensional code format and printing device thereof - Google Patents

One-dimensional code format and printing device thereof Download PDF

Info

Publication number
CN112836779A
CN112836779A CN202110157242.1A CN202110157242A CN112836779A CN 112836779 A CN112836779 A CN 112836779A CN 202110157242 A CN202110157242 A CN 202110157242A CN 112836779 A CN112836779 A CN 112836779A
Authority
CN
China
Prior art keywords
image
detected
module
code
submodule
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
CN202110157242.1A
Other languages
Chinese (zh)
Other versions
CN112836779B (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.)
Beijing Dynaflow Experiment Technology Co Ltd
Original Assignee
Beijing Dynaflow Experiment Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dynaflow Experiment Technology Co Ltd filed Critical Beijing Dynaflow Experiment Technology Co Ltd
Priority to CN202110157242.1A priority Critical patent/CN112836779B/en
Publication of CN112836779A publication Critical patent/CN112836779A/en
Application granted granted Critical
Publication of CN112836779B publication Critical patent/CN112836779B/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/06018Record 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 one-dimensional coding
    • G06K19/06028Record 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 one-dimensional coding using bar 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/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14131D bar codes
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (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)
  • Quality & Reliability (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a one-dimensional code format and a printing device thereof, comprising: four structural areas of a left blank area, a bar code, a digital code and a right blank area; the bar code is positioned between the left blank area and the right blank area; the bar code comprises a plain code, a secret code and at least 34 sub bar codes; the at least 34 sub-barcodes are arranged between the plain code and the secret code; the plain code is arranged at the outermost side of the bar code; the secret code is arranged at the innermost side of the bar code; the digital code is positioned below the bar code and comprises at least 13 digits. Has the advantages that: through the arranged secret code, information in the code is protected, the one-dimensional code is subjected to code breaking detection, the occurrence of the code breaking condition is avoided, the quality of the one-dimensional code is guaranteed, and the waste of resources is reduced.

Description

One-dimensional code format and printing device thereof
Technical Field
The invention relates to the technical field of labels, in particular to a one-dimensional code format and a printing device thereof.
Background
The one-dimensional code is mainly used for commodity identification and is a mark consisting of a group of regularly arranged bar codes and corresponding digital codes. At present, in the prior art, bar codes in one-dimensional codes are all plain codes, no secret code exists, information in the codes cannot be well protected, and no good solution is provided for the condition of code breaking, so that not only is resource waste caused, but also the experience of users is reduced; meanwhile, the quality of the one-dimensional code cannot be guaranteed in the prior art, so that the situation of code scanning failure caused by poor quality occurs.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the art described above. Therefore, the invention aims to provide a one-dimensional code format, which protects the information in the code through the set secret code, and carries out code breaking detection on the one-dimensional code, thereby avoiding the occurrence of the code breaking condition, ensuring the quality of the one-dimensional code and reducing the waste of resources.
To achieve the above object, an embodiment of the present invention provides a one-dimensional code format, including:
four structural areas of a left blank area, a bar code, a digital code and a right blank area; the bar code is positioned between the left blank area and the right blank area; the bar code comprises a plain code, a secret code and at least 34 sub bar codes; the at least 34 sub-barcodes are arranged between the plain code and the secret code;
the plain code is arranged at the outermost side of the bar code;
the secret code is arranged at the innermost side of the bar code;
the digital code is positioned below the bar code and comprises at least 13 digits.
Furthermore, the printing device with the one-dimensional code format comprises an image acquisition module to be detected, a code breaking detection module, a first detection module, an image processing module, a second detection module, a control module and a printing module; the image to be detected acquisition module is used for acquiring at least one first image to be detected with the one-dimensional code format; the code breaking detection module is connected with the image acquisition module to be detected and used for receiving a first image to be detected sent by the image acquisition module to be detected, extracting features of the first image to be detected, extracting a target region in the first image to be detected, carrying out code breaking detection processing on the target region, and screening out the first image to be detected without code breaking in the target region as a second image to be detected; the target area is a bar code area; the first detection module is used for carrying out first definition detection on the second image to be detected sent by the code breaking detection module and sending the second image to be detected qualified by the first definition detection to the control module; sending the unqualified second image to be detected to an image processing module; the image processing module is connected with the first detection module and used for receiving an unqualified second image to be detected sent by the first detection module and preprocessing the unqualified second image to be detected to obtain a third image to be detected; the second detection module is connected with the image processing module and used for receiving a third image to be detected sent by the image processing module, performing second definition detection on the third image to be detected, sending the third image to be detected qualified after the second detection to the control module, and sending the unqualified third image to be detected to the image processing module; the control module respectively with first detection module, second detection module, print module are connected for receive the qualified second that first detection module sent wait to detect the image with the qualified third that second detection module sent waits to detect the image, and control print module will be qualified the second wait to detect the image and the third wait to detect the image and print.
Further, the code breaking detection module comprises a feature extraction submodule for performing feature extraction on the first image to be detected, extracting a target region in the first image to be detected, and taking the target region as a first target region map; the brightness correction submodule is connected with the feature extraction submodule and used for receiving a first target area map sent by the feature extraction submodule, acquiring the brightness value of each pixel point in the first target area map, generating a first brightness distribution map according to the brightness value of each pixel point, inputting the brightness distribution map into a pre-trained brightness correction model, outputting a second brightness distribution map, and matching the second brightness distribution map with the first target area map to obtain a second target area map; the brightness correction model is a neural network model obtained by training a first brightness distribution graph of a sample and a second brightness distribution graph corresponding to the first brightness distribution graph of the sample; the image binarization submodule is connected with the brightness correction submodule and used for receiving the second target area image sent by the brightness correction submodule and carrying out image binarization processing on the second target area image to obtain a third target area image; the barcode quantity judgment sub-module is connected with the image binarization sub-module and used for receiving a third target area map sent by the image binarization sub-module, processing the third target area map based on a connected area analysis method to obtain a plurality of connected areas, respectively acquiring the shapes of the connected areas, screening the connected areas with rectangular shapes, counting the number of the connected areas with rectangular shapes, judging whether the number is smaller than a preset number, and when the number is determined to be smaller than the preset number, performing code breaking marking on a first to-be-detected image corresponding to the third target area map and sending the first to-be-detected image to a code breaking module; on the contrary, the communicated region in the rectangular shape is used as a sub-bar code and is sent to a bar code length detection sub-module; the bar code length detection sub-module is connected with the bar code quantity judgment sub-module and used for receiving the sub-bar codes sent by the bar code quantity judgment sub-module, respectively extracting the characteristics of the sub-bar codes, extracting the upper and lower boundaries of the sub-bar codes, respectively calculating the lengths of the corresponding sub-bar codes according to the upper and lower boundaries, respectively judging whether the lengths are all equal to the preset length or not, and when the lengths are all equal to the preset length, sending a first image to be detected corresponding to the third target area image to the first detection module as a second image to be detected; and otherwise, carrying out code breaking marking on the first image to be detected corresponding to the third target area image and sending the image to be detected to a code breaking module. The code breaking submodule is respectively connected with the barcode quantity judging submodule and the barcode length detecting submodule and is used for receiving and storing a first image to be detected sent by the barcode quantity judging submodule and the barcode length detecting submodule.
Further, the code breaking submodule comprises a receiving unit, and the receiving unit is used for receiving the first image to be detected sent by the bar code quantity judging submodule and the length detecting submodule; the storage unit is used for storing the first image to be detected sent by the receiving unit; and the alarm unit is used for sending an alarm prompt when the receiving unit receives the first image to be detected.
Further, the alarm unit comprises a buzzer alarm.
Further, the first detection module comprises a first definition calculating sub-module, which is used for calculating the first definition of the second image to be detected; the first sending submodule is used for judging whether the first definition is greater than the preset definition or not, and sending the second image to be detected to the control module when the definition is determined to be greater than the preset definition; otherwise, sending the second image to be detected to an image processing module;
calculating the first definition of the second image to be detected, including:
calculating the average gray value L of the second image to be detected, as shown in formula (1):
Figure BDA0002934183910000041
wherein M is the length of the second image to be detected; n is the width of the second image to be detected; x is the maximum value of the abscissa of the pixel point in the second image to be detected; y is the maximum value of the vertical coordinate of the pixel point in the second image to be detected; f (i, j) is the gray value of the pixel point (i, j) in the second image to be detected;
calculating the first definition S of the second image to be detected according to the average gray value L of the second image to be detected, as shown in formula (2):
Figure BDA0002934183910000042
wherein f ismaxThe maximum gray value of the pixel point in the second image to be detected is obtained; f. ofminAnd the minimum gray value of the pixel point in the second image to be detected is obtained.
Further, the image processing module comprises a receiving sub-module, which is used for receiving the second image to be detected sent by the first sending sub-module; the first gray-scale image generation submodule is used for carrying out image graying on the second image to be detected to obtain a gray-scale image and generating a first gray-scale image according to the gray-scale image; the first gray scale image processing submodule is connected with the first gray scale image generating submodule and used for receiving a first gray scale image sent by the first gray scale image generating submodule, acquiring a gray scale value of each pixel point in the first gray scale image, screening the pixel points of which the gray scale values are smaller than a preset first gray scale value, counting the first number of the pixel points of which the gray scale values are smaller than the preset first gray scale value, and calculating the first percentage of the first number in all the pixel points; screening pixel points with the gray scale values larger than a preset second gray scale value, counting a second number of the pixel points with the gray scale values larger than or equal to the preset second gray scale value, and calculating a second percentage of the second number in all the pixel points; calculating a correction coefficient according to the first percentage and the second percentage; performing image segmentation processing on the first gray-scale image to obtain a plurality of sub first gray-scale images, respectively performing equalization processing on the plurality of sub first gray-scale images based on the correction coefficient, and combining the plurality of sub first gray-scale images after equalization processing to obtain a second gray-scale image; the noise reduction submodule is connected with the first gray scale image processing submodule and used for receiving a second gray scale image sent by the first gray scale image processing submodule, acquiring a first pixel value of each pixel point in the second gray scale image and calculating according to the first pixel value to obtain a first average value; obtaining absolute values of pixel difference values of a plurality of first pixel values and a first mean value according to a plurality of first pixel values and the first mean value, obtaining a second mean value according to the absolute values of the plurality of pixel difference values, multiplying the second mean value by a preset constant to obtain a noise value of the second gray scale image, obtaining a signal-to-noise ratio function according to the noise value, and substituting the first pixel value of each pixel point in the second gray scale image into the signal-to-noise ratio function respectively to obtain a second pixel value of each pixel point after noise reduction; and the confirming submodule is connected with the noise reduction submodule and used for receiving the second pixel value of each pixel point after noise reduction processing and sent by the noise reduction submodule and generating a third image to be detected after confirmation.
Further, the second detection module comprises a second definition detection submodule for performing second definition calculation on a third image to be detected to obtain a second definition; the second sending submodule is used for judging whether the second definition is greater than the preset definition or not, and sending the third image to be detected to the control module when the second definition is determined to be greater than the preset definition; otherwise, sending the third image to be detected to an image processing module for secondary processing;
furthermore, the control module comprises a first control sub-module which is used for carrying out information interaction with the first detection module, the image processing module and the second detection module; and the second control submodule is used for controlling the printing module to print the received second image to be detected and the received third image to be detected.
The invention has the beneficial effects that: through the secret code that sets up, make the information in the sign indicating number obtain the protection, carry out disconnected sign indicating number to one-dimensional code image and detect, avoided causing because of disconnected sign indicating number and can not sweep out the condition of sign indicating number interior information, reduced the waste of resource, carry out image detection and carry out image processing to the one-dimensional code image that does not have disconnected sign indicating number simultaneously, guaranteed the definition of one-dimensional code image, guaranteed the quality of the one-dimensional code that prints out, increased the practicality of this device, improved user's experience and felt.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a one-dimensional code format diagram of a one-dimensional code format and printing apparatus therefor according to the present invention;
FIG. 2 is a block diagram of a first embodiment of a one-dimensional code format and printing apparatus therefor in accordance with the present invention;
FIG. 3 is a block diagram of a second embodiment of a one-dimensional code format and printing apparatus therefor in accordance with the present invention;
fig. 4 is a block diagram of a third embodiment of a one-dimensional code format and a printing apparatus therefor according to the present invention.
Reference numerals:
the device comprises a left blank area 1, a barcode 2, a digital code 3, a right blank area 4, an image acquisition module 5 to be detected, a broken code detection module 6, a feature extraction sub-module 601, a brightness correction sub-module 602, an image binarization module 603, a barcode number judgment sub-module 604, a barcode length detection sub-module 605, a broken code sub-module 606, a first detection module 7, an image processing module 8, a receiving sub-module 801, a first gray-scale image generation sub-module 802, a first gray-scale image processing sub-module 803, a noise reduction sub-module 804, a confirmation sub-module 805, a second detection module 9, a control module 10 and a printing module 11.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
A one-dimensional code format and a printing apparatus according to an embodiment of the present invention will be described with reference to fig. 1 to 4.
According to some embodiments of the invention, a one-dimensional code format comprises: four structural areas of a left blank area, a bar code, a digital code and a right blank area; the bar code is positioned between the left blank area and the right blank area; the bar code comprises a plain code, a secret code and at least 34 sub bar codes; the at least 34 sub-barcodes are arranged between the plain code and the secret code; the plain code is arranged at the outermost side of the bar code; the secret code is arranged at the innermost side of the bar code; the digital code is positioned below the bar code and comprises at least 13 digits.
The working principle and the beneficial effects of the scheme are as follows: the bar code is used for storing commodity information, the digital code is used for being scanned as a standby code when the bar code is in an accident situation, the secret code is used for protecting the commodity information in the code and avoiding the commodity information from being stolen, and the clear code is used for increasing the characteristic value of the one-dimensional code, so that the accuracy of a scanning result is improved, and the experience of a user is improved.
According to some embodiments of the present invention, the printing apparatus with one-dimensional code format further comprises an image to be detected acquiring module, a code breaking detecting module, a first detecting module, an image processing module, a second detecting module, a control module and a printing module; the image to be detected acquisition module is used for acquiring at least one first image to be detected with the one-dimensional code format; the code breaking detection module is connected with the image acquisition module to be detected and used for receiving a first image to be detected sent by the image acquisition module to be detected, extracting features of the first image to be detected, extracting a target region in the first image to be detected, carrying out code breaking detection processing on the target region, and screening out the first image to be detected without code breaking in the target region as a second image to be detected; the target area is a bar code area; the first detection module is used for carrying out first definition detection on the second image to be detected sent by the code breaking detection module and sending the second image to be detected qualified by the first definition detection to the control module; sending the unqualified second image to be detected to an image processing module; the image processing module is connected with the first detection module and used for receiving an unqualified second image to be detected sent by the first detection module and preprocessing the unqualified second image to be detected to obtain a third image to be detected; the second detection module is connected with the image processing module and used for receiving a third image to be detected sent by the image processing module, performing second definition detection on the third image to be detected, sending the third image to be detected qualified after the second detection to the control module, and sending the unqualified third image to be detected to the image processing module; the control module respectively with first detection module, second detection module, print module are connected for receive the qualified second that first detection module sent wait to detect the image with the qualified third that second detection module sent waits to detect the image, and control print module will be qualified the second wait to detect the image and the third wait to detect the image and print.
The working principle and the beneficial effects of the scheme are as follows: through carrying out disconnected sign indicating number to one-dimensional code image and detecting, avoided causing because of disconnected sign indicating number and sweep the condition of sign indicating number failure, the waste of resource has been reduced, the one-dimensional code image to disconnected sign indicating number is saved and is sent out the suggestion of reporting to the police and remind the user in time to handle, user's experience is felt has been improved, carry out image detection and carry out image processing to the one-dimensional code image that does not have disconnected sign indicating number simultaneously, the definition of one-dimensional code image has been guaranteed, the quality of the one-dimensional code that prints out has been guaranteed, and then the efficiency and the success rate of sweeping the sign indicating number have been guaranteed, the practicality.
According to some embodiments of the present invention, the code-breaking detection module includes a feature extraction sub-module, configured to perform feature extraction on the first image to be detected, extract a target region in the first image to be detected, and use the target region as a first target region map; the brightness correction submodule is connected with the feature extraction submodule and used for receiving a first target area map sent by the feature extraction submodule, acquiring the brightness value of each pixel point in the first target area map, generating a first brightness distribution map according to the brightness value of each pixel point, inputting the brightness distribution map into a pre-trained brightness correction model, outputting a second brightness distribution map, and matching the second brightness distribution map with the first target area map to obtain a second target area map; the brightness correction model is a neural network model obtained by training a first brightness distribution graph of a sample and a second brightness distribution graph corresponding to the first brightness distribution graph of the sample; the image binarization submodule is connected with the brightness correction submodule and used for receiving the second target area image sent by the brightness correction submodule and carrying out image binarization processing on the second target area image to obtain a third target area image; the barcode quantity judgment sub-module is connected with the image binarization sub-module and used for receiving a third target area map sent by the image binarization sub-module, processing the third target area map based on a connected area analysis method to obtain a plurality of connected areas, respectively acquiring the shapes of the connected areas, screening the connected areas with rectangular shapes, counting the number of the connected areas with rectangular shapes, judging whether the number is smaller than a preset number, and when the number is determined to be smaller than the preset number, performing code breaking marking on a first to-be-detected image corresponding to the third target area map and sending the first to-be-detected image to a code breaking module; on the contrary, the communicated region in the rectangular shape is used as a sub-bar code and is sent to a bar code length detection sub-module; the bar code length detection sub-module is connected with the bar code quantity judgment sub-module and used for receiving the sub-bar codes sent by the bar code quantity judgment sub-module, respectively extracting the characteristics of the sub-bar codes, extracting the upper and lower boundaries of the sub-bar codes, respectively calculating the lengths of the corresponding sub-bar codes according to the upper and lower boundaries, respectively judging whether the lengths are all equal to the preset length or not, and when the lengths are all equal to the preset length, sending a first image to be detected corresponding to the third target area image to the first detection module as a second image to be detected; and otherwise, carrying out code breaking marking on the first image to be detected corresponding to the third target area image and sending the image to be detected to a code breaking module. The code breaking submodule is respectively connected with the barcode quantity judging submodule and the barcode length detecting submodule and is used for receiving and storing a first image to be detected sent by the barcode quantity judging submodule and the barcode length detecting submodule.
The working principle and the beneficial effects of the scheme are as follows: the feature extraction sub-module is used for extracting features of the first image to be detected, extracting a target region in the first image to be detected, taking the target region as a first target region graph, extracting a bar code region in the first image to be detected and carrying out code breaking detection, so that the accuracy of subsequent detection is ensured, the calculated amount of the subsequent detection is introduced, and the detection efficiency is improved; the brightness correction submodule is connected with the feature extraction submodule and used for receiving a first target area map sent by the feature extraction submodule, acquiring the brightness value of each pixel point in the first target area map, generating a first brightness distribution map according to the brightness value of each pixel point, inputting the brightness distribution map into a pre-trained brightness correction model, outputting a second brightness distribution map, and matching the second brightness distribution map with the first target area map to obtain a second target area map; the brightness correction model is a neural network model obtained by training a first brightness distribution map of a sample and a second brightness distribution map corresponding to the first brightness distribution map of the sample, the first brightness distribution map is trained through a pre-trained neural network model, so that the brightness value on the output second brightness distribution map is more accurate, the second brightness distribution map is matched with the first target area map, the second brightness distribution map corresponds to the pixel points of the first target area map one by one, the identification degree of the matched second target area map is improved, and the accuracy of subsequent detection is improved; the image binarization sub-module is connected with the brightness correction sub-module and is used for receiving the second target area image sent by the brightness correction sub-module, carrying out image binarization processing on the second target area image to obtain a third target area image, and carrying out image binarization processing on the second target area image to enable the characteristics of the third target area image to be more obvious; the barcode quantity judgment sub-module is connected with the image binarization sub-module and used for receiving a third target area map sent by the image binarization sub-module, processing the third target area map based on a connected area analysis method to obtain a plurality of connected areas, respectively acquiring the shapes of the connected areas, screening the connected areas with rectangular shapes, counting the number of the connected areas with rectangular shapes, judging whether the number is smaller than a preset number, and when the number is determined to be smaller than the preset number, performing code breaking marking on a first to-be-detected image corresponding to the third target area map and sending the first to-be-detected image to a code breaking module; otherwise, the connected regions with the rectangular shapes are used as the sub-barcodes and are sent to the barcode length detection sub-module, and the number of the rectangular connected regions is judged as the barcodes are rectangular; the bar code length detection sub-module is connected with the bar code quantity judgment sub-module and used for receiving the sub-bar codes sent by the bar code quantity judgment sub-module, respectively extracting the characteristics of the sub-bar codes, extracting the upper and lower boundaries of the sub-bar codes, respectively calculating the lengths of the corresponding sub-bar codes according to the upper and lower boundaries, respectively judging whether the lengths are all equal to the preset length or not, and when the lengths are all equal to the preset length, sending a first image to be detected corresponding to the third target area image to the first detection module as a second image to be detected; on the contrary, the first image to be detected corresponding to the third target area image is subjected to code breaking marking and sent to a code breaking module, the lengths of the sub-barcodes are all consistent, the calculated lengths of the sub-barcodes are more accurate by extracting the upper and lower boundaries of the sub-barcodes, and the accuracy of the final detection result is improved; the code breaking submodule is respectively connected with the barcode quantity judging submodule and the barcode length detecting submodule and is used for receiving and storing a first image to be detected sent by the barcode quantity judging submodule and the barcode length detecting submodule.
According to some embodiments of the invention, the code breaking submodule comprises a receiving unit, a judging submodule and a length detecting submodule, wherein the receiving unit is used for receiving a first image to be detected sent by the code quantity judging submodule and the length detecting submodule; the storage unit is used for storing the first image to be detected sent by the receiving unit; and the alarm unit is used for sending an alarm prompt when the receiving unit receives the first image to be detected.
The working principle and the beneficial effects of the scheme are as follows: the storage unit is used for storing the first image to be detected sent by the receiving unit, backing up the first image to be detected with the code breaking and increasing the subsequent experience of a user, and the alarm unit is used for sending an alarm prompt when the receiving unit receives the first image to be detected; and reminding the user to process in time.
According to some embodiments of the invention, the alarm unit comprises a buzzer alarm.
According to some embodiments of the invention, the first detection module comprises a first sharpness calculation sub-module for calculating a first sharpness of the second image to be detected; the first sending submodule is used for judging whether the first definition is greater than the preset definition or not, and sending the second image to be detected to the control module when the definition is determined to be greater than the preset definition; otherwise, sending the second image to be detected to an image processing module;
calculating the first definition of the second image to be detected, including:
calculating the average gray value L of the second image to be detected, as shown in formula (1):
Figure BDA0002934183910000111
wherein M is the length of the second image to be detected; n is the width of the second image to be detected; x is the maximum value of the abscissa of the pixel point in the second image to be detected; y is the maximum value of the vertical coordinate of the pixel point in the second image to be detected; f (i, j) is the gray value of the pixel point (i, j) in the second image to be detected;
calculating the first definition S of the second image to be detected according to the average gray value L of the second image to be detected, as shown in formula (2):
Figure BDA0002934183910000112
wherein f ismaxThe maximum gray value of the pixel point in the second image to be detected is obtained; f. ofminAnd the minimum gray value of the pixel point in the second image to be detected is obtained.
The working principle and the beneficial effects of the scheme are as follows: the definition is a parameter capable of representing important characteristics of an image, the higher the definition is, the better the quality of the second image to be detected is, in order to ensure the quality of the finally printed one-dimensional code, it is very necessary to calculate the definition of the second image to be detected, when calculating the first definition of the second image to be detected, the factors such as the length of the second image to be detected, the width of the second image to be detected, the average gray value L of the second image to be detected, the maximum gray value of the pixel points in the second image to be detected, the minimum gray value of the pixel points in the second image to be detected are considered, so that the calculated first definition is more accurate, the accuracy of judging the first definition and the preset definition is improved, and when the first definition is greater than the preset definition, the second image to be detected is sent to a control module, and when the first definition is smaller than the preset definition, the second image to be detected is sent to an image processing module for processing.
According to some embodiments of the present invention, the image processing module includes a receiving sub-module, configured to receive the second image to be detected sent by the first sending sub-module; the first gray-scale image generation submodule is used for carrying out image graying on the second image to be detected to obtain a gray-scale image and generating a first gray-scale image according to the gray-scale image; the first gray scale image processing submodule is connected with the first gray scale image generating submodule and used for receiving a first gray scale image sent by the first gray scale image generating submodule, acquiring a gray scale value of each pixel point in the first gray scale image, screening the pixel points of which the gray scale values are smaller than a preset first gray scale value, counting the first number of the pixel points of which the gray scale values are smaller than the preset first gray scale value, and calculating the first percentage of the first number in all the pixel points; screening pixel points with the gray scale values larger than a preset second gray scale value, counting a second number of the pixel points with the gray scale values larger than or equal to the preset second gray scale value, and calculating a second percentage of the second number in all the pixel points; calculating a correction coefficient according to the first percentage and the second percentage; performing image segmentation processing on the first gray-scale image to obtain a plurality of sub first gray-scale images, respectively performing equalization processing on the plurality of sub first gray-scale images based on the correction coefficient, and combining the plurality of sub first gray-scale images after equalization processing to obtain a second gray-scale image; the noise reduction submodule is connected with the first gray scale image processing submodule and used for receiving a second gray scale image sent by the first gray scale image processing submodule, acquiring a first pixel value of each pixel point in the second gray scale image and calculating according to the first pixel value to obtain a first average value; obtaining absolute values of pixel difference values of a plurality of first pixel values and a first mean value according to a plurality of first pixel values and the first mean value, obtaining a second mean value according to the absolute values of the plurality of pixel difference values, multiplying the second mean value by a preset constant to obtain a noise value of the second gray scale image, obtaining a signal-to-noise ratio function according to the noise value, and substituting the first pixel value of each pixel point in the second gray scale image into the signal-to-noise ratio function respectively to obtain a second pixel value of each pixel point after noise reduction; and the confirming submodule is connected with the noise reduction submodule and used for receiving the second pixel value of each pixel point after noise reduction processing and sent by the noise reduction submodule and generating a third image to be detected after confirmation.
The working principle and the beneficial effects of the scheme are as follows: the first gray-scale image generation submodule is used for carrying out image graying on the second image to be detected to obtain a gray-scale image, carrying out image graying on the second image to be detected to avoid the strip distortion of the second image to be detected and generating a first gray-scale image according to the gray-scale image; the first gray scale image processing submodule is connected with the first gray scale image generating submodule and used for receiving a first gray scale image sent by the first gray scale image generating submodule, acquiring a gray scale value of each pixel point in the first gray scale image, screening the pixel points of which the gray scale values are smaller than a preset first gray scale value, counting the first number of the pixel points of which the gray scale values are smaller than the preset first gray scale value, and calculating the first percentage of the first number in all the pixel points; screening pixel points with the gray scale values larger than a preset second gray scale value, counting a second number of the pixel points with the gray scale values larger than or equal to the preset second gray scale value, and calculating a second percentage of the second number in all the pixel points; calculating a correction coefficient according to the first percentage and the second percentage, wherein the correction coefficient is the ratio of the first percentage to the second percentage, and the correction coefficient calculated according to the first percentage and the second percentage is more accurate; performing image segmentation processing on the first gray-scale image to obtain a plurality of sub first gray-scale images, respectively performing equalization processing on the plurality of sub first gray-scale images based on the correction coefficient, combining the plurality of equalized sub first gray-scale images to obtain a second gray-scale image, and respectively performing equalization processing on the plurality of sub first gray-scale images based on the correction coefficient to enable the equalized sub first gray-scale images to be clearer; the noise reduction submodule is used for receiving a second gray scale image sent by the first gray scale image processing submodule, acquiring a first pixel value of each pixel point in the second gray scale image, and calculating according to the first pixel value to obtain a first average value; obtaining absolute values of pixel difference values of a plurality of first pixel values and a first mean value according to a plurality of first pixel values and the first mean value, obtaining a second mean value according to the absolute values of the plurality of pixel difference values, multiplying the second mean value by a preset constant to obtain a noise value of the second gray scale image, obtaining a signal-to-noise ratio function according to the noise value, respectively substituting the first pixel value of each pixel point in the second gray scale image into the signal-to-noise ratio function to obtain a second pixel value of each pixel point after noise reduction treatment, wherein in an example, the second mean value is 50, and then the noise value of the second gray scale image is 50 × 1.6 ═ 80; respectively substituting the first pixel value of each pixel point in the second gray scale image into the signal-to-noise ratio function to obtain the second pixel value of each pixel point after noise reduction treatment, so that the second pixel value of each pixel point after noise reduction is more accurate; and the recognition submodule is connected with the noise reduction submodule and used for receiving the second pixel value of each pixel point after the noise reduction processing sent by the noise reduction submodule and generating a third image to be detected after the second pixel value is confirmed, and the third image to be detected is clearer by carrying out enhancement processing and noise reduction processing on the second image to be detected.
According to some embodiments of the present invention, the second detection module includes a second sharpness detection sub-module, configured to perform a second sharpness calculation on a third image to be detected, so as to obtain a second sharpness; the second sending submodule is used for judging whether the second definition is greater than the preset definition or not, and sending the third image to be detected to the control module when the second definition is determined to be greater than the preset definition; and otherwise, sending the third image to be detected to an image processing module for secondary processing.
The working principle and the beneficial effects of the scheme are that the second definition calculation is carried out on the third image to be detected, the passing rate of the one-dimensional code image is strictly controlled, the quality of the finally printed one-dimensional code image is powerfully guaranteed, the waste of resources is reduced, meanwhile, the third image to be detected, which is unqualified in second detection, is sent to the image processing module for secondary processing, and the intelligence of the device is improved.
According to some embodiments of the invention, the control module comprises a first control sub-module for performing information interaction with the first detection module, the image processing module and the second detection module; and the second control submodule is used for controlling the printing module to print the received second image to be detected and the received third image to be detected.
The working principle and the beneficial effects of the scheme are as follows: the first control submodule is used for carrying out information interaction with the first detection module, the image processing module and the second detection module, so that the timeliness and the accuracy of information transmission of the first detection module, the image processing module and the second detection module are guaranteed, and the working efficiency of the device is improved.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (9)

1. A one-dimensional code format, comprising: four structural areas of a left blank area, a bar code, a digital code and a right blank area;
the bar code is positioned between the left blank area and the right blank area;
the bar code comprises a plain code, a secret code and at least 34 sub bar codes;
the at least 34 sub-barcodes are arranged between the plain code and the secret code;
the plain code is arranged at the outermost side of the bar code;
the secret code is arranged at the innermost side of the bar code;
the digital code is positioned below the bar code and comprises at least 13 digits.
2. The printing apparatus of one-dimensional code format according to claim 1, comprising: the system comprises an image acquisition module to be detected, a code breaking detection module, a first detection module, an image processing module, a second detection module, a control module and a printing module; wherein,
the image to be detected acquisition module is used for acquiring at least one first image to be detected with the one-dimensional code format;
the code breaking detection module is connected with the image acquisition module to be detected and used for receiving a first image to be detected sent by the image acquisition module to be detected, extracting features of the first image to be detected, extracting a target region in the first image to be detected, carrying out code breaking detection processing on the target region, and screening out the first image to be detected without code breaking in the target region as a second image to be detected; the target area is a bar code area;
the first detection module is used for carrying out first definition detection on the second image to be detected sent by the code breaking detection module and sending the second image to be detected qualified by the first definition detection to the control module; sending the unqualified second image to be detected to an image processing module;
the image processing module is connected with the first detection module and used for receiving an unqualified second image to be detected sent by the first detection module and preprocessing the unqualified second image to be detected to obtain a third image to be detected;
the second detection module is connected with the image processing module and used for receiving a third image to be detected sent by the image processing module, performing second definition detection on the third image to be detected, sending the third image to be detected qualified after the second detection to the control module, and sending the unqualified third image to be detected to the image processing module;
the control module respectively with first detection module, second detection module, print module are connected for receive the qualified second that first detection module sent wait to detect the image with the qualified third that second detection module sent waits to detect the image, and control print module will be qualified the second wait to detect the image and the third wait to detect the image and print.
3. The printing apparatus of one-dimensional code format according to claim 2, wherein the code break detection module includes:
the feature extraction submodule is used for extracting features of the first image to be detected, extracting a target area in the first image to be detected and taking the target area as a first target area graph;
the brightness correction submodule is connected with the feature extraction submodule and used for receiving a first target area map sent by the feature extraction submodule, acquiring the brightness value of each pixel point in the first target area map, generating a first brightness distribution map according to the brightness value of each pixel point, inputting the brightness distribution map into a pre-trained brightness correction model, outputting a second brightness distribution map, and matching the second brightness distribution map with the first target area map to obtain a second target area map; the brightness correction model is a neural network model obtained by training a first brightness distribution graph of a sample and a second brightness distribution graph corresponding to the first brightness distribution graph of the sample;
the image binarization submodule is connected with the brightness correction submodule and used for receiving the second target area image sent by the brightness correction submodule and carrying out image binarization processing on the second target area image to obtain a third target area image;
the barcode quantity judgment sub-module is connected with the image binarization sub-module and used for receiving a third target area map sent by the image binarization sub-module, processing the third target area map based on a connected area analysis method to obtain a plurality of connected areas, respectively acquiring the shapes of the connected areas, screening the connected areas with rectangular shapes, counting the number of the connected areas with rectangular shapes, judging whether the number is smaller than a preset number, and when the number is determined to be smaller than the preset number, performing code breaking marking on a first to-be-detected image corresponding to the third target area map and sending the first to-be-detected image to a code breaking module;
on the contrary, the communicated region in the rectangular shape is used as a sub-bar code and is sent to a bar code length detection sub-module;
the bar code length detection sub-module is connected with the bar code quantity judgment sub-module and used for receiving the sub-bar codes sent by the bar code quantity judgment sub-module, respectively extracting the characteristics of the sub-bar codes, extracting the upper and lower boundaries of the sub-bar codes, respectively calculating the lengths of the corresponding sub-bar codes according to the upper and lower boundaries, respectively judging whether the lengths are all equal to the preset length or not, and when the lengths are all equal to the preset length, sending a first image to be detected corresponding to the third target area image to the first detection module as a second image to be detected;
otherwise, code breaking marking is carried out on the first image to be detected corresponding to the third target area image and the first image to be detected is sent to a code breaking module;
the code breaking submodule is respectively connected with the barcode quantity judging submodule and the barcode length detecting submodule and is used for receiving and storing a first image to be detected sent by the barcode quantity judging submodule and the barcode length detecting submodule.
4. A printing apparatus in one-dimensional code format according to claim 3, wherein the break code submodule comprises:
the receiving unit is used for receiving the first image to be detected sent by the bar code number judging submodule and the length detecting submodule;
the storage unit is used for storing the first image to be detected sent by the receiving unit;
and the alarm unit is used for sending an alarm prompt when the receiving unit receives the first image to be detected.
5. The printing apparatus of one-dimensional code format according to claim 4, wherein the alarm unit includes a buzzer alarm.
6. The one-dimensional code format printing apparatus of claim 2, wherein the first detection module comprises:
the first definition calculating operator module is used for calculating the first definition of the second image to be detected;
the first sending submodule is used for judging whether the first definition is greater than the preset definition or not, and sending the second image to be detected to the control module when the definition is determined to be greater than the preset definition;
otherwise, sending the second image to be detected to an image processing module;
calculating the first definition of the second image to be detected, including:
calculating the average gray value L of the second image to be detected, as shown in formula (1):
Figure FDA0002934183900000041
wherein M is the length of the second image to be detected; n is the width of the second image to be detected; x is the maximum value of the abscissa of the pixel point in the second image to be detected; y is the maximum value of the vertical coordinate of the pixel point in the second image to be detected; f (i, j) is the gray value of the pixel point (i, j) in the second image to be detected;
calculating the first definition S of the second image to be detected according to the average gray value L of the second image to be detected, as shown in formula (2):
Figure FDA0002934183900000051
wherein f ismaxThe maximum gray value of the pixel point in the second image to be detected is obtained; f. ofminAnd the minimum gray value of the pixel point in the second image to be detected is obtained.
7. The printing apparatus of one-dimensional code format according to claim 6, wherein the image processing module includes:
the receiving submodule is used for receiving the second image to be detected sent by the first sending submodule;
the first gray-scale image generation submodule is used for carrying out image graying on the second image to be detected to obtain a gray-scale image and generating a first gray-scale image according to the gray-scale image;
the first gray scale image processing submodule is connected with the first gray scale image generating submodule and is used for:
receiving a first gray scale image sent by the first gray scale image generation submodule, acquiring a gray scale value of each pixel point in the first gray scale image, screening the pixel points of which the gray scale values are smaller than a preset first gray scale value, counting the first number of the pixel points of which the gray scale values are smaller than the preset first gray scale value, and calculating the first percentage of the first number in all the pixel points;
screening pixel points with the gray scale values larger than a preset second gray scale value, counting a second number of the pixel points with the gray scale values larger than or equal to the preset second gray scale value, and calculating a second percentage of the second number in all the pixel points;
calculating a correction coefficient according to the first percentage and the second percentage;
performing image segmentation processing on the first gray-scale image to obtain a plurality of sub first gray-scale images, respectively performing equalization processing on the plurality of sub first gray-scale images based on the correction coefficient, and combining the plurality of sub first gray-scale images after equalization processing to obtain a second gray-scale image;
the noise reduction sub-module is connected with the first gray scale image processing sub-module and is used for:
receiving a second gray scale image sent by the first gray scale image processing submodule, acquiring a first pixel value of each pixel point in the second gray scale image, and calculating according to the first pixel value to obtain a first average value;
obtaining absolute values of pixel difference values of a plurality of first pixel values and a first mean value according to a plurality of first pixel values and the first mean value, obtaining a second mean value according to the absolute values of the plurality of pixel difference values, multiplying the second mean value by a preset constant to obtain a noise value of the second gray scale image, obtaining a signal-to-noise ratio function according to the noise value, and substituting the first pixel value of each pixel point in the second gray scale image into the signal-to-noise ratio function respectively to obtain a second pixel value of each pixel point after noise reduction;
and the confirming submodule is connected with the noise reduction submodule and used for receiving the second pixel value of each pixel point after noise reduction processing and sent by the noise reduction submodule and generating a third image to be detected after confirmation.
8. The printing apparatus of one-dimensional code format according to claim 2, wherein the second detection module includes:
the second definition detection submodule is used for carrying out second definition calculation on the third image to be detected to obtain second definition;
the second sending submodule is used for judging whether the second definition is greater than the preset definition or not, and sending the third image to be detected to the control module when the second definition is determined to be greater than the preset definition;
and otherwise, sending the third image to be detected to an image processing module for secondary processing.
9. The printing apparatus of one-dimensional code format according to claim 2, wherein the control module includes:
the first control submodule is used for carrying out information interaction with the first detection module, the image processing module and the second detection module;
and the second control submodule is used for controlling the printing module to print the received second image to be detected and the received third image to be detected.
CN202110157242.1A 2021-02-04 2021-02-04 Printing device of one-dimensional code format Active CN112836779B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110157242.1A CN112836779B (en) 2021-02-04 2021-02-04 Printing device of one-dimensional code format

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110157242.1A CN112836779B (en) 2021-02-04 2021-02-04 Printing device of one-dimensional code format

Publications (2)

Publication Number Publication Date
CN112836779A true CN112836779A (en) 2021-05-25
CN112836779B CN112836779B (en) 2023-10-31

Family

ID=75932537

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110157242.1A Active CN112836779B (en) 2021-02-04 2021-02-04 Printing device of one-dimensional code format

Country Status (1)

Country Link
CN (1) CN112836779B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201336039Y (en) * 2009-02-11 2009-10-28 山东大学 Mechanical bar code data plate
US20110259962A1 (en) * 2008-09-23 2011-10-27 Advanced Track And Trace Method and device for authenticating geometrical codes
CN104899589A (en) * 2015-05-12 2015-09-09 广州中大数码科技有限公司 Method for realizing two-dimensional bar code preprocessing by using threshold binarization algorithm
CN105574466A (en) * 2015-12-23 2016-05-11 苏州佳世达电通有限公司 Barcode processing method and barcode processing apparatus
CN108805129A (en) * 2017-08-24 2018-11-13 贵州省烟草公司贵阳市公司 Tobacco laser code assists in identifying method, apparatus and tobacco laser code identification equipment
CN109977717A (en) * 2019-03-18 2019-07-05 北京意锐新创科技有限公司 Bar code method of payment and device based on light and shade code

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110259962A1 (en) * 2008-09-23 2011-10-27 Advanced Track And Trace Method and device for authenticating geometrical codes
CN201336039Y (en) * 2009-02-11 2009-10-28 山东大学 Mechanical bar code data plate
CN104899589A (en) * 2015-05-12 2015-09-09 广州中大数码科技有限公司 Method for realizing two-dimensional bar code preprocessing by using threshold binarization algorithm
CN105574466A (en) * 2015-12-23 2016-05-11 苏州佳世达电通有限公司 Barcode processing method and barcode processing apparatus
CN108805129A (en) * 2017-08-24 2018-11-13 贵州省烟草公司贵阳市公司 Tobacco laser code assists in identifying method, apparatus and tobacco laser code identification equipment
CN109977717A (en) * 2019-03-18 2019-07-05 北京意锐新创科技有限公司 Bar code method of payment and device based on light and shade code

Also Published As

Publication number Publication date
CN112836779B (en) 2023-10-31

Similar Documents

Publication Publication Date Title
CN103914858B (en) Document Image Compression Method And Its Application In Document Authentication
CN106033544B (en) Template matching-based test paper content area extraction method
CN105160339B (en) A kind of Quick Response Code print quality online evaluation method
CN110210477B (en) Digital instrument reading identification method
CN114926839B (en) Image identification method based on RPA and AI and electronic equipment
EP2014082A1 (en) Generating a bitonal image from a scanned colour image
CN115302963B (en) Bar code printing control method, system and medium based on machine vision
CN114155527A (en) Scene text recognition method and device
CN111340041A (en) License plate recognition method and device based on deep learning
CN112001200A (en) Identification code identification method, device, equipment, storage medium and system
CN114266764A (en) Character integrity detection method and device for printed label
CN110291527B (en) Information processing method, system, cloud processing device and computer program product
CN115512381A (en) Text recognition method, text recognition device, text recognition equipment, storage medium and working machine
CN111507119A (en) Identification code identification method and device, electronic equipment and computer readable storage medium
US5553162A (en) Method for detecting ink jet or dot matrix printing
Sun et al. Identification of QR codes based on pattern recognition
CN112836779B (en) Printing device of one-dimensional code format
CN110874538B (en) Method and device for evaluating decoding result of bar code and electronic equipment
CN111753842B (en) Method and device for detecting text region of bill
CN114663731A (en) Training method and system of license plate detection model, and license plate detection method and system
CN111626982A (en) Method and device for identifying batch codes of containers to be detected
CN118097676B (en) Downhole tool tag monitoring system based on image processing
CN111046860A (en) Intelligent claim settlement system based on mobile carrier
CN115359543B (en) Remote printing method and system based on block chain
CN117542023B (en) Traffic sign detection method, device, electronic equipment 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