Optical information acquisition method
By filling lights with multiple colors in sequence and adjusting the fill light time according to contrast, the problem of optical information acquisition of different materials and colors is solved, and the reading efficiency is improved, especially for optical characters that are difficult to read, which has achieved Better reading effect.
Patent Information
- Application Number
- CN202410932666.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-12
- Publication Date
- 2024-11-08
AI Technical Summary
When existing optical information acquisition devices read barcodes of different materials or colors, it is difficult to quickly read, and the pre-established comparison table cannot cover all materials, resulting in inefficient reading.
Use multiple colors of fill light to fill light in sequence, and calculate the contrast of the image, the first period is used to quickly read easy optical information, and the second period is used to fill light in targeted for difficult-to-read information. Use the fill light corresponding to the image with the largest contrast ratio to perform fill light for extended time.
It improves the reading efficiency of the optical information acquisition device, and can successfully read optical characters of different materials and colors, especially high-density barcodes and QR codes that are difficult to read, reducing reading time.
Smart Images

Figure CN118921564A_ABST
Abstract
Description
[0001] This application is a divisional application of the Chinese patent application with the application date of January 12, 2022, application number 202210032808.2, and invention name “Optical Information Collection Device”. Technical Field
[0002] The present application relates to the field of optical information acquisition, and in particular to an optical information acquisition device and an optical information acquisition method. Background Art
[0003] The barcodes commonly referred to in the industry include one-dimensional codes and two-dimensional codes. They refer to graphic identifiers that arrange multiple bars and spaces of different widths according to certain coding rules to express a set of information. Common barcodes are parallel line patterns composed of black bars (referred to as bars) and white bars (referred to as spaces) with very different reflectivity, while two-dimensional codes are regular two-dimensional patterns composed of stacked black blocks and white blocks. Since the "bars" and "spaces" in the barcode symbol have different reflectivities to light, the barcode scanner receives reflected light signals of different strengths and generates electric pulses with different potentials accordingly. The width of the "bars" and "spaces" in the barcode symbol determines the length of the electric pulse signals with different potentials. The light signal received by the scanner needs to be converted into an electrical signal by photoelectric conversion and amplified by an amplifier circuit. Due to the certain size of the scanning light spot, the fuzzy edge when the barcode is printed, and some other reasons, the barcode electrical signal amplified by the circuit is a smooth undulating signal, which is called an "analog electrical signal". The "analog electrical signal" needs to be shaped into a common "digital signal". According to the coding rules corresponding to the code system, the decoder can read and translate the "digital signal" into digital and character information. Barcodes can mark the country of production, manufacturer, product name, production date, book classification number, mail start and end location, category, date and many other information of the goods, so they are widely used in many fields such as commodity circulation, book management, postal management, banking system, etc.
[0004] For example, barcodes are now printed on various products (or packages, the same below) to facilitate the management and control of product production and sales. Barcodes can also be printed on materials of various materials and colors. The color of the barcode is no longer limited to the original black and white, but has a rich variety of colors depending on the color of the product. Summary of the invention
[0005] The purpose of the present application is to provide an optical information collection device and an optical information collection method which use fill lights of multiple colors to fill in the first time period, and use fill lights corresponding to the image with the largest contrast in the first time period to fill in the second time period.
[0006] To achieve the above objectives, this application adopts the following technical means:
[0007] The present application provides an optical information acquisition device, characterized in that it includes: a camera for acquiring images; multiple fill lights, and the fill lights of the multiple fill lights have different fill colors; a control unit, which controls the camera to acquire images after being triggered, and controls the multiple fill lights to fill light when the camera acquires images, and the fill light time of the multiple fill lights includes a first time period and a second time period. In the first time period, the multiple fill lights fill light in sequence, and the control unit respectively calculates and compares the contrast of multiple frames of images acquired by the camera when the multiple fill lights fill light, and the fill light corresponding to the image with the largest contrast is used for fill light in the second time period.
[0008] Optionally, the control unit only calculates the contrast of a specific position in the image.
[0009] Optionally, the specific position is a position occupied by an optical character.
[0010] Optionally, a targeting unit is included for projecting a targeting pattern having a central light spot, wherein the central light spot at least partially overlaps with the specific position.
[0011] Optionally, when the control unit is triggered again to control the multiple fill lights to fill light in sequence, the first fill light to fill light is the last fill light to fill light when it was triggered to capture an image last time.
[0012] Optionally, the preset time of the first time period is less than or equal to the preset time of the second time period.
[0013] The present application provides an optical information acquisition method, which is characterized in that it includes the following steps: S1: controlling a camera to acquire images and controlling fill lights of multiple colors to sequentially fill light in a first time period; S2: calculating and comparing the contrast of images acquired when fill lights of multiple colors are used for fill light; S3: using the fill light corresponding to the image with the largest contrast for fill light in a second time period.
[0014] Optionally, in S2, the control unit only calculates the contrast of the position where the optical character is located in the image.
[0015] Optionally, S1 further includes projecting an aiming pattern to aim at an optical character. When there are multiple optical characters in the image, in S2, the control unit only calculates the contrast of the position of the optical character overlapping with the aiming center of the aiming pattern.
[0016] Optionally, after S3, when the multiple fill-in lights are triggered to fill-in light in sequence for the next time, the first fill-in light is the last fill-in light that was triggered to fill-in light when capturing an image the previous time. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1This is a three-dimensional diagram of an optical information acquisition device according to an embodiment of the present application;
[0018] Figure 2 for Figure 1 A schematic diagram of the optical information collection device from another perspective, with components thereof shown through a window;
[0019] Figure 3 It is a schematic diagram of a partial structure of an optical information collection device according to an embodiment of the present application, and shows a sighting pattern projected by a sighting unit;
[0020] Figure 4 This is a schematic diagram of an optical information collection device according to an embodiment of the present application projecting an aiming pattern to aim at optical information / optical characters;
[0021] Figure 5 This is a timing diagram of the fill light of the optical information acquisition device according to an embodiment of the present application;
[0022] Figure 6 A schematic diagram of an optical information acquisition device processing an image according to an embodiment of the present application;
[0023] Figure 7 This is a flow chart of a method for collecting optical information by an optical information collection device according to an embodiment of the present application.
[0024] Optical information acquisition device 1 Shell 2 Trigger 3 Scan Window 4 Fill light window 5 Camera 6 Aiming unit 7 Fill light 8 Aiming pattern 9 Center spot 10 Rectangular frame 11 Control unit 12 Storage unit 13 Target optical character M Suspicious part Y DETAILED DESCRIPTION
[0025] When reading barcodes, fill lights are usually needed. Different materials or colors have different light absorption and reflectivity. In order to quickly read barcodes printed on different materials, the industry has developed fill light technologies with multiple colors, such as red light, white light, green light, and yellow light. Further, developers have integrated fill lights with multiple colors into the same reader. The fill lights with multiple colors circulate to fill light, so that one reader can read barcodes of different colors printed on different materials.
[0026] However, in order to decode quickly, the cycle of the multi-color fill light is relatively short, and the fill light time allocated to each color of the fill light is even shorter. For the barcode being read, usually only one color of the fill light is the best among the multi-color fill lights, while the other fill lights are not the best. Due to the angle and distance of reading the barcode, the barcode being read is printed by special industry, etc., if the barcode is not successfully read in the first cycle, it is a waste of time to continue to use the multi-color fill light to cycle fill light.
[0027] In response to the above problems, industry insiders have proposed to pre-establish a comparison table of material materials / colors and fill light colors based on the different materials / colors. When reading the barcode, the material / color of the material is first identified through image recognition technology, and then the fill light of the corresponding color is used. However, this only captures the surface of the problem, because even materials of the same material or color may have different light absorption and reflectivity due to different structures or production processes, and some materials with similar appearances need to be analyzed by professional analytical instruments. For example, many alloys with similar colors have different compositions, synthetic plastics with similar colors have different compositions, or artificial glass with similar colors have different compositions. For paper with the same composition, some are denser and some are more dense, and their light absorption and reflectivity are also different. It is not possible to distinguish materials through image recognition technology, and even if a comparison table is established, it is easy to make mistakes: in short, due to the wide variety of materials, different materials of the same color will have different absorption and reflectivity for the same color of fill light, and a pre-established comparison table cannot cover all materials, and it is difficult to identify the type of material only through image recognition technology. Pre-establishing a comparison table of materials and fill light colors cannot fundamentally solve the problem.
[0028] In view of the above problems, the present application provides a new optical information acquisition device and an optical information acquisition method, and adopts new methods and technical means to solve these problems.
[0029] In order to facilitate a better understanding of the purpose, structure, features and functions of the present application, the present application is further described in conjunction with the accompanying drawings and specific implementation methods.
[0030] Reference Figure 1 As shown, an embodiment of the optical information acquisition device 1 of the present application is a scanning gun, comprising a housing 2 having a receiving cavity, and a trigger 3, a transparent scanning window 4 and a fill light window 5 arranged on the housing 2. The trigger 3 is used for the user to trigger the scanning gun to acquire optical information.
[0031] Reference Figure 2 As shown, a camera 6 and a sighting unit 7 are arranged in the scanning window 4 , and a plurality of fill light lamps 8 are arranged in the fill light window 5 .
[0032] The fill light colors of the multiple fill lights 8 are different. Multiple fill lights 8 of different colors, such as white light, red light, green light, blue light, and yellow light, can be selected according to actual needs. In one embodiment of the present application, six fill lights 8 are arranged in a line, a pair of white light fill lights 8 are respectively located on both sides, a pair of red light fill lights 8 are located in the center, and a pair of blue light fill lights 8 are located between the pair of white light fill lights 8 and the pair of red light fill lights 8, so that the pair of white light fill lights 8, the pair of red light fill lights 8 and the pair of blue light fill lights 8 are all symmetrical about the center of the fill light window 5. When a pair of fill lights 8 of any color are used alone for fill light, the illumination field formed in the entire field of view of the camera 6 is symmetrical about the center of the fill light window 5, and the illumination field is more uniform.
[0033] refer to Figure 3 As shown, the aiming unit 7 can be a common LED (light-emitting diode) aiming unit 7 or a laser aiming unit 7. These two aiming units 7 usually need to be matched with a specific lens to produce an aiming pattern 9 of a specific shape. In the present embodiment, laser aiming is preferred, which cooperates with a diffraction optical lens to produce an aiming pattern 9 having a central light spot 10 and a rectangular frame 11. The central light spot 10 is configured to coincide with (or be close to) the center of the field of view of the camera 6, and the rectangular frame 11 is configured to coincide with or approximately coincide with the field of view of the camera 6 (usually the rectangular frame 11 is smaller than the field of view of the camera 6).
[0034] Continue to refer Figure 3 , which is a block diagram of a partial structure (or logic) of the optical information acquisition device 1 according to an embodiment of the present application, wherein the components drawn therein do not necessarily represent their actual shapes, structures or sizes, but are only for illustration. Figure 3 The main components of the optical information acquisition device 1 also include a control unit 12 and a storage unit 13. The control unit 12 is electrically connected to other components to output control instructions to control other components. The storage unit 13 is used to store control programs for the control unit 12 to call.
[0035] refer to Figure 4 As shown, when the user sends a trigger signal through the trigger 3, the control unit 12 controls the aiming unit 7 to project the aiming pattern 9 to aim at the target optical character M (such as a barcode or text character) through the trigger, so that the target optical character M is located in the rectangular frame 11 of the aiming pattern 9, and the central light spot 10 is aligned with the target optical character M, so that the target optical character M is exactly located in the center of the field of view of the camera 6. The control unit 12 then sends an instruction to control the camera 6 to capture the image of the target optical character M. While the camera 6 is capturing the image, the control unit 12 controls the multiple fill lights 8 to fill in the light.
[0036] The fill-in time of the multiple fill-in lights 8 is pre-set to include a first period and a second period. In the first period, the multiple fill-in lights 8 fill in light in sequence. In the present application, the initial order of the multiple fill-in lights 8 is: white light, red light, and blue light. When the fill-in lights 8 of each color fill in light, the camera 6 can capture multiple frames of images. The capture cycle of each frame of image includes image capture time and image transmission processing time. The control unit 12 synchronously calculates the contrast of each frame of image, and the camera 6 performs automatic exposure according to the automatic exposure control algorithm, so that the exposure parameters can be adjusted according to the contrast of the previous frame of image, so as to expect the next frame of image to have a greater contrast. Specifically, if the frame rate of the camera 6 is 50HZ, in order to improve the reading efficiency, the first time period is usually set shorter, and the first time period can be set to 300-600ms. For example, the first time period is 300ms, and the fill light time of the white, red and blue color fill light 8 is 100ms. When each color fill light 8 is filling light, the camera 6 can collect 5 frames of images, and because the exposure parameters are adjusted by the automatic exposure control algorithm, in theory, for optical information that is easy to read, such as simple barcodes, low-density two-dimensional codes, simple alphanumeric symbols, etc., it can usually be successfully read in the first time period. If the optical information is successfully read, the control unit 12 controls the end of the current reading process until the next reading process is started after the next trigger.
[0037] For optical information that is easy to read, if it has been successfully read when the blue light fill light 8 fills in the first time period, the control unit 12 controls to end the optical information reading process; when triggered next time, in the first time period, the control unit 12 controls multiple fill lights 8 to fill in sequentially, and the first fill light 8 to fill in is the last fill light 8 that filled in when the entire reading process was ended last time. Since the optical information was successfully read last time when the blue light fill light 8 filled in, the blue light fill light 8 will be the first to fill in the next time it is triggered. The fill light order of the fill light 8 in the first time period is blue, red, and white.
[0038] Since the first period is short, some difficult-to-read optical information, such as high-density barcodes and QR codes, DPM codes, complex text symbols, etc., usually cannot be read successfully in the first period. Figure 5The timing diagram of the fill light of the fill light 8 of multiple colors when the optical information acquisition device 1 acquires optical information that is difficult to read is shown. In the first period, the white, red and blue fill lights 8 sequentially fill light, and the control unit 12 calculates and compares the contrast of all images in the first period, thereby obtaining an image with the largest contrast, and fill light is performed in the second period with the fill light 8 when the image with the largest contrast is acquired. The second period is usually set to a longer time, such as 600-5000ms, and the camera 6 can have a longer time for automatic exposure when acquiring images in the second period, and theoretically can obtain an image with a larger contrast, so that the optical information that is difficult to read in the first period can also be successfully read.
[0039] For example, for optical information that is difficult to read, when white light, red light, and blue light are used to fill in the first period of time in sequence but the optical information is not read successfully, the control unit 12 calculates the contrast of all images collected in the first period of time. When the contrast of the image collected when the red light fill light 8 fills in the light is the largest, the control unit 12 controls the red light fill light 8 to continue to fill in the light in the second period of time until the reading is successful or the timeout occurs. When triggered next time, in the first period of time, the control unit 12 controls multiple fill lights 8 to fill in the light in sequence, and the fill light sequence is red, blue, and white.
[0040] The image contrast calculation method in the prior art usually calculates the contrast of the entire image, which is inefficient and the contrast is not the contrast of the target optical character M in the entire image. The recognition of optical characters, such as barcode recognition, mainly depends on the contrast between the "bars" and "spaces" of the barcode. The greater the contrast between the "bars" and "spaces", the easier it is to read the barcode; the smaller the contrast between the "bars" and "spaces", the more difficult it is to read the barcode. Figure 6As shown, in this embodiment, in order to further improve the reading efficiency, the calculation process of the image contrast is also optimized, that is, for the image (P1, P2) captured by the camera 6, the control unit 12 only calculates the contrast of a specific position in the image (P1, P2). The most ideal situation is that the specific position is exactly the position occupied by the target optical character M, which may be achieved by the following method: the control unit 12 (or a separate image processing unit, not shown, the same below) segments the entire image (P1, P2), cuts out a suspicious part Y in the image (P1, P2) that may be the target optical character M, and calculates the contrast of the suspicious part Y. If only one suspicious part Y is cut out from the entire image, the contrast of the suspicious part Y is very likely to be the contrast of the target optical character M, which is more accurate and efficient; and when multiple suspicious parts Y are cut out from the entire image (P1, P2) and all of them may be the target optical character M, the contrast of the target optical character M cannot be accurately obtained. The contrast of the target optical character M in the multiple suspicious parts Y can be further obtained by the following method: due to the user's operating habits, the central light spot 10 of the aiming pattern 9 is usually aimed at the target optical character M, so that the central light spot 10 overlaps with at least a portion of the target optical character M. When there are multiple suspicious parts Y in the entire image (P1, P2) that may be the target optical character M, only the suspicious part Y overlapping with the target central light spot 10 is cut out as the target optical character M, and only the contrast of the suspicious part Y is calculated.
[0041] Furthermore, since only the contrast of the target optical character M needs to be obtained, during the automatic exposure process, the automatic exposure is performed only according to the brightness of the target optical character M, without considering the brightness of the background around the target optical character M.
[0042] Furthermore, the effect of the aiming pattern 9 on the contrast calculation needs to be considered. Figure 6 As shown, in the image (P1), since the aiming pattern 9 is usually brighter (the aiming pattern 9 in P1 is black, which is only used as an example, the brightness of the aiming pattern 9 in the actual image is relatively large, and it is usually the brightest part in the binary image), it may even be the brightest part in the entire image, and when the central light spot 10 overlaps with the target optical character M, it will further affect the contrast of the target optical character M. Therefore, it is necessary to filter out the aiming pattern 9 in the image: in the acquisition cycle of a frame of image (P1), the aiming pattern 9 may not be projected during the image acquisition time, and the aiming pattern 9 may be projected during the image transmission processing time, so that the aiming pattern 9 can be used for aiming, and the image overexposure caused by the aiming pattern 9 being too bright can be avoided; or the aiming pattern 9 may be projected when acquiring a frame of image (P1), and the aiming pattern 9 may not be projected when acquiring the next frame of image (P2), and only the contrast of the next frame of image may be calculated.
[0043] In one embodiment (not shown in the figure, the same below), the scanning window and the fill light window are combined into one window, and multiple fill lights and the camera are arranged in the same window; further, multiple fill lights can be integrated into one module with the camera and the aiming unit, which is usually called a scanning engine or a scanning head.
[0044] In one embodiment (not shown in the figure, the same below), in the first time period, different colors of fill lights can be used to fill in the light simultaneously, such as red and blue fill lights can be used to fill in the light simultaneously, so as to provide richer fill light colors, in order to obtain an image with greater contrast.
[0045] In one embodiment (not shown in the figure, the same below), when the central light spot does not overlap with the target optical character, or when the density of optical characters is very large, resulting in multiple different optical characters overlapping with a portion of the central light spot at the same time, the center coordinates of the central light spot can be determined first, and then the optical character closest to the center coordinates can be determined as the target optical character.
[0046] like Figure 7 As shown, it is a flow chart of a method for collecting optical information of the optical information collection device 1 of the aforementioned embodiment of the present application, comprising the following steps:
[0047] S1: Control the camera 6 to collect images and control the fill lights 8 of multiple colors to fill light in sequence during the first period.
[0048] The initial fill light sequence of the fill lights 8 of various colors is: white light, red light, blue light. The camera 6 can capture multiple frames of images during the fill light time of each color fill light 8.
[0049] S2: Calculate and compare the contrast of the images collected when the fill lights 8 of various colors are used for fill lighting.
[0050] S3: The fill light 8 corresponding to the image with the largest contrast performs fill light in the second period.
[0051] The second period is usually set to a longer time. When the camera 6 collects images in the second period, it has a longer time for automatic exposure. In theory, an image with a larger contrast can be obtained, so that optical information that is difficult to read in the first period can also be successfully read.
[0052] The optical information acquisition device and optical information acquisition method of the present application have the following beneficial effects:
[0053] The optical information acquisition device 1 and the optical information acquisition method of the present application use a plurality of fill lights 8 of different colors for fill light when the camera 6 acquires an image, and divides the fill light time into a first period and a second period. In the first period, the plurality of fill lights 8 are used for fill light in sequence, and the contrast of the multiple frames of images acquired by the camera 6 is calculated. In the second period, the fill light 8 corresponding to the image with the largest contrast is used for fill light. Therefore, the optical information acquisition device 1 and the optical information acquisition method of the present application are not only suitable for the acquisition of optical information on materials of different materials / colors, but also can successfully read simple optical information that is easy to read in the first period. Moreover, for some special optical characters that are difficult to read (such as DPM code, DirectPart Mark), fill light is carried out in a targeted manner in the second period, and a good reading effect is also achieved, thereby improving the reading efficiency.
[0054] The above detailed description is only an explanation of the preferred embodiment of the present application, and does not limit the patent scope of the present application. Therefore, all equivalent technical changes made by using the description and illustrations of this creation are included in the patent scope of this creation.
Claims
1. An optical information acquisition method, characterized in that: The following steps are involved: S1: Control the camera to collect images and control the fill lights of multiple colors to fill light in sequence during the first period; S2: Calculate and compare the contrast of the images collected when the fill lights of multiple colors are used for supplementary lighting; S3: Use the fill light corresponding to the image with the largest contrast to perform fill light in the second period.
2. The optical information acquisition method according to claim 1, characterized in that: S1 also includes projecting an aiming pattern to aim at the optical character.
3. The optical information acquisition method according to claim 2, characterized in that: The aiming pattern includes a rectangular frame and a central light spot, the rectangular frame is configured to coincide with the field of view of the camera, and the central light spot is configured to coincide with the center of the field of view of the camera.
4. The optical information acquisition method according to claim 3, characterized in that: In S2, the contrast is calculated only at the location where the optical character is located in the image.
5. The optical information acquisition method according to claim 4, characterized in that: When there are multiple optical characters in the image, only the contrast of the position where the optical character overlaps with the central light spot is calculated.
6. The optical information acquisition method according to claim 5, characterized in that: When there are multiple different optical characters in the image and they overlap with a part of the central light spot at the same time, the center coordinates of the central light spot are first determined, and then the optical character closest to the center coordinates is determined as the target optical character, and only the contrast of the target optical character is calculated.
7. The optical information acquisition method according to claim 2, characterized in that: In the first period, when the fill light of each color is used to fill in the light, the camera collects multiple frames of images and synchronously calculates the contrast of each frame of image. The camera performs automatic exposure according to the automatic exposure control algorithm, thereby adjusting the exposure parameters according to the contrast of the previous frame of image to make the next frame of image have a greater contrast.
8. The optical information acquisition method according to claim 7, characterized in that: The acquisition cycle of each frame of image includes image acquisition time and image transmission processing time. In the acquisition cycle of one frame of image, the aiming pattern is not projected during the image acquisition time, and the aiming pattern is projected during the image transmission processing time.
9. The optical information acquisition method according to claim 1, characterized in that: The preset time of the first period is less than or equal to the preset time of the second period.
10. The optical information acquisition method according to claim 3, characterized in that: After S3, when the multiple fill-in lights are triggered to fill in light in sequence for the next time, the first fill-in light is the last fill-in light when it was triggered to capture an image the previous time.
