Code scanning system
By analyzing the relative position between the barcode and the scanning frame, and adjusting the angle and spacing of the scanning frame according to the analysis results, the problem of scanning accuracy and inefficiency in existing scanning techniques is solved, and a more efficient scanning process is achieved.
Patent Information
- Application Number
- CN202510188736.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-06-10
AI Technical Summary
The existing code scanning technology lacks the relative position between the barcode and the code scanning box, resulting in low accuracy and efficiency of scanning code scanning.
By obtaining the scan image of the barcode in the scanning box, analyzing the deviation data of the barcode, determining whether the relative position between it and the scanning box is qualified, and adjusting the angle of the scanning box according to the angle control value, and further adjusting the scanning box through the spacing adjustment value, so that the spacing area of the barcode is symmetrical.
It improves the accuracy and efficiency of scanning codes, ensures that the relative position between the barcode and the scanning code box is qualified, and enhances the accuracy of scanning code analysis and processing.
Smart Images

Figure CN120124652A_ABST
Abstract
Description
[0001] This divisional application is a divisional application of a Chinese patent application with an application date of October 10, 2024, an application number of 202411407978X, and an invention title of "Scanning Code Method, System and Device for Scanning Codes". Technical Field
[0002] The present invention belongs to the technical field of scanning codes, specifically a scanning code system. Background Art
[0003] Today, in the digital wave sweeping across the globe, scanning code technology, with its efficient and convenient features, has become a bridge connecting the online and offline worlds, profoundly changing our way of life. From payment, identity verification to information acquisition, scanning code methods are everywhere, greatly improving the efficiency of life and work.
[0004] A Chinese patent application with a publication number of CN112464679A discloses a scanning code method and a scanning code device, including: a first light source and a second light source, the colors of the first light source and the second light source are different, and the scanning code method includes: controlling the first light source to emit light, and obtaining a first scanning code result for scanning a first graphic code; judging whether the first scanning code result meets a preset condition; if not, then switching to the second light source to emit light, and obtaining a second scanning code result for scanning the first graphic code.
[0005] In the prior art, during the scanning code process, the relative position between the bar code and the scanning frame is lacking in analysis. In practice, without such analysis, the accuracy of scanning code cannot be guaranteed, and when the relative position between the bar code and the scanning frame is unqualified, the influence and the degree of influence cannot be analyzed, and the accurate judgment of the adjustment during the scanning code process cannot be achieved, reducing the efficiency of scanning code analysis and processing and the quality of scanning codes.
[0006] Therefore, the present invention provides a scanning code system. Summary of the Invention
[0007] In order to make up for the deficiencies of the prior art and solve at least one of the technical problems proposed in the background art.
[0008] The technical solution adopted by the present invention to solve its technical problems is: a scanning code method, including: Obtaining a scanning image of a bar code within a scanning frame, based on the scanning image, obtaining deviation data of the bar code, where the deviation data includes the distance between the top of the bar code and the edge of the scanning frame, processing and analyzing the deviation data, marking the bar code to obtain a prominent bar code, and processing and analyzing the prominent bar code to obtain a prominent performance value; Judging whether the relative position between the bar code and the scanning frame is qualified based on the prominent performance value, and if it is unqualified, generating a regulation signal; Based on the regulation signal, obtain the angle regulation value, and regulate the angle of the code scanning frame according to the angle regulation value; After regulating the angle of the code scanning frame, obtain the regulated code scanning image. Based on the code scanning image, obtain the width data of the spacer area, where the width data includes a width value. Based on the width data, process and analyze to obtain the symmetry performance value. Based on the symmetry performance value, determine whether the spacer area of the bar code in the code scanning image is symmetric. If it is not symmetric, generate an asymmetry signal; Based on the asymmetry signal, obtain the brightness value of the bar code in the code scanning image. Construct a brightness change broken line according to the brightness value of the bar code. Based on the brightness change broken line, process and analyze to obtain the asymmetry influence value. According to the asymmetry influence value, determine whether the asymmetry of the spacer area of the bar code will affect the brightness of the bar code; Based on the fact that the asymmetry of the spacer area of the bar code affects the brightness of the bar code, obtain the influence evaluation value. Based on the influence evaluation value, determine the degree of influence of the asymmetry of the spacer area of the bar code on the brightness of the bar code. If the degree of influence is high, generate an influence strong signal; Based on the influence strong signal, obtain the spacing adjustment value, and adjust the code scanning frame based on the spacing adjustment value to make the spacer area of the bar code symmetric.
[0009] As a further technical solution of the present invention: The process of marking the bar code is as follows: Obtain the top distance deviation of the bar code and compare it with the average value of the top distance deviations of the bar codes; If the top distance deviation of the bar code is greater than the average value of the top distance deviations of the bar codes, mark the bar code as a prominent bar code; If the top distance deviation of the bar code is less than or equal to the average value of the top distance deviations of the bar codes, mark the bar code as a non-prominent bar code.
[0010] As a further technical solution of the present invention: The method for obtaining the top distance deviation of the bar code and the average value of the top distance deviations of the bar codes is as follows: Sum up the distances between the tops of all bar codes and the edge of the code scanning frame and take the average value to obtain the average top distance of the bar codes. Perform a difference process on the top distance of the bar code and the average top distance of the bar codes, and take the absolute value of the obtained difference to obtain the top distance deviation of the bar code. Sum up the top distance deviations of all bar codes and take the average value to obtain the average top distance deviation of the bar codes.
[0011] As a further technical solution of the present invention: The method for obtaining the prominent performance value is as follows: Obtain the prominent quantity value SL and the prominent degree value CD; Perform data processing on the obtained prominent quantity value SL and prominent degree value CD through the formula: Obtain the prominent performance value TC, where s1 and s2 are both preset proportionality coefficients.
[0012] As a further technical solution of the present invention: The obtaining method of the prominent quantity value SL is as follows: Count the number of prominent barcodes, and perform a ratio process with the total number of barcodes to obtain the prominent quantity value of the barcodes, and mark it as SL.
[0013] As a further technical solution of the present invention: The obtaining method of the prominent degree value CD is as follows: Perform a difference process on the top distance deviation of the prominent barcodes and the average value of the top distance deviations to obtain the relative top distance deviation of the barcodes. Sum and average the relative top distance deviations of all barcodes to obtain the average value of the relative top distance deviations. Perform a ratio process on the average value of the relative top distance deviations and the average value of the top distance deviations to obtain the prominent degree value, and mark it as CD.
[0014] As a further technical solution of the present invention: The obtaining method of the angle regulation value is as follows: In the X-Y coordinate system, connect the tops of all barcodes in sequence to obtain the top connection line of the barcodes. Extend the top connection line of the barcodes and intersect it with the X-axis, and obtain the included angle formed by the extended top connection line and the X-axis to obtain the angle regulation value; Regulate the angle of its scanning frame based on the angle regulation value.
[0015] As a further technical solution of the present invention: The obtaining method of the symmetry performance value is as follows: Obtain the width values of the spacer areas on both sides of the barcode, and sum and average them to obtain the theoretical width symmetry value; Perform a difference process on the width values of the spacer areas on both sides of the barcode, and take the absolute value of the difference to obtain the spacer area width deviation value; Perform a ratio process on the spacer area width deviation value and the theoretical width symmetry value to obtain the symmetry performance value.
[0016] As a further technical solution of the present invention: The obtaining method of the asymmetry influence value is as follows: Obtain the rising sub-fold line, respectively count the number of rising sub-fold lines and the number of falling sub-fold lines, and compare them; If the number of rising sub-fold lines is greater than the number of falling sub-fold lines, mark the rising sub-fold line as the target sub-fold line, and perform a ratio process on the number of target sub-fold lines and the number of brightness change sub-fold lines to obtain the asymmetry influence value YX; If the number of rising sub - broken lines is less than the number of falling sub - broken lines, mark the falling sub - broken lines as target sub - broken lines, and perform a ratio process on the number of target sub - broken lines and the number of brightness - changing sub - broken lines to obtain the asymmetry influence value YX.
[0017] As a further technical solution of the present invention: The obtaining method of the rising sub - broken line is as follows: Divide the brightness - changing broken line into several brightness - changing sub - broken lines, obtain the slope values of the brightness - changing sub - broken lines, and mark the brightness - changing sub - broken lines according to their slope values; It should be noted that the two end - points of the brightness - changing sub - broken line respectively correspond to the brightness values of two ringing barcodes; If the slope value of the brightness - changing sub - broken line is greater than 0, mark the brightness - changing sub - broken line as a rising sub - broken line.
[0018] As a further technical solution of the present invention: The obtaining method of the influence evaluation value is as follows: Obtain the average brightness deviation LDp, the variance value FCz of the brightness data group, and the asymmetry influence value YX; Perform data processing on the obtained average brightness deviation LDp, the variance value FCz of the brightness data group, and the asymmetry influence value YX, through the formula: Obtain the influence evaluation value PG, where a1, a2, and a3 are all preset proportional coefficients.
[0019] As a further technical solution of the present invention: The obtaining method of the average brightness deviation LDp is as follows: Obtain the target sub - broken line, perform a difference process on the brightness values corresponding to both ends of the target sub - broken line to obtain the brightness deviation corresponding to the target sub - broken line, sum and average the brightness deviations corresponding to all target sub - broken lines to obtain the average brightness deviation, and mark it as LDp.
[0020] As a further technical solution of the present invention: The obtaining method of the variance value FCz of the brightness data group is as follows: Integrate the brightness values of all barcodes into a brightness data group, obtain the variance value of the brightness data group, and mark it as FCz.
[0021] As a further technical solution of the present invention: The process of adjusting the scanning frame based on the spacing adjustment value is as follows: Obtain the spacing adjustment value, where the spacing adjustment value , where PC represents the width deviation value of the spacer area; Compare the width values of the spacer areas on both sides of the barcode, and select the direction where the spacer area with the smaller width value is located as the scanning - frame adjustment direction; Adjust the scanning frame according to the spacing adjustment value and the scanning - frame adjustment direction.
[0022] A scanning code system, comprising: A position analysis module: When scanning the code, obtain a scanning image of the bar code within the scanning frame. Based on the scanning image, obtain deviation data of the bar code, where the deviation data includes the distance between the top of the bar code and the edge of the scanning frame. Process and analyze the deviation data, mark the bar code to obtain a prominent bar code, and process and analyze the prominent bar code to obtain a prominent performance value; A position judgment module; Based on the prominent performance value, judge whether the relative position between the bar code and the scanning frame is qualified. If it is unqualified, generate a regulation signal; A first regulation module: Based on the regulation signal, obtain an angle regulation value, and regulate the angle of the scanning frame according to the angle regulation value; A symmetry analysis module: After regulating the angle of the scanning frame, obtain the regulated scanning image. Based on the scanning image, obtain the width data of the interval area, where the width data includes a width value. Based on the width data, process and analyze to obtain a symmetry performance value. Based on the symmetry performance value, judge whether the interval area of the bar code in the scanning image is symmetric. If it is not symmetric, generate an asymmetry signal; An influence analysis module: Based on the asymmetry signal, obtain the brightness value of the bar code in the scanning image. Construct a brightness change broken line according to the brightness value of the bar code. Based on the brightness change broken line, process and analyze to obtain an asymmetry influence value. Judge whether the asymmetry of the interval area of the bar code will affect the brightness of the bar code according to the asymmetry influence value; An influence evaluation module: Based on the fact that the asymmetry of the interval area of the bar code affects the brightness of the bar code, obtain an influence evaluation value. Based on the influence evaluation value, judge the influence degree of the asymmetry of the interval area of the bar code on the brightness of the bar code. If the influence degree is high, generate a strong influence signal; A second regulation module: Based on the strong influence signal, obtain a spacing adjustment value, and adjust the scanning frame based on the spacing adjustment value to make the interval area of the bar code symmetric.
[0023] A device for scanning the code, and the device for scanning the code is prepared according to the scanning method.
[0024] The beneficial effects of the present invention are as follows: 1. When scanning the code, obtain the scanning image of the barcode within the scanning frame. Based on the scanning image, obtain the deviation data of the barcode, where the deviation data includes the distance between the top of the barcode and the edge of the scanning frame. Process and analyze the deviation data to obtain the outstanding performance value, and determine whether the relative position between the barcode and the scanning frame is qualified. If it is unqualified, generate an unqualified signal. The present invention monitors the relative position between the barcode and the scanning frame, which is beneficial to timely judge the qualification of the relative position between the barcode and the scanning frame, facilitating subsequent timely regulation. Secondly, adjust the angle of the scanning frame during code scanning through the angle adjustment value, making the barcode relative to the edge of the disposed scanning frame, which is beneficial to improving the accuracy of code scanning recognition.
[0025] 2. Obtain the adjusted scanning image. Based on the width data, process and analyze to obtain the symmetry performance value. Based on the symmetry performance value, judge whether the interval area of the barcode in the scanning image is symmetric. If it is not symmetric, obtain the brightness value of the barcode in the scanning image, construct a brightness change broken line according to the brightness value of the barcode, and based on the brightness change broken line, process and analyze to obtain the asymmetry influence value, and judge whether the asymmetry of the interval area of the barcode will affect the brightness of the barcode. The present invention analyzes whether the interval area is symmetric, and judges whether it affects the barcode brightness in the case of asymmetry (affecting the uniform distribution of the light spot on the barcode), which is convenient for subsequent accurate judgment and analysis of code scanning adjustment, and improves the efficiency of code scanning analysis and processing.
[0026] 3. Obtain the influence evaluation value, judge the influence degree of the asymmetry of the interval area of the barcode on the brightness of the barcode. If the influence degree is high, obtain the spacing adjustment value, and adjust the scanning frame based on the spacing adjustment value to make the interval area of the barcode symmetric. The present invention adjusts the scanning frame in the case of a high influence degree, further improving the accuracy of code scanning. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The present invention will be further described below with reference to the accompanying drawings.
[0028] Figure 1 is the flowchart of the steps of the code scanning method described in the embodiment of the present invention; Figure 2 is the program block diagram of the code scanning system described in the embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0029] In order to make the technical means, creative features, achieved purposes and effects of the present invention easy to understand, the present invention will be further described below in conjunction with specific embodiments.
[0030] Embodiment 1 As Figure 1 shown, the code scanning method described in the embodiment of the present invention includes: Step 1: When scanning the code, obtain the scanning image of the barcode within the scanning frame. Based on the scanning image, obtain the deviation data of the barcode, where the deviation data includes the distance between the top end of the barcode and the edge of the scanning frame. Process and analyze the deviation data, mark the barcode, obtain the prominent barcode, and process and analyze the prominent barcode to obtain the prominent performance value; It should be noted that the scanning image is the image when all barcodes are completely within the scanning frame; In some embodiments, in the scanning image, a Cartesian coordinate system X - Y is constructed with the top edge of the scanning frame as the X - axis and the side edge of the scanning frame as the Y - axis; It should be noted that the top edge of the scanning frame is the side edge of the scanning frame that is perpendicular to all barcodes, and the side edge of the scanning frame is the side edge of the scanning frame that is parallel to all barcodes; Mark the end of the barcode close to the X - axis as the top end, obtain the shortest vertical distance from the top end of the barcode to the X - axis, and get the distance between the top end of the barcode and the edge of the scanning frame; Sum up and average the distances between the top ends of all barcodes and the edge of the scanning frame to obtain the average top - end distance of the barcodes. Perform a difference operation between the top - end distance of the barcode and the average top - end distance of the barcodes, and take the absolute value of the obtained difference to get the top - end distance deviation of the barcode. Sum up and average the top - end distance deviations of all barcodes to obtain the average top - end distance deviation of the barcodes; Compare the top - end distance deviation of the barcode with the average top - end distance deviation of the barcodes: If the top - end distance deviation of the barcode is greater than the average top - end distance deviation of the barcodes, mark the barcode as a prominent barcode; If the top - end distance deviation of the barcode is less than or equal to the average top - end distance deviation of the barcodes, mark the barcode as a non - prominent barcode; Count the number of prominent barcodes, and perform a ratio operation with the total number of barcodes to obtain the prominent quantity value of the barcodes, and mark it as SL; Perform a difference operation between the top - end distance deviation of the prominent barcode and the average top - end distance deviation to obtain the relative top - end distance deviation of the barcode. Sum up and average the relative top - end distance deviations of all barcodes to obtain the average relative top - end distance deviation. Perform a ratio operation between the average relative top - end distance deviation and the average top - end distance deviation to obtain the prominence degree value, and mark it as CD; Perform data processing on the obtained prominent quantity value SL and prominence degree value CD through the formula: Obtain the prominent performance value TC, where s1 and s2 are both preset proportionality coefficients; It should be noted that the meaning represented by the outstanding performance value is as follows: the outstanding performance value is obtained by calculating and processing the outstanding quantity value SL and the outstanding degree value CD. Among them, the outstanding quantity value SL reflects the proportion of the number of outstanding barcodes. The larger the proportion, it means that compared with the overall distance level between the barcode and the edge of the scanning frame, there are more barcodes with a large difference in the distance between the barcode and the scanning frame and the overall distance level, and the higher the degree of unqualified relative position between the barcode and the scanning frame. Similarly, the outstanding degree value CD reflects the degree of difference between the distance level between all outstanding barcodes and the scanning frame and the overall distance level. The larger the degree of difference, the higher the degree of unqualified relative position between the barcode and the scanning frame; Step 2: Based on the outstanding performance value, determine whether the relative position between the barcode and the scanning frame is qualified. If it is unqualified, generate a regulation signal; In some embodiments, the outstanding performance value is compared with the outstanding performance threshold; If the outstanding performance value is greater than the outstanding performance threshold, generate a regulation signal; If the outstanding performance value is less than or equal to the outstanding performance threshold, do not perform any operation; Step 3: Based on the regulation signal, obtain the angle regulation value, and regulate the angle of the scanning frame according to the angle regulation value; Specifically, in the X-Y coordinate system, connect the tops of all barcodes in sequence to obtain the top connection line of the barcodes. Extend the top connection line of the barcodes and intersect it with the X-axis to obtain the angle formed by the extended top connection line and the X-axis, and obtain the angle regulation value; Regulate the angle of its scanning frame based on the angle regulation value; The technical solution of the embodiment of the present invention is as follows: when scanning the code, obtain the scanning image of the barcode in the scanning frame. Based on the scanning image, obtain the deviation data of the barcode. Among them, the deviation data includes the distance between the top of the barcode and the edge of the scanning frame. Process and analyze the deviation data to obtain the outstanding performance value, and judge whether the relative position between the barcode and the scanning frame is qualified. If it is unqualified, generate an unqualified signal. The present invention monitors the relative position between the barcode and the scanning frame, which is beneficial to timely judge the qualification of the relative position between the barcode and the scanning frame and facilitate subsequent timely regulation. Secondly, regulate the angle of the scanning frame during scanning through the angle regulation value, so that the barcode is compared with the edge of the disposal scanning frame, which is beneficial to improving the accuracy of code scanning recognition.
[0031] Embodiment 2 As Figure 1 shown, based on Embodiment 1, the code scanning method described in the embodiment of the present invention includes: Step 4: After adjusting the angle of the barcode scanning frame, obtain the adjusted barcode scanning image. Based on the barcode scanning image, obtain the width data of the spacer region, where the width data includes width values. Based on the width data, process and analyze to obtain the symmetry performance value. Based on the symmetry performance value, determine whether the spacer region of the barcode in the barcode scanning image is symmetric. If it is not symmetric, generate an asymmetry signal; It should be noted that the spacer region refers to the region formed by the outermost barcode and the side edge of the adjacent nearest barcode scanning frame among all barcodes; Specifically, obtain the width values of the spacer regions on both sides of the barcode, sum them up and take the average to obtain the theoretical width symmetry value; Perform a difference operation on the width values of the spacer regions on both sides of the barcode, and take the absolute value of the difference to obtain the spacer region width deviation value; Perform a ratio operation on the spacer region width deviation value and the theoretical width symmetry value to obtain the symmetry performance value; In some embodiments, perform a ratio operation on the symmetry performance value and the symmetry performance threshold value. Specifically: If the symmetry performance value is greater than the symmetry performance value, it means that the spacer region of the barcode is asymmetric, and generate an asymmetry signal; If the symmetry performance value is less than or equal to the symmetry performance value, it means that the spacer region of the barcode is symmetric, and no operation is performed; Step 5: Based on the asymmetry signal, obtain the brightness value of the barcode in the barcode scanning image. Construct a brightness change broken line according to the brightness value of the barcode. Based on the brightness change broken line, process and analyze to obtain the asymmetry influence value. According to the asymmetry influence value, determine whether the asymmetry of the spacer region of the barcode will affect the brightness of the barcode; Specifically, number the barcodes in sequence, obtain the brightness values of the barcodes. Use the number as the X-axis and the brightness value as the Y-axis to construct a two-dimensional coordinate system. Mark and connect the brightness values of the barcodes in the coordinate system to obtain the brightness change broken line; Divide the brightness change broken line into several brightness change sub-broken lines, obtain the slope values of the brightness change sub-broken lines, and mark the brightness change sub-broken lines according to the slope values of the brightness change sub-broken lines; It should be noted that the two end points of the brightness change sub-broken line respectively correspond to the brightness values of two adjacent barcodes; If the slope value of the brightness change sub-broken line is greater than 0, mark the brightness change sub-broken line as an ascending sub-broken line; If the slope value of the brightness change sub-broken line is less than 0, mark the brightness change sub-broken line as a descending sub-broken line; If the slope value of the brightness change sub-broken line is equal to 0, mark the brightness change sub-broken line as an unchanged sub-broken line; Respectively count the number of ascending sub-broken lines and the number of descending sub-broken lines, and compare them; If the number of rising sub - broken lines is greater than the number of falling sub - broken lines, mark the rising sub - broken lines as target sub - broken lines, and process the ratio of the number of target sub - broken lines to the number of brightness - changing sub - broken lines to obtain the asymmetry influence value YX; If the number of rising sub - broken lines is less than the number of falling sub - broken lines, mark the falling sub - broken lines as target sub - broken lines, and process the ratio of the number of target sub - broken lines to the number of brightness - changing sub - broken lines to obtain the asymmetry influence value YX; If the number of rising sub - broken lines is equal to the number of falling sub - broken lines, it means that the asymmetry of the spacer area of the barcode does not affect the brightness of the barcode; In some embodiments, compare the asymmetry influence value YX with the asymmetry influence threshold; If the asymmetry influence value YX is greater than the asymmetry influence threshold, it means that the asymmetry of the spacer area of the barcode affects the brightness of the barcode; If the asymmetry influence value YX is less than or equal to the asymmetry influence threshold, the asymmetry of the spacer area of the barcode does not affect the brightness of the barcode; The technical solution of the embodiment of the present invention is as follows: Obtain the adjusted scanning code image, based on the width data, process and analyze to obtain the symmetry performance value, based on the symmetry performance value, judge whether the spacer area of the barcode in the scanning code image is symmetric. If it is asymmetric, obtain the brightness value of the barcode in the scanning code image, construct a brightness change broken line based on the brightness value of the barcode, based on the brightness change broken line, process and analyze to obtain the asymmetry influence value, and judge whether the asymmetry of the spacer area of the barcode will affect the brightness of the barcode. The present invention analyzes whether the spacer area is symmetric, and in the case of asymmetry, judges whether it affects the barcode brightness (affecting the uniform distribution of the light spot on the barcode), which is convenient for subsequent accurate judgment and analysis of scanning code adjustment, and improves the efficiency of scanning code analysis and processing.
[0032] Embodiment 3 As Figure 1 shown, based on Embodiment 1 and Embodiment 2, the scanning code method described in the embodiment of the present invention includes: Step six: Based on the fact that the asymmetry of the spacer area of the barcode affects the brightness of the barcode, obtain an influence evaluation value, and based on the influence evaluation value, judge the influence degree of the asymmetry of the spacer area of the barcode on the brightness of the barcode. If the influence degree is high, generate a strong influence signal; Specifically, obtain the target sub - broken line, perform a difference process on the brightness values corresponding to both ends of the target sub - broken line to obtain the brightness deviation corresponding to the target sub - broken line, sum and average the brightness deviations corresponding to all target sub - broken lines to obtain the average brightness deviation, and mark it as LDp; Integrate the brightness values of all barcodes into a brightness data group, obtain the variance value of the brightness data group, and mark it as FCz; Perform data processing on the obtained average brightness deviation LDp, variance value FCz of the brightness data group, and asymmetry influence value YX. Through the formula: Obtain the influence evaluation value PG, where a1, a2, and a3 are all preset proportionality coefficients; It should be noted that the meaning represented by the influence evaluation value PG is: by analyzing the degree of continuous change in the brightness of the barcode and the deviation dispersion degree of the brightness between barcodes, it reflects the influence degree of the interval asymmetry of the barcode on the brightness of the barcode; In some embodiments, compare the influence evaluation value PG with the influence evaluation threshold; If the influence evaluation value PG is greater than the influence evaluation threshold, it indicates that the influence degree of the interval asymmetry of the barcode on the brightness of the barcode is high, and a strong influence signal is generated; If the influence evaluation value PG is less than or equal to the influence evaluation threshold, it indicates that the influence degree of the interval asymmetry of the barcode on the brightness of the barcode is low; Step seven: Based on the strong influence signal, obtain the spacing adjustment value, and adjust the scanning frame based on the spacing adjustment value to make the interval area of the barcode symmetrical; Specifically, the spacing adjustment value , where PC represents the interval width deviation value; Compare the width values of the interval areas on both sides of the barcode, and select the direction where the interval area with the smaller width value is located as the adjustment direction of the scanning frame; Adjust the scanning frame according to the spacing adjustment value and the scanning frame adjustment direction; The technical solution of the embodiment of the present invention is: obtain the influence evaluation value, judge the influence degree of the interval asymmetry of the barcode on the brightness of the barcode. If the influence degree is high, obtain the spacing adjustment value, and adjust the scanning frame based on the spacing adjustment value to make the interval area of the barcode symmetrical. Based on the high influence degree, the present invention adjusts the scanning frame, further improving the accuracy of scanning.
[0033] Embodiment 4 As Figure 2 shown, the scanning system described in the embodiment of the present invention includes: Position analysis module: When scanning the code, obtain the scanning image of the barcode within the scanning frame. Based on the scanning image, obtain the deviation data of the barcode, where the deviation data includes the distance between the top of the barcode and the edge of the scanning frame. Process and analyze the deviation data, mark the barcode, obtain the prominent barcode, and process and analyze the prominent barcode to obtain the prominent performance value; Position judgment module: Based on the prominent performance value, judge whether the relative position between the barcode and the scanning frame is qualified. If not, generate a regulation signal; The first regulation module: Based on the regulation signal, obtain the angle regulation value, and regulate the angle of the code scanning frame according to the angle regulation value; The symmetry analysis module: After regulating the angle of the code scanning frame, obtain the regulated code scanning image. Based on the code scanning image, obtain the width data of the spacer area. Among them, the width data includes a width value. Based on the width data, process and analyze to obtain the symmetry performance value. Based on the symmetry performance value, judge whether the spacer area of the bar code in the code scanning image is symmetric. If it is not symmetric, generate an asymmetry signal; The influence analysis module: Based on the asymmetry signal, obtain the brightness value of the bar code in the code scanning image. Construct a brightness change broken line according to the brightness value of the bar code. Based on the brightness change broken line, process and analyze to obtain the asymmetry influence value. According to the asymmetry influence value, judge whether the asymmetry of the spacer area of the bar code will affect the brightness of the bar code; The influence evaluation module: Based on the fact that the asymmetry of the spacer area of the bar code affects the brightness of the bar code, obtain the influence evaluation value. Based on the influence evaluation value, judge the influence degree of the asymmetry of the spacer area of the bar code on the brightness of the bar code. If the influence degree is high, generate an influence strong signal; The second regulation module: Based on the influence strong signal, obtain the spacing adjustment value, and adjust the code scanning frame based on the spacing adjustment value to make the spacer area of the bar code symmetric.
[0034] Embodiment 5
[0035] The device for code scanning described in the embodiment of the present invention includes: The device for code scanning described in the present invention is prepared according to the code scanning method.
[0036] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. What is described in the above embodiments and the specification only illustrates the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed. The scope of protection claimed by the present invention is defined by the appended claims and their equivalents.
Claims
1. Scanning code system, characterized by: include: Position analysis module: when scanning a barcode, a scanned image of the barcode in the scanned frame is obtained, and based on the scanned image, deviation data of the barcode is obtained, wherein the deviation data includes the distance between the top of the barcode and the edge of the scanned frame, the deviation data is processed and analyzed, the barcode is marked, and a prominent barcode is obtained, and the prominent barcode is processed and analyzed to obtain a prominent performance value; Position judgment module: judging whether the relative position between the barcode and the scanning frame is qualified based on the prominent performance value, and generating a control signal if it is unqualified; The first control module: obtains an angle control value based on the control signal, and controls the angle of the code scanning frame according to the angle control value; Symmetry analysis module: after adjusting the angle of the code scanning frame, the regulated code scanning image is obtained, and based on the code scanning image, the width data of the spacing area is obtained, wherein the width data includes a width value, and based on the width data, a symmetry performance value is obtained by processing and analyzing, and based on the symmetry performance value, it is judged whether the spacing area of the barcode in the code scanning image is symmetrical, and if it is asymmetrical, an asymmetry signal is generated; Impact analysis module: Based on the asymmetric signal, the brightness value of the barcode in the scanned image is obtained, and a brightness change curve is constructed according to the brightness value of the barcode. Based on the brightness change curve, an asymmetric impact value is obtained through processing and analysis, and it is determined whether the asymmetry of the spacer area of the barcode will affect the brightness of the barcode according to the asymmetric impact value; Impact assessment module: based on the influence of the asymmetry of the spacer area of the barcode on the brightness of the barcode, an impact assessment value is obtained, and the influence degree of the asymmetry of the spacer area of the barcode on the brightness of the barcode is judged based on the impact assessment value. If the influence degree is high, a strong influence signal is generated; The second control module: based on the strong influencing signal, obtains the spacing adjustment value, and adjusts the code scanning frame based on the spacing adjustment value to make the spacing area of the barcode symmetrical.
2. The code scanning system according to claim 1, characterized in that: The process of marking the barcode is as follows: Obtaining the top distance deviation of the barcode and the average of the top distance deviation of the barcode and comparing them; If the top distance deviation of the barcode is greater than the mean top distance deviation of the barcode, the barcode is marked as a protruding barcode; If the top distance deviation of the barcode is less than or equal to the mean top distance deviation of the barcode, the barcode is marked as a non-protruding barcode.
3. The code scanning system according to claim 1, characterized in that: The outstanding performance value is obtained in the following manner: Obtain a protrusion quantity value SL and a protrusion degree value CD; The obtained protrusion quantity value SL and protrusion degree value CD are processed by data, and the formula is: The outstanding performance value TC is obtained, wherein s1 and s2 are both preset proportional coefficients.
4. The code scanning system according to claim 1, characterized in that: The method for obtaining the protrusion quantity value SL is as follows: The number of protruding barcodes is counted and the ratio is processed with the total number of barcodes to obtain the protruding number value of the barcode, which is marked as SL.
5. The code scanning system according to claim 1, characterized in that: The protrusion degree value CD is obtained as follows: The top distance deviation of the protruding barcode is processed by difference with the mean of the top distance deviation to obtain the relative deviation of the top distance of the barcode. The top distance relative deviations of all barcodes are summed and averaged to obtain the mean of the top distance relative deviation. The mean of the top distance relative deviation is processed by ratio with the mean of the top distance deviation to obtain the protrusion degree value, which is marked as CD.
Citation Information
Patent Citations
Code scanning method and code scanning equipment
CN112464679A