Code recognition device and method based on multi-angle light source
By using a multi-angle light source lighting module and an image processing module behind the transparent material, the problem of low recognition accuracy in the prior art is solved, and high accuracy recognition and efficiency improvement of transparent material encoding are achieved.
Patent Information
- Application Number
- CN202311549854.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-20
- Publication Date
- 2025-05-20
AI Technical Summary
In the prior art, the accuracy of identifying the mark behind the transparent material is low, which is affected by factors such as light, angle, strength, etc., and the manual identification efficiency is low and the accuracy is poor.
The encoding recognition device based on a multi-angle light source is adopted, including a light source illumination module, an image processing module and an encoding recognition module. Through multi-angle lighting and image processing, images are read and processed to realize encoding recognition.
It improves the accurate identification ability of the rear coding of transparent materials, reduces the error of manual identification, and improves work efficiency.
Smart Images

Figure CN120020910A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision, and particularly to an encoding recognition device and method based on multi-angle light sources. Background Art
[0002] In modern society, transparent materials are widely used in various fields, such as vehicle instrument panels, digital camera screens, dials of dial pressure gauges, etc. Due to the simple structure and low cost of dial pressure gauges, they are widely used in fields such as machinery, chemical industry, oil and natural gas. The encoding behind the scale of the pressure gauge is usually marked by stamping or engraving, and currently mostly relies on manual visual recognition, or is obtained by directly photographing or scanning the surface of the transparent material.
[0003] However, due to the certain refractive and transmissive properties of transparent materials, visual recognition is easily affected by factors such as the brightness, angle, and intensity of light, and interference from dirt, oil stains, water stains, etc., which increases the difficulty of recognition and reduces the accuracy of recognition. After multiple manual operations, the error is large and it is easy to get tired, resulting in a decrease in efficiency and difficulty in meeting the need for accurate encoding recognition. Summary of the Invention
[0004] Aiming at the technical problem of low accuracy in recognizing the identification behind transparent materials in the prior art, the present invention discloses an encoding recognition device and method based on multi-angle light sources.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] An encoding recognition device based on multi-angle light sources, comprising a light source illumination module, an image processing module, and an encoding recognition module connected in sequence;
[0007] The light source illumination module is used to achieve multi-angle illumination and capture corresponding images under illumination at different angles;
[0008] The image processing module is used to process the captured images to obtain encoded images;
[0009] The encoding recognition module is used to read the encoding information from the encoded images.
[0010] Preferably, the light source illumination module includes a camera unit 1, an illumination unit 2, and a fixed base 7; the camera unit 1 is installed above the illumination unit 2, and the fixed base 7 is placed below the illumination unit 2.
[0011] Preferably, the illumination unit 2 includes an upper part and a lower part, and the diameter of the upper part is smaller than the diameter of the lower part;
[0012] The upper part is a circular camera installation slot for installing the camera unit 1, and the camera of the camera unit 1 is aligned with the first hole; the lower part is a circular hollow structure with lighting devices installed on the inner side and a plurality of opposite fixing holes arranged on the outer side.
[0013] Preferably, the lighting device includes three layers of light bands arranged in sequence from top to bottom, and each layer of light band is an annular LED light band; the light bands include a first light band 4, a second light band 5, and a third light band 6.
[0014] Preferably, the light emitted by the first light band 4 is white, the light emitted by the second light band 5 is red, and the light emitted by the third light band 6 is green.
[0015] Preferably, a diffuser plate 3 is installed at the bottom of the lower part, which is circular in shape and fixed by bolts through the fixing holes.
[0016] The present invention also provides a coding recognition method based on multi-angle light sources, which specifically includes the following steps:
[0017] S1: Obtain a first image set of the object to be recognized at multiple angles of different light sources;
[0018] S2: Preprocess the obtained first image set to obtain a second image set;
[0019] S3: Set weights for the images under the same light band in the second image set and then fuse them. Then, perform the first processing on the fused images to obtain coding images corresponding to different light bands;
[0020] S4: Perform the second processing on the coding images using a defogging algorithm, and then perform weighted fusion on the coding images corresponding to different light bands according to the weighted fusion method to obtain the final coding image;
[0021] S5: Perform OCR recognition on the final coding image to read the coding information.
[0022] Preferably, the S1 includes:
[0023] S1-1: Sequentially turn on the LEDs at different arcs of the first light band, and collect the first sub-images of the object to be recognized under the light sources at different arcs; then make the first light band in a fully lit state, and collect the second sub-images of the object to be recognized in the fully lit state;
[0024] S1-2: Sequentially turn on the LEDs at different arcs of the second light band, and collect the third sub-images of the object to be recognized under the light sources at different arcs; then make the second light band in a fully lit state, and collect the fourth sub-images of the object to be recognized in the fully lit state;
[0025] S1-3: Turn on the LEDs under different arcs of the third light band in sequence, and collect the fifth sub-image of the object to be recognized under light sources with different arcs; then make the third light band in a fully lit state, and collect the sixth sub-image of the object to be recognized in the fully lit state.
[0026] S1-4: Construct the first image set according to the first sub-image, the second sub-image, the third sub-image, the fourth sub-image, the fifth sub-image, and the sixth sub-image.
[0027] Preferably, the preprocessing steps in S2 are as follows:
[0028] Remove the noise generated by light refraction around each image in the first image set through the high-contrast retention algorithm; then through grayscale conversion and binarization, obtain an image with effective character contours; then perform histogram equalization on the image with effective character contours to obtain two images under the same frequency, a total of six images, which constitute the second image set.
[0029] Preferably, S3 includes:
[0030] S3-1: Set different weights for the two images under the same light band in the second image set according to the contrast between flashing and full brightness, and then perform fusion respectively to obtain the corresponding fused images.
[0031] S3-2: Use the MSRCR algorithm of Retinex to process the fused images to obtain complete character images under high contrast; then through the Laplacian operator, strengthen the contour information of the character images and increase the brightness of the character engraving area to obtain the encoded images.
[0032] In summary, due to the adoption of the above technical solutions, compared with the prior art, the present invention has at least the following beneficial effects:
[0033] The present invention irradiates a transparent material with multiple low-angle light sources, processes the reflected and transmitted light at different angles, and combines the changes of multi-angle light sources to read and process images, realizing accurate recognition of the encoding behind the transparent material, which can replace manual recognition and improve accuracy and work efficiency at the same time. Description of the Drawings:
[0034] Figure 1 It is a schematic diagram of an encoding recognition device based on multi-angle light sources according to an exemplary embodiment of the present invention.
[0035] Figure 2 It is a schematic diagram of a light source illumination module according to an exemplary embodiment of the present invention.
[0036] Figure 3 It is a schematic diagram of the principle of a diffuser plate according to an exemplary embodiment of the present invention.
[0037] Figure 4 Schematic diagram of an encoding recognition method based on multi-angle light sources according to an exemplary embodiment of the present invention. Detailed implementation manners
[0038] The present invention will be further described in detail below in conjunction with embodiments and specific implementation manners. However, this should not be construed as limiting the scope of the above-mentioned subject matter of the present invention to the following embodiments. Any technology implemented based on the content of the present invention belongs to the scope of the present invention.
[0039] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "longitudinal", "transverse", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as limiting the present invention.
[0040] As Figure 1 shown, the present invention provides an encoding recognition device based on multi-angle light sources, including a light source illumination module, an image processing module, and an encoding recognition module connected in sequence.
[0041] In this embodiment, the light source illumination module is used to achieve multi-angle illumination and capture corresponding images under illumination at different angles.
[0042] The image processing module is used to process the captured images to obtain an encoded image, where the encoded image is an image containing an encoding, and the brightness of the encoding is higher than the surrounding brightness.
[0043] The encoding recognition module is used to read the encoding information from the encoded image.
[0044] As Figure 2 shown, the light source illumination module includes a camera unit 1, an illumination unit 2, and a fixed base 7.
[0045] In this embodiment, the illumination unit 2 includes an upper part and a lower part. A first hole is provided at the connection between the upper part and the lower part. The upper part is a circular camera mounting slot for mounting the camera unit 1 (which can capture pictures after reflection of light sources at different angles, that is, enabling the camera to capture multiple pictures of the same object at multiple angles and multiple light frequencies), and the camera of the camera unit 1 is aligned with the first hole (the diameter of the first hole is smaller than the diameter of the upper part). The lower part is a circular hollow structure, with illumination devices installed inside, and a plurality of opposite fixing holes (such as three) are arranged on the outer circumference from top to bottom. These fixing holes are used for fixing with pins according to the position of the diffuser plate 3. The diameter of the upper part is smaller than the diameter of the lower part.
[0046] In this embodiment, the lighting device includes three layers of annular light bands arranged in sequence from top to bottom, including a first light band 4, a second light band 5, and a third light band 6 (which can be adjacent or spaced apart by a certain distance; and the diameter of the third light band 6 > the diameter of the second light band 5 > the diameter of the first light band 4); each layer of light band is an annular LED light strip, and the high-density LED lamp array has high brightness and emits full and uniform light. The light emitted by the first light band 4 is white, the light emitted by the second light band 5 is red, and the light emitted by the third light band 6 is green, which can achieve lighting at different frequencies and alternating illumination of the LED lights in different arc ranges (the frequency and arc can be controlled by a single-chip microcomputer), realizing multi-angle illumination.
[0047] In this embodiment, a diffuser plate 3 is installed at the bottom of the lower part. It is circular and can be fixed by a bolt through a fixing hole. The diffuser plate 3 is used to enhance the diffusion effect of the light emitted by the lighting device, so as to obtain a uniform and stable diffused light irradiation area, as Figure 3 shown. Figure 3 In [the figure], a represents the diffused light irradiation area formed after the light source passes through the diffuser plate 3, Figure 3 and b in [the figure] represents the light irradiation area formed by direct irradiation (that is, without passing through the diffuser plate 3 by the light source). By comparing the two, it can be seen that the diffused light irradiation area formed after passing through the diffuser plate 3 is larger and more uniform than the light irradiation area formed by direct irradiation. In the case of the diffuser plate and direct light illumination, the width of the emission angle can be increased after diffusion; when low-angle light rays from all directions enter the diffuser plate, the slight non-uniformity of the material will cause the light rays to scatter at different angles, so that the light rays emitted from the diffuser plate 3 will not produce bright spots caused by specular reflection, becoming uniform and soft, making the light spot more uniform, the light more uniform and full, thereby obtaining a dial image with more obvious contrast and better imaging.
[0048] In this embodiment, the thickness of the diffuser plate 3 can be changed according to different types of dials, so as to obtain different images and reduce the influence of low-salience regions and stains or the transparent material of the dial on code recognition. The circular diffuser plate combined with the annular LED light strip can realize multi-angle shooting and light uniformity technology, greatly improving the image quality and clarity and reducing the influence of noise.
[0049] The position of the diffuser plate 3 in the lighting unit 2 can also be adjusted according to requirements and the lighting range (it can be fixed through fixing holes at different positions on the outside), so as to obtain dial images under different light source irradiation conditions, greatly improving the stability of the recognition of effective information in the image. The emission of light by a single light source will cause uneven light reflection, and the light blocked by the dial structure will form a region with relatively low salience. The annular light strip can effectively emit light sources and reduce the problem of low salience.
[0050] In this embodiment, one end of the fixed base 7 is provided with a fixed column, and a vertical bracket is arranged on the fixed column (the height of the bracket can be adjusted by rotating the thread on the column), and a hollow disc is arranged on the bracket. The lighting unit 2 is placed on the hollow disc (the diameter of the hollow disc is smaller than the diameter of the lower part of the lighting unit 2), and the other end of the fixed base 7 is directly below the hollow disc for placing the object to be recognized.
[0051] Based on the above-mentioned coding recognition device based on multi-angle light sources, the present invention also provides a coding recognition method based on multi-angle light sources, which specifically includes the following steps:
[0052] S1: Fix the object to be recognized on the fixed base, and obtain a first image set of the object to be recognized at multiple angles of different light sources.
[0053] S1-1: Turn on the LEDs at different arcs of the first light band in sequence (the LED on time at each arc is 2 seconds), and collect the first sub-images of the object to be recognized under the light sources at different arcs; then make the first light band in a fully lit state (the on time is 2 seconds), and collect the second sub-images of the object to be recognized in the fully lit state.
[0054] In this embodiment, in order to facilitate the multi-angle collection of images, the LEDs of each layer of light band are divided into multiple arcs, which can be controlled by a single-chip microcomputer respectively. For example, the first arc is 0°-60°, the second arc is 120°-180°, and the third arc is 240°-300° (the arc of the light band illumination can be adjusted according to the read dial).
[0055] S1-2: Turn on the LEDs at different arcs of the second light band in sequence (the LED on time at each arc is 2 seconds), and collect the third sub-images of the object to be recognized under the light sources at different arcs; then make the second light band in a fully lit state, and collect the fourth sub-images of the object to be recognized in the fully lit state.
[0056] S1-3: Turn on the LEDs at different arcs of the third light band in sequence (the LED on time at each arc is 2 seconds), and collect the fifth sub-images of the object to be recognized under the light sources at different arcs; then make the third light band in a fully lit state, and collect the sixth sub-images of the object to be recognized in the fully lit state.
[0057] S1-4: Fuse the first sub-image, the second sub-image, the third sub-image, the fourth sub-image, the fifth sub-image, and the sixth sub-image into a first image set.
[0058] In this embodiment, through the irradiation of different arcs of light sources, multiple sub-images of the same target can be obtained under the multi-angle illumination layer.
[0059] S2: Preprocess the obtained first image set to obtain a second image set.
[0060] In this embodiment, the steps of preprocessing are as follows:
[0061] Remove the noise generated by the light refraction around each image in the first image set through the high-contrast retention algorithm; then, through grayscale conversion and binarization, obtain an image with effective character contours; then perform histogram equalization on the image with effective character contours, select the image corresponding to the optimal histogram, and obtain two pictures under the same frequency, a total of six pictures, which constitute the second image set.
[0062] S3: Set weights for the images under the same light band in the second image set and then perform fusion, and then perform the first processing on the fused image to obtain the encoded images corresponding to different light bands.
[0063] S3-1: Set different weights for the two images under the same light band in the second image set according to the contrast between flicker and full brightness, and then perform fusion (the fusion operation can be directly performed on the image through OPENCV operations) to obtain a fused image.
[0064] S3-2: Use the MSRCR algorithm of Retinex to further process the fused image to obtain a complete character image under high contrast; then, through the Laplacian operator, strengthen the contour information of the character image and increase the brightness of the character engraving area, so that the character engraving will be more prominent than the surrounding environment, and obtain the encoded image.
[0065] In this embodiment, the area of the fused image is divided into two parts: the area near the black and white contour is the first part (the black and white contour is the position where the character information is located), and the rest of the area is the second part; then, use the machine learning framework to define the ROI (region of interest, the inside of the box where the character information is located) of the black and white contour according to the training information and perform an affine transformation on the ROI area to make the character encoding information face the reader, so as to obtain the character image. The training model is based on the prior art.
[0066] S4: Use the defogging algorithm to perform the second processing on the encoded image to make the black and white contours of the encoded image more obvious, and then perform Gamma correction to enhance the contrast and brightness of the image, and perform weighted fusion on the encoded images corresponding to different light bands according to the clarity of the contours to obtain the final encoded image.
[0067] Specifically, fuse the encoded images corresponding to different light bands through the weighted fusion method in the image fusion algorithm based on the gradient domain (set different weight ratios according to the clarity), use histogram equalization to make the color difference of the fused image transition naturally, and finally use the RANSAC algorithm to fit the image contour, and then use the Laplacian operator for sharpening processing. The fusion process and the fitting process are both prior arts.
[0068] S5: Perform OCR recognition on the final encoded image (which is a prior art) to read the encoded information.
[0069] A computer-readable medium can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0070] In the present disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. And in the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination of the above.
[0071] The computer-readable medium can be included in the described multi-angle light source-based transparent material rear encoding recognition device; or it can exist separately and not be assembled into the system. The above computer-readable medium carries one or more programs, and when the one or more programs are executed by such a system, the system implements the method as described in the embodiments.
[0072] Those of ordinary skill in the art can understand that the above embodiments are specific examples for implementing the present invention, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of the present invention.
Claims
1. A coding recognition device based on a multi-angle light source, characterized in that: It includes a light source illumination module, an image processing module and a code recognition module which are connected in sequence; Light source illumination module, used to realize multi-angle illumination and capture corresponding images under different angles of illumination; An image processing module, used for processing the captured image to obtain a coded image; The coding recognition module is used to read coding information from the coding image.
2. The code recognition device based on multi-angle light source according to claim 1, characterized in that: The light source illumination module comprises a camera unit (1), an illumination unit (2) and a fixed base (7); the camera unit (1) is installed above the illumination unit (2), and the fixed base (7) is placed below the illumination unit (2).
3. The code recognition device based on multi-angle light source as claimed in claim 2, characterized in that: The lighting unit (2) comprises an upper part and a lower part, and the diameter of the upper part is smaller than the diameter of the lower part; The upper part is a circular camera mounting slot for mounting the camera unit (1), with the camera of the camera unit (1) aligned with the first hole; the lower part is a circular hollow structure, with a lighting device mounted on the inside and a plurality of corresponding fixing holes arranged on the outside.
4. The code recognition device based on multi-angle light source as claimed in claim 3, characterized in that: The lighting device comprises three layers of light bands arranged in sequence from top to bottom, each layer of light band is a ring-shaped LED light band; the light bands comprise a first light band (4), a second light band (5), and a third light band (6).
5. The code recognition device based on multi-angle light source as claimed in claim 3, characterized in that: The light emitted by the first light band (4) is white, the light emitted by the second light band (5) is red, and the light emitted by the third light band (6) is green.
6. The code recognition device based on multi-angle light source as claimed in claim 3, characterized in that: A diffusion plate (3) is installed at the bottom of the lower part and is circular in shape and fixed by a latch through a fixing hole.
7. The method for coding recognition based on multi-angle light source of the device according to any one of claims 1 to 6, characterized in that: The specific steps include: S1: Acquire a first image set of an object to be identified under multiple angles of different light sources; S2: preprocessing the acquired first image set to obtain a second image set; S3: weighting the images in the same light band in the second image set and fusing them, and then performing a first processing on the fused images to obtain corresponding coded images in different light bands; S4: using a defogging algorithm to perform a second processing on the coded image, and then weighted fusion of the coded images corresponding to different light bands according to a weighted fusion method to obtain a final coded image; S5: Perform OCR recognition on the final encoded image and read the encoded information.
8. The method for code recognition based on multi-angle light source according to claim 7, characterized in that: The S1 includes: S1-1: sequentially turn on the LEDs of the first light band under different arcs to collect the first sub-image of the object to be identified under different arc light sources; then make the first light band in a full-bright state to collect the second sub-image of the object to be identified in a full-bright state; S1-2: sequentially turning on the LEDs of the second light band at different arcs to collect the third sub-image of the object to be identified under the light sources of different arcs; then making the second light band fully bright, collecting the fourth sub-image of the object to be identified in the fully bright state; S1-3: sequentially turning on the LEDs of the third light band at different arcs to collect the fifth sub-image of the object to be identified under the light sources of different arcs; then making the third light band fully bright, collecting the sixth sub-image of the object to be identified in the fully bright state; S1-4: construct a first image set according to the first sub-image, the second sub-image, the third sub-image, the fourth sub-image, the fifth sub-image, and the sixth sub-image.
9. The method for code recognition based on multi-angle light source according to claim 7, characterized in that: The steps of preprocessing in S2 are: The noise caused by the refraction of light around each image in the first image set is removed by a high-contrast retention algorithm; then, images with valid character contours are obtained by grayscale and binarization; and then histogram equalization is performed on the images with valid character contours to obtain two images at the same frequency, a total of six images, which constitute the second image set.
10. The method for code recognition based on multi-angle light source according to claim 9, characterized in that: The S3 includes: S3-1: setting different weights for two images under the same light band in the second image set according to the contrast between flicker and full brightness, and then fusing them respectively to obtain a corresponding fused image; S3-2: Use the Retinex MSRCR algorithm to process the fused image to obtain a complete character image with high contrast; then use the Laplace operator to enhance the contour information of the character image and increase the brightness of the character engraving area to obtain the encoded image.