A control method and device for scanning a two-dimensional code
Patent Information
- Application Number
- CN202310384939.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-03
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-04-03
AI Technical Summary
但在超高速连续运动包装设备(如G.D进口软包超高速包装机组S1000、G.D进口硬包超高速包装机组H1000以及国产硬包包装机组ZB48)上应用时,我们发现现有的控制系统在设备高速运行过程及高低速变换过程(即工况的改变)中无法确保二维码拍照的有效进行,烟包在连续不断运动过程中,没有停留工位能保证烟包状态的稳定性,从而导致系统无法快速识别二维码的有效信息,从而无法做后续的剔除和关联操作;工况改变造成的图像成像的不稳定,会导致系统算力负担的增加,并且直接影响了系统的稳定性
Smart Images

Figure CN116451716B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of QR code recognition technology, and more specifically, to a control method and apparatus for scanning QR codes. Background Technology
[0002] With the rise of the Internet of Things (IoT) industry, "one item, one code" technology is being applied in more and more industries. Currently, in cigarette production, unique QR codes are printed on the packaging paper of cigarette packs and cartons. These QR codes store relevant industry requirement information and customized information from cigarette manufacturers, playing a significant role in macro-control of the tobacco industry, anti-counterfeiting, and future tobacco consumption patterns. Therefore, to meet the needs of production and quality information traceability and machine performance optimization, achieving accurate association between the QR codes on cigarette packs and cartons has become an urgent problem to be solved.
[0003] With the development of identifier resolution technology, online QR code parsing methods have been widely used. This involves timestamping the QR code information of individual boxes and cartons and recording it in a database. Then, in the background, the QR code information of every 10 individual boxes is associated with the QR code of one carton, based on the timestamp. To address the problems that easily arise in the complex processes of cigarette packaging machines, such as machine downtime due to malfunctions, box rejection, and manual addition of boxes in actual production, a precise association system for QR code information of packaging machine products was developed. This system aims to improve the accuracy of anti-counterfeiting traceability and the level of digital production management for cigarette products, based on the workstation-based operation characteristics of mainstream packaging machines in the tobacco industry. The "box condition" association system boasts extremely high accuracy in associating "box and carton" with "conditions," which places high demands on the stability of the QR code system's imaging and information capture.
[0004] In QR code photo-taking systems, the control method of triggering photo-taking based on workstations has strict requirements on the actual production conditions of the equipment, the installation position of the QR code camera, the exposure brightness, and the trigger time. For example, the photo-taking must be done at a workstation that requires a pause, and the state of the QR code cigarette pack at that workstation must be stable, i.e., the working conditions need to be fixed. Medium-speed roll-to-roll packaging equipment should have a slower production speed and sufficient workstation pause time, and the requirements for the QR code system are not high, making it more suitable, such as intermittently moving packaging equipment such as packaging units ZB45 and ZB25. However, when applied to ultra-high-speed continuous motion packaging equipment (such as the GD imported soft-pack ultra-high-speed packaging unit S1000, the GD imported hard-pack ultra-high-speed packaging unit H1000, and the domestic hard-pack packaging unit ZB48), we found that the existing control system could not ensure the effective scanning of QR codes during high-speed operation and high-low speed transitions (i.e., changes in operating conditions). During continuous movement of the cigarette packs, there was no stationary position to ensure the stability of the packs' state, resulting in the system's inability to quickly identify the valid information of the QR codes, thus hindering subsequent rejection and association operations. The instability in image imaging caused by changes in operating conditions increases the system's computational burden and directly affects the system's stability. Summary of the Invention
[0005] This application provides a control method and apparatus for scanning QR codes. The scanning parameters of the QR code camera are adjusted according to the vehicle speed and the obtained QR code image to adapt to the real-time changes in the speed and operating conditions of the device. This fundamentally improves the effectiveness and stability of the QR code camera in reading information and enhances the stability of the system for accurately associating QR code information.
[0006] This application provides a control method for scanning QR codes, including:
[0007] Preset the initial trigger phase, initial gain, and initial focal length of the QR code camera;
[0008] Repeat the following steps:
[0009] The trigger phase is calculated and corrected based on the actual vehicle speed and initial trigger phase of the equipment;
[0010] The receiver obtains real-time QR code images based on the corrected trigger phase, initial gain, and initial focal length from the QR code camera.
[0011] The real-time QR code image is parsed to obtain the gain adjustment value and / or focal length adjustment value;
[0012] Correct the initial gain based on the gain adjustment value, and correct the initial focal length based on the focal length adjustment value to obtain the corrected gain and / or corrected focal length;
[0013] Update the initial gain and initial focal length to the corrected gain and corrected gain.
[0014] Preferably, the trigger phase is calculated and corrected based on the actual vehicle speed and the initial trigger phase, specifically including:
[0015] Calculate the phase compensation value based on the actual vehicle speed and the corresponding offset degree.
[0016] The initial trigger phase is corrected based on the phase compensation value to obtain the corrected trigger phase.
[0017] Preferably, the offset degree corresponds to different speed ranges.
[0018] Preferably, the real-time QR code image is parsed to obtain a gain adjustment value, specifically including:
[0019] Obtain the corresponding standard grayscale value based on the standard QR code image, and obtain the corresponding real-time grayscale value based on the real-time QR code image;
[0020] If the absolute value of the first difference between the real-time grayscale value and the standard grayscale value is greater than the first threshold, then the gain adjustment value is determined based on the first difference.
[0021] Preferably, the real-time QR code image is parsed to obtain the focus adjustment value, specifically including:
[0022] Obtain the standard resolution and standard contrast of a standard QR code image, and obtain the real-time resolution and real-time contrast of a real-time QR code image.
[0023] By comparing real-time sharpness with standard sharpness and real-time contrast with standard contrast, a second difference between the focal length of the real-time QR code image and the focal length of the standard QR code image is determined.
[0024] If the absolute value of the second difference is greater than the second threshold, then the focal length adjustment value is determined based on the second difference.
[0025] This application also provides a control device for scanning QR codes, including a preset module, a first correction module, a receiving module, a parsing module, a second correction module, and an updating module;
[0026] The preset module is used to preset the initial trigger phase, initial gain, and initial focal length of the QR code camera;
[0027] The first calibration module is used to calculate and correct the trigger phase based on the actual vehicle speed and the initial trigger phase of the equipment.
[0028] The receiving module is used to receive real-time QR code images obtained by the QR code camera based on the correction trigger phase, initial gain, and initial focal length;
[0029] The parsing module is used to parse real-time QR code images to obtain gain adjustment values and / or focal length adjustment values;
[0030] The second correction module is used to correct the initial gain based on the gain adjustment value and the initial focal length based on the focal length adjustment value, so as to obtain the corrected gain and / or corrected focal length.
[0031] The update module is used to update the initial gain and initial focal length to the corrected gain and corrected gain.
[0032] Preferably, the first correction module includes a compensation value calculation module and a phase correction module;
[0033] The compensation value calculation module is used to calculate the phase compensation value based on the actual vehicle speed and the corresponding offset degree.
[0034] The phase correction module is used to correct the initial trigger phase based on the phase compensation value to obtain the corrected trigger phase.
[0035] Preferably, the offset degree corresponds to different speed ranges.
[0036] Preferably, the parsing module includes a grayscale value acquisition module and a gain adjustment value determination module;
[0037] The grayscale value acquisition module is used to obtain the corresponding standard grayscale value based on the standard QR code image, and to obtain the corresponding real-time grayscale value based on the real-time QR code image;
[0038] The gain adjustment value determination module is used to determine the gain adjustment value based on the first difference when the absolute value of the first difference between the real-time grayscale value and the standard grayscale value is greater than the first threshold.
[0039] Preferably, the analysis module includes a sharpness and contrast acquisition module, a difference determination module, and a focus adjustment value determination module;
[0040] The sharpness and contrast acquisition module is used to obtain the standard sharpness and standard contrast of a standard QR code image, and to obtain the real-time sharpness and real-time contrast of a real-time QR code image.
[0041] The difference determination module is used to compare real-time sharpness with standard sharpness, and real-time contrast with standard contrast, to determine a second difference between the focal length of the real-time QR code image and the focal length of the standard QR code image.
[0042] The focal length adjustment value determination module is used to determine the focal length adjustment value based on the second difference when the absolute value of the second difference is greater than the second threshold.
[0043] Other features and advantages of this application will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0044] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments of the present application and, together with their description, serve to explain the principles of the present application.
[0045] Figure 1 A flowchart of the control method for scanning QR codes provided in this application;
[0046] Figure 2 A structural diagram of the control device for scanning QR codes provided in this application. Detailed Implementation
[0047] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present application.
[0048] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the scope of this application and its application or use.
[0049] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, they should be considered part of the specification.
[0050] In all the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0051] This application provides a control method and apparatus for scanning QR codes. The scanning parameters of the QR code camera are adjusted according to the vehicle speed and the obtained QR code image to adapt to the real-time changes in the speed and operating conditions of the device. This fundamentally improves the effectiveness and stability of the QR code camera in reading information and enhances the stability of the system for accurately associating QR code information.
[0052] Example 1
[0053] like Figure 1 As shown, the QR code scanning control method provided in this application includes:
[0054] S110: Presets the initial trigger phase, initial gain, and initial focal length of the QR code camera.
[0055] Specifically, the initial trigger phase, initial gain, and initial focal length of the QR code camera are determined based on the shift chain method on the device and the installation position of the QR code camera.
[0056] The shift chain refers to the position (or degree) of the cigarette pack at each stage of the process.
[0057] S120: Calculate and correct the trigger phase based on the actual vehicle speed and initial trigger phase of the equipment.
[0058] Specifically, as one embodiment, the trigger phase is calculated and corrected based on the actual vehicle speed and the initial trigger phase, which specifically includes:
[0059] S1201: Calculate the phase compensation value based on the actual vehicle speed and the corresponding offset degree.
[0060] Specifically, the offset degree varies depending on the vehicle speed range.
[0061] As an example, the vehicle speed of the device is divided into two intervals: a low-speed segment and a high-speed segment. Each interval has a corresponding extreme value (maximum speed), and the corresponding offset degrees are different.
[0062] As an example, the phase compensation value is calculated according to the following formula:
[0063]
[0064] S1202: Correct the initial trigger phase based on the phase compensation value to obtain the corrected trigger phase.
[0065] Based on the above, the corrected trigger phase = initial trigger phase + phase compensation value.
[0066] S130: Receives real-time QR code images obtained by a QR code camera based on the corrected trigger phase, initial gain, and initial focal length.
[0067] After adjusting the QR code camera based on the correction trigger phase, initial gain, and initial focal length, the QR code camera is used to take pictures of the QR codes on the passing materials (cigarette packs), resulting in real-time QR code images.
[0068] S140: Parse the real-time QR code image to obtain the gain adjustment value and / or focal length adjustment value.
[0069] As one example, parsing a real-time QR code image to obtain a gain adjustment value specifically includes:
[0070] P1: Obtain the corresponding standard grayscale value based on the standard QR code image, and obtain the corresponding real-time grayscale value based on the real-time QR code image.
[0071] P2: Determine if the absolute value of the first difference between the real-time grayscale value and the standard grayscale value is greater than the first threshold. If yes, proceed to P3; otherwise, maintain the initial gain.
[0072] P3: Determine the gain adjustment value based on the first difference.
[0073] Specifically, if the gain value of the real-time QR code image is too small relative to the gain value of the standard QR code image (i.e., the first difference is less than zero and its absolute value is greater than the first threshold), then the gain adjustment value is >0, meaning the gain needs to be increased; if the gain value of the real-time QR code image is too large relative to the gain value of the standard QR code image (i.e., the first difference is greater than zero and its absolute value is greater than the first threshold), then the gain adjustment value is <0, meaning the gain needs to be decreased.
[0074] As an example, parsing the real-time QR code image to obtain the focus adjustment value specifically includes:
[0075] Q1: Obtain the standard resolution and standard contrast of a standard QR code image, and obtain the real-time resolution and real-time contrast of a real-time QR code image.
[0076] Q2: By comparing real-time sharpness with standard sharpness, and real-time contrast with standard contrast, determine the second difference between the focal length of the real-time QR code image and the focal length of the standard QR code image.
[0077] Q3: Determine if the absolute value of the second difference is greater than the second threshold. If yes, proceed to Q4; otherwise, maintain the initial focal length.
[0078] Q4: Determine the focal length adjustment value based on the second difference.
[0079] Specifically, if the focal length of the real-time QR code image is too small compared to the focal length of the standard QR code image (i.e., the second difference is less than zero and its absolute value is greater than the second threshold), then the focal length adjustment value is >0, meaning the focal length needs to be increased; if the focal length of the real-time QR code image is too large compared to the focal length of the standard QR code image (i.e., the second difference is greater than zero and its absolute value is greater than the second threshold), then the focal length adjustment value is <0, meaning the focal length needs to be decreased.
[0080] S150: Correct the initial gain based on the gain adjustment value, and correct the initial focal length based on the focal length adjustment value to obtain the corrected gain and / or corrected focal length.
[0081] S160: Update the initial gain and initial focal length to the corrected gain and corrected focal length. Then return to S120 so that the QR code camera takes a picture according to the corrected gain and focal length.
[0082] This cycle repeats, with the QR code camera adjusting its trigger phase in real time according to the vehicle speed, and operating with the gain and focal length from the previous cycle. Therefore, when vehicle speed or operating conditions change, the QR code camera's image parameters can be adjusted promptly, improving the stability of the QR code system and ensuring that the "box-bar" and "condition" association success rate reaches the required 99.99%.
[0083] Example:
[0084] The following example, using the QR code installation and debugging of the W1000 imported ultra-high-speed packaging machine, illustrates this application.
[0085] Using a shift chain and in conjunction with the mechanical mounting position of the QR code camera, the initial trigger phase for the QR code system to take a picture is set to 220°. When the W1000's speed is 500 rpm, the offset is 5°; when the W1000's speed reaches 1000 rpm, the offset reaches 9°; the initial gain of the QR code camera is set to 120, and the initial focal length is set to 110.
[0086] The control program divides the vehicle speed into two segments: a low-speed segment (0-500 rpm) and a high-speed segment (500-1000 rpm), with extreme values of 500 and 1000 respectively.
[0087] The correction trigger phase for the low-speed range = 220° + the phase compensation value for the low-speed range;
[0088] The correction trigger phase for the high-speed section = 220° + the phase compensation value for the high-speed section.
[0089] Based on the aforementioned corrected trigger phase, initial gain, and initial focal length, the QR code camera automatically triggers the image capture of the cigarette pack and generates an image for the system to analyze the gain and focal length values.
[0090] The control program determines the gain value of the QR code scanning system by comparing the grayscale values of a standard QR code image and a real-time QR code image generated by photography. If the control program determines that the gain value is too small, the gain adjustment value is set to 5 to correct the gain. (新) =120+5; If the control program determines that the gain value is too large, then the gain adjustment value = -5, and the gain is corrected. 新 =120-5.
[0091] The control program compares the clarity and contrast of a standard QR code image and a real-time QR code image generated by taking a picture to determine the difference between the initial focal length and the focal length of the standard QR code image. If the control program determines that the focal length value is too small, the focal length adjustment value is set to 0.5, and the focal length f is corrected. 新 =110+0.5; If the control program determines that the focal length value is too large, then the focal length adjustment value = -0.5, and the focal length f is corrected. 新 =110-0.5.
[0092] The program uses the corrected gain and corrected focal length as the parameters for the QR code scanning system to photograph the next pack of cigarettes, and then re-photographs, analyzes, and corrects the image. This process is repeated until a stable QR code image is obtained.
[0093] The following are the results of the comparative experiment:
[0094] Comparison models: Two W1000 models;
[0095] Product Specifications: Cigarette pack with QR code;
[0096] Comparison method: Both machines used the same batch of trademark paper and produced the same specifications. The QR code reading success rate of the QR code system was tracked for 10 production shifts for each machine.
[0097] The comparison results are shown in the following figure:
[0098] Train number 1 95.672% 99.993% Train number 2 96.339% 99.992% Train number 3 95.889% 99.987% Train number 4 96.420% 99.994% Train No. 5 95.432% 99.993% Train number 6 96.556% 99.993% Train number 7 96.782% 99.992% Train number 8 95.478% 99.993% Train number 9 95.976% 99.991% Train number 10 96.011% 99.990% average value 96.056% 99.992%
[0099] The results show that the imaging of the continuous motion ultra-high-speed packaging machine using the QR code scanning control method in this application is more stable and the code reading success rate is higher.
[0100] Example 2
[0101] Based on the above control method, this application also provides a control device for scanning QR codes. For example... Figure 2 As shown, the control device includes a preset module 210, a first correction module 220, a receiving module 230, a parsing module 240, a second correction module 250, and an update module 260.
[0102] The preset module 210 is used to preset the initial trigger phase, initial gain, and initial focal length of the QR code camera.
[0103] The first correction module 220 is used to calculate and correct the trigger phase based on the actual vehicle speed and the initial trigger phase of the equipment.
[0104] The receiving module 230 is used to receive real-time QR code images obtained by the QR code camera based on the corrected trigger phase, initial gain, and initial focal length.
[0105] The parsing module 240 is used to parse the real-time QR code image to obtain the gain adjustment value and / or focal length adjustment value.
[0106] The second correction module 250 is used to correct the initial gain based on the gain adjustment value and the initial focal length based on the focal length adjustment value, so as to obtain the corrected gain and / or corrected focal length.
[0107] The update module 260 is used to update the initial gain and initial focal length to the correction gain and correction gain.
[0108] As one embodiment, the first correction module 220 includes a compensation value calculation module 2201 and a phase correction module 2202.
[0109] The compensation value calculation module 2201 is used to calculate the phase compensation value based on the actual vehicle speed and the corresponding offset degree.
[0110] The phase correction module 2202 is used to correct the initial trigger phase based on the phase compensation value to obtain the corrected trigger phase.
[0111] As one embodiment, the parsing module 240 includes a grayscale value acquisition module 2401 and a gain adjustment value determination module 2402.
[0112] The grayscale value acquisition module 2401 is used to obtain the corresponding standard grayscale value based on the standard QR code image and to obtain the corresponding real-time grayscale value based on the real-time QR code image.
[0113] The gain adjustment value determination module 2402 is used to determine the gain adjustment value based on the first difference when the absolute value of the first difference between the real-time grayscale value and the standard grayscale value is greater than the first threshold.
[0114] As one embodiment, the resolution module 240 includes a sharpness and contrast acquisition module 2403, a difference determination module 2404, and a focal length adjustment value determination module 2405.
[0115] The sharpness and contrast acquisition module 2403 is used to obtain the standard sharpness and standard contrast of a standard QR code image, and to obtain the real-time sharpness and real-time contrast of a real-time QR code image.
[0116] The difference determination module 2404 is used to compare the real-time sharpness with the standard sharpness, and the real-time contrast with the standard contrast, to determine a second difference between the focal length of the real-time QR code image and the focal length of the standard QR code image.
[0117] The focal length adjustment value determination module 2405 is used to determine the focal length adjustment value based on the second difference when the absolute value of the second difference is greater than the second threshold.
[0118] This application improves the image stability of QR code photography, and solves the problems of large image acquisition deviation and poor stability caused by phase changes triggered by changes in vehicle speed and inconsistent requirements for camera gain and focal length. It improves the stability of the QR code system and ensures that the success rate of "box and bar" association meets the requirements.
[0119] While specific embodiments of this application have been described in detail by way of examples, those skilled in the art should understand that the above examples are for illustrative purposes only and are not intended to limit the scope of this application. Those skilled in the art should understand that modifications can be made to the above embodiments without departing from the scope and spirit of this application. The scope of this application is defined by the appended claims.
Claims
1. A control method for scanning QR codes, characterized in that, include: Preset the initial trigger phase, initial gain, and initial focal length of the QR code camera; Repeat the following steps: The vehicle speed of the device is divided into at least two speed ranges, and each speed range has a corresponding offset degree. The speed range in which the actual vehicle speed is located is determined based on the actual vehicle speed of the device. A phase compensation value is calculated based on the actual vehicle speed and the offset degree corresponding to the speed range. The initial trigger phase is corrected based on the phase compensation value to obtain the corrected trigger phase. Receive a real-time QR code image obtained by the QR code camera based on the correction trigger phase, the initial gain, and the initial focal length; The real-time QR code image is parsed to obtain gain adjustment values and / or focal length adjustment values, wherein: A standard grayscale value is obtained based on a standard QR code image, and a real-time grayscale value is obtained based on the real-time QR code image; if the absolute value of the first difference between the real-time grayscale value and the standard grayscale value is greater than a first threshold, the gain adjustment value is determined based on the first difference. And / or, obtain the standard sharpness and standard contrast of the standard QR code image, and obtain the real-time sharpness and real-time contrast of the real-time QR code image; compare the real-time sharpness with the standard sharpness, and the real-time contrast with the standard contrast, to determine a second difference between the focal length of the real-time QR code image and the focal length of the standard QR code image; if the absolute value of the second difference is greater than a second threshold, then determine the focal length adjustment value based on the second difference; The initial gain is corrected based on the gain adjustment value, and the initial focal length is corrected based on the focal length adjustment value to obtain the corrected gain and / or corrected focal length; The initial gain and initial focal length are updated to the corrected gain and the corrected focal length.
2. The control method for scanning QR codes according to claim 1, characterized in that, The phase compensation value is calculated according to the following formula: Phase compensation value = actual vehicle speed / extreme value of the speed range × offset degree of the speed range.
3. The control method for scanning QR codes according to claim 1, characterized in that, The vehicle speed range includes a low-speed segment and a high-speed segment, and the offset degree corresponding to the low-speed segment is less than the offset degree corresponding to the high-speed segment.
4. The control method for scanning QR codes according to claim 1, characterized in that, If the real-time grayscale value is less than the standard grayscale value, and the absolute value of the first difference is greater than the first threshold, then the gain adjustment value is greater than zero, and the correction gain is the sum of the initial gain and the gain adjustment value; if the real-time grayscale value is greater than the standard grayscale value, and the absolute value of the first difference is greater than the first threshold, then the gain adjustment value is less than zero, and the correction gain is the sum of the initial gain and the gain adjustment value.
5. The control method for scanning QR codes according to claim 1, characterized in that, If the focal length of the real-time QR code image is less than the focal length of the standard QR code image, and the absolute value of the second difference is greater than the second threshold, then the focal length adjustment value is greater than zero, and the corrected focal length is the sum of the initial focal length and the focal length adjustment value; if the focal length of the real-time QR code image is greater than the focal length of the standard QR code image, and the absolute value of the second difference is greater than the second threshold, then the focal length adjustment value is less than zero, and the corrected focal length is the sum of the initial focal length and the focal length adjustment value.
6. The control method for scanning QR codes according to claim 1, characterized in that, The initial trigger phase is determined based on the shift chain method on the device and the installation position of the QR code camera. The initial trigger phase is the rotation angle of the main shaft of the device.
7. A control device for scanning QR codes, characterized in that, It includes a preset module, a first calibration module, a receiving module, a parsing module, a second calibration module, and an update module; The preset module is used to preset the initial trigger phase, initial gain, and initial focal length of the QR code camera; The first correction module is used to divide the vehicle speed of the device into at least two speed intervals, each speed interval having a corresponding offset degree; determine the speed interval where the actual vehicle speed is located based on the actual vehicle speed of the device; calculate the phase compensation value based on the actual vehicle speed and the offset degree corresponding to the speed interval; and correct the initial trigger phase based on the phase compensation value to obtain the corrected trigger phase. The receiving module is used to receive real-time QR code images obtained by the QR code camera based on the correction trigger phase, the initial gain, and the initial focal length; The parsing module is used to parse the real-time QR code image to obtain a gain adjustment value and / or a focal length adjustment value. The parsing module includes a grayscale value acquisition module and a gain adjustment value determination module, as well as / or a sharpness and contrast acquisition module, a difference determination module, and a focal length adjustment value determination module. The grayscale value acquisition module is used to obtain a corresponding standard grayscale value based on a standard QR code image and a corresponding real-time grayscale value based on the real-time QR code image. The gain adjustment value determination module is used to, when the absolute value of the first difference between the real-time grayscale value and the standard grayscale value is greater than a first threshold, determine the gain adjustment value based on the first... A difference is used to determine the gain adjustment value; the sharpness and contrast acquisition module is used to obtain the standard sharpness and standard contrast of the standard QR code image, and to obtain the real-time sharpness and real-time contrast of the real-time QR code image; the difference determination module is used to compare the real-time sharpness with the standard sharpness, and the real-time contrast with the standard contrast, to determine a second difference between the focal length of the real-time QR code image and the focal length of the standard QR code image; the focal length adjustment value determination module is used to determine the focal length adjustment value based on the second difference when the absolute value of the second difference is greater than a second threshold. The second correction module is used to correct the initial gain according to the gain adjustment value and the initial focal length according to the focal length adjustment value to obtain the corrected gain and / or corrected focal length; The update module is used to update the initial gain and initial focal length to the corrected gain and the corrected focal length.
8. The control device for scanning QR codes according to claim 7, characterized in that, The first correction module includes a compensation value calculation module and a phase correction module; The compensation value calculation module is used to calculate the phase compensation value based on the actual vehicle speed and the offset degree corresponding to the vehicle speed range. The phase compensation value = actual vehicle speed / extreme value of the vehicle speed range × offset degree corresponding to the vehicle speed range. The phase correction module is used to correct the initial trigger phase based on the phase compensation value to obtain the corrected trigger phase.
9. The control device for scanning QR codes according to claim 7, characterized in that, The vehicle speed range includes a low-speed segment and a high-speed segment, and the offset degree corresponding to the low-speed segment is less than the offset degree corresponding to the high-speed segment.
10. The control device for scanning QR codes according to claim 7, characterized in that, The initial trigger phase is the rotation angle of the main shaft of the packaging equipment, which is determined based on the method of the shift chain on the equipment and the installation position of the QR code camera.
Citation Information
Patent Citations
Robot alignment method and device, electronic equipment and computer readable storage medium
CN113297871A