Intelligent light source switching method and system for two-dimensional bar code recognition
By dynamically adjusting the light source mode to adapt to complex lighting environments and barcode image characteristics, the problem of single light source adjustment strategy in the prior art is solved, significantly improving the adaptability and accuracy of two-dimensional barcode recognition.
Patent Information
- Application Number
- CN202510297169.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-06-27
AI Technical Summary
The existing two-dimensional barcode recognition system cannot adapt effectively in complex and changing lighting environments, resulting in a decrease in recognition rate and a single light source adjustment strategy, which cannot fully play the role of light source optimization.
By collecting ambient lighting information and barcode image information, based on the preset light source mode selection and correction strategy, the light source mode is dynamically adjusted to adapt to complex lighting environments and barcode image features.
The precise selection and dynamic optimization of light source mode are achieved, which significantly improves the adaptability and accuracy of two-dimensional barcode recognition, and avoids the decrease in recognition rate caused by the lighting environment.
Smart Images

Figure CN120218098A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of barcode recognition, and in particular, to an intelligent light source switching method and system for two-dimensional barcode recognition. Background Art
[0002] In the technical field of two-dimensional barcode recognition, the selection and adjustment of the light source are one of the key factors affecting the recognition effect. Existing two-dimensional barcode recognition systems usually adopt a fixed light source or a simple manual light source adjustment mode, such as automatically adjusting the light source brightness according to the ambient light intensity. However, these methods have obvious limitations in practical applications.
[0003] First of all, the fixed light source cannot adapt to complex and changeable lighting environments. For example, in strong light, weak light or high reflection conditions, the fixed light source may cause overexposure, underexposure or interference reflection of the barcode image, thus reducing the recognition rate. Secondly, the existing light source adjustment strategies usually only rely on single ambient light intensity information, resulting in inaccurate selection of the light source mode and unable to fully play the optimization role of the light source. In addition, the existing technology lacks the ability to dynamically correct the light source mode. For example, when the barcode recognition fails, it is unable to adjust the light source parameters in real time according to the recognition result, further restricting the improvement of the recognition effect. These problems are particularly prominent in complex scenarios (such as outdoors, warehouses, and retail environments), seriously affecting the efficiency and accuracy of two-dimensional barcode recognition.
[0004] Therefore, there is an urgent need for a method that can intelligently switch the light source mode. Through multi-dimensional ambient light analysis and dynamic light source correction strategies, precise adjustment of the light source can be achieved, thereby improving the adaptability and reliability of two-dimensional barcode recognition. Summary of the Invention
[0005] In order to solve the above-mentioned defects and improve the adaptability and reliability of two-dimensional barcode recognition in different environments, the present application provides an intelligent light source switching method and system for two-dimensional barcode recognition.
[0006] The first invention object of the present application is achieved through the following technical solutions:
[0007] An intelligent light source switching method for two-dimensional barcode recognition includes the steps of:
[0008] Obtaining ambient light information through a collection terminal;
[0009] Matching the initial light source mode corresponding to the ambient light information based on a preset light source mode selection strategy, and adjusting the light source based on the matched initial light source mode;
[0010] Obtaining barcode image information through a collection terminal, and recognizing the barcode image information;
[0011] Adjust the initial light source mode based on the recognition result of the barcode image information through a preset light source mode correction strategy to obtain a corrected light source mode, and adjust the light source based on the corrected light source mode.
[0012] By adopting the above technical solution, the ambient light information is obtained through the acquisition terminal, and the initial light source mode corresponding to the current ambient light information is matched based on a preset light source mode selection strategy, and the light source is adjusted to the initial light source mode to cope with the complex and changeable light environment; the barcode image information is obtained through the acquisition terminal, and the barcode image information is recognized. Based on the recognition result of the barcode image information, the initial light source mode is dynamically adjusted through a preset light source mode correction strategy to obtain a corrected light source mode to optimize the light source parameters, and the light source is adjusted based on the corrected light source mode; in this application, the initial light source mode is selected by matching the ambient light information to solve the problem that a fixed light source cannot adapt to a complex and changeable light environment and avoid the decrease in recognition rate caused by ambient light; secondly, the light source mode is dynamically corrected based on the recognition result of the barcode image information to solve the problem of a single light source adjustment strategy and the inability to fully exert the optimization effect of the light source in the prior art, and achieve the precise selection of the light source mode; through the above steps, this application realizes the dynamic optimization and precise adjustment of the light source mode, and has the effect of significantly improving the adaptability and accuracy of two-dimensional barcode recognition.
[0013] This application can be further configured in a preferred example as follows: the step of matching the initial light source mode corresponding to the ambient light information based on a preset light source mode selection strategy and adjusting the light source based on the matched initial light source mode includes the steps of:
[0014] Recognize the light characteristics in the ambient light information, where the light characteristics include light direction, light intensity, color temperature, spectral distribution, and light uniformity;
[0015] Determine the polarization angle of polarized light based on the light direction, and determine the polarization intensity of polarized light based on the color temperature and spectral distribution;
[0016] Determine the brightness parameter based on the light intensity, and determine the illumination uniformity based on the light uniformity;
[0017] Determine the initial light source mode by combining the polarization angle of polarized light, the polarization intensity of polarized light, the brightness parameter, and the illumination uniformity.
[0018] By adopting the above technical solutions, the light characteristics in the ambient light information are identified, including the light direction, light intensity, color temperature, spectral distribution, and light uniformity; the polarization angle of polarized light is determined based on the light direction, and the polarization intensity of polarized light is determined based on the color temperature and spectral distribution to cope with the interference under high-reflection or complex spectral conditions; the brightness parameter is determined based on the light intensity, and the illumination uniformity is determined based on the light uniformity to ensure that the brightness and light distribution of the barcode image meet the recognition requirements; the initial light source mode is comprehensively determined by combining the polarization angle of polarized light, the polarization intensity of polarized light, the brightness parameter, and the illumination uniformity, and the light source is adjusted to the initial light source mode; through the above method, the present application realizes the precise adjustment of the light source mode in a complex light environment. By identifying the light characteristics in the ambient light information, the problems in the prior art such as single light source adjustment strategy and inability to adapt to complex light environments are solved, ensuring the accuracy and adaptability of the light source mode selection; the polarization angle and polarization intensity of polarized light are determined based on characteristics such as light direction, color temperature, and spectral distribution, solving the problem of barcode image interference under high-reflection or complex spectral conditions, and improving the clarity and recognizability of the image; the brightness parameter and illumination uniformity are determined by combining the light intensity and light uniformity, solving the problems of uneven brightness, overexposure, and underexposure of the barcode image, ensuring the stability and consistency of the image quality, and realizing the refined selection and optimization of the light source mode.
[0019] In a preferred example, the present application can be further configured as follows: the step of adjusting the initial light source mode based on the recognition result of the barcode image information by the pre-set light source mode correction strategy to obtain the corrected light source mode and adjusting the light source based on the corrected light source mode includes the steps of:
[0020] Identify the barcode image features in the barcode image information, where the barcode image features include contrast, edge sharpness, brightness uniformity, and reflection interference degree;
[0021] Determine the brightness adjustment parameter based on the contrast, and determine the light source focusing parameter based on the edge sharpness;
[0022] Adjust the light source distribution parameter based on the brightness uniformity, and determine the polarization correction parameter based on the reflection interference degree;
[0023] Combine the brightness adjustment parameter, the light source focusing parameter, the light source distribution parameter, and the polarization correction parameter to adjust the initial light source mode to obtain the corrected light source mode.
[0024] By adopting the above technical solution, barcode image features in barcode image information are identified, including contrast, edge sharpness, brightness uniformity, and specular interference degree; based on the contrast, brightness adjustment parameters are determined to optimize the overall brightness and detail performance of the image; based on the edge sharpness, light source focusing parameters are determined to improve the sharpness and recognition accuracy of the barcode edge; based on the brightness uniformity, light source distribution parameters are adjusted to ensure uniform illumination distribution of the barcode image and avoid local overbrightness or overdarkness; based on the specular interference degree, polarization light correction parameters are determined to reduce the interference of high reflection or specular reflection on the image quality; combining the brightness adjustment parameters, light source focusing parameters, light source distribution parameters, and polarization light correction parameters, the initial light source mode is dynamically adjusted to obtain a corrected light source mode; through the above method, the present application realizes the dynamic correction of the light source mode under complex barcode image conditions. By identifying barcode image features, the problems in the prior art such as a single light source adjustment strategy and inability to adapt to complex barcode image conditions are solved, ensuring the accuracy and adaptability of the light source mode correction; based on the contrast and edge sharpness, the brightness adjustment parameters and light source focusing parameters are determined to solve the problems of insufficient brightness or blurred edges of the barcode image and improve the sharpness and recognizability of the image; at the same time, based on the brightness uniformity and specular interference degree, the light source distribution parameters and polarization light correction parameters are adjusted to solve the problems of uneven illumination or specular interference of the barcode image and ensure the stability and consistency of the image quality; it has the effects of significantly improving the efficiency and accuracy of two-dimensional barcode recognition, strong adaptability, high recognition rate, and good real-time performance.
[0025] In a preferred example, the present application can be further configured as follows: the step of adjusting the initial light source mode based on the recognition result of barcode image information through a pre-set light source mode correction strategy to obtain a corrected light source mode and adjusting the light source based on the corrected light source mode includes the steps of:
[0026] Obtain all light source information and identify the illumination range corresponding to the light source information in the initial light source mode;
[0027] Based on the illumination range corresponding to each light source information, determine whether there is an illumination overlapping area;
[0028] When there is an illumination overlapping area, identify whether there is a barcode recognition area within the illumination overlapping area;
[0029] When there is a barcode recognition area, update the corrected light source mode of the light source information associated with the illumination overlapping area corresponding to the barcode recognition area based on a pre-set light source mode update strategy.
[0030] By adopting the above technical solution, all light source information is obtained, and the illumination range corresponding to the light source information in the initial light source mode is identified to clarify the illumination area of each light source; based on the illumination ranges corresponding to the light source information, it is determined whether there is an illumination overlapping area, that is, whether the illumination ranges of multiple light sources overlap; when there is an illumination overlapping area, it is further identified whether there is a barcode recognition area in this area, that is, it is determined whether the barcode is located in the illumination overlapping area; when there is a barcode recognition area, based on the preset light source mode update strategy, the corrected light source mode of the light source information associated with the illumination overlapping area corresponding to the barcode recognition area is updated to ensure that the illumination conditions in this area meet the barcode recognition requirements. Through the above steps, the present application realizes the refined management and optimization of the illumination overlapping area, avoids the degradation of the barcode image quality caused by illumination overlap, and further improves the recognition effect.
[0031] In a preferred example, the present application can be further configured as follows: the step of, when there is a barcode recognition area, updating the corrected light source mode of the light source information associated with the illumination overlapping area corresponding to the barcode recognition area based on the preset light source mode update strategy includes the steps of:
[0032] Obtain the barcode image information in the barcode recognition area, and identify whether there are multi-light-source interference features in the barcode image information;
[0033] If there are multi-light-source interference features, analyze the mutual influence between the light source information associated with the illumination overlapping area based on the multi-light-source interference features;
[0034] Update the corrected light source mode based on the analysis result through the preset light source mode update strategy.
[0035] By adopting the above technical solution, the barcode image information in the barcode recognition area is obtained, and it is identified whether there are multi-light-source interference features in the barcode image information, such as overbrightness, shadows or reflective interference caused by the irradiation of multiple light sources; if there are multi-light-source interference features, analyze the mutual influence between the light source information associated with the illumination overlapping area based on the multi-light-source interference features, such as judging whether the parameters such as the brightness, angle, and color temperature of each light source conflict or are superimposed; through the preset light source mode update strategy, update the corrected light source mode based on the analysis result, such as adjusting the brightness, angle or polarization parameters of the light source to eliminate multi-light-source interference and optimize the barcode image quality; through the above method, the present application realizes the accurate identification and dynamic optimization of multi-light-source interference, and has the effect of significantly improving the efficiency and accuracy of two-dimensional barcode recognition.
[0036] In a preferred example, the present application can be further configured as follows: the step of obtaining the barcode image information through the acquisition terminal and identifying the barcode image information includes the steps of:
[0037] Input the barcode image information into a pre-trained feature recognition model for feature recognition;
[0038] When receiving the motion vector features output by the feature recognition model, analyze the influence of the motion vector features on the barcode image information in the initial light source mode;
[0039] Update the initial light source mode based on the analysis result, adjust the light source based on the updated initial light source mode, and re-obtain the barcode image information through the acquisition terminal.
[0040] By adopting the above technical solution, input the barcode image information into a pre-trained feature recognition model for feature recognition to extract the feature information of the barcode; when receiving the motion vector features output by the feature recognition model, analyze the influence of the motion vector features on the barcode image information in the initial light source mode; update the initial light source mode based on the analysis result to optimize the barcode image quality; adjust the light source based on the updated initial light source mode and re-obtain the barcode image information through the acquisition terminal to ensure continuous improvement of the recognition effect; through the above method, the present application realizes dynamic analysis of the barcode motion state and real-time optimization of the light source mode, and has the effect of significantly improving the efficiency and accuracy of two-dimensional barcode recognition.
[0041] In a preferred example, the present application can be further configured as: the motion vector features include a motion direction, a motion speed, and a motion acceleration, and the step of analyzing the influence of the motion vector features on the barcode image information in the initial light source mode when receiving the motion vector features output by the feature recognition model includes:
[0042] Analyze the influence of the motion direction on the barcode image information in the initial light source mode to generate a motion direction analysis result;
[0043] Analyze the influence of the motion speed on the barcode image information in the initial light source mode to generate a motion speed analysis result;
[0044] Analyze the influence of the motion acceleration on the barcode image information in the initial light source mode to generate a motion acceleration analysis result;
[0045] Combine the motion direction, the motion speed, and the motion acceleration to determine whether the barcode image information is in a complex motion state. If so, generate a complex motion analysis result.
[0046] By adopting the above technical solution, the influence of the moving direction on the bar code image information in the initial light source mode is analyzed, and the moving direction analysis result is generated; the influence of the moving speed on the bar code image information in the initial light source mode is analyzed, and the moving speed analysis result is generated; the influence of the moving acceleration on the bar code image information in the initial light source mode is analyzed, and the moving acceleration analysis result is generated; combining the analysis results of the moving direction, moving speed and moving acceleration, comprehensively judge whether the bar code image information is in a complex motion state. If so, generate a complex motion analysis result; through the above steps, the present application realizes the refined evaluation of the bar code motion state and the accurate judgment of the complex motion state, providing a reliable basis for the subsequent light source mode adjustment.
[0047] The second invention object of the present application is achieved by the following technical solutions:
[0048] A light source intelligent switching system for two-dimensional bar code recognition, comprising:
[0049] A first acquisition module, configured to acquire ambient light information through an acquisition terminal;
[0050] A first light source adjustment module, configured to match the initial light source mode corresponding to the ambient light information based on a preset light source mode selection strategy, and adjust the light source based on the matched initial light source mode;
[0051] A second acquisition module, configured to acquire bar code image information through an acquisition terminal and identify the bar code image information;
[0052] A second light source adjustment module, configured to adjust the initial light source mode based on the recognition result of the bar code image information through a preset light source mode correction strategy to obtain a corrected light source mode, and adjust the light source based on the corrected light source mode;
[0053] A third light source adjustment module, configured to adjust the light source based on the corrected light source mode.
[0054] By adopting the above technical solution, a first acquisition module is configured to acquire ambient light information through an acquisition terminal; a first light source adjustment module is configured to match the initial light source mode corresponding to the ambient light information based on a preset light source mode selection strategy, and adjust the light source based on the matched initial light source mode; a second acquisition module is configured to acquire bar code image information through an acquisition terminal and identify the bar code image information; a second light source adjustment module is configured to adjust the initial light source mode based on the recognition result of the bar code image information through a preset light source mode correction strategy to obtain a corrected light source mode, and adjust the light source based on the corrected light source mode; a third light source adjustment module is configured to adjust the light source based on the corrected light source mode.
[0055] In summary, the present application includes at least one of the following beneficial technical effects:
[0056] 1. This application selects the initial light source mode by matching the ambient light information, solves the problem that fixed light sources cannot adapt to complex and variable lighting environments, and avoids the decrease in recognition rate caused by ambient light. Secondly, based on the recognition results of barcode image information, the light source mode is dynamically corrected, solving the problems in the prior art such as single light source adjustment strategy and inability to fully exert the optimization effect of the light source, realizing the precise selection of the light source mode and the dynamic optimization of the light source mode, and having the effect of significantly improving the adaptability and accuracy of two-dimensional barcode recognition. Brief Description of the Drawings
[0057] Figure 1 is a flowchart of an embodiment of a method for intelligent switching of light sources for two-dimensional barcode recognition in this application;
[0058] Figure 2 is a flowchart of the implementation of step S20 in an embodiment of a method for intelligent switching of light sources for two-dimensional barcode recognition in this application;
[0059] Figure 3 is a flowchart of the implementation of step S40 in an embodiment of a method for intelligent switching of light sources for two-dimensional barcode recognition in this application;
[0060] Figure 4 is another flowchart of the implementation of step S40 in an embodiment of a method for intelligent switching of light sources for two-dimensional barcode recognition in this application;
[0061] Figure 5 is a flowchart of the implementation of step S440 in an embodiment of a method for intelligent switching of light sources for two-dimensional barcode recognition in this application;
[0062] Figure 6 is a flowchart of the implementation of step S30 in an embodiment of a method for intelligent switching of light sources for two-dimensional barcode recognition in this application. Detailed Description of the Embodiment
[0063] The following further elaborates on this application in conjunction with the attached Figure 1-6 drawings.
[0064] In one embodiment, as Figure 1 shown, this application discloses a method for intelligent switching of light sources for two-dimensional barcode recognition, specifically including the following steps:
[0065] S10: Obtain ambient light information through a collection terminal;
[0066] In this embodiment, the collection terminal is a device for obtaining ambient light information and barcode image information, including hardware components such as a camera and a light sensor; the ambient light information is the lighting characteristic data of the current environment obtained by the collection terminal;
[0067] Specifically, use a collection terminal (such as a light sensor) to obtain the current ambient light information;
[0068] S20: Based on a pre-set light source mode selection strategy, match the initial light source mode corresponding to the ambient light information, and adjust the light source based on the matched initial light source mode;
[0069] In this embodiment, the light source mode selection strategy is a rule algorithm for matching a suitable light source mode according to the ambient light information, and is used to determine the initial light source mode; the initial light source mode is the working state and parameter settings of the light source matched by the light source mode selection strategy;
[0070] Specifically, according to the ambient light information, through a pre-set light source mode selection strategy, match a suitable initial light source mode. For example, select a low-brightness light source mode in a strong light environment, select a high-brightness light source mode in a weak light environment, etc., and adjust the light source to the matched initial light source mode;
[0071] S30: Obtain barcode image information through a collection terminal and identify the barcode image information;
[0072] In this embodiment, the barcode image information is image data containing a two-dimensional barcode obtained by a collection terminal, including a barcode area, barcode type, barcode content, and image quality characteristics (such as contrast, edge sharpness, brightness uniformity, etc.);
[0073] Specifically, use a collection terminal (such as a camera) to obtain barcode image information containing a two-dimensional barcode and identify the barcode image information;
[0074] S40: Based on the recognition result of the barcode image information, adjust the initial light source mode through a pre-set light source mode correction strategy to obtain a corrected light source mode, and adjust the light source based on the corrected light source mode;
[0075] In this embodiment, the light source mode correction strategy is a rule or algorithm for adjusting the light source mode according to the recognition result of the barcode image information, and is used to optimize the light source parameters; the corrected light source mode is the working state and parameter settings of the light source after being adjusted based on the light source mode correction strategy;
[0076] Specifically, according to the recognition result of the barcode image information, through a pre-set light source mode correction strategy, adjust the initial light source mode to obtain a corrected light source mode, and adjust the light source to the corrected light source mode to optimize the barcode image quality; for example, if the barcode image contrast is insufficient, increase the light source brightness; if there is specular reflection interference in the barcode image, adjust the polarization angle.
[0077] In one embodiment, as Figure 2 shown, step S20 includes the steps:
[0078] S201: Identify the lighting features in the ambient lighting information, where the lighting features include the lighting direction, lighting intensity, color temperature, spectral distribution, and lighting uniformity;
[0079] S202: Determine the polarization angle based on the lighting direction, and determine the polarization intensity based on the color temperature and spectral distribution;
[0080] S203: Determine the brightness parameter based on the lighting intensity, and determine the illumination uniformity based on the lighting uniformity;
[0081] S204: Combine the polarization angle, polarization intensity, brightness parameter, and illumination uniformity to determine the initial light source mode;
[0082] In this embodiment, the lighting features are specific lighting attributes in the ambient lighting information, including the lighting direction, lighting intensity, color temperature, spectral distribution, and lighting uniformity; the polarization angle is the irradiation angle of the polarized light source, which is used to reduce high reflection or specular reflection interference and improve the clarity of the barcode image; the polarization intensity is the brightness intensity of the polarized light source, which is used to control the effect of the polarized light and reduce specular reflection interference; the brightness parameter is the brightness setting of the light source, which is used to adjust the overall brightness of the light source irradiating the object to avoid overexposure or underexposure; the illumination uniformity is the degree of uniformity of the light source irradiating the illuminated object, which is used to ensure that the light distribution on the surface of the illuminated object is consistent and avoid local overbrightness or overdarkness; the initial light source mode is the light source mode determined according to the ambient lighting information, including parameter settings such as the polarization angle, polarization intensity, brightness parameter, and illumination uniformity;
[0083] Specifically, a collection terminal (such as a light sensor) is used to obtain the light information of the current environment, analyze the environmental light information, and extract light features, including light direction, light intensity, color temperature, spectral distribution, and light uniformity, etc.; according to the light direction, the polarization angle of light is determined to reduce high reflection or specular reflection interference. For example, if the light direction is perpendicular to the surface of the irradiated object, the polarization angle of light is adjusted to eliminate specular reflection; according to the color temperature and spectral distribution, the contrast and the polarization intensity of light are determined to optimize the clarity and detail performance of the irradiated object. For example, in a warm color temperature environment, the contrast is adjusted to increase the brightness difference between the irradiated object and the background; according to the light intensity, the brightness parameter is determined to adjust the overall brightness of the surface of the irradiated object. For example, the brightness parameter is reduced in a strong light environment and increased in a weak light environment; according to the light uniformity, the illumination uniformity is determined to ensure that the light distribution on the surface of the irradiated object is consistent. For example, if the light is uneven, the light source distribution parameters are adjusted to make the light on the surface of the irradiated object uniform; by synthesizing the polarization angle of light, the polarization intensity of light, the contrast, the brightness parameter, and the illumination uniformity, the initial light source mode is determined. For example, the polarization angle and intensity of light are combined to reduce specular reflection interference, and the brightness parameter and illumination uniformity are combined to optimize the brightness and light distribution; after determining the initial light source mode, the light source is adjusted to this mode to provide an optimized light condition for the subsequent acquisition and recognition of bar code image information.
[0084] In one embodiment, as Figure 3 shown, step S40 includes the steps:
[0085] S401: Identify the bar code image features in the bar code image information, where the bar code image features include contrast, edge sharpness, brightness uniformity, and specular reflection interference degree;
[0086] S402: Determine the brightness adjustment parameter based on the contrast, and determine the light source focusing parameter based on the edge sharpness;
[0087] S403: Adjust the light source distribution parameter based on the brightness uniformity, and determine the polarization correction parameter based on the specular reflection interference degree;
[0088] S404: Combine the brightness adjustment parameter, the light source focusing parameter, the light source distribution parameter, and the polarization correction parameter to adjust the initial light source mode to obtain the corrected light source mode;
[0089] In this embodiment, the barcode image information is the image data containing the two-dimensional barcode acquired by the acquisition terminal, including the barcode area, barcode type, barcode content, and image quality characteristics; the barcode image feature is the specific image quality attribute in the barcode image information, including contrast, edge sharpness, brightness uniformity, and reflection interference degree; the contrast is the brightness difference between the barcode area and the background area in the barcode image, which is an important factor affecting the barcode recognition effect; the edge sharpness is the clarity of the barcode edge in the barcode image, reflecting the detail performance of the barcode image; the brightness uniformity is the degree of uniformity of the light distribution in the barcode image, ensuring consistent illumination in the barcode area and avoiding local over-brightness or under-brightness; the reflection interference degree is the degree of interference caused by reflection or high reflection in the barcode image, which is an important factor affecting the barcode recognition effect; the brightness adjustment parameter is the brightness setting of the light source, used to adjust the overall brightness of the barcode image and avoid overexposure or underexposure; the light source focusing parameter is the focusing setting of the light source, used to optimize the edge sharpness of the barcode image and improve the detail performance; the light source distribution parameter is the distribution setting of the light source, used to adjust the illumination uniformity of the barcode image and ensure consistent light distribution; the polarized light correction parameter is the adjustment setting of the polarized light source, used to reduce reflection interference and improve the clarity of the barcode image;
[0090] Specifically, use image processing technology to analyze the barcode image information and extract barcode image features, including contrast, edge sharpness, brightness uniformity, and reflection interference degree. According to the contrast, determine the brightness adjustment parameter. For example, if the barcode image contrast is insufficient, increase the brightness parameter to improve the brightness difference between the barcode area and the background. According to the edge sharpness, determine the light source focusing parameter. For example, if the barcode edge is blurred, adjust the light source focusing parameter to improve the edge sharpness. According to the brightness uniformity, adjust the light source distribution parameter. For example, if the barcode image illumination is uneven, adjust the light source distribution parameter to make the illumination in the barcode area uniform. According to the reflection interference degree, determine the polarized light correction parameter. For example, if there is reflection interference in the barcode image, adjust the polarization angle and intensity to reduce reflection. Combine the brightness adjustment parameter, light source focusing parameter, light source distribution parameter, and polarized light correction parameter to adjust the initial light source mode. For example, combine the brightness adjustment parameter and the light source distribution parameter to optimize the image brightness and illumination uniformity, and combine the light source focusing parameter and the polarized light correction parameter to improve the edge sharpness and reduce reflection interference. After obtaining the corrected light source mode, adjust the light source to this mode;
[0091] Exemplarily, in a retail environment, barcodes may have insufficient contrast due to uneven lighting or specular interference due to high reflectivity; in a warehouse environment, barcodes may have blurred edges due to rapid movement, and it is necessary to adjust the light source focusing parameters to improve the recognition effect; in an outdoor environment, barcodes may have specular interference due to direct sunlight, and it is necessary to adjust the polarized light correction parameters to eliminate specular reflection; in a logistics sorting scenario, barcodes may have poor recognition effects due to complex lighting conditions. By correcting the light source mode, the image quality is optimized and the sorting efficiency is improved.
[0092] In one embodiment, as Figure 4 shown, step S40 includes the steps:
[0093] S410: Obtain all light source information and identify the illumination range corresponding to the light source information in the initial light source mode;
[0094] S420: Based on the illumination ranges corresponding to each light source information, determine whether there is an illumination overlapping area;
[0095] S430: When there is an illumination overlapping area, identify whether there is a barcode recognition area within the illumination overlapping area;
[0096] S440: When there is a barcode recognition area, update the corrected light source mode of the light source information associated with the illumination overlapping area corresponding to the barcode recognition area based on the pre-set light source mode update strategy;
[0097] In this embodiment, the light source information is the identity information and parameter data of the light source obtained by the acquisition terminal, where the identity information includes location information; the illumination range is the area range irradiated by the light source in the current mode, usually determined by the angle, brightness, and irradiation distance of the light source; the illumination overlapping area is the area where the illumination ranges of multiple light sources overlap, which may cause too high illumination intensity or uneven distribution in this area; the barcode recognition area is the area where barcode image recognition needs to be performed, that is, the working area for recognizing barcodes; the light source mode update strategy is a rule or algorithm for adjusting the light source mode according to the characteristics of the illumination overlapping area and the barcode recognition area, and is used to optimize the light source mode;
[0098] Specifically, obtain the identity information and parameter data of all light sources. According to the initial light source mode, identify the illumination range of each light source, that is, the area irradiated by the light source, analyze the illumination ranges of the light sources, and determine whether there are overlapping areas in the illumination ranges of multiple light sources; if there is an overlapping illumination area, further analyze the illumination characteristics of this area. In the overlapping illumination area, identify whether there is a barcode recognition area, that is, the area where the barcode is located. If there is a barcode recognition area, further analyze the impact of the illumination conditions in this area on the barcode image quality; according to the illumination characteristics of the barcode recognition area, through a pre-set light source mode update strategy, adjust and update the corrected light source mode. For example, if the overlapping illumination area causes the barcode image to be too bright, reduce the light source brightness; if the overlapping illumination area causes uneven illumination, adjust the light source distribution parameters.
[0099] In one embodiment, as Figure 5 shown, step S440 includes the steps:
[0100] S441: Obtain the barcode image information within the barcode recognition area, and identify whether there are multi-light source interference characteristics in the barcode image information;
[0101] S442: If there are multi-light source interference characteristics, then analyze the mutual influence between the light source information associated with the overlapping illumination area based on the multi-light source interference characteristics;
[0102] S443: Update the corrected light source mode based on the analysis result through a pre-set light source mode update strategy;
[0103] In this embodiment, the multi-light source interference characteristics are the characteristics of barcode image quality problems caused by the simultaneous irradiation of multiple light sources, such as being too bright, having shadows, specular interference, or uneven illumination, etc.; the light source mode update strategy is a rule or algorithm for adjusting and updating the corrected light source mode according to the mutual influence between the multi-light source interference characteristics and the light source information, and is used to optimize the illumination conditions;
[0104] Specifically, obtain the barcode image information within the barcode recognition area, analyze the barcode image information, and identify whether there are multi-light source interference characteristics, such as being too bright, having shadows, specular interference, or uneven illumination, etc.; if there are multi-light source interference characteristics, then analyze the mutual influence between the light source information associated with the overlapping illumination area, for example, whether the brightness superposition of multiple light sources causes the barcode image to be too bright, and whether the light source angle conflict causes shadows or specular interference; according to the mutual influence between the multi-light source interference characteristics and the light source information, through a pre-set light source mode update strategy, adjust the corrected light source mode. For example, if multiple light sources cause the barcode image to be too bright, reduce the light source brightness; if the light source angle conflict causes shadows, adjust the light source angle; if there is specular interference, adjust the polarization light angle and intensity, etc.; update the corrected light source mode, and adjust the light source to the updated corrected light source mode.
[0105] Exemplarily, in a warehouse environment, multiple light sources irradiating a barcode area simultaneously may cause the barcode image to be too bright or have shadows; in a logistics sorting scenario, multiple light sources irradiating the same conveyor belt area may cause reflective interference or uneven illumination in the barcode image; in a retail environment, multiple light sources irradiating the same product barcode area may cause reflective interference in the barcode image.
[0106] In one embodiment, as Figure 6 shown, step S30 includes the steps of:
[0107] S301: Input the barcode image information into a pre-trained feature recognition model for feature recognition;
[0108] S302: When receiving the motion vector features output by the feature recognition model, analyze the influence of the motion vector features on the barcode image information in the initial light source mode;
[0109] S303: Update the initial light source mode based on the analysis result, adjust the light source based on the updated initial light source mode, and re-obtain the barcode image information through the acquisition terminal;
[0110] In this embodiment, the pre-trained feature recognition model is a deep learning model trained with a large amount of barcode image data, which can extract features from the barcode image, such as motion vector features, texture features, illumination features, etc.; the motion vector features are the relative motion information of objects or light sources in the barcode image, used to describe the image changes caused by the motion of light sources or objects in the barcode image;
[0111] Specifically, input the barcode image information obtained by the acquisition terminal into the pre-trained feature recognition model to extract features in the barcode image, such as motion vector features, texture features, illumination features, etc.; when receiving the motion vector features output by the feature recognition model, analyze the influence of the motion vector features on the barcode image information in the initial light source mode. For example, whether the motion vector features cause the barcode image to be blurred, distorted, or have uneven illumination; based on the analysis result of the motion vector features on the barcode image information, update the initial light source mode. For example, if the motion vector features cause the barcode image to be blurred, increase the light source brightness or adjust the light source angle; if the motion vector features cause uneven illumination, adjust the light source parameters; adjust the light source based on the updated initial light source mode and re-obtain the barcode image information through the acquisition terminal to ensure the high quality of the barcode image and the continuous improvement of the recognition effect.
[0112] In one embodiment, the motion vector features include motion direction, motion speed, and motion acceleration, and step S302 includes:
[0113] Analyze the influence of the movement direction on the bar code image information in the initial light source mode, and generate the movement direction analysis result;
[0114] Analyze the influence of the movement speed on the bar code image information in the initial light source mode, and generate the movement speed analysis result;
[0115] Analyze the influence of the movement acceleration on the bar code image information in the initial light source mode, and generate the movement acceleration analysis result;
[0116] Combine the movement direction, movement speed and movement acceleration to determine whether the bar code image information is in a complex movement state. If so, generate the complex movement analysis result;
[0117] In this embodiment, the motion vector feature is the relative motion information of the bar code in the bar code image, including the movement direction, movement speed and movement acceleration; the movement direction is the movement direction of the bar code in the bar code image, such as the horizontal direction, vertical direction or inclined direction; the movement speed is the movement speed of the bar code in the bar code image, which is used to describe the image change speed caused by the movement of the bar code in the bar code image; the movement acceleration is the movement acceleration of the bar code in the bar code image, which is used to describe the image change acceleration caused by the movement of the bar code in the bar code image; the complex movement state means that the movement state of the bar code in the bar code image is complex, for example, the movement direction, movement speed and movement acceleration all change, resulting in the bar code image being blurred, distorted or having uneven illumination.
[0118] Specifically, analyze the influence of the movement direction on the bar code image information in the initial light source mode, such as whether the movement direction causes the bar code image to be blurred, distorted or have uneven illumination; analyze the influence of the movement speed on the bar code image information in the initial light source mode, such as whether the movement speed causes the bar code image to be blurred, distorted or have uneven illumination; analyze the influence of the movement acceleration on the bar code image information in the initial light source mode, such as whether the movement acceleration causes the bar code image to be blurred, distorted or have uneven illumination; combine the movement direction, movement speed and movement acceleration to determine whether the bar code image information is in a complex movement state, for example, the movement direction, movement speed and movement acceleration all change, resulting in the bar code image being blurred, distorted or having uneven illumination; if so, generate the complex movement analysis result for subsequent light source mode update;
[0119] Exemplarily, in the logistics sorting scenario, when the bar code image is blurred due to the movement of the conveyor belt, generate the corresponding analysis result:
[0120] In the logistics sorting scenario, the horizontal movement of the conveyor belt causes barcode images to be blurred. Analyze the influence of the movement direction on the barcode image information to generate a movement direction analysis result; the high-speed movement of the conveyor belt causes barcode images to be blurred. Analyze the influence of the movement speed on the barcode image information to generate a movement speed analysis result; the accelerating movement of the conveyor belt causes barcode images to be blurred. Analyze the influence of the movement acceleration on the barcode image information to generate a movement acceleration analysis result; combine the movement direction, movement speed, and movement acceleration to determine whether the barcode image information is in a complex movement state and generate a complex movement analysis result.
[0121] In a warehouse environment, when barcode images are blurred due to the movement of the conveyor belt, corresponding analysis results are generated:
[0122] In a warehouse environment, the horizontal movement of the conveyor belt causes barcode images to be blurred. Analyze the influence of the movement direction on the barcode image information to generate a movement direction analysis result; the high-speed movement of the conveyor belt causes barcode images to be blurred. Analyze the influence of the movement speed on the barcode image information to generate a movement speed analysis result; the accelerating movement of the conveyor belt causes barcode images to be blurred. Analyze the influence of the movement acceleration on the barcode image information to generate a movement acceleration analysis result; combine the movement direction, movement speed, and movement acceleration to determine whether the barcode image information is in a complex movement state and generate a complex movement analysis result.
[0123] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not imply the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0124] In one embodiment, a light source intelligent switching system for two-dimensional barcode recognition is provided. The light source intelligent switching system for two-dimensional barcode recognition corresponds one-to-one with the light source intelligent switching method for two-dimensional barcode recognition in the above embodiment. The light source intelligent switching system for two-dimensional barcode recognition includes:
[0125] A first acquisition module for obtaining ambient light information through an acquisition terminal;
[0126] A first light source adjustment module for matching the initial light source mode corresponding to the ambient light information based on a pre-set light source mode selection strategy and adjusting the light source based on the matched initial light source mode;
[0127] A second acquisition module for obtaining barcode image information through an acquisition terminal and recognizing the barcode image information;
[0128] A second light source adjustment module for adjusting the initial light source mode based on the recognition result of the barcode image information through a pre-set light source mode correction strategy to obtain a corrected light source mode and adjusting the light source based on the corrected light source mode;
[0129] A third light source adjustment module, configured to adjust a light source based on a corrected light source mode.
[0130] For the specific limitations of a light source intelligent switching system for two-dimensional barcode recognition, reference may be made to the limitations of a light source intelligent switching method for two-dimensional barcode recognition in the foregoing text, which will not be elaborated herein. Each module in the above-mentioned light source intelligent switching system for two-dimensional barcode recognition can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or stored in a memory in the computer device in the form of software, so as to facilitate the processor to call and execute the operations corresponding to each of the above modules.
[0131] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A light source intelligent switching method for two-dimensional barcode recognition, characterized in that: The method comprises the steps of: obtaining ambient light information through a collection terminal; Matching an initial light source mode corresponding to the ambient lighting information based on a preset light source mode selection strategy, and adjusting the light source based on the matched initial light source mode; Obtain barcode image information through a collection terminal and identify the barcode image information; The initial light source mode is adjusted based on the recognition result of the barcode image information through a preset light source mode correction strategy to obtain a corrected light source mode, and the light source is adjusted based on the corrected light source mode.
2. The method for intelligently switching light sources for two-dimensional barcode recognition according to claim 1, characterized in that: The step of matching the initial light source mode corresponding to the ambient lighting information based on the preset light source mode selection strategy and adjusting the light source based on the matched initial light source mode comprises the following steps: Identify lighting features in ambient lighting information, wherein the lighting features include lighting direction, lighting intensity, color temperature, spectral distribution, and lighting uniformity; Determine the angle of polarized light based on the illumination direction, and determine the intensity of polarized light based on the color temperature and spectral distribution; Determine brightness parameters based on light intensity, and determine illumination uniformity based on light uniformity; The initial light source mode is determined by combining the polarization angle, polarization intensity, brightness parameters and illumination uniformity.
3. The method for intelligently switching light sources for two-dimensional barcode recognition according to claim 1, characterized in that: The steps of adjusting the initial light source mode based on the recognition result of the barcode image information by using a preset light source mode correction strategy to obtain a corrected light source mode, and adjusting the light source based on the corrected light source mode include the following steps: Identify barcode image features in the barcode image information, wherein the barcode image features include contrast, edge clarity, brightness uniformity, and reflective interference; Determine a brightness adjustment parameter based on the contrast, and determine a light source focus parameter based on the edge definition; Adjust the light source distribution parameters based on brightness uniformity, and determine the polarization correction parameters based on the reflection interference degree; The initial light source mode is adjusted by combining the brightness adjustment parameter, the light source focusing parameter, the light source distribution parameter and the polarization correction parameter to obtain the corrected light source mode.
4. The method for intelligently switching light sources for two-dimensional barcode recognition according to claim 1, characterized in that: The steps of adjusting the initial light source mode based on the recognition result of the barcode image information by using a preset light source mode correction strategy to obtain a corrected light source mode, and adjusting the light source based on the corrected light source mode include the following steps: Obtain all light source information and identify the lighting range corresponding to the light source information in the initial light source mode; Determine whether there is an overlapping illumination area based on the illumination range corresponding to each light source information; When there is an illumination overlap area, it is identified whether there is a barcode recognition area in the illumination overlap area; When there is a barcode recognition area, the corrected light source mode of the light source information associated with the illumination overlap area corresponding to the barcode recognition area is updated based on a preset light source mode update strategy.
5. The method for intelligently switching light sources for two-dimensional barcode recognition according to claim 4, characterized in that: The step of updating the corrected light source mode of the light source information associated with the illumination overlap area corresponding to the barcode recognition area based on a preset light source mode update strategy when there is a barcode recognition area comprises the following steps: Obtaining barcode image information within the barcode recognition area, and identifying whether there is a multi-light source interference feature in the barcode image information; If there are multiple light source interference features, the mutual influence between the light source information associated with the illumination overlap area is analyzed based on the multiple light source interference features; The corrected light source mode is updated based on the analysis result through a preset light source mode update strategy.
6. The method for intelligently switching light sources for two-dimensional barcode recognition according to claim 1, characterized in that: The step of acquiring barcode image information through a collection terminal and identifying the barcode image information comprises the following steps: Input the barcode image information into the pre-trained feature recognition model for feature recognition; When receiving the motion vector feature output by the feature recognition model, analyzing the influence of the motion vector feature on the barcode image information under the initial light source mode; The initial light source mode is updated based on the analysis result, the light source is adjusted based on the updated initial light source mode, and the barcode image information is acquired again through the acquisition terminal.
7. The method for intelligently switching light sources for two-dimensional barcode recognition according to claim 6, characterized in that: The motion vector feature includes a motion direction, a motion speed, and a motion acceleration. When the motion vector feature output by the feature recognition model is received, the step of analyzing the influence of the motion vector feature on the barcode image information in the initial light source mode includes: Analyze the influence of the motion direction on the barcode image information in the initial light source mode and generate the motion direction analysis result; Analyze the influence of motion speed on barcode image information in the initial light source mode and generate motion speed analysis results; Analyze the influence of motion acceleration on barcode image information in the initial light source mode and generate motion acceleration analysis results; Combined with the motion direction, motion speed and motion acceleration, it is determined whether the barcode image information is in a complex motion state. If so, a complex motion analysis result is generated.
8. A light source intelligent switching system for two-dimensional barcode recognition, characterized in that: include: A first acquisition module, used to acquire ambient light information through an acquisition terminal; A first light source adjustment module, configured to match an initial light source mode corresponding to the ambient light information based on a preset light source mode selection strategy, and adjust the light source based on the matched initial light source mode; The second acquisition module is used to obtain the barcode image information through the acquisition terminal and identify the barcode image information; The second light source adjustment module is used to adjust the initial light source mode based on the recognition result of the barcode image information through a preset light source mode correction strategy to obtain a corrected light source mode, and adjust the light source based on the corrected light source mode.
Citation Information
Patent Citations
Palm image acquisition method and device based on multiple light sources, equipment and medium
CN117197846A
Self-adaptive control method and device for supplementary light source of industrial camera
CN119596622A
Angularly varying light emitting device with an imager
US20210112647A1