Code scanning light supplementing device
By analyzing the brightness and recognition time of the barcode in the scanning code system, determining whether fill light is needed, and evaluating brightness uniformity after filling light, and choosing a suitable fill light method, the problems of uneven fill light and low recognition accuracy in the existing technology are solved, and the accuracy and efficiency of scanning fill light are improved.
Patent Information
- Application Number
- CN202411722065.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-09-27
AI Technical Summary
There is a lack of analysis and evaluation of the accuracy and uniformity of fill light in existing code scanning fill light technology, resulting in reduced scanning code recognition accuracy and poor fill light quality.
By collecting barcode images under no fill light conditions, analyzing their brightness values and generating signals to be filled with light; generating and determining the fill light signals based on the accumulated recognition time; performing brightness uniformity analysis after fill light, determining whether the fill light is uniform, and selecting an appropriate fill light method based on the analysis results.
It improves the accuracy and efficiency of scanning codes to fill light, prevents unnecessary waste of fill light resources, and ensures the accuracy and quality of scanning codes to identify.
Smart Images

Figure CN119670775A_ABST
Abstract
Description
[0001] This divisional application is a divisional application of the Chinese patent application with the application date of September 27, 2024, application number 2024113600074, and invention name “Code scanning fill light method and device”. Technical Field
[0002] The present invention belongs to the technical field of code scanning light supplementation, and in particular to a code scanning light supplementation method and device. Background Art
[0003] In a dimly lit environment, the scanning success rate will drop significantly, affecting the user experience. In the prior art, there is already a fill light technology, but the fill light technology often has problems such as low fill light quality. Therefore, it is particularly important to study a scan code fill light method and device.
[0004] A Chinese patent application with publication number CN109165539A discloses a method and device for filling light when scanning a code, including: obtaining a code scanning instruction, turning on the camera scanning function, scanning the image, and storing the scanned image in a cache; recognizing the cached image; if the recognition is unsuccessful, analyzing the brightness of the image to determine whether the analyzed brightness is lower than a predetermined threshold; if the brightness is lower than the predetermined threshold, turning on the flashlight function for filling light. Method 2 includes: when a light sensing instruction is obtained, turning on the light sensing function to sense the light intensity of the surrounding environment; determining whether the light intensity is lower than the light intensity threshold; if the light intensity is lower than the light intensity threshold, turning on the flashlight function for filling light, and turning on the camera scanning function.
[0005] In the prior art, there is a lack of analysis and evaluation of the accuracy of the fill light, that is, there is a lack of analysis of the uniformity of the fill light. If there is no analysis, uniform fill light of the barcode cannot be achieved, thereby reducing the accuracy of code scanning and recognition. In addition, in the prior art, there is also a lack of analysis of whether the brightness of the barcode without fill light will affect the uniformity of the fill light, resulting in an inability to make a better choice of the fill light method, thereby reducing the quality of the fill light for code scanning and also resulting in a reduction in the accuracy of code scanning.
[0006] To this end, the present invention provides a code scanning fill light method and device. Summary of the invention
[0007] In order to make up for the deficiencies of the prior art, at least one technical problem raised in the background technology is solved.
[0008] The technical solution adopted by the present invention to solve the technical problem is: a code scanning light filling method, comprising: Under the condition of no fill light, an image of the barcode is collected by an image acquisition device and marked as an initial image, the initial image is processed and analyzed to obtain a brightness value of the barcode, and the brightness value of the barcode is compared with a preset brightness threshold of the barcode to obtain a signal to be filled light; Based on the signal to be filled light, the barcode is identified by using a barcode scanning device. When the barcode is completely within the identification frame of the barcode scanning device, the barcode is not identified successfully, and real-time timing is started to obtain the cumulative identification time. If the cumulative identification time reaches the preset identification time, and the barcode is still not identified successfully, a fill light signal is generated; Based on the determined fill light signal, the fill light device is used to fill light the barcode, and when filling light, the image of the barcode after the fill light is obtained, and it is marked as the fill light image, and the uniformity of the brightness in the barcode area in the fill light image is analyzed to obtain the fill light brightness uniformity value, and whether the scanned code fill light is uniform according to the fill light brightness uniformity value is judged, and a fill light state signal is generated, wherein the fill light state signal includes a fill light uniformity signal and a fill light non-uniformity signal; Based on the fill light non-uniform signal, the initial image is analyzed to obtain the regional impact value, and the brightness of the barcode without fill light is judged according to the regional impact value whether it will affect the fill light non-uniformity. If it does, an impact signal is generated; Based on the impact signal, the initial image is processed and analyzed to obtain a non-uniform concentration value, and a fill light mode is selected according to the non-uniform concentration value, wherein the fill light mode includes dual-area fill light and multi-area fill light.
[0009] As a further technical solution of the present invention, the brightness value of the barcode is obtained by: The collected initial image is converted into a grayscale image using the image processing database. The area where the barcode is located is marked as the barcode area in the grayscale image. The grayscale value of each pixel in the barcode area is obtained. The grayscale value of each pixel in the barcode area is summed and averaged to obtain the brightness value of the barcode.
[0010] As a further technical solution of the present invention, the method of generating the light signal to be filled is: Comparing the brightness value of the barcode with a preset brightness threshold of the barcode; If the brightness value of the barcode is lower than the preset brightness threshold of the barcode, it means that the brightness of the barcode does not meet the brightness requirement for scanning the barcode, and fill light is required to generate a fill light signal.
[0011] As a further technical solution of the present invention, the method for obtaining the uniform value of the fill light brightness is: The brightness highlight quantity value SL and the brightness highlight degree value CD are processed by the formula: The fill light brightness uniform value JY is obtained, wherein s1 and s2 are both preset proportional coefficients.
[0012] As a further technical solution of the present invention, the brightness highlight value SL is obtained in the following manner: Compare the absolute deviation of the fill light brightness in the barcode sub-region with the average of the absolute deviations of the fill light brightness in all barcode sub-regions; If the absolute deviation of the fill-in brightness in the barcode sub-region is greater than the average of the absolute deviations of the fill-in brightness in all barcode sub-regions, then the barcode sub-region is marked as a brightness-highlighted sub-region; The number of brightness-highlighted sub-regions is counted and compared with the number of barcode sub-regions to obtain a brightness-highlighted number value, which is marked as SL.
[0013] As a further technical solution of the present invention, the brightness prominence value CD is obtained in the following manner: Obtain the corresponding fill light brightness absolute deviation of the brightness-prominent sub-area, and perform difference processing on it and the mean of the fill light brightness absolute deviation to obtain the fill light brightness relative deviation of the brightness-prominent sub-area, sum and average the fill light brightness relative deviations of all brightness-prominent sub-areas to obtain the mean of the fill light brightness relative deviation, perform ratio processing on the mean of the fill light brightness relative deviation and the mean of the fill light brightness absolute deviation to obtain the brightness prominence value, and mark it as CD.
[0014] As a further technical solution of the present invention, the method for obtaining the mean absolute deviation of the fill light brightness is: Obtain the brightness value of each barcode sub-region in the fill light image, sum and average the brightness values in all barcode sub-regions to obtain the brightness mean of all barcode sub-regions, perform difference processing on the brightness value in the barcode sub-region and the brightness mean of all barcode sub-regions to obtain the fill light brightness deviation in the barcode sub-region, take the absolute value of the fill light brightness deviation in the barcode sub-region to obtain the fill light brightness absolute deviation in the barcode sub-region, sum and average the fill light brightness absolute deviations in all barcode sub-regions to obtain the average of the fill light brightness absolute deviations in all barcode sub-regions.
[0015] As a further technical solution of the present invention, the brightness value of the barcode sub-region is obtained by: A fill-light image is obtained, and the barcode area in the fill-light image is divided into several barcode sub-areas of equal area. The brightness value in the barcode sub-area is obtained by summing up the grayscale values of all pixels in the barcode sub-area and taking the average value.
[0016] As a further technical solution of the present invention, the fill light status signal is generated in the following manner: Compare the fill light brightness average value JY with the fill light brightness average threshold; If the fill light brightness uniformity value JY is greater than the fill light brightness uniformity threshold, a fill light non-uniform signal is generated; If the fill light brightness uniformity value JY is less than or equal to the fill light brightness uniformity threshold, a fill light uniformity signal is generated.
[0017] As a further technical solution of the present invention, the regional influence value is obtained by: Divide the barcode area in the initial image into a number of initial barcode sub-areas of equal area, obtain the brightness value of each initial barcode sub-area in the initial image, and based on the brightness value of each initial barcode sub-area in the initial image, obtain the brightness deviation, the absolute brightness deviation and the average of the absolute brightness deviations in all initial barcode sub-areas, and perform processing and analysis to obtain the first impact value DYy, the second impact value DRy and the third impact value DSy; The obtained first impact value DYy, second impact value DRy and third impact value DSy are processed by the formula: The regional influence value QYy is obtained, wherein a1, a2 and a3 are all preset proportional coefficients.
[0018] As a further technical solution of the present invention, the first impact value DYy is obtained in the following manner: Among all the brightness-prominent sub-regions, the brightness-prominent sub-region that coincides with the brightness-abnormal sub-region is marked as the first-affected sub-region; The number of first impact sub-regions is counted, and the ratio is processed with the number of brightness prominent sub-regions to obtain a first impact value, which is marked as DYy.
[0019] As a further technical solution of the present invention, the second impact value DRy is obtained in the following manner: In the first affected sub-region, the brightness deviation and the fill light brightness deviation in the first affected sub-region are obtained, and a positive and negative comparison is performed, and the affected sub-region is marked according to the comparison result, specifically: If the brightness deviation in the first affected sub-region and the fill light brightness deviation are both positive or negative, the first affected sub-region is marked as the second affected sub-region; The number of the second impact sub-regions is counted, and the second impact value is obtained by performing ratio processing on the second impact sub-regions and the second impact value is marked as DRy.
[0020] As a further technical solution of the present invention, the third impact value DSy is obtained in the following manner: In the second impact sub-region, the brightness deviation in the second impact sub-region is numerically compared with the fill light brightness deviation, specifically: If the brightness deviation in the second affected sub-region is equal to the fill light brightness deviation, the second affected sub-region is marked as the third affected sub-region; The number of the third impact sub-regions is counted, and the third impact value is obtained by performing ratio processing on the third impact sub-region and the third impact value is marked as DSy.
[0021] As a further technical solution of the present invention, the abnormal brightness sub-region is obtained by: Compare the absolute brightness deviation in the initial barcode sub-region with the average absolute brightness deviation in all initial barcode sub-regions; If the absolute brightness deviation in the initial barcode sub-region is greater than the average absolute brightness deviation in all initial barcode sub-regions, the initial barcode sub-region is marked as a brightness abnormal sub-region.
[0022] As a further technical solution of the present invention, the generation method of the influence signal is: Compare the regional impact value QYy with the regional impact threshold; If the regional influence value QYy is greater than the regional influence threshold, an influence signal is generated.
[0023] As a further technical solution of the present invention, the non-uniform concentration value is obtained by: The concentrated value JZ of the brightness highlight sub-region and the brightness discrete value LS of the brightness highlight sub-region are processed by the formula: The non-uniform concentration value FJ is obtained, wherein z1 and z2 are both preset proportional coefficients.
[0024] As a further technical solution of the present invention, the method for obtaining the concentrated value JZ of the brightness highlight sub-region is as follows: The initial image is obtained, and the adjacent brightness-prominent sub-regions in the initial image are integrated into a continuous sub-region. The number of continuous sub-regions is counted and the ratio is processed with the number of brightness-prominent sub-regions to obtain the concentration value of the brightness-prominent sub-regions, which is marked as JZ.
[0025] As a further technical solution of the present invention, the brightness discrete value LS of the brightness highlight sub-region is obtained as follows: The brightness values in all brightness-prominent sub-regions are integrated into a brightness value data group, and the variance value of the brightness value data group is obtained and marked as the brightness discrete value LS of the brightness-prominent sub-region.
[0026] As a further technical solution of the present invention, the process of selecting the fill light method according to the non-uniform concentration value is as follows: Compare the non-uniform concentration value FJ with the non-uniform concentration threshold; If the non-uniform concentration value FJ is greater than the non-uniform concentration threshold, dual-area fill light is selected; If the non-uniform concentration value FJ is less than or equal to the non-uniform concentration threshold, multi-area fill light is selected.
[0027] The code scanning fill light device comprises: Fill-in light analysis module: Under the condition of no fill-in light, use the image acquisition device to collect the image of the barcode and mark it as the initial image, process and analyze the initial image to obtain the brightness value of the barcode, compare the brightness value of the barcode with the preset brightness threshold of the barcode, and obtain the fill-in light signal; Fill light determination module: Based on the fill light signal, the barcode is identified by the barcode scanning device. When the barcode is completely within the identification frame of the barcode scanning device, the barcode is not identified successfully, and the real-time timing is started to obtain the cumulative identification time. If the cumulative identification time reaches the preset identification time, the barcode is still not identified successfully, and a fill light determination signal is generated; Fill-light uniformity analysis module: Based on the fill-light signal, fill-light the barcode using the fill-light device, and obtain the image of the barcode after fill-lighting during fill-lighting, and mark it as the fill-light image, and perform uniformity analysis on the brightness in the barcode area of the fill-light image to obtain the fill-light brightness uniformity value, and determine whether the fill-lighting of the barcode scanning is uniform according to the fill-light brightness uniformity value, and generate a fill-light status signal, wherein the fill-light status signal includes a fill-light uniformity signal and a fill-light non-uniformity signal; Fill light interference analysis module: Based on the fill light non-uniform signal, the initial image is analyzed to obtain the regional impact value. According to the regional impact value, it is determined whether the brightness of the barcode without fill light will affect the fill light non-uniformity. If it does, an impact signal is generated; Fill light mode selection module: Based on the impact signal, the initial image is processed and analyzed to obtain a non-uniform concentration value, and the fill light mode is selected according to the non-uniform concentration value, wherein the fill light modes include dual-area fill light and multi-area fill light.
[0028] The beneficial effects of the present invention are as follows: 1. By comparing and analyzing the brightness values of the barcodes, a fill light signal is generated, and the fill light signal is determined based on the cumulative analysis of the scanning time, thereby improving the accuracy of determining the fill light for scanning and preventing unnecessary fill light for scanning, which leads to a waste of fill light resources. Secondly, after the fill light is filled, the uniformity of the fill light is determined to prevent the problem of uneven fill light leading to scanning failure, thereby improving the accuracy of the fill light.
[0029] 2. Based on the fill light non-uniform signal, the initial image is analyzed to obtain the regional influence value, and the regional influence value is used to determine whether the brightness of the barcode without fill light will affect the fill light unevenness. If it does, an influence signal is generated, and the initial image is processed and analyzed based on the influence signal to obtain a non-uniform concentration value. The fill light mode is selected according to the non-uniform concentration value, wherein the fill light mode includes dual-area fill light and multi-area fill light. The present invention analyzes whether the brightness of the barcode without fill light will affect the fill light unevenness, which is conducive to troubleshooting and analyzing the impact of the fill light unevenness. After determining that the brightness of the barcode without fill light will affect the fill light unevenness, the fill light mode is effectively selected by analyzing the concentration degree and brightness deviation of the brightness uneven area, thereby improving the fill light efficiency and fill light quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The present invention will be further described below in conjunction with the accompanying drawings.
[0031] Figure 1 is a flowchart of the steps of the code scanning light filling method described in Embodiment 1 of the present invention; Figure 2 This is a flowchart of the steps of the code scanning light filling method described in Example 2 of the present invention. Figure 3 It is a system module diagram of the code scanning fill light device described in Example 3 of the present invention. DETAILED DESCRIPTION
[0032] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further explained below in conjunction with specific implementation methods.
[0033] Example 1
[0034] like Figure 1 As shown, the code scanning fill light method according to the embodiment of the present invention includes: Step 1: Under the condition of no fill light, use an image acquisition device to capture an image of the barcode, mark it as an initial image, process and analyze the initial image to obtain the brightness value of the barcode, compare the brightness value of the barcode with a preset brightness threshold of the barcode, and obtain a signal to be filled with light; In some embodiments, the collected initial image is converted into a grayscale image using an image processing database, the area where the barcode is located is marked as a barcode area in the grayscale image, the grayscale value of each pixel in the barcode area is obtained, and the grayscale value of each pixel in the barcode area is summed and averaged to obtain the brightness value of the barcode; It should be noted that the image processing database includes but is not limited to Python's Pillow library and OpenCV library; Comparing the brightness value of the barcode with a preset brightness threshold of the barcode; If the brightness value of the barcode is higher than the preset brightness threshold of the barcode, it means that the brightness of the barcode meets the brightness requirement for scanning, and no fill light is needed; If the brightness value of the barcode is lower than the preset brightness threshold of the barcode, it means that the brightness of the barcode does not meet the brightness requirement for scanning the barcode, and fill light is required to generate a fill light signal; It should be noted that the brightness threshold of the barcode is set in advance by those skilled in the art according to the recognition specification requirements of the barcode scanning device; Step 2: Based on the signal to be filled light, the barcode is identified by using a barcode scanning device. When the barcode is completely within the identification frame of the barcode scanning device, the barcode is not identified successfully, and real-time timing is started to obtain the cumulative identification time. If the cumulative identification time reaches the preset identification time, the barcode is still not identified successfully, and a fill light signal is generated; Step 3: Based on the determined fill light signal, fill light is applied to the barcode using a fill light device, and during fill light application, an image of the barcode after fill light application is obtained and marked as a fill light image, and uniformity analysis is performed on the brightness within the barcode region of the fill light image to obtain a fill light brightness uniformity value, and whether the fill light for scanning the barcode is uniform is determined according to the fill light brightness uniformity value, and a fill light status signal is generated, wherein the fill light status signal includes a fill light uniformity signal and a fill light non-uniformity signal; In some embodiments, a fill-in-light image is obtained, and the barcode region in the fill-in-light image is divided into a plurality of barcode sub-regions of equal area, and the brightness value in the barcode sub-region is obtained using an image processing database, wherein the brightness value in the barcode sub-region is obtained by summing up the grayscale values of all pixels in the barcode sub-region and taking the average value; Obtain the brightness value of each barcode sub-region in the fill light image, sum and average the brightness values in all barcode sub-regions to obtain the brightness mean value in all barcode sub-regions, perform difference processing on the brightness value in the barcode sub-region and the brightness mean value in all barcode sub-regions to obtain the fill light brightness deviation in the barcode sub-region, take the absolute value of the fill light brightness deviation in the barcode sub-region to obtain the fill light brightness absolute deviation in the barcode sub-region, sum and average the fill light brightness absolute deviations in all barcode sub-regions to obtain the average of the fill light brightness absolute deviations in all barcode sub-regions; Compare the absolute deviation of the fill light brightness in the barcode sub-region with the average of the absolute deviations of the fill light brightness in all barcode sub-regions; If the absolute deviation of the fill-in brightness in the barcode sub-region is greater than the average of the absolute deviations of the fill-in brightness in all barcode sub-regions, then the barcode sub-region is marked as a brightness-highlighted sub-region; If the absolute deviation of the fill light brightness in the barcode sub-region is less than or equal to the average of the absolute deviations of the fill light brightness in all barcode sub-regions, then the barcode sub-region is marked as a brightness non-prominent sub-region; Count the number of brightness highlight sub-regions, and compare it with the number of barcode sub-regions to obtain the brightness highlight value, which is marked as SL; Obtain the corresponding fill light brightness absolute deviation of the brightness prominent sub-region, and perform difference processing on it and the mean value of the fill light brightness absolute deviation to obtain the fill light brightness relative deviation of the brightness prominent sub-region, sum and average the fill light brightness relative deviations of all brightness prominent sub-regions to obtain the mean value of the fill light brightness relative deviation, perform ratio processing on the mean value of the fill light brightness relative deviation and the mean value of the fill light brightness absolute deviation to obtain the brightness prominence value, and mark it as CD; The obtained brightness highlight quantity value SL and brightness highlight degree value CD are processed by data, and the formula is: The fill light brightness uniform value JY is obtained, wherein s1 and s2 are both preset proportional coefficients; It should be noted that the meaning of the fill light brightness uniformity value JY is: the fill light brightness uniformity value is calculated by the brightness highlight quantity value SL and the brightness highlight degree value CD, wherein the brightness highlight quantity value SL reflects the proportion of the number of barcode sub-regions in the barcode region after the fill light, whose brightness is greatly different from the overall average brightness of the barcode region. The larger the brightness highlight quantity value SL, the more barcode sub-regions with uneven brightness there are in the barcode region, and the worse the brightness uniformity in the barcode region; the brightness highlight degree value CD reflects the degree of deviation between the brightness of the barcode sub-region with uneven brightness and the overall brightness of the barcode region, that is, the degree of brightness unevenness. The larger the brightness highlight degree value CD, the worse the brightness uniformity in the barcode region. In some embodiments, the fill light brightness uniform value JY is compared with the fill light brightness uniform threshold; If the fill light brightness uniformity value JY is greater than the fill light brightness uniformity threshold, it means that the barcode fill light is uneven, and a fill light non-uniformity signal is generated; If the fill light brightness uniformity value JY is less than or equal to the fill light brightness uniformity threshold, it means that the barcode fill light is uniform, and a fill light uniformity signal is generated; Based on the fill light uniform signal, code scanning and recognition are performed after fill light; The technical solution of the embodiment of the present invention is: by comparing and analyzing the brightness values of the barcodes, a signal to be filled in is generated, and a determined fill in signal is obtained based on the cumulative analysis of the scanning time, thereby improving the accuracy of determining the fill in for scanning and preventing unnecessary fill in for scanning, which leads to a waste of fill in resources. Secondly, after the fill in, the uniformity of the fill in is determined to prevent the problem of uneven fill in which leads to scanning failure, thereby improving the accuracy of the fill in.
[0035] Example 2
[0036] like Figure 2 As shown, based on Example 1, the code scanning fill light method described in the embodiment of the present invention includes: Step 4: Based on the fill light non-uniform signal, analyze the initial image to obtain the regional impact value, and determine whether the brightness of the barcode without fill light will affect the fill light non-uniformity according to the regional impact value. If it does, generate an impact signal; Specifically, the barcode region in the initial image is divided into a number of initial barcode sub-regions of equal area; It should be noted that the method of dividing the initial image into initial barcode sub-regions is the same as the method of dividing the fill light image into barcode sub-regions; Obtaining the brightness value of each initial barcode sub-region in the initial image, and based on the brightness value of each initial barcode sub-region in the initial image, obtaining the brightness deviation, the brightness absolute deviation and the average of the brightness absolute deviations in all initial barcode sub-regions; It should be noted that the brightness value of each initial barcode sub-region in the initial image is obtained in the same way as the brightness value of each barcode sub-region in the fill light image; the brightness deviation is obtained in the same way as the fill light brightness deviation, the brightness absolute deviation is obtained in the same way as the fill light brightness absolute deviation, and the average of the brightness absolute deviations in all initial barcode sub-regions is obtained in the same way as the average of the fill light brightness absolute deviations in all barcode sub-regions; Compare the absolute brightness deviation in the initial barcode sub-region with the average absolute brightness deviation in all initial barcode sub-regions; If the absolute brightness deviation in the initial barcode sub-region is greater than the average absolute brightness deviation in all initial barcode sub-regions, then the initial barcode sub-region is marked as a brightness abnormal sub-region; If the absolute brightness deviation in the initial barcode sub-region is less than or equal to the average absolute brightness deviation in all initial barcode sub-regions, then the initial barcode sub-region is marked as a brightness non-abnormal sub-region; Among all the brightness-prominent sub-regions, the brightness-prominent sub-region that coincides with the brightness-abnormal sub-region is marked as the first-affected sub-region; Count the number of first impact sub-regions, and perform ratio processing on the first impact value and the first impact value, and mark the first impact value as DYy; In the first affected sub-region, the brightness deviation and the fill light brightness deviation in the first affected sub-region are obtained, and a positive and negative comparison is performed, and the affected sub-region is marked according to the comparison result, specifically: If the brightness deviation in the first affected sub-region and the fill light brightness deviation are both positive or negative, the first affected sub-region is marked as the second affected sub-region; If the brightness deviation and fill light brightness deviation in the first impact sub-region are different positive or different negative, no operation will be performed; Count the number of the second impact sub-regions, and perform ratio processing on the second impact sub-regions to obtain a second impact value, which is marked as DRy; In the second impact sub-region, the brightness deviation in the second impact sub-region is numerically compared with the fill light brightness deviation, specifically: If the brightness deviation in the second affected sub-region is equal to the fill light brightness deviation, the second affected sub-region is marked as the third affected sub-region; If the brightness deviation in the second impact sub-region is not equal to the fill light brightness deviation, no operation is performed; Count the number of the third impact sub-regions, and perform ratio processing on the third impact sub-regions to obtain a third impact value, and mark the third impact value as DSy; The obtained first impact value DYy, second impact value DRy and third impact value DSy are processed by the formula: The regional impact value QYy is obtained, where a1, a2 and a3 are all preset proportional coefficients; It should be noted that the meaning of the regional influence value QYy is: the regional influence value QYy is calculated by the first influence value DYy, the second influence value DRy and the third influence value DSy, wherein the first influence value DYy reflects the proportion of the number of brightness-prominent sub-regions that coincide with the position of the brightness-abnormal sub-region. The larger the proportion, the higher the distribution similarity of the brightness-uneven sub-regions of the barcode before and after the fill light, which means that the brightness of the barcode before the fill light will affect the unevenness of the fill light. The second influence value DRy reflects the distribution similarity of the brightness-uneven sub-regions before and after the fill light. The proportion of sub-regions with the same positive and negative brightness deviation after fill light. The larger the proportion, the similarity of the brightness deviation of the sub-regions with uneven brightness before and after fill light is, which means that the brightness of the barcode before fill light will affect the unevenness of fill light. The third impact value DSy reflects the proportion of sub-regions with the same brightness deviation before and after fill light. The larger the proportion, the higher the similarity of the brightness deviation between the sub-regions with uneven brightness before and after fill light is, which means that the brightness of the barcode before fill light will affect the unevenness of fill light. In some embodiments, the regional impact value QYy is compared with a regional impact threshold; If the regional impact value QYy is greater than the regional impact threshold, it means that the brightness of the barcode without fill light will affect the fill light unevenness, and an impact signal will be generated; If the regional impact value QYy is less than or equal to the regional impact threshold, it means that the brightness of the barcode without fill light will not affect the fill light unevenness, and a no-impact signal is generated; Based on the fact that it does not affect the signal, other factors that affect the light uniformity are investigated and analyzed, including but not limited to the investigation of fill light equipment and barcode quality, etc.; Step 5: Based on the impact signal, the initial image is processed and analyzed to obtain a non-uniform concentration value, and a fill light mode is selected according to the non-uniform concentration value, wherein the fill light mode includes a dual-area fill light and a multi-area fill light; The meaning of dual-area fill light is: fill light is applied to two areas separately, and the meaning of multi-area fill light is: fill light is applied to more than two areas separately; In some embodiments, an initial image is acquired, adjacent brightness prominent sub-regions in the initial image are integrated into a continuous sub-region, the number of continuous sub-regions is counted, and the continuous sub-regions are compared with the number of brightness prominent sub-regions to obtain a concentrated value of the brightness prominent sub-regions, and the concentrated value is marked as JZ; Integrate the brightness values in all brightness-prominent sub-regions into a brightness value data group, obtain the variance value of the brightness value data group, and mark it as the brightness discrete value LS of the brightness-prominent sub-region; The obtained concentrated value JZ of the brightness highlight sub-region and the brightness discrete value LS of the brightness highlight sub-region are processed by the formula: Obtain a non-uniform concentration value FJ, where z1 and z2 are both preset proportional coefficients; It should be noted that the non-uniform concentration value FJ means that the non-uniform concentration value FJ is calculated by the concentration value JZ of the brightness highlight sub-region and the brightness discrete value LS. The concentration value JZ of the brightness highlight sub-region reflects the concentration degree of the brightness highlight sub-region in the initial image. The higher the concentration degree, the more these brightness highlight sub-regions can be used as a whole region for fill light. The brightness discrete value LS reflects the brightness deviation between the brightness highlight sub-regions. The smaller the brightness deviation between them, the more similar the corresponding brightness between the brightness highlight sub-regions are. These brightness highlight sub-regions can be used as a whole region for fill light. In some embodiments, the non-uniform concentration value FJ is compared with a non-uniform concentration threshold; If the non-uniform concentration value FJ is greater than the non-uniform concentration threshold, it means that these brightness-prominent sub-regions can be treated as a whole region for fill-in, and dual-region fill-in is selected; If the non-uniform concentration value FJ is less than or equal to the non-uniform concentration threshold, it means that these sub-areas with prominent brightness cannot be used as a whole area for fill light, and multi-area fill light is selected; Based on dual-area fill light, all the sub-areas with prominent brightness are divided into one overall area for fill light, and the remaining sub-areas with non-prominent brightness are taken as one overall area for fill light; Based on multi-area fill light, each sub-area with prominent brightness is filled with light independently, and adjacent sub-areas with non-prominent brightness are integrated into an independent area for fill light; The technical solution of the embodiment of the present invention is: based on the fill light non-uniform signal, the initial image is analyzed to obtain the regional influence value, and whether the brightness of the barcode without fill light will affect the fill light unevenness is determined according to the regional influence value. If it does, an influence signal is generated, and based on the influence signal, the initial image is processed and analyzed to obtain a non-uniform concentration value, and the fill light mode is selected according to the non-uniform concentration value, wherein the fill light mode includes dual-area fill light and multi-area fill light. The present invention analyzes whether the brightness of the barcode without fill light will affect the fill light unevenness, which is conducive to troubleshooting and analyzing the impact of the fill light unevenness, and after determining that the brightness of the barcode without fill light will affect the fill light unevenness, the fill light mode is effectively selected by analyzing the concentration degree and brightness deviation of the brightness uneven area, thereby improving the fill light efficiency and fill light quality.
[0037] Example 3
[0038] like Figure 3As shown, the barcode scanning light supplement device according to the embodiment of the present invention includes: Fill-in light analysis module: Under the condition of no fill-in light, use the image acquisition device to collect the image of the barcode and mark it as the initial image, process and analyze the initial image to obtain the brightness value of the barcode, compare the brightness value of the barcode with the preset brightness threshold of the barcode, and obtain the fill-in light signal; Fill light determination module: Based on the fill light signal, the barcode is identified by the barcode scanning device. When the barcode is completely within the identification frame of the barcode scanning device, the barcode is not identified successfully, and the real-time timing is started to obtain the cumulative identification time. If the cumulative identification time reaches the preset identification time, the barcode is still not identified successfully, and a fill light determination signal is generated; Fill-light uniformity analysis module: Based on the fill-light signal, fill-light the barcode using the fill-light device, and obtain the image of the barcode after fill-lighting during fill-lighting, and mark it as the fill-light image, and perform uniformity analysis on the brightness in the barcode area of the fill-light image to obtain the fill-light brightness uniformity value, and determine whether the fill-lighting of the barcode scanning is uniform according to the fill-light brightness uniformity value, and generate a fill-light status signal, wherein the fill-light status signal includes a fill-light uniformity signal and a fill-light non-uniformity signal; Fill light interference analysis module: Based on the fill light non-uniform signal, the initial image is analyzed to obtain the regional impact value. According to the regional impact value, it is determined whether the brightness of the barcode without fill light will affect the fill light non-uniformity. If it does, an impact signal is generated; Fill light mode selection module: Based on the impact signal, the initial image is processed and analyzed to obtain a non-uniform concentration value, and the fill light mode is selected according to the non-uniform concentration value, wherein the fill light modes include dual-area fill light and multi-area fill light.
[0039] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A barcode scanning light supplement device, characterized in that: include: Fill-in light analysis module: Under the condition of no fill-in light, use the image acquisition device to collect the image of the barcode and mark it as the initial image, process and analyze the initial image to obtain the brightness value of the barcode, compare the brightness value of the barcode with the preset brightness threshold of the barcode, and obtain the fill-in light signal; Fill light determination module: Based on the fill light signal, the barcode is identified by the barcode scanning device. When the barcode is completely within the identification frame of the barcode scanning device, the barcode is not identified successfully, and the real-time timing is started to obtain the cumulative identification time. If the cumulative identification time reaches the preset identification time, the barcode is still not identified successfully, and a fill light determination signal is generated; Fill-light uniformity analysis module: Based on the fill-light signal, fill-light the barcode using the fill-light device, and obtain the image of the barcode after fill-lighting during fill-lighting, and mark it as the fill-light image, and perform uniformity analysis on the brightness in the barcode area of the fill-light image to obtain the fill-light brightness uniformity value, and determine whether the fill-lighting of the barcode scanning is uniform according to the fill-light brightness uniformity value, and generate a fill-light status signal, wherein the fill-light status signal includes a fill-light uniformity signal and a fill-light non-uniformity signal; Fill light interference analysis module: Based on the fill light non-uniform signal, the initial image is analyzed to obtain the regional impact value. According to the regional impact value, it is determined whether the brightness of the barcode without fill light will affect the fill light non-uniformity. If it does, an impact signal is generated; Fill light mode selection module: Based on the impact signal, the initial image is processed and analyzed to obtain a non-uniform concentration value, and the fill light mode is selected according to the non-uniform concentration value, wherein the fill light modes include dual-area fill light and multi-area fill light.
2. The barcode scanning light supplement device according to claim 1, characterized in that: In the fill light uniformity analysis module, the fill light brightness uniformity value is obtained in the following manner: The brightness highlight quantity value SL and the brightness highlight degree value CD are processed to obtain the fill light brightness uniform value JY; Based on the fill light non-uniform signal, the initial image is analyzed to obtain the regional impact value. According to the regional impact value, it is determined whether the brightness of the barcode without fill light will affect the fill light non-uniformity. If it does, an impact signal is generated.
3. The barcode scanning light supplement device according to claim 1, characterized in that: The regional influence value is obtained as follows: Divide the barcode area in the initial image into a number of initial barcode sub-areas of equal area, obtain the brightness value of each initial barcode sub-area in the initial image, and based on the brightness value of each initial barcode sub-area in the initial image, obtain the brightness deviation, the absolute brightness deviation and the average of the absolute brightness deviations in all initial barcode sub-areas, and perform processing and analysis to obtain the first impact value DYy, the second impact value DRy and the third impact value DSy; The obtained first influence value DYy, second influence value DRy and third influence value DSy are processed to obtain a regional influence value QYy.
4. The barcode scanning light supplement device according to claim 1, characterized in that: The concentrated value JZ of the brightness prominent sub-region and the brightness discrete value LS of the brightness prominent sub-region are processed to obtain the non-uniform concentrated value FJ.
5. The barcode scanning light supplement device according to claim 1, characterized in that: The brightness prominence value CD is obtained as follows: Obtain the corresponding fill light brightness absolute deviation of the brightness-prominent sub-area, and perform difference processing on it and the mean of the fill light brightness absolute deviation to obtain the fill light brightness relative deviation of the brightness-prominent sub-area, sum and average the fill light brightness relative deviations of all brightness-prominent sub-areas to obtain the mean of the fill light brightness relative deviation, perform ratio processing on the mean of the fill light brightness relative deviation and the mean of the fill light brightness absolute deviation to obtain the brightness prominence value, and mark it as CD.
6. The barcode scanning light supplement device according to claim 1, characterized in that: The way to obtain the mean deviation is: Obtain the brightness value of each barcode sub-region in the fill light image, sum and average the brightness values in all barcode sub-regions to obtain the brightness mean of all barcode sub-regions, perform difference processing on the brightness value in the barcode sub-region and the brightness mean of all barcode sub-regions to obtain the fill light brightness deviation in the barcode sub-region, take the absolute value of the fill light brightness deviation in the barcode sub-region to obtain the fill light brightness absolute deviation in the barcode sub-region, sum and average the fill light brightness absolute deviations in all barcode sub-regions to obtain the average of the fill light brightness absolute deviations in all barcode sub-regions.
7. The barcode scanning light supplement device according to claim 1, characterized in that: The brightness value of the barcode sub-area is obtained as follows: A fill-light image is obtained, and the barcode area in the fill-light image is divided into several barcode sub-areas of equal area. The brightness value in the barcode sub-area is obtained by summing up the grayscale values of all pixels in the barcode sub-area and taking the average value.
8. The barcode scanning light supplement device according to claim 1, characterized in that: The method for obtaining the concentrated value JZ of the brightness highlight sub-region is as follows: The initial image is obtained, and the adjacent brightness-prominent sub-regions in the initial image are integrated into a continuous sub-region. The number of continuous sub-regions is counted and the ratio is processed with the number of brightness-prominent sub-regions to obtain the concentration value of the brightness-prominent sub-regions, which is marked as JZ.
9. The barcode scanning light supplement device according to claim 1, characterized in that: The brightness discrete value LS of the brightness highlight sub-region is obtained as follows: The brightness values in all brightness-prominent sub-regions are integrated into a brightness value data group, and the variance value of the brightness value data group is obtained and marked as the brightness discrete value LS of the brightness-prominent sub-region.
10. The barcode scanning light supplement device according to claim 1, characterized in that: The process of selecting the fill light method according to the non-uniform concentration value is as follows: Compare the non-uniform concentration value FJ with the non-uniform concentration threshold; If the non-uniform concentration value FJ is greater than the non-uniform concentration threshold, dual-area fill light is selected; If the non-uniform concentration value FJ is less than or equal to the non-uniform concentration threshold, multi-area fill light is selected.
Citation Information
Patent Citations
A scanning code light supplementing method and device
CN109165539A
Two-dimensional code authenticated by opaque medium and authentication system thereof
CN110728163A
Method and device for reading two-dimensional code under complex background based on machine vision
CN111311226A
Two-dimensional code recognition method, device and equipment
CN117744683A
Industrial DPM bar code self-learning contrast scanning method, system and device and medium
CN118013990A
Cited By
Parameter adjustment method and device of code reader and storage medium
CN121503510A
Mobile phone APP intelligent code scanning and AI automatic identification system
CN121683831A
Smart code scanning and AI automatic identification system of mobile phone APP
CN121683831B