CN111460848B - Reading equipment and method capable of identifying bar codes of various materials and color bar codes - Google Patents

Reading equipment and method capable of identifying bar codes of various materials and color bar codes Download PDF

Info

Publication number
CN111460848B
CN111460848B CN202010251109.8A CN202010251109A CN111460848B CN 111460848 B CN111460848 B CN 111460848B CN 202010251109 A CN202010251109 A CN 202010251109A CN 111460848 B CN111460848 B CN 111460848B
Authority
CN
China
Prior art keywords
light
lamp
light supplementing
color
bar code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010251109.8A
Other languages
Chinese (zh)
Other versions
CN111460848A (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.)
Fuzhou Symbol Information Technology Co ltd
Original Assignee
Fuzhou Symbol Information 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 Fuzhou Symbol Information Technology Co ltd filed Critical Fuzhou Symbol Information Technology Co ltd
Priority to CN202010251109.8A priority Critical patent/CN111460848B/en
Publication of CN111460848A publication Critical patent/CN111460848A/en
Application granted granted Critical
Publication of CN111460848B publication Critical patent/CN111460848B/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
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
    • 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
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Landscapes

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

Abstract

The invention relates to a reading device capable of identifying bar codes of various materials and color bar codes, comprising: the system comprises a processor, an imaging module and a light supplementing lamp module, wherein the light supplementing lamp module comprises a plurality of light supplementing lamps, and the light supplementing lamps comprise white light supplementing lamps and non-white light supplementing lamps; the processor controls the light supplementing lamp module to light a white light supplementing lamp; the imaging module collects the current bar code to obtain a digitized bar code image, and then sends the digitized bar code image to the processor; the processor inquires a light supplementing lamp mapping table according to gray value characteristics of the gray image, and determines the color of the light supplementing lamp suitable for the bar code of the current type; establishing a mapping relation between a gray scale range value and the color of the light supplementing lamp in the light supplementing lamp mapping table; the processor controls the light supplementing lamp module to light the light supplementing lamp corresponding to the color, and the light supplementing lamp is set; the bar code reading device starts to collect bar codes after the light supplementing lamp is arranged. The invention improves the depth of field range and decoding capability of the bar code reading equipment by automatically adjusting the color and brightness of the light supplementing lamp.

Description

Reading equipment and method capable of identifying bar codes of various materials and color bar codes
Technical Field
The invention relates to a recognition device and a recognition method capable of recognizing bar codes of various materials and color bar codes, belonging to the field of bar code recognition.
Background
The existing bar codes mainly comprise one-dimensional bar codes and two-dimensional bar codes. The one-dimensional bar code is a graphic identifier for expressing a group of information by arranging a plurality of bars with unequal widths and spaces according to a certain coding rule, and common one-dimensional bar codes are as follows: bar codes, which are a pattern of parallel lines of bars and spaces of widely varying reflectivity. The two-dimensional code records information by using a certain specific geometric figure distributed on a plane (in a two-dimensional direction) according to a certain rule and a black-white alternate figure. With the rapid development of bar code technology, bar codes have been increasingly used in various fields. The color of the bar code and the color of the bar code background are also various, for example, the color is used as a background color, the bar code is black or white, or the bar code is colored (i.e., one color other than black and white is adopted), and the background color is black or white; or both the bar code and the background color are colored (e.g., red bar code, yellow background color). Meanwhile, the existing bar codes are not limited to being printed on paper surfaces and packaging bags, and bar codes are often manufactured on the surfaces of some unconventional materials, such as transparent plastics and metals (dark colors, light colors and the like). The diversification of bar code forms also puts higher demands on bar code reading equipment.
The existing bar code reading equipment is generally a light supplementing lamp which provides a single light source and has fixed brightness, and the equipment adjusts the brightness of the light supplementing lamp to be within a standard range before leaving a factory and then fixes the brightness value. When a camera of the bar code reading device collects bar code images, no matter what presentation form the bar code adopts, a uniform light source is adopted for light supplementing. The barcode image collected by the camera is transmitted back to the processor for decoding, and for the barcode made of the color barcode and the special medium, the barcode image has poor contrast and limited depth of field, and various problems such as difficult decoding and even failure decoding occur when the processor decodes the barcode image.
Disclosure of Invention
In order to solve the technical problems, the invention provides a reading device capable of identifying bar codes of various materials and color bar codes, and the depth of field and decoding capability of the bar code reading device are improved by automatically adjusting the color and brightness of a light supplementing lamp.
The first technical scheme of the invention is as follows:
the reading equipment capable of identifying bar codes of various materials and color bar codes comprises a processor, an imaging module and a light supplementing lamp module, wherein the light supplementing lamp module and the imaging module are both in communication connection with the processor, the light supplementing lamp module comprises a plurality of light supplementing lamps, and the light supplementing lamps comprise white light supplementing lamps and non-white light supplementing lamps; the processor stores instructions, and the processor loads the instructions and executes the following light filling lamp setting steps: the processor controls the light supplementing lamp module to light a white light supplementing lamp; the imaging module collects the current bar code to obtain a digitized bar code image, and then converts the bar code image into a gray image and sends the gray image to the processor; the bar code image comprises a bar code and the background information related to the bar code; the processor inquires a light supplementing lamp mapping table according to gray value characteristics of the gray image, and determines the color of the light supplementing lamp suitable for the bar code of the current type; establishing a mapping relation between a gray scale range value and the color of the light supplementing lamp in the light supplementing lamp mapping table; the processor controls the light supplementing lamp module to light the light supplementing lamp corresponding to the color, and the light supplementing lamp is set; the bar code reading device starts to collect bar codes after the light supplementing lamp is arranged.
More preferably, the generating process of the light filling lamp mapping table is as follows: manufacturing a plurality of test pictures P1-Pi with different background colors, wherein each test picture Pi is subjected to light supplementing by using light supplementing lamps L1-Lj, the light supplementing lamps L1-Lj comprise white light supplementing lamps and light supplementing lamps with other colors, and then, image information of the test pictures is acquired through an imaging module and converted into gray images to be transmitted to a processor; the processor calculates an average gray value of the gray image; the test staff records the average gray value of each test picture under each light supplementing lamp one by one, and establishes an average gray value set A1 j= { A11, A12, A13..A 1j } of the test picture P1, an average gray value set of the test picture P2 is A2 j= { A21, A22, A23..A 2j }, an average gray value set of the test picture P3 is A3 j= { A31, A32, A33..A 3j }, and an average gray value set of the test picture Pi is Aij= { Ai1, ai2, ai3..Aij }; the tester compares the average gray value of the other color light supplement lamps in the average gray value set of each test picture with the average gray value of the white light supplement lamp one by one to obtain j-1 contrast values, and records the light supplement lamp color C1 corresponding to the maximum contrast value and the light supplement lamp color C2 corresponding to the minimum contrast value of the test picture; and establishing a light supplementing lamp mapping table according to the mapping relation between the average gray value of each test picture under the white light supplementing lamp and the light supplementing lamp colors C1 and C2, taking the gray range value in the preset floating range of the average gray value as an index, taking the light supplementing lamp colors C1 and C2 corresponding to the average gray value as mapping values, and then loading the light supplementing lamp mapping table into the reading equipment.
More preferably, the processor queries a light supplementing lamp mapping table according to the gray value characteristic of the gray image, wherein the gray value characteristic is a bar code gray value, the processor identifies a bar code region and a non-bar code region from the gray image, the bar code region comprises a bar code gray value and a background color gray value, and reads the gray value of the non-bar code region, and the gray value is the background color gray value, so that the bar code gray value is determined; inquiring the light supplementing lamp mapping table according to the bar code gray values to obtain an index corresponding to the bar code gray values and a light supplementing lamp color C1 and a light supplementing lamp color C2 mapped by the index, wherein the processor controls the light supplementing lamp module to turn on a light supplementing lamp corresponding to the light supplementing lamp color C1;
more preferably, the processor queries the light filling lamp mapping table according to gray value characteristics of the gray image, wherein the gray value characteristics are background color gray values: the processor identifies a bar code area and a non-bar code area from the gray level image, the bar code area comprises a bar code gray level value and a background color gray level value, the gray level value of the non-bar code area is read, the gray level value is the background color gray level value, the light supplementing lamp mapping table is inquired according to the background color gray level value, an index corresponding to the background color gray level value and a light supplementing lamp color C1 and a light supplementing lamp color C2 mapped by the index are obtained, and the processor controls the light supplementing lamp module to turn on a light supplementing lamp corresponding to the light supplementing lamp color C2.
More preferably, the processor queries the light filling lamp mapping table according to gray value characteristics of the gray image, wherein the gray value characteristics are average gray values: inquiring the light filling lamp mapping table according to the average gray value to obtain an index corresponding to the average gray value and a light filling lamp color C1 and a light filling lamp color C2 mapped by the index, and controlling the light filling lamp module to turn on a light filling lamp corresponding to the light filling lamp color C1 or the light filling lamp color C2 by the processor.
More preferably, the light-compensating lamp mapping table also records brightness values corresponding to the light-compensating lamps with different colors, and specifically, the light-compensating lamp mapping table establishes a mapping relationship between a gray scale range value and the color of the light-compensating lamp and the brightness corresponding to the light-compensating lamp with the color; the processor inquires a light supplementing lamp mapping table according to gray value characteristics of the gray image, and determines the color and brightness value of the light supplementing lamp suitable for the bar code of the current type; the processor controls the light supplementing lamp module to light the light supplementing lamp corresponding to the color, and meanwhile, the processor also controls the light supplementing lamp module to adjust the current, so that the light supplementing lamp reaches the brightness value, and the light supplementing lamp is set.
More preferably, after the completion of the light-compensating lamp setting step, the method further comprises the step of performing light-compensating lamp brightness adjustment: the imaging module collects images possibly containing bar codes after being irradiated by a light supplementing lamp for lighting the light supplementing color; and if the decoding is successful, the processor commands to save the light filling setting, lock the color and the brightness of the light filling lamp, and if the decoding is failed, the processor commands to modify the light filling setting, increase or decrease a preset brightness change value on the current brightness value, and execute the light filling lamp brightness adjusting step again.
More preferably, when the decoding failure occurs, the processor records the contrast ratio of the bar code gray value and the background gray value in the gray image in the FLASH, then the processor executes the brightness adjustment step again, if the decoding failure still occurs, the contrast ratio of the bar code gray value and the background gray value of the current gray image is compared with the contrast ratio of the gray image of the previous frame, if the contrast ratio is increased, the trend of the contrast ratio and the previous brightness adjustment is kept consistent, namely, a preset brightness change value is increased or decreased again; if the contrast ratio is reduced, the preset brightness variation value is reduced or increased contrary to the previous brightness adjustment trend.
More preferably, the reading device further comprises a shell for fixing the light supplementing lamp module and the imaging module, the shell is provided with a window for collecting bar code images and emitting light rays of the light supplementing lamp, the window is provided with a clamping groove for clamping the polarizer, and the polarizer is embedded in the window.
The invention also provides a reading method capable of identifying the bar codes of various materials and the color bar codes.
The technical scheme II of the invention is as follows:
the method adopts a processor, an imaging module and a light supplementing lamp module, wherein the light supplementing lamp module comprises a plurality of light supplementing lamps, and the light supplementing lamps comprise white light supplementing lamps and non-white light supplementing lamps; the processor stores instructions, and the processor loads the instructions and executes the following light filling lamp setting steps: the processor controls the light supplementing lamp module to light a white light supplementing lamp; the imaging module collects the current bar code to obtain a digitized bar code image, and then converts the bar code image into a gray image and sends the gray image to the processor; the bar code image comprises a bar code and the background information related to the bar code; the processor inquires a light supplementing lamp mapping table according to gray value characteristics of the gray image, and determines the color of the light supplementing lamp suitable for the bar code of the current type; establishing a mapping relation between a gray scale range value and the color of the light supplementing lamp in the light supplementing lamp mapping table; the processor controls the light supplementing lamp module to light the light supplementing lamp corresponding to the color, and the light supplementing lamp is set; the bar code reading device starts to collect bar codes after the light supplementing lamp is arranged.
More preferably, the generating process of the light filling lamp mapping table is as follows: manufacturing a plurality of test pictures P1-Pi with different background colors, wherein each test picture Pi is subjected to light supplementing by using light supplementing lamps L1-Lj, the light supplementing lamps L1-Lj comprise white light supplementing lamps and light supplementing lamps with other colors, and then, image information of the test pictures is acquired through an imaging module and converted into gray images to be transmitted to a processor; the processor calculates an average gray value of the gray image; the test staff records the average gray value of each test picture under each light supplementing lamp one by one, and establishes an average gray value set A1 j= { A11, A12, A13..A 1j } of the test picture P1, an average gray value set of the test picture P2 is A2 j= { A21, A22, A23..A 2j }, an average gray value set of the test picture P3 is A3 j= { A31, A32, A33..A 3j }, and an average gray value set of the test picture Pi is Aij= { Ai1, ai2, ai3..Aij }; the tester compares the average gray value of the other color light supplement lamps in the average gray value set of each test picture with the average gray value of the white light supplement lamp one by one to obtain j-1 contrast values, and records the light supplement lamp color C1 corresponding to the maximum contrast value and the light supplement lamp color C2 corresponding to the minimum contrast value of the test picture; and establishing a light supplementing lamp mapping table according to the mapping relation between the average gray value of each test picture under the white light supplementing lamp and the light supplementing lamp colors C1 and C2, taking the gray range value in the preset floating range of the average gray value as an index, taking the light supplementing lamp colors C1 and C2 corresponding to the average gray value as mapping values, and then loading the light supplementing lamp mapping table into the reading equipment.
More preferably, the processor queries the light filling lamp mapping table according to gray value characteristics of the gray image, wherein the gray value characteristics are bar code gray values: the processor identifies a bar code area and a non-bar code area from the gray image, wherein the bar code area comprises a bar code gray value and a background color gray value, and reads the gray value of the non-bar code area, and the gray value is the background color gray value, so that the bar code gray value is determined; inquiring the light supplementing lamp mapping table according to the bar code gray values to obtain an index corresponding to the bar code gray values and a light supplementing lamp color C1 and a light supplementing lamp color C2 mapped by the index, and controlling the light supplementing lamp module to turn on a light supplementing lamp corresponding to the light supplementing lamp color C1 by the processor.
More preferably, the processor queries the light filling lamp mapping table according to gray value characteristics of the gray image, wherein the gray value characteristics are background color gray values: the processor identifies a bar code area and a non-bar code area from the gray level image, the bar code area comprises a bar code gray level value and a background color gray level value, the gray level value of the non-bar code area is read, the gray level value is the background color gray level value, the light supplementing lamp mapping table is inquired according to the background color gray level value, an index corresponding to the background color gray level value and a light supplementing lamp color C1 and a light supplementing lamp color C2 mapped by the index are obtained, and the processor controls the light supplementing lamp module to turn on a light supplementing lamp corresponding to the light supplementing lamp color C2.
More preferably, the processor queries the light filling lamp mapping table according to gray value characteristics of the gray image, wherein the gray value characteristics are average gray values: inquiring the light filling lamp mapping table according to the average gray value to obtain an index corresponding to the average gray value and a light filling lamp color C1 and a light filling lamp color C2 mapped by the index, and controlling the light filling lamp module to turn on a light filling lamp corresponding to the light filling lamp color C1 or the light filling lamp color C2 by the processor.
More preferably, the light-compensating lamp mapping table records brightness values corresponding to the light-compensating lamps of each color, and specifically, the light-compensating lamp mapping table establishes a mapping relationship between a gray scale range value and the color of the light-compensating lamp and the brightness corresponding to the light-compensating lamp of the color; the processor inquires a light supplementing lamp mapping table according to gray value characteristics of the gray image, and determines the color and brightness value of the light supplementing lamp suitable for the bar code of the current type; the processor controls the light supplementing lamp module to light the light supplementing lamp corresponding to the color, and meanwhile, the processor also controls the light supplementing lamp module to adjust the current, so that the light supplementing lamp reaches the brightness value, and the light supplementing lamp is set.
More preferably, after the completion of the light-compensating lamp setting step, the method further comprises the step of performing light-compensating lamp brightness adjustment: the imaging module collects images possibly containing bar codes after being irradiated by a light supplementing lamp for lighting the light supplementing color; and if the decoding is successful, the processor commands to save the light filling setting, lock the color and the brightness of the light filling lamp, and if the decoding is failed, the processor commands to modify the light filling setting, increase or decrease a preset brightness change value on the current brightness value, and execute the light filling lamp brightness adjusting step again.
More preferably, when the decoding fails, the contrast between the bar code gray value and the background gray value in the gray image is recorded, the brightness adjusting step of the light supplementing lamp is executed again, if the decoding fails, the contrast between the bar code gray value and the background gray value of the current gray image is compared with the contrast of the gray image of the previous frame, if the contrast is improved, the contrast is consistent with the brightness adjusting direction of the previous frame, and then a preset brightness change value is increased or reduced; if the contrast ratio is reduced, the brightness change value is reduced or increased by a preset brightness change value in the opposite direction to the previous brightness adjustment direction.
More preferably, the reading device further comprises a shell for fixing the light supplementing lamp module and the imaging module, the shell is provided with a window for collecting bar code images and emitting light rays of the light supplementing lamp, the window is provided with a clamping groove for clamping the polarizer, and the polarizer is embedded on the window.
The invention has the following beneficial effects:
the identification device is provided with the light supplementing lamps with a plurality of colors and the optimal light supplementing color is set according to the gray level image acquired in the white light supplementing state, so that the identification device can adaptively set the light supplementing lamps according to the bar code color and the bar code material, the image contrast ratio is improved, and the decoding success rate of the bar code identification device is improved.
The bar code reading equipment determines the color of the light supplementing lamp according to the gray value characteristics, can effectively enhance the contrast of bar code images and improves the decoding speed.
The bar code reading equipment can also finely adjust the brightness of the light supplementing lamp, is more flexible to apply, can read bar codes with various colors and materials, and improves the universality of products.
The bar code reading equipment can adopt the light supplementing lamp with the polarizer, thereby improving the reading capability of bar codes made of metal materials and bar codes with bright surface reflection.
Drawings
FIG. 1 is a system block diagram of a reader device of the present invention;
FIG. 2 is a reading flow chart of the reading device of the present invention;
fig. 3 is a reading flow chart of the second embodiment and the fourth embodiment of the present invention.
FIG. 4 is a gray scale intent of a hue circle;
FIG. 5 is a schematic view of a polarizer structure of the reading device of the present invention;
fig. 6 is a schematic diagram of a gray scale image of a barcode image acquired by the present invention.
1. A processor; 2. an imaging module; 3. a light supplementing lamp module; 4. a housing; 5. a polarizer; 31. a light supplementing lamp; 41. a clamping groove.
Detailed Description
The invention will now be described in detail with reference to the drawings and to specific embodiments.
Example 1
Referring to fig. 1 and 2, a reading device capable of identifying bar codes of various materials and color bar codes includes a processor 1, an imaging module 2, and a light compensating module 3, wherein the light compensating module 3 includes a plurality of light compensating lamps 31, and the light compensating lamps 31 include white and non-white light compensating lamps, such as red light compensating lamps, blue light compensating lamps, and the like; instructions are stored in the processor 1, and the processor 1 loads the instructions and executes the following light filling lamp 31 setting steps: the processor 1 controls the light supplementing lamp module 3 to light the white light supplementing lamp 31; the imaging module 2 collects the current bar code to obtain a digitized bar code image, then converts the bar code image into a gray image and sends the gray image to the processor 1, as shown in fig. 6, wherein the gray image of the bar code image is collected by the green background black bar code under the white light supplementing lamp. The bar code image comprises a bar code and the background information related to the bar code; the processor 1 inquires a light supplementing lamp mapping table according to gray value characteristics of the gray image, and determines the color of the light supplementing lamp suitable for the bar code of the current type; the light supplementing lamp mapping table establishes a mapping relation between gray values and colors of the light supplementing lamps; the processor 1 controls the light supplementing lamp module 3 to light the light supplementing lamp 31 corresponding to the color, the setting of the light supplementing lamp 31 is completed, and the bar code reading equipment starts to collect bar codes after the setting of the light supplementing lamp is completed. Generally, the imaging module 2 includes a lens module and an image sensor, and an external output interface. The barcode image is acquired by an image sensor and the color image is converted into a gray scale image. The bar code reading device also generally comprises a buzzer, a status indicator lamp, a sighting positioning lamp and the like for reminding.
The generation process of the light filling lamp mapping table is as follows: and manufacturing a plurality of test pictures P1-Pi with different background colors, wherein each test picture Pi is subjected to light supplementing by using light supplementing lamps L1-Lj, the light supplementing lamps L1-Lj comprise white light supplementing lamps and light supplementing lamps with other colors, and then, the imaging module is used for acquiring image information of the test pictures and converting the image information into gray level images to be transmitted to the processor 1. The processor 1 calculates an average gray value of the gray image; the tester records the average gray value of each test picture Pi under each light supplement lamp one by one, establishes an average gray value set a1j= { a11, a12, a 13..a1j } of the test picture P1, an average gray value set of the test picture P2 is a2j= { a21, a22, a 23..a2j } the average gray value set for the test picture P3 is a3j= { a31, a32, a 33..a3j }, the average gray value set of the test pictures Pi is aij= { Ai1, ai2, ai3. The tester compares the average gray value of the other color light supplement lamps in the average gray value set of each test picture with the average gray value of the white light supplement lamp one by one to obtain j-1 contrast values, and records the light supplement lamp color C1 corresponding to the maximum contrast value and the light supplement lamp color C2 corresponding to the minimum contrast value of the test picture; and establishing a light supplementing lamp mapping table according to the mapping relation between the average gray value of each test picture under the white light supplementing lamp and the light supplementing lamp colors C1 and C2, taking the gray range value in the preset floating range of the average gray value as an index, taking the light supplementing lamp colors C1 and C2 corresponding to the average gray value as mapping values, as shown in table 1, and loading the light supplementing lamp mapping table into the reading equipment. Generally, the gray scale range value is within a range of + -5% -10% of the average gray scale value of the test picture Pi. When the number of test pictures Pi is small, a large proportion of the floating range, for example 8% -10%, is selected so that the index of the light filling map table can cover the whole gray scale range. When the number of test pictures Pi is small, a small proportion of the floating range, for example 5% -7%, is selected.
Table 1:
Figure GDA0004075296430000051
the processor 1 queries a light filling lamp mapping table according to gray value characteristics of the gray image, wherein the gray value characteristics are bar code gray values or background color gray values or average gray values. The method for obtaining the bar code gray value and the background color gray value can be as follows: the processor 1 identifies a bar code area and a non-bar code area from the gray image, wherein the bar code area comprises a bar code gray value and a background color gray value, and reads the gray value of the non-bar code area, and the gray value is the background color gray value, so that the bar code gray value is determined. Inquiring the light supplementing lamp mapping table according to the bar code gray value to obtain an index corresponding to the bar code gray value and a light supplementing lamp color C1 and a light supplementing lamp color C2 mapped by the index, wherein the processor 1 controls the light supplementing lamp module 3 to turn on a light supplementing lamp 31 corresponding to the light supplementing lamp color C1. The principle is as follows: according to the relationship between colors represented by the hue circle (as shown in fig. 4, in the actual use process, the color hue circle principle is used), namely adjacent colors (for example, blue and green) are called a same color system, as long as the color of the same color system is irradiated to the position of the bar code on the article, the bar code lightens due to strong reflection under the irradiation of the same color system, thereby enhancing the brightness of the bar code, and correspondingly, improving the contrast between the bar code and the background, thereby realizing rapid decoding.
Or inquiring the light supplement lamp mapping table according to the background color gray value to obtain an index corresponding to the background color gray value and the light supplement lamp color C1 and the light supplement lamp color C2 mapped by the index, wherein the processor 1 controls the light supplement lamp module 3 to turn on the light supplement lamp 31 corresponding to the light supplement lamp color C2. The principle is as follows: according to the relation between colors represented by the hue circle, namely colors (for example, green and red) at two ends are called complementary colors, as long as the complementary colors are irradiated to the positions of the bar codes on the article, the background of the bar codes is darkened due to low reflectivity under the irradiation of the complementary colors, so that the brightness of the background is weakened, and correspondingly, the contrast between the bar codes and the background is improved, so that quick decoding is realized.
Or inquiring the light filling lamp mapping table according to the average gray value to obtain the light filling lamp color C1 and the light filling lamp color C2 mapped by the index corresponding to the average gray value, and controlling the light filling lamp module 3 to turn on the light filling lamp 31 corresponding to the light filling lamp color C1 or the light filling lamp color C2 by the processor 1. The sum of the gray values of each pixel point of the image is calculated to be averaged, and the average gray value of the gray image is obtained. Preferably, when the average gray value is smaller than 60, the bar code image is indicated to be entirely dark, the color C1 of the light supplementing lamp is selected to be turned on, and the color C1 of the light supplementing lamp with large contrast can enhance the brightness of the image; when the average gray value is more than 60 and less than 190, the brightness of the bar code image is moderate, and C1 or C2 can be adopted as the color of the light filling lamp, or the two can be used for polling the color of the light filling lamp; when the average gray value is greater than 190, the whole bar code image is brighter, and the color C2 of the light supplementing lamp is selected to be turned on, so that the acquired bar code image is darkened to some extent, and overexplosion or flare cannot occur. The average gray value calculation method of the gray image comprises the following steps: and calculating the sum of gray values of each pixel point of the image, and averaging.
For example, after the bar code image of the green bar code is converted into the gray image, the gray value of the green bar code is 210, the gray value of the green bar code is 120, and the index of the light filling lamp mapping table is searched by using the gray value of the green bar code as 120. In the light filling map, the gray scale value ranges from 110 to 130, the corresponding light filling colors are blue (high contrast) and red (low contrast), and then the light filling color is determined to be blue. The blue light supplementing lamp 31 can reduce the gray level of the pink background color and increase the gray level of the green bar code, thereby enhancing the contrast of the whole image and improving the decoding success rate.
For bar codes made of metal materials, the reflection of the metal surface is complex, is related to the incident wavelength and the surface roughness, is influenced by other factors such as non-zero metal conductivity, and when a bar code image is acquired, bright spots, flare spots and the like can appear in the bar code image due to strong reflection, so that the picture quality is destroyed, and decoding is influenced. Therefore, by arranging a polarizer 5 in front of the light-compensating lamp 31, and matching the polarizer 5 in front of the photographing lens, the polarization direction of the polarizer 5 in front of the photographing lens is perpendicular to (or at an angle of tens of degrees to) the polarization direction of the polarizer 5 in front of the light-compensating lamp 31, the polarized light reflected at the bright spots can be fully absorbed (or partially weakened), so that the strong flare on the surface of the illuminated metal object can be weakened or even eliminated, the illumination effect of the lamp on other parts is basically not influenced, and a clear image is formed on the picture. Specifically, as shown in fig. 5, the reading device further includes a housing 4 for fixing the light compensating lamp module 3 and the imaging module 2, the housing 4 is provided with a window for collecting the bar code image and emitting the light of the light compensating lamp, the window is provided with a clamping groove 41 for clamping the polarizer 5, and the polarizer 5 is embedded in the window. According to the scene requirement, if the bar code material has stronger light reflection or the bar code is printed on the mirror surface or the bar code is placed in the plastic bag, the polarizer 5 is inserted into the clamping groove 41, so that the light emitted by the light supplementing lamp 31 is emitted after passing through the polarizer 5. The harmful reflections and specular images on the smooth surface of the transparency are significantly reduced or even eliminated by the polarizer 5, and a complete and clear image of the scene inside or behind the transparency is captured.
Example two
The first embodiment adds the implementation manners of setting, adjusting and locking the brightness of the light compensating lamp 31, so that the bar code reading device in the first embodiment can adaptively select the color of the light compensating lamp, and can adaptively adjust the brightness of the light compensating lamp 31, thereby greatly improving the capability of the bar code reading device to cope with various flexible and changeable application scenes.
Referring to fig. 3, the setting of the brightness of the light compensating lamp 31 is completed while the setting step of the light compensating lamp 31 is performed, specifically: the light-compensating lamp mapping table also records the brightness values corresponding to the light-compensating lamps 31 of each color, that is, the light-compensating lamp mapping table establishes the mapping relationship between the gray scale range value and the light-compensating lamp color and the brightness value corresponding to the light-compensating lamp 31 of the color; the processor 1 inquires a light supplementing lamp mapping table according to gray value characteristics of the gray image, and determines the color and brightness value of the light supplementing lamp suitable for the bar code of the current type; the processor 1 controls the light supplementing lamp module 3 to light the light supplementing lamp 31 corresponding to the color, and meanwhile, the processor 1 also controls the light supplementing lamp module 3 to adjust the current so that the light supplementing lamp 31 reaches the brightness value, and the setting of the light supplementing lamp 31 is completed. Taking an LED driver AW3643 of an AWINIC company as an example, the processor 1 communicates with the processor 1 through an I2C bus, and the processor 1 sends instructions to configure the working mode of the AW3643 chip, including the lighting of the LED, the current level, the duration of brightness, and the like, and meanwhile, the LED driver can be stopped and abnormal state monitored through HWEN and TX pins on the LED driver. After the above-mentioned setting step of the light compensating lamp 31 is completed, when the acquired barcode image is failed to be decoded by the processor 1, the processor 1 further executes the brightness adjusting step of the light compensating lamp 31: the imaging module 2 acquires an image possibly containing a bar code after being irradiated by a light supplementing lamp 31 which lights a light supplementing color; the processor 1 decodes the barcode image, if the decoding is successful, the processor 1 instructs to save the light filling setting, locks the color and brightness of the light filling lamp 31, if the decoding is failed, the processor 1 instructs to modify the light filling setting, fine-adjusts the brightness of the light filling lamp 31, increases or decreases a preset brightness variation value from the current brightness value, and repeatedly executes the brightness adjustment step of the light filling lamp 31. Specifically, the fine tuning step may be: after decoding fails, after adding a brightness change value on the basis of the brightness value, repeating the step of adjusting the brightness of the light supplementing lamp 31, if the brightness is still failed, adding a brightness change value again, then executing the step of adjusting the brightness of the light supplementing lamp 31, if the brightness is failed for a plurality of times and the brightness increment reaches a preset moving threshold value, reducing a brightness change value on the basis of the brightness value, then executing the step of adjusting the brightness of the light supplementing lamp 31 again, and if the brightness decrement reaches the preset moving threshold value or the decoding is failed, prompting the user that the setting of the light supplementing lamp 31 is failed.
Specifically, the fine tuning step may further be: the imaging module 2 acquires an image possibly containing a bar code after being irradiated by a light supplementing lamp 31 which lights a light supplementing color; the processor 1 decodes the barcode image, if the decoding is successful, the processor 1 commands to save the light filling setting, lock the color and brightness of the light filling lamp 31, if the decoding is failed, the processor 1 commands to modify the light filling setting, fine-tune the brightness of the light filling lamp 31, increase or decrease a preset brightness variation value on the current brightness value, record the contrast between the barcode gray value and the background gray value in the gray image, and repeatedly execute the brightness adjustment step of the light filling lamp 31. If decoding fails, comparing the contrast between the bar code gray value of the current (i.e. current acquired) gray image and the background gray value with the contrast of the previous gray image, if the contrast is improved, keeping the same with the previous brightness adjustment direction, and increasing or decreasing a preset brightness change value, i.e. if the previous brightness adjustment mode is to increase a preset brightness change value, the current time still continues to increase a preset brightness change value, and if the previous brightness adjustment mode is to decrease a preset brightness change value, the current time still continues to decrease a preset brightness change value; if the contrast ratio is reduced, the brightness change value is reduced or increased by a preset brightness change value in the opposite direction to the previous brightness adjustment direction. If the decoding fails a plurality of times and the brightness increment reaches the preset moving threshold or the decoding fails, the user is prompted that the setting of the light filling lamp 31 fails.
It should be noted that, the processor 1 executes each step logic, and invokes a program stored in the memory through a corresponding interface to execute a corresponding operation instruction on a module/device to be executed.
The bar code reading device of the second embodiment can also finely adjust the brightness of the light compensating lamp 31, so that the bar code reading device is more flexible to apply and improves the universality of products.
Example III
Referring to fig. 1 and 2, a method for recognizing bar codes of various materials and color bar codes includes a processor 1, an imaging module 2, and a light compensating module 3, wherein the light compensating module 3 includes a plurality of light compensating lamps 31, and the light compensating lamps 31 include white and non-white light compensating lamps, such as a red light compensating lamp 31, a blue light compensating lamp 31, and the like; instructions are stored in the processor 1, and the processor 1 loads the instructions and executes the following light filling lamp 31 setting steps: the processor 1 controls the light supplementing lamp module 3 to light the white light supplementing lamp 31; the imaging module 2 collects the current bar code to obtain a digitized bar code image, then converts the bar code image into a gray image and sends the gray image to the processor 1, as shown in fig. 6, wherein the gray image of the bar code image is collected by the green background black bar code under the white light supplementing lamp. The bar code image comprises a bar code and the background information related to the bar code; the processor 1 inquires a light supplementing lamp mapping table according to gray value characteristics of the gray image, and determines the color of the light supplementing lamp suitable for the bar code of the current type; establishing a mapping relation between a gray scale range value and the color of the light supplementing lamp in the light supplementing lamp mapping table; the processor 1 controls the light supplementing lamp module 3 to light the light supplementing lamp 31 corresponding to the color, and the light supplementing lamp 31 is arranged; the bar code reading device starts to collect bar codes after the light supplementing lamp is arranged. Generally, the imaging module 2 includes an image sensor and a lens, and acquires a barcode image through the image sensor and converts a color image into a grayscale image. The bar code reading device also generally comprises a buzzer, a status indicator lamp, a sighting positioning lamp and the like for reminding.
The generation process of the light filling lamp mapping table is as follows: and manufacturing a plurality of test pictures P1-Pi with different background colors, wherein each test picture Pi is subjected to light supplementing by using light supplementing lamps L1-Lj, the light supplementing lamps L1-Lj comprise white light supplementing lamps and light supplementing lamps with other colors, and then, the imaging module is used for acquiring image information of the test pictures and converting the image information into gray level images to be transmitted to the processor 1. The processor 1 calculates an average gray value of the gray image; the tester records the average gray value of each test picture Pi under each light supplement lamp one by one, establishes an average gray value set a1j= { a11, a12, a 13..a1j } of the test picture P1, an average gray value set of the test picture P2 is a2j= { a21, a22, a 23..a2j } the average gray value set for the test picture P3 is a3j= { a31, a32, a 33..a3j }, the average gray value set of the test pictures Pi is aij= { Ai1, ai2, ai3. The tester compares the average gray value of the other color light supplement lamps in the average gray value set of each test picture with the average gray value of the white light supplement lamp one by one to obtain j-1 contrast values, and records the light supplement lamp color C1 corresponding to the maximum contrast value and the light supplement lamp color C2 corresponding to the minimum contrast value of the test picture; and establishing a light supplementing lamp mapping table according to the mapping relation between the average gray value of each test picture under the white light supplementing lamp and the light supplementing lamp colors C1 and C2, taking the gray range value in the preset floating range of the average gray value as an index, taking the light supplementing lamp colors C1 and C2 corresponding to the average gray value as mapping values, and then loading the light supplementing lamp mapping table into the reading equipment. Generally, the gray scale range value is within a range of + -5% -10% of the average gray scale value of the test picture Pi. When the number of test pictures Pi is small, a large proportion of the floating range, for example 8% -10%, is selected so that the index of the light filling map table can cover the whole gray scale range. When the number of test pictures Pi is small, a small proportion of the floating range, for example 5% -7%, is selected.
The processor 1 queries a light filling lamp mapping table according to gray value characteristics of the gray image, wherein the gray value characteristics are bar code gray values or background color gray values or average gray values. The method for obtaining the bar code gray value and the background color gray value can be as follows: the processor 1 identifies a bar code area and a non-bar code area from the gray image, wherein the bar code area comprises a bar code gray value and a background color gray value, and reads the gray value of the non-bar code area, and the gray value is the background color gray value, so that the bar code gray value is determined. Inquiring the light supplementing lamp mapping table according to the bar code gray value to obtain an index corresponding to the bar code gray value and a light supplementing lamp color C1 and a light supplementing lamp color C2 mapped by the index, wherein the processor 1 controls the light supplementing lamp module 3 to turn on a light supplementing lamp 31 corresponding to the light supplementing lamp color C1. The principle is as follows: according to the relation between colors represented by the hue circle, namely adjacent colors (for example, blue and green) are called a same color system, as long as the color of the same color system is irradiated to the position of the bar code on the article, the bar code lightens due to strong reflection under the irradiation of the light of the same color system, so that the brightness of the bar code is enhanced, and correspondingly, the contrast between the bar code and the background is improved, thereby realizing rapid decoding.
Or inquiring the light supplement lamp mapping table according to the background color gray value to obtain an index corresponding to the background color gray value and the light supplement lamp color C1 and the light supplement lamp color C2 mapped by the index, wherein the processor 1 controls the light supplement lamp module 3 to turn on the light supplement lamp 31 corresponding to the light supplement lamp color C2. The principle is as follows: according to the relation between colors represented by the hue circle, namely colors (for example, green and red) at two ends are called complementary colors, as long as the complementary colors are irradiated to the positions of the bar codes on the article, the background of the bar codes is darkened due to low reflectivity under the irradiation of the complementary colors, so that the brightness of the background is weakened, and correspondingly, the contrast between the bar codes and the background is improved, so that quick decoding is realized.
Or inquiring the light filling lamp mapping table according to the average gray value to obtain the light filling lamp color C1 and the light filling lamp color C2 mapped by the index corresponding to the average gray value, and controlling the light filling lamp module 3 to turn on the light filling lamp 31 corresponding to the light filling lamp color C1 or the light filling lamp color C2 by the processor 1. Preferably, when the average gray value is smaller than 60, the bar code image is indicated to be entirely dark, the color C1 of the light supplementing lamp is selected to be turned on, and the color C1 of the light supplementing lamp with large contrast can enhance the brightness of the image; when the average gray value is more than 60 and less than 190, the brightness of the bar code image is moderate, and C1 or C2 can be adopted as the color of the light filling lamp, or the two can be used for polling the color of the light filling lamp; when the average gray value is greater than 190, the whole bar code image is brighter, and the color C2 of the light supplementing lamp is selected to be turned on, so that the acquired bar code image is darkened to some extent, and overexplosion or flare cannot occur. The average gray value calculation method of the gray image comprises the following steps: and calculating the sum of gray values of each pixel point of the image, and averaging.
For example, after the bar code image of the green bar code is converted into the gray image, the gray value of the green bar code is 210, the gray value of the green bar code is 120, and the index of the light filling lamp mapping table is searched by using the gray value of the green bar code as 120. In the light filling map, the gray scale value ranges from 110 to 130, the corresponding light filling colors are blue (high contrast) and red (low contrast), and then the light filling color is determined to be blue. The blue light supplementing lamp 31 can reduce the gray level of the pink background color and increase the gray level of the green bar code, thereby enhancing the contrast of the whole image and improving the decoding success rate.
For bar codes made of metal materials, the reflection of the metal surface is complex, is related to the incident wavelength and the surface roughness, is influenced by other factors such as non-zero metal conductivity, and when a bar code image is acquired, bright spots, flare spots and the like can appear in the bar code image due to strong reflection, so that the picture quality is destroyed, and decoding is influenced. Therefore, by arranging a polarizer 5 in front of the light-compensating lamp 31, and matching the polarizer 5 in front of the photographing lens, the polarization direction of the polarizer 5 in front of the photographing lens is perpendicular to (or at an angle of tens of degrees to) the polarization direction of the polarizer 5 in front of the light-compensating lamp 31, the polarized light reflected at the bright spots can be fully absorbed (or partially weakened), so that the strong flare on the surface of the illuminated metal object can be weakened or even eliminated, the illumination effect of the lamp on other parts is basically not influenced, and a clear image is formed on the picture. Specifically: as shown in fig. 5, the reading device further includes a housing 4 for fixing the light compensating lamp module 3 and the imaging module 2, the housing 4 is provided with a window for collecting the barcode image and emitting the light of the light compensating lamp, the window is provided with a slot 41 for clamping the polarizer 5, and the polarizer 5 is embedded in the window. According to the scene requirement, if the bar code material has stronger light reflection or the bar code is printed on the mirror surface or the bar code is placed in the plastic bag, the polarizer 5 is inserted into the clamping groove 41, so that the light emitted by the light supplementing lamp 31 is emitted after passing through the polarizer 5. The harmful reflections and specular images on the smooth surface of the transparency are significantly reduced or even eliminated by the polarizer 5, and a complete and clear image of the scene inside or behind the transparency is captured.
Example IV
The third embodiment adds the implementation manners of setting, adjusting and locking the brightness of the light compensating lamp 31, so that the bar code reading method in the third embodiment not only can adaptively select the color of the light compensating lamp, but also can adaptively adjust the brightness of the light compensating lamp 31, thereby greatly improving the capability of the bar code reading device to cope with various flexible and changeable application scenes.
Referring to fig. 3, the setting of the brightness of the light compensating lamp 31 is completed while the setting step of the light compensating lamp 31 is performed, specifically: the light-compensating lamp mapping table also records the brightness values corresponding to the light-compensating lamps 31 of each color, that is, the light-compensating lamp mapping table establishes the mapping relationship between the gray scale range value and the light-compensating lamp color and the brightness value corresponding to the light-compensating lamp 31 of the color; the processor 1 inquires a light supplementing lamp mapping table according to gray value characteristics of the gray image, and determines the color and brightness value of the light supplementing lamp suitable for the bar code of the current type; the processor 1 controls the light supplementing lamp module 3 to light the light supplementing lamp 31 corresponding to the color, and meanwhile, the processor 1 also controls the light supplementing lamp module 3 to adjust the current so that the light supplementing lamp 31 reaches the brightness value, and the setting of the light supplementing lamp 31 is completed. Taking an LED driver AW3643 of an AWINIC company as an example, the processor 1 communicates with the processor 1 through an I2C bus, and the processor 1 sends instructions to configure the working mode of the AW3643 chip, including the lighting of the LED, the current level, the duration of brightness, and the like, and meanwhile, the LED driver can be stopped and abnormal state monitored through HWEN and TX pins on the LED driver. After the above-mentioned setting step of the light compensating lamp 31 is completed, when the acquired barcode image is failed to be decoded by the processor 1, the processor 1 further executes the brightness adjusting step of the light compensating lamp 31: the imaging module 2 acquires an image possibly containing a bar code after being irradiated by a light supplementing lamp 31 which lights a light supplementing color; the processor 1 decodes the barcode image, if the decoding is successful, the processor 1 instructs to save the light filling setting, locks the color and brightness of the light filling lamp 31, if the decoding is failed, the processor 1 instructs to modify the light filling setting, fine-adjusts the brightness of the light filling lamp 31, increases or decreases a preset brightness variation value from the current brightness value, and repeatedly executes the brightness adjustment step of the light filling lamp 31. Specifically, the fine tuning step may be: after decoding fails, after adding a brightness change value on the basis of the brightness value, repeating the step of adjusting the brightness of the light supplementing lamp 31, if the brightness is still failed, adding a brightness change value again, then executing the step of adjusting the brightness of the light supplementing lamp 31, if the brightness is failed for a plurality of times and the brightness increment reaches a preset moving threshold value, reducing a brightness change value on the basis of the brightness value, then executing the step of adjusting the brightness of the light supplementing lamp 31 again, and if the brightness decrement reaches the preset moving threshold value or the decoding is failed, prompting the user that the setting of the light supplementing lamp 31 is failed.
Specifically, the fine tuning step may further be: the imaging module 2 acquires an image possibly containing a bar code after being irradiated by a light supplementing lamp 31 which lights a light supplementing color; the processor 1 decodes the barcode image, if the decoding is successful, the processor 1 commands to save the light filling setting, lock the color and brightness of the light filling lamp 31, if the decoding is failed, the processor 1 commands to modify the light filling setting, fine-tune the brightness of the light filling lamp 31, increase or decrease a preset brightness variation value on the current brightness value, record the contrast between the barcode gray value and the background gray value in the gray image, and repeatedly execute the brightness adjustment step of the light filling lamp 31. If decoding fails, comparing the contrast between the bar code gray value of the current (i.e. current acquired) gray image and the background gray value with the contrast of the previous gray image, if the contrast is improved, keeping the same with the previous brightness adjustment direction, and increasing or decreasing a preset brightness change value, i.e. if the previous brightness adjustment mode is to increase a preset brightness change value, the current time still continues to increase a preset brightness change value, and if the previous brightness adjustment mode is to decrease a preset brightness change value, the current time still continues to decrease a preset brightness change value; if the contrast ratio is reduced, the brightness change value is reduced or increased by a preset brightness change value in the opposite direction to the previous brightness adjustment direction. If the decoding fails a plurality of times and the brightness increment reaches the preset moving threshold or the decoding fails, the user is prompted that the setting of the light filling lamp 31 fails.
The bar code reading method of the fourth embodiment can also fine-tune the brightness of the light supplementing lamp 31, so that the application is more flexible, and the universality of the product is improved.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent structures or equivalent processes or direct or indirect application in other related technical fields are included in the scope of the present invention.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent structures or equivalent processes or direct or indirect application in other related technical fields are included in the scope of the present invention.

Claims (12)

1. The reading equipment capable of identifying bar codes of various materials and color bar codes comprises: processor (1), formation of image module (2), light filling lamp module (3) and formation of image module (2) all with processor (1) communication connection, its characterized in that: the light supplementing lamp module (3) comprises a plurality of light supplementing lamps (31), wherein the light supplementing lamps (31) comprise white light supplementing lamps and non-white light supplementing lamps; the processor (1) stores instructions, and the processor (1) loads the instructions and executes the following light filling lamp setting steps:
The processor (1) controls the light supplementing lamp module (3) to light a white light supplementing lamp (31);
the imaging module (2) acquires a current bar code to obtain a digitized bar code image, and then converts the bar code image into a gray level image and sends the gray level image to the processor (1); the bar code image comprises a bar code and the background information related to the bar code;
the processor (1) inquires a light supplementing lamp mapping table according to gray value characteristics of the gray image, and determines the color of the light supplementing lamp suitable for the bar code of the current type; establishing a mapping relation between a gray scale range value and the color of the light supplementing lamp in the light supplementing lamp mapping table;
the light supplementing lamp mapping table also records brightness values corresponding to the light supplementing lamps (31) with various colors, and specifically, the light supplementing lamp mapping table establishes a mapping relation between gray scale range values and the colors of the light supplementing lamps and the brightness corresponding to the light supplementing lamps (31) with the colors; the processor (1) inquires a light supplementing lamp mapping table according to gray value characteristics of the gray image, and determines the color and brightness value of the light supplementing lamp suitable for the bar code of the current type; the processor (1) controls the light supplementing lamp module (3) to light the light supplementing lamp (31) corresponding to the color, and meanwhile, the processor (1) also controls the light supplementing lamp module (3) to adjust the current so that the light supplementing lamp (31) reaches the brightness value, and the light supplementing lamp is set;
The device also comprises a shell for fixing the light supplementing lamp module (3) and the imaging module (2), wherein the shell is provided with a window for collecting bar code images and emitting light rays of the light supplementing lamp (31), the window is provided with a clamping groove (41) for clamping the polarizer (5), and the polarizer (5) is embedded on the window;
the bar code reading equipment starts to collect bar codes after the light supplementing lamp is arranged;
the generation process of the light filling lamp mapping table is as follows: manufacturing a plurality of test pictures P1-Pi with different background colors, wherein each test picture Pi is subjected to light supplementing by using light supplementing lamps L1-Lj, the light supplementing lamps L1-Lj comprise white light supplementing lamps and light supplementing lamps with other colors, then acquiring image information of the test pictures through an imaging module (2), converting the image information into gray images, and transmitting the gray images to a processor (1); the processor (1) calculates an average gray value of the gray image;
the test staff records the average gray value of each test picture under each light supplementing lamp one by one, and establishes an average gray value set A1 j= { A11, A12, A13..A 1j } of the test picture P1, an average gray value set of the test picture P2 is A2 j= { A21, A22, A23..A 2j }, an average gray value set of the test picture P3 is A3 j= { A31, A32, A33..A 3j }, and an average gray value set of the test picture Pi is Aij= { Ai1, ai2, ai3..Aij };
The tester compares the average gray value of the other color light supplement lamps in the average gray value set of each test picture with the average gray value of the white light supplement lamp one by one to obtain j-1 contrast values, and records the light supplement lamp color C1 corresponding to the maximum contrast value and the light supplement lamp color C2 corresponding to the minimum contrast value of the test picture;
and establishing a light supplementing lamp mapping table according to the mapping relation between the average gray value of each test picture under the white light supplementing lamp and the light supplementing lamp colors C1 and C2, taking the gray range value in the preset floating range of the average gray value as an index, taking the light supplementing lamp colors C1 and C2 corresponding to the average gray value as mapping values, and then loading the light supplementing lamp mapping table into the reading equipment.
2. The reading device capable of identifying barcodes and color barcodes of various materials according to claim 1, wherein: the processor (1) queries a light supplementing lamp mapping table according to the gray value characteristic of the gray image, wherein the gray value characteristic is a bar code gray value, the processor (1) identifies a bar code area and a non-bar code area from the gray image, the bar code area comprises a bar code gray value and a background gray value, the gray value of the non-bar code area is read, and the gray value is the background gray value, so that the bar code gray value is determined; inquiring the light supplementing lamp mapping table according to the bar code gray value to obtain an index corresponding to the bar code gray value and a light supplementing lamp color C1 and a light supplementing lamp color C2 mapped by the index, wherein the processor (1) controls the light supplementing lamp module (3) to turn on a light supplementing lamp (31) corresponding to the light supplementing lamp color C1.
3. The reading device capable of identifying barcodes and color barcodes of various materials according to claim 1, wherein: the processor (1) queries a light filling lamp mapping table according to gray value characteristics of gray images, wherein the gray value characteristics are background color gray values: the processor (1) identifies a bar code area and a non-bar code area from the gray level image, the bar code area comprises a bar code gray level value and a background color gray level value, the gray level value of the non-bar code area is read, the gray level value is the background color gray level value, the light supplement lamp mapping table is queried according to the background color gray level value, an index corresponding to the background color gray level value and a light supplement lamp color C1 and a light supplement lamp color C2 mapped by the index are obtained, and the processor (1) controls the light supplement lamp module (3) to turn on a light supplement lamp (31) corresponding to the light supplement lamp color C2.
4. The reading device capable of identifying barcodes and color barcodes of various materials according to claim 1, wherein: the processor (1) queries a light filling lamp mapping table according to gray value characteristics of gray images, wherein the gray value characteristics are average gray values: inquiring the light filling lamp mapping table according to the average gray value to obtain an index corresponding to the average gray value and a light filling lamp color C1 and a light filling lamp color C2 mapped by the index, wherein the processor (1) controls the light filling lamp module to turn on a light filling lamp (31) corresponding to the light filling lamp color C1 or the light filling lamp color C2.
5. The reading device capable of identifying barcodes and color barcodes of various materials according to claim 1, wherein: after the light filling lamp setting step is performed, the method further comprises the step of performing light filling lamp brightness adjustment:
the imaging module (2) acquires an image possibly containing a bar code after being irradiated by a light supplementing lamp (31) for lighting a light supplementing color;
the processor (1) performs decoding attempt on the bar code image, if decoding is successful, the processor (1) commands to save the light filling setting, lock the color and the brightness of the light filling lamp (31), if decoding is failed, the processor (1) commands to modify the light filling setting, increase or decrease a preset brightness change value on the current brightness value, and execute the light filling lamp brightness adjustment step again.
6. The reading device capable of identifying barcodes and color barcodes of various materials according to claim 5, wherein: when the decoding failure occurs, the processor records the contrast ratio of the bar code gray value and the background gray value in the gray image in FLASH, then the processor executes the brightness adjustment step of the light supplementing lamp again, if the decoding failure still occurs, the contrast ratio of the bar code gray value and the background gray value of the current gray image is compared with the contrast ratio of the gray image of the previous frame, if the contrast ratio is increased, the trend of the contrast ratio and the previous brightness adjustment is kept consistent, namely, a preset brightness change value is increased or decreased again; if the contrast ratio is reduced, the preset brightness variation value is reduced or increased contrary to the previous brightness adjustment trend.
7. The method for recognizing and reading the bar codes of various materials and the color bar codes is characterized in that a processor (1), an imaging module (2) and a light supplementing lamp module (3) are adopted, and the light supplementing lamp module (3) and the imaging module (2) are in communication connection with the processor (1), and the method is characterized in that: the light supplementing lamp module (3) comprises a plurality of light supplementing lamps (31), wherein the light supplementing lamps (31) comprise white light supplementing lamps and non-white light supplementing lamps; the processor (1) stores instructions, and the processor (1) loads the instructions and executes the following light filling lamp setting steps:
the processor (1) controls the light supplementing lamp module (3) to light a white light supplementing lamp (31);
the imaging module (2) acquires a current bar code to obtain a digitized bar code image, and then converts the bar code image into a gray level image and sends the gray level image to the processor (1); the bar code image comprises a bar code and the background information related to the bar code;
the processor (1) inquires a light supplementing lamp mapping table according to gray value characteristics of the gray image, and determines the color of the light supplementing lamp suitable for the bar code of the current type; establishing a mapping relation between a gray scale range value and the color of the light supplementing lamp in the light supplementing lamp mapping table;
the processor (1) controls the light supplementing lamp module (3) to light the light supplementing lamp (31) corresponding to the color, and the light supplementing lamp is set;
The bar code reading equipment starts to collect bar codes after the light supplementing lamp is arranged;
the generation process of the light filling lamp mapping table is as follows: manufacturing a plurality of test pictures P1-Pi with different background colors, wherein each test picture Pi is subjected to light supplementing by using light supplementing lamps L1-Lj, the light supplementing lamps L1-Lj comprise white light supplementing lamps and light supplementing lamps with other colors, then acquiring image information of the test pictures through an imaging module (2), converting the image information into gray images, and transmitting the gray images to a processor (1); the processor (1) calculates an average gray value of the gray image;
the test staff records the average gray value of each test picture under each light supplementing lamp one by one, and establishes an average gray value set A1 j= { A11, A12, A13..A 1j } of the test picture P1, an average gray value set of the test picture P2 is A2 j= { A21, A22, A23..A 2j }, an average gray value set of the test picture P3 is A3 j= { A31, A32, A33..A 3j }, and an average gray value set of the test picture Pi is Aij= { Ai1, ai2, ai3..Aij };
the tester compares the average gray value of the other color light supplement lamps in the average gray value set of each test picture with the average gray value of the white light supplement lamp one by one to obtain j-1 contrast values, and records the light supplement lamp color C1 corresponding to the maximum contrast value and the light supplement lamp color C2 corresponding to the minimum contrast value of the test picture;
According to the mapping relation between the average gray value of each test picture under the white light supplement lamp and the light supplement lamp colors C1 and C2, taking the gray range value in the preset floating range of the average gray value as an index, taking the light supplement lamp colors C1 and C2 corresponding to the average gray value as mapping values, establishing a light supplement lamp mapping table, and then loading the light supplement lamp mapping table into the reading equipment;
the light supplementing lamp mapping table also records brightness values corresponding to the light supplementing lamps (31) with various colors, and specifically, the light supplementing lamp mapping table establishes a mapping relation between gray scale range values and the colors of the light supplementing lamps and the brightness corresponding to the light supplementing lamps (31) with the colors; the processor (1) inquires a light supplementing lamp mapping table according to gray value characteristics of the gray image, and determines the color and brightness value of the light supplementing lamp suitable for the bar code of the current type; the processor (1) controls the light supplementing lamp module (3) to light the light supplementing lamp (31) corresponding to the color, and meanwhile, the processor (1) also controls the light supplementing lamp module (3) to adjust the current so that the light supplementing lamp (31) reaches the brightness value, and the light supplementing lamp is set;
the light supplementing device comprises a light supplementing lamp module (3) and an imaging module (2), and is characterized by further comprising a shell for fixing the light supplementing lamp module (3) and the imaging module (2), wherein the shell is provided with a window for collecting bar code images and emitting light rays of the light supplementing lamp (31), the window is provided with a clamping groove (41) for clamping a polarizer (5), and the polarizer (5) is embedded on the window.
8. The method for recognizing and reading barcodes and color barcodes according to claim 7, wherein: the processor (1) queries a light filling lamp mapping table according to gray value characteristics of gray images, wherein the gray value characteristics are bar code gray values: the processor (1) identifies a bar code area and a non-bar code area from the gray image, wherein the bar code area comprises a bar code gray value and a background color gray value, and reads the gray value of the non-bar code area, and the gray value is the background color gray value, so that the bar code gray value is determined; inquiring the light supplementing lamp mapping table according to the bar code gray values to obtain an index corresponding to the bar code gray values and a light supplementing lamp color C1 and a light supplementing lamp color C2 mapped by the index, wherein the processor (1) controls the light supplementing lamp module (3) to turn on a light supplementing lamp (31) corresponding to the light supplementing lamp color C1.
9. The method for recognizing and reading barcodes and color barcodes according to claim 7, wherein: the processor (1) queries a light filling lamp mapping table according to gray value characteristics of gray images, wherein the gray value characteristics are background color gray values: the processor (1) identifies a bar code area and a non-bar code area from the gray level image, the bar code area comprises a bar code gray level value and a background color gray level value, the gray level value of the non-bar code area is read, the gray level value is the background color gray level value, the light supplementing lamp mapping table is queried according to the background color gray level value, an index corresponding to the background color gray level value and a light supplementing lamp color C1 and a light supplementing lamp color C2 mapped by the index are obtained, and the processor (1) controls the light supplementing lamp module (3) to turn on a light supplementing lamp (31) corresponding to the light supplementing lamp color C2.
10. The method for recognizing and reading barcodes and color barcodes according to claim 7, wherein: the processor (1) queries a light filling lamp mapping table according to gray value characteristics of gray images, wherein the gray value characteristics are average gray values: inquiring the light filling lamp mapping table according to the average gray value to obtain an index corresponding to the average gray value and a light filling lamp color C1 and a light filling lamp color C2 mapped by the index, wherein the processor (1) controls the light filling lamp module to turn on a light filling lamp corresponding to the light filling lamp color C1 or the light filling lamp color C2.
11. The method for recognizing and reading barcodes and color barcodes according to claim 7, wherein: after the light filling lamp setting step is performed, the method further comprises the step of performing light filling lamp brightness adjustment:
the imaging module (2) acquires an image possibly containing a bar code after being irradiated by a light supplementing lamp (31) for lighting a light supplementing color;
the processor (1) decodes the bar code image, if the decoding is successful, the processor (1) commands to save the light filling setting, lock the color and the brightness of the light filling lamp (31), if the decoding is failed, the processor (1) commands to modify the light filling setting, increase or decrease a preset brightness change value on the current brightness value, and execute the light filling lamp brightness adjusting step again.
12. The method for recognizing and reading barcodes and color barcodes according to claim 11, wherein: when the decoding failure occurs, the processor records the contrast ratio of the bar code gray value and the background gray value in the gray image in FLASH, then the processor executes the brightness adjustment step of the light supplementing lamp again, if the decoding failure still occurs, the contrast ratio of the bar code gray value and the background gray value of the current gray image is compared with the contrast ratio of the gray image of the previous frame, if the contrast ratio is increased, the trend of the contrast ratio and the previous brightness adjustment is kept consistent, namely, a preset brightness change value is increased or decreased again; if the contrast ratio is reduced, the preset brightness variation value is reduced or increased contrary to the previous brightness adjustment trend.
CN202010251109.8A 2020-04-01 2020-04-01 Reading equipment and method capable of identifying bar codes of various materials and color bar codes Active CN111460848B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010251109.8A CN111460848B (en) 2020-04-01 2020-04-01 Reading equipment and method capable of identifying bar codes of various materials and color bar codes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010251109.8A CN111460848B (en) 2020-04-01 2020-04-01 Reading equipment and method capable of identifying bar codes of various materials and color bar codes

Publications (2)

Publication Number Publication Date
CN111460848A CN111460848A (en) 2020-07-28
CN111460848B true CN111460848B (en) 2023-05-02

Family

ID=71680547

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010251109.8A Active CN111460848B (en) 2020-04-01 2020-04-01 Reading equipment and method capable of identifying bar codes of various materials and color bar codes

Country Status (1)

Country Link
CN (1) CN111460848B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112546643B (en) * 2020-12-29 2022-04-29 深圳市创客工场科技有限公司 Model car line patrol method and device
CN116939336A (en) * 2022-01-12 2023-10-24 深圳盈达信息科技有限公司 Optical information acquisition device and optical information acquisition method
CN115577726A (en) * 2022-11-11 2023-01-06 无锡盈达聚力科技有限公司 Image forming apparatus and image forming method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005018391A (en) * 2003-06-26 2005-01-20 Casio Comput Co Ltd Code reading device and program
CN102393906A (en) * 2011-07-12 2012-03-28 四川大学 Computer vision inspection technology-based method for rapid detection and extraction of two-dimensional code
CN109684887A (en) * 2018-11-15 2019-04-26 无锡盈达聚力科技有限公司 Scanning means, its light filling lamp control system and control method
CN110516490A (en) * 2019-07-19 2019-11-29 深圳盈达机器视觉技术有限公司 Handheld terminal and its light filling lamp control method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8584953B2 (en) * 2011-02-24 2013-11-19 Psion, Inc. System and method for decoding barcodes not easily perceptible by human vision

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005018391A (en) * 2003-06-26 2005-01-20 Casio Comput Co Ltd Code reading device and program
CN102393906A (en) * 2011-07-12 2012-03-28 四川大学 Computer vision inspection technology-based method for rapid detection and extraction of two-dimensional code
CN109684887A (en) * 2018-11-15 2019-04-26 无锡盈达聚力科技有限公司 Scanning means, its light filling lamp control system and control method
CN110516490A (en) * 2019-07-19 2019-11-29 深圳盈达机器视觉技术有限公司 Handheld terminal and its light filling lamp control method

Also Published As

Publication number Publication date
CN111460848A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN111460848B (en) Reading equipment and method capable of identifying bar codes of various materials and color bar codes
CN103201752B (en) Adaptive data reader and method of operating
US6375075B1 (en) Method and apparatus for reading machine-readable symbols including color symbol elements
WO2017157034A1 (en) Method, device, and storage medium for identifying two-dimensional code
US7245780B2 (en) Group average filter algorithm for digital image processing
US8596541B2 (en) Image capture device with integrated barcode scanning
US7333653B2 (en) Detecting and correcting redeye in an image
US9495572B2 (en) Identifying one- or two-dimensional bar codes via weighted image data combination
US20150379325A1 (en) Image sensor with integrated region of interest calculation for iris capture, autofocus, and gain control
US20090212112A1 (en) Barcode detection based on morphological operations
US20080149720A1 (en) Barcode environment enhancement
CN1953362A (en) A method and installation to embed pattern in two-dimensional bar code
US6992846B2 (en) Micro reader scan engine with prism
EP3559855B1 (en) White illumination for barcode scanners with improved power efficiency and cost
US20130001310A1 (en) Information code and information code reader
Querini et al. Color classifiers for 2D color barcodes
US11403475B2 (en) DPM barcode reader having a partially polarized window coupled to diffusive, polarized and bright fields opportunely tuned to particular wavelengths
CN213069846U (en) Bar code reading equipment based on multi-azimuth light source compensation
WO2005062234A1 (en) Section based algorithm for image enhancement
WO2023134304A1 (en) Optical information collection apparatus and optical information collection method
JP2001526430A (en) Single chip symbol reader with smart sensor
US10650205B2 (en) Methods, systems, and apparatuses for scanning and decoding direct part marking indicia
US9191537B2 (en) Systems and methods for enhanced object detection
CN110168963B (en) Communication method and device
CN108023640B (en) Visible light communication system based on flat lamp and mobile terminal camera

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