Code reader tuning method and device and code reader

By performing image adjustment and decoding score calculation on the code reader, the preferred tuning parameters are determined, which solves the problem that the code reader is difficult to decode stably, and improves the stability of automatic parameter tuning and decoding.

CN119150895APending Publication Date: 2024-12-17SHENZHEN YANXIANG JINMA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411224616.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

It is difficult for the code reader to decode images stably, especially for users who have not decoded the code, and the operation of adjusting the camera's exposure gain parameters and other operations cannot achieve stable decoding.

Method used

By obtaining the image to be decoded and its multiple different tuning targets, adjusting the image, calculating multiple images to be scored and tuning parameters, determining the preferred decoding score, and then using the preferred tuning parameters for code reader tuning, realizing one-click automatic Complete parameter tuning.

Benefits of technology

It improves the decoding stability of the code reader, automatically completes the selection of exposure, gain and code system, reduces the efficiency of parameter tuning, and simplifies the use process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150895A_ABST
    Figure CN119150895A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of image processing, and provides a code reader tuning method and device and a code reader. The method comprises the following steps: obtaining a to-be-decoded image and a plurality of different tuning targets, and adjusting the to-be-decoded image based on the plurality of different tuning targets to obtain a plurality of to-be-scored images and a plurality of tuning parameters of the to-be-decoded image when the to-be-decoded image reaches the plurality of different tuning targets; decoding score calculation is carried out on the multiple to-be-scored images to obtain a decoding score of at least one to-be-scored image, and an optimal tuning parameter is determined based on an optimal decoding score in the decoding scores of the at least one to-be-scored image and a corresponding relation between the to-be-scored image and the tuning parameter; and tuning the code reader by using the preferred tuning parameter. According to the invention, the code reader can realize the stable decoding capability based on the optimal tuning parameters, automatically completes the functions of exposure, gain, code system and code system number selection, can be quickly operated by a user, and is convenient to use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and in particular, relates to a code reader tuning method, device and code reader. Background Art

[0002] With the widespread use of barcode reader equipment, the use of barcode reader human-computer interaction has attracted more and more attention, and the convenience of software use has become increasingly demanded. Barcodes such as one-dimensional and two-dimensional codes are difficult to identify for users who do not understand the decoding system, and asking users to adjust the exposure gain parameters of the camera cannot make the barcode reader decode stably. Summary of the invention

[0003] The embodiments of the present application provide a code reader tuning method, device, and code reader, which can solve the technical problem that it is difficult for a code reader to stably decode images.

[0004] In a first aspect, an embodiment of the present application provides a code reader tuning method, comprising:

[0005] Obtaining an image to be decoded and a plurality of different tuning targets;

[0006] Based on the multiple different tuning targets, the image to be decoded is adjusted to obtain multiple images to be scored and multiple tuning parameters when the image to be decoded achieves the multiple different tuning targets, wherein the image to be scored forms a corresponding relationship with the tuning parameters;

[0007] Calculating decoding scores for the multiple images to be rated respectively to obtain a decoding score of at least one image to be rated;

[0008] Determining a preferred tuning parameter based on a preferred decoding score among the decoding scores of the at least one image to be scored and a corresponding relationship between the image to be scored and the tuning parameter;

[0009] The preferred tuning parameters are used to tune the code reader.

[0010] In a possible implementation manner of the first aspect, before respectively calculating the decoding scores of the plurality of images to be rated to obtain the decoding score of at least one image to be rated, the method further includes:

[0011] Determine a barcode quality score and a barcode quantity of one or more barcodes of at least one image to be rated among the plurality of images to be rated;

[0012] The step of respectively calculating decoding scores of the plurality of images to be rated to obtain a decoding score of at least one image to be rated comprises:

[0013] A decoding score of at least one image to be rated is determined based on the barcode quality scores of one or more barcodes and the number of barcodes of the at least one image to be rated.

[0014] In a possible implementation manner of the first aspect, before respectively calculating the decoding scores of the plurality of images to be rated to obtain the decoding score of at least one image to be rated, the method further includes:

[0015] Determining the image sharpness of at least one image to be rated among the plurality of images to be rated;

[0016] The step of respectively calculating the decoding scores of the plurality of images to be rated to obtain a decoding score of at least one image to be rated further comprises:

[0017] A decoding score of at least one image to be rated is determined based on the barcode quality score of one or more barcodes of the at least one image to be rated, the number of barcodes, and the image sharpness.

[0018] In a possible implementation of the first aspect, the barcode quality score is determined based on at least any one of the following parameters:

[0019] -Image barcode quality score;

[0020] - minimum contrast score;

[0021] -Discontinuity fraction;

[0022] -Wide-narrow contrast ratio score.

[0023] In a possible implementation of the first aspect, the image barcode quality score is determined based on the following parameters:

[0024] -Number of black pixels;

[0025] -Number of non-black pixels;

[0026] -Number of black pixel intervals;

[0027] - The number of non-black pixel gaps.

[0028] In a possible implementation of the first aspect, the minimum contrast score is determined based on the following parameters:

[0029] - Highest black bar adjacent contrast;

[0030] - The second highest black bar adjacent contrast;

[0031] - lowest black bar adjacent contrast;

[0032] - The second lowest black bar adjacent contrast.

[0033] In a possible implementation of the first aspect, the discontinuity score is determined based on the following parameters:

[0034] - Highest black bar adjacent contrast;

[0035] - Lowest black bar adjacent contrast.

[0036] In a possible implementation manner of the first aspect, the wide-narrow contrast ratio score is determined based on the following parameters:

[0037] - the contrast between the widest black area and the adjacent non-black bars;

[0038] -The contrast between the narrowest black area and the adjacent non-black bars.

[0039] In a second aspect, an embodiment of the present application provides a code reader tuning device, including:

[0040] A tuning target acquisition module, used to obtain an image to be decoded and a plurality of different tuning targets;

[0041] A scoring image obtaining module, configured to adjust the image to be decoded based on the multiple different tuning targets, to obtain multiple images to be scored and multiple tuning parameters when the image to be decoded achieves the multiple different tuning targets, wherein the images to be scored form a corresponding relationship with the tuning parameters;

[0042] A decoding score obtaining module, used to calculate decoding scores for the multiple images to be rated respectively, so as to obtain a decoding score of at least one image to be rated;

[0043] a tuning parameter determination module, which determines a preferred tuning parameter based on a preferred decoding score among the decoding scores of the at least one image to be scored and a corresponding relationship between the image to be scored and the tuning parameter;

[0044] The code reader tuning module is used to tune the code reader using the preferred tuning parameters.

[0045] In a third aspect, an embodiment of the present application provides a code reader, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the code reader tuning method as described in the first aspect above is implemented.

[0046] In a fourth aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the code reader tuning method as described in the first aspect above is implemented.

[0047] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the code reader tuning method described in the first aspect is implemented.

[0048] In a sixth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the code reader tuning method described in the first aspect above.

[0049] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0050] According to the scheme of the present application, by obtaining an image to be decoded and a plurality of different tuning targets, the image to be decoded is adjusted based on the plurality of different tuning targets, and a plurality of images to be scored and a plurality of tuning parameters are obtained when the image to be decoded reaches a plurality of different tuning targets, and then the decoding scores of the plurality of images to be scored are calculated respectively to obtain the decoding score of at least one image to be scored, and based on the preferred decoding score in the decoding score of at least one image to be scored, the corresponding relationship between the image to be scored and the tuning parameters, the preferred tuning parameters are determined, so as to use the preferred tuning parameters to tune the code reader. The present application can determine the preferred tuning parameters based on the preferred decoding scores, define the decoding stability of the code reader using the decoding scores of the images to be scored, and output the preferred tuning parameters corresponding to the preferred decoding scores, and then use the preferred tuning parameters to tune the code reader, so as to realize the function of the code reader automatically completing parameter tuning with one click. The present application can enable the code reader to realize stable decoding capability based on the preferred tuning parameters, and automatically complete the functions of selecting exposure, gain, code system and code system quantity, so that the user can quickly get started and use it conveniently. Furthermore, the present application significantly reduces the number of times the gain range and exposure range are adjusted by defining a limited number of tuning targets, thereby greatly improving the parameter tuning efficiency.

[0051] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0053] Figure 1 It is a flowchart of a code reader tuning method provided by an embodiment of the present application;

[0054] Figure 2 This is a schematic diagram of an image to be rated in an application embodiment of the present application;

[0055] Figure 3 It is a flowchart of a code reader tuning method provided by an application embodiment of the present application;

[0056] Figure 4 is a structural schematic diagram of a code reader tuning device provided in one embodiment of the present application;

[0057] Figure 5 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0059] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0060] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0061] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0062] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0063] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0064] With the widespread use of barcode reader equipment, the use of barcode reader human-computer interaction has attracted more and more attention, and the convenience of software use has become increasingly demanded. Barcodes such as one-dimensional and two-dimensional codes are difficult to identify for users who do not understand the decoding system, and asking users to adjust the exposure gain parameters of the camera cannot make the barcode reader decode stably.

[0065] The present application proposes a one-key tuning function with the highest stable decoding capability, which automatically completes the selection of exposure, gain, code system and code system quantity. The present application scheme can automatically tune the parameters such as exposure, gain, code system and decoding quantity of the code reader with one key, so as to facilitate users to quickly get started and use it.

[0066] Figure 1 It is a flowchart of a code reader tuning method provided in one embodiment of the present application.

[0067] like Figure 1 As shown, the code reader tuning method includes:

[0068] S11, obtaining an image to be decoded and a plurality of different tuning targets.

[0069] Here, the image to be decoded usually includes one or more barcodes, such as a one-dimensional code, a two-dimensional code, and the like.

[0070] The present application scheme can set multiple different tuning targets. For example, the image grayscale interval [0-255] can be divided into several continuous intervals, such as [0-4], [5-9], [10-14], [15-19], ... (and so on), [250-255], a total of 51 intervals, and the grayscale median in each interval is used as the target brightness value to obtain 51 tuning targets. For another example, the image grayscale interval [0-255] can be divided into several continuous intervals, such as [0-9], [10-19], [20-29], [30-39], ... (and so on), [250-255], a total of 26 intervals, and the average of all grayscale values ​​in each interval is taken and then rounded as the target brightness value to obtain 26 tuning targets. Those skilled in the art should understand that the above method of obtaining multiple different tuning targets is only an example, and other methods of obtaining multiple different tuning targets also fall within the scope of protection of the present application.

[0071] By defining a limited number of tuning targets, the present application greatly reduces the number of times the gain range and exposure range are adjusted, greatly effectively avoiding the subtle image grayscale changes caused by subtle exposure and gain values, and greatly improving the parameter tuning efficiency. In the prior art, the number of times the gain range and exposure range are adjusted is 2 million * 15 = 30 million times. By defining a limited number of tuning targets, the present application can reduce the number of times the gain range and exposure range are adjusted to a limited number of tuning targets (e.g., 26 times, 51 times, etc.), greatly improving the parameter tuning efficiency.

[0072] In one embodiment, a plurality of different tuning targets form a non-continuous tuning sequence. Here, a plurality of different tuning targets may be sequentially adjusted and randomly shuffled so that the plurality of different tuning targets form a non-continuous tuning sequence. For example, a total of 26 continuous intervals of [0-9], [10-19], [20-29], [30-39], ... (and so on), [250-255] are shuffled into a non-continuous tuning sequence of [20-29], [60-69], [0-9], [150-159], [90-99], ... [10-19].

[0073] In the prior art, when the adjustment step value is small, too many adjustment times may be generated. The present application can further improve the adjustment efficiency of parameter tuning by sequentially adjusting and randomly shuffling multiple different tuning targets.

[0074] S12, adjusting the image to be decoded based on the multiple different tuning targets to obtain multiple images to be scored and multiple tuning parameters when the image to be decoded achieves the multiple different tuning targets, wherein the image to be scored forms a corresponding relationship with the tuning parameters.

[0075] Here, multiple images to be scored and multiple tuning parameters can be obtained when the image to be decoded reaches multiple different tuning targets (e.g., multiple different brightness values). For example, for 26 tuning targets, each time the image to be decoded reaches one of the tuning targets, an image to be scored is obtained by sampling, and a tuning parameter at this time is recorded. Therefore, the image to be scored forms a corresponding relationship with the tuning parameter. For 26 tuning targets, 26 images to be scored and 26 tuning parameters can be obtained, wherein each image to be scored corresponds to a tuning parameter. Different tuning parameters can be determined under different tuning targets (e.g., multiple different brightness values), such as different exposures, different gains, different code values, etc. Therefore, the image to be scored forms a corresponding relationship with the tuning parameter.

[0076] In one embodiment, an image to be decoded can be obtained, and an average brightness value and image sharpness corresponding to the image to be decoded can be obtained; the absolute value of the difference between the average brightness value and the tuning target can be obtained, and the corresponding target exposure gain strategy can be determined based on the size relationship between the absolute value of the difference and the preset brightness allowable change value; wherein the target exposure gain strategy is used to adjust the camera parameters so that the image brightness value of the captured image captured by the camera does not exceed the preset brightness allowable change value between the absolute value of the difference between the image brightness value and the tuning target, and the current camera parameters obtained by adjustment based on the target exposure gain strategy can be obtained, and the first image sharpness value sequence corresponding to the first captured image set captured by adjusting the camera parameters based on the target exposure gain strategy can be obtained; the sequence value change trend information corresponding to the first image sharpness value sequence can be obtained; if it is determined that the sequence value change trend information is a trend of first rising and then falling, the sharpness peak value corresponding to the first image sharpness value sequence can be obtained, and the camera parameter adjustment can be stopped. Here, the specific image in the first captured image set corresponding to the sharpness peak value is the image to be scored.

[0077] In this embodiment, if it is determined that the sequence value change trend information is a trend of first rising and then falling, it means that the absolute value of the difference between the image brightness value of the captured image and the tuning target does not exceed the preset brightness allowable change value, which is the highest sharpness after the image sharpness decreases. At this time, the sharpness peak value corresponding to the first image sharpness value sequence is obtained, and the camera parameter adjustment is stopped. At this time, the camera parameters that the camera finally has include not only the exposure value and gain value included in the obtained current camera parameters, but also the sharpness peak value corresponding to the obtained image sharpness value sequence. The above parameters together constitute the final camera parameters, that is, the tuning parameters in this application.

[0078] Those skilled in the art should understand that the above-mentioned method of adjusting the image to be decoded based on the multiple different tuning targets to obtain multiple images to be scored and multiple tuning parameters for the image to be decoded under the multiple different tuning targets is only an example. Other methods not listed in the list of methods of adjusting the image to be decoded based on the multiple different tuning targets to obtain multiple images to be scored and multiple tuning parameters for the image to be decoded under the multiple different tuning targets should also fall within the protection scope of the present application.

[0079] S13, respectively calculating decoding scores for the multiple images to be rated to obtain a decoding score of at least one image to be rated.

[0080] Here, the decoding score of each different image to be rated can be calculated in a variety of ways to obtain a decoding score corresponding to each image to be rated.

[0081] S14: Determine a preferred tuning parameter based on a preferred decoding score among the decoding scores of the at least one image to be scored and a corresponding relationship between the image to be scored and the tuning parameter.

[0082] Here, for example, a first decoding score threshold may be set, and a preferred decoding score higher than the first decoding score threshold may be obtained from a plurality of decoding scores corresponding to a plurality of images to be scored. For another example, a second decoding score region may be set, and a preferred decoding score belonging to the second decoding score region may be obtained from a plurality of decoding scores corresponding to a plurality of images to be scored.

[0083] Since different decoding scores correspond to different images to be scored, and as mentioned above, different images to be scored correspond to different tuning parameters, the decoding scores, the images to be scored, and the tuning parameters form a one-to-one correspondence. The tuning parameters corresponding to the preferred decoding scores can be determined as the preferred tuning parameters.

[0084] S15, tuning the code reader using the preferred tuning parameters.

[0085] Here, the code reader can be tuned based on the preferred tuning parameters. After the tuning, for example, the image to be decoded can be decoded, so that the code reader can automatically complete the parameter tuning function with one click.

[0086] According to the scheme of the present application, by obtaining an image to be decoded and a plurality of different tuning targets, the image to be decoded is adjusted based on the plurality of different tuning targets, and a plurality of images to be scored and a plurality of tuning parameters are obtained when the image to be decoded reaches a plurality of different tuning targets, and then the decoding scores of the plurality of images to be scored are calculated respectively to obtain the decoding score of at least one image to be scored, and based on the preferred decoding score in the decoding score of at least one image to be scored, the corresponding relationship between the image to be scored and the tuning parameters, the preferred tuning parameters are determined, and then the reader is tuned using the preferred tuning parameters. The present application can determine the preferred tuning parameters based on the preferred decoding scores, define the decoding stability of the reader using the decoding scores of the images to be scored, and output the preferred tuning parameters corresponding to the preferred decoding scores, so as to realize the function of the reader to automatically complete parameter tuning with one click. The present application can enable the reader to achieve stable decoding capability based on the preferred tuning parameters, and automatically complete the functions of selecting exposure, gain, code system and code system quantity, so that the user can quickly get started and use it conveniently. Furthermore, the present application significantly reduces the number of times the gain range and exposure range are adjusted by defining a limited number of tuning targets, thereby greatly improving the parameter tuning efficiency.

[0087] In one embodiment, before respectively calculating the decoding scores of the plurality of images to be rated to obtain the decoding score of at least one image to be rated, the code reader tuning method further includes: determining a barcode quality score and a barcode quantity of one or more barcodes of at least one image to be rated among the plurality of images to be rated;

[0088] The performing decoding score calculation on the multiple images to be rated respectively to obtain the decoding score of at least one image to be rated includes: determining the decoding score of at least one image to be rated based on the barcode quality score and the number of barcodes of one or more barcodes of the at least one image to be rated.

[0089] Here, the number of barcodes included in the image to be rated can be calculated by various decoding algorithms. And the barcode quality score calculation method can be used to calculate and obtain the barcode quality scores of one or more barcodes included in the image to be rated. After determining the barcode quality scores of one or more barcodes of the image to be rated and the number of barcodes of the image to be rated, the decoding score of the image to be rated can be determined. By performing decoding score calculations on multiple images to be rated, the decoding score of each image to be rated can be obtained.

[0090] Here, the decoding score of at least one image to be rated may be determined by calculating through the following formula based on the barcode quality scores of one or more barcodes and the number of barcodes of at least one image to be rated.

[0091]

[0092] Among them, Score represents the decoding score of the image to be rated, T represents the number of barcodes in the image to be rated, and P i Identifies the barcode quality score of a barcode, It represents the sum of barcode quality scores of all barcodes in the image to be rated.

[0093] The present application determines the decoding score of the image to be scored by calculating the number of barcodes in the image to be scored and the barcode quality score of one or more barcodes in the image to be scored, and can obtain the preferred decoding score with the highest number of barcodes and the highest barcode quality score in the tuning process, and then determine the preferred tuning parameters (preferred exposure value, preferred gain value) to achieve the most stable preferred tuning parameters with the largest number of decodings, and then use the preferred tuning parameters to tune the code reader to achieve the function of automatically completing parameter tuning of the code reader with one click.

[0094] In one embodiment, before respectively calculating the decoding scores of the plurality of images to be rated to obtain the decoding score of at least one image to be rated, the code reader tuning method further includes: determining the image sharpness of at least one image to be rated among the plurality of images to be rated;

[0095] Calculating decoding scores for multiple images to be rated respectively to obtain a decoding score of at least one image to be rated also includes: determining the decoding score of at least one image to be rated based on the barcode quality score, the number of barcodes, and the image sharpness of one or more barcodes of the at least one image to be rated.

[0096] Here, the number of barcodes included in the image to be rated can be calculated by various decoding algorithms. The barcode quality score calculation method can be used to calculate and obtain the barcode quality scores of one or more barcodes included in the image to be rated. The image sharpness of the image to be rated can be obtained by various image sharpness calculation methods. After determining the barcode quality scores of one or more barcodes of the image to be rated, the number of barcodes of the image to be rated, and the image sharpness of the image to be rated, the decoding score of the image to be rated can be determined. By performing decoding score calculations on multiple images to be rated, the decoding score of each image to be rated can be obtained.

[0097] Here, the decoding score of at least one image to be rated may be determined by calculating through the following formula based on the barcode quality score of one or more barcodes of at least one image to be rated, the number of barcodes, and the image sharpness.

[0098]

[0099] Among them, Score represents the decoding score of the image to be rated, T represents the number of barcodes in the image to be rated, and P iIdentifies the barcode quality score of the i-th barcode, represents the sum of the barcode quality scores of all barcodes in the image to be rated, H represents the weight, which is used to perform weighted calculation on the sum of the barcode quality scores of one or more barcodes and the number of barcodes in the image to be rated, and f(x) represents the image sharpness of the image to be rated. H can be any number from 10 to 10000, for example, and preferably, H is 1000. This formula can be understood as the decoding score of the image to be rated is mainly determined by the number of barcodes in the image to be rated and the image quality of the image to be rated, and secondly by the image sharpness as an auxiliary.

[0100] Among them, image sharpness can be calculated based on point sharpness algorithm, variance method, difference method, etc.

[0101] For example, image sharpness can be calculated based on the following formula:

[0102]

[0103] Among them, n and m are the length and width of the image, df is the grayscale change amplitude, and dx is the distance increment between pixels. The formula can be described as: for each point in the image to be scored, take 8 neighboring points and subtract them from it one by one, first calculate the weighted sum of the 8 differences, and then add the values ​​of all points and divide them by the total number of pixels.

[0104] The present application determines the decoding score of the image to be scored by calculating the number of barcodes in the image to be scored, the image sharpness, and the barcode quality score of one or more barcodes in the image to be scored. The preferred decoding score with the highest number of barcodes, the highest barcode quality score, and the highest image sharpness in the tuning process can be obtained, and then the preferred tuning parameters (preferred exposure value, preferred gain value) can be determined to achieve the most stable preferred tuning parameters with the largest number of decodings, and then the preferred tuning parameters are used to tune the code reader to achieve the function of automatically completing parameter tuning of the code reader with one click.

[0105] In one embodiment, the barcode quality score of one or more barcodes of the image to be scored is determined based on at least one of the following parameters:

[0106] -Image barcode quality score;

[0107] - minimum contrast score;

[0108] -Discontinuity fraction;

[0109] -Wide-narrow contrast ratio score.

[0110] Here, the barcode quality score of one or more barcodes of the image to be scored can be determined based on any one or any multiple of the above parameters. For example, the barcode quality score can be determined based on the image barcode quality score. In another example, the barcode quality score can be determined based on the minimum contrast score and the discontinuity score. In another example, the barcode quality score can be determined based on the image barcode quality score, the discontinuity score, and the width-narrow contrast ratio score. Those skilled in the art should understand that the above method of determining the barcode quality score is only an example, and other methods of determining the barcode quality score also fall within the scope of protection of this application.

[0111] Preferably, the barcode quality score of one or more barcodes of the image to be scored can be determined based on the following formula:

[0112] P i =PCS i +MEC i +Modulation i +SC i

[0113] Among them, P i Indicates the barcode quality score of the i-th barcode, PCS i The image barcode quality score (Print Contrast Signal) of the i-th barcode, MEC i Indicates the minimum contrast score (Minimum Edge Contrast) of the i-th barcode, Modulation i represents the discontinuity score of the i-th barcode, SC i Indicates the width-to-narrow contrast ratio score of the i-th barcode.

[0114] The present application determines the barcode quality score by calculating the image barcode quality score, the minimum contrast score, the discontinuity score, and the width-narrow contrast ratio score, and can obtain the preferred decoding score of the highest barcode quality score in the tuning process, and then determine the preferred tuning parameters (preferred exposure value, preferred gain value) to achieve the most stable and the most decoded preferred tuning parameters, and then use the preferred tuning parameters to tune the code reader to achieve the function of automatically completing parameter tuning of the code reader with one click.

[0115] In one embodiment, the image barcode quality score may be determined based on the following parameters:

[0116] -Number of black pixels;

[0117] -Number of non-black pixels;

[0118] -Number of black pixel intervals;

[0119] - The number of non-black pixel gaps.

[0120] Here, the image barcode quality score of the barcode can be determined based on the following formula:

[0121] PCS i =[(IB i +ID i )-(IW i +IL i )] / (IB i +ID i +IW i +IL i )

[0122] Among them, PCS i Indicates the image barcode quality score of the i-th barcode, IB i Indicates the number of black pixels in the i-th barcode, ID i Indicates the number of non-black pixels of the i-th barcode, IW i Indicates the number of black pixel intervals of the i-th barcode, IL i Indicates the number of non-black pixel intervals of the i-th barcode.

[0123] Here, PCS i Indicates the ratio of the black part to the non-black part, or the ratio of the black part to the non-black part. PCS i The larger the value, the smaller the proportion of image occlusion and reflection, and the corresponding barcode quality score P i The higher.

[0124] Among them, IB i 、ID i , IW i IL i Statistics can be performed in the following way: the image to be scored is converted into a grayscale image, and then binarized according to the average grayscale of the image, and pixels whose image pixels are smaller than the average grayscale of the image are identified as black pixels, and pixels whose pixels are larger than the average grayscale are identified as non-black pixels. The number of non-black pixels in black pixels is identified as the number of black pixel intervals, and the black pixels in non-black pixels are identified as the number of non-black pixel intervals.

[0125] Figure 2 This is a schematic diagram of an image to be scored in an application embodiment of the present application. Figure 2 As shown in (a) in FIG. 1 , the image to be scored includes a plurality of black barcodes (i.e., black bars) and a plurality of non-black barcodes (i.e., non-black bars). Figure 2 As shown in (b) in FIG. 1 , the black barcode includes a large number of black pixels and non-black pixels indicated by red frames. Figure 2As shown in (c) in FIG. 1 , the non-black barcode includes a large number of non-black pixels and black pixels shown in the red box. Count the number of black pixels in a barcode (e.g., barcode i) region IB i 、Non-black pixel number ID i , black pixel interval number IW i , non-black pixel interval number IL i , you can calculate the PCS of the barcode (for example, barcode i) i .

[0126] The present application calculates the image barcode quality score of the barcode based on the number of black pixels, the number of non-black pixels, the number of black pixel intervals, and the number of non-black pixel intervals of the barcode, and then determines the barcode quality score of the barcode. The preferred decoding score corresponding to the highest barcode quality score in the tuning process can be obtained, and then the preferred tuning parameters (preferred exposure value, preferred gain value) can be determined to achieve the most stable preferred tuning parameters with the largest number of decodings, and then the preferred tuning parameters are used to tune the barcode reader to achieve the function of automatically completing parameter tuning of the barcode reader with one click.

[0127] In one embodiment, the minimum contrast score may be determined based on the following parameters:

[0128] - Highest black bar adjacent contrast;

[0129] - The second highest black bar adjacent contrast;

[0130] - lowest black bar adjacent contrast;

[0131] - The second lowest black bar adjacent contrast.

[0132] Here, the minimum contrast score of the barcode can be determined based on the following formula:

[0133] MEC i =[min(Dk1 i ,Dk2 i )-max(Dl1 i ,Dl2 i )] / [min(Dk1 i ,Dk2 i )+max(Dl1 i ,Dl2 i )]

[0134] Among them, MEC i Indicates the minimum contrast score of the i-th barcode, Dk1 i Indicates the highest black bar adjacent contrast in the i-th barcode, Dk2 i Indicates the second highest black bar adjacent contrast in the i-th barcode, Dl1 iIndicates the lowest black bar adjacent contrast in the i-th barcode, Dl2 i Indicates the second lowest adjacent contrast of black bars in the i-th barcode.

[0135] Here, the minimum contrast score of the barcode represents the contrast of the barcode edge. The higher the value, the better the edge contrast. The corresponding barcode quality score P i The higher.

[0136] like Figure 2 As shown in (a), the barcode is a one-dimensional code with alternating black and white. Traverse each pixel of each barcode in the barcode, and find the black with the lowest pixel value in the black bar and the white with the highest pixel value in the adjacent white bar (i.e. non-black bar) from left to right as the contrast between the adjacent black and white, and record the contrast with the largest and second largest adjacent contrast from left to right as Dk1 i and Dk2 i , record the lowest and second lowest contrast of adjacent contrast as Dl1 i and Dl2 i , and thus calculate the MEC i .

[0137] The present application calculates the minimum contrast score of the barcode based on the highest black bar adjacent contrast, the second highest black bar adjacent contrast, the lowest black bar adjacent contrast, and the second lowest black bar adjacent contrast of the barcode, and then determines the barcode quality score of the barcode. The preferred decoding score corresponding to the highest barcode quality score in the tuning process can be obtained, and then the preferred tuning parameters (preferred exposure value, preferred gain value) can be determined to achieve the most stable preferred tuning parameters with the largest number of decodings, and then the preferred tuning parameters are used to tune the barcode reader to achieve the function of the barcode reader automatically completing parameter tuning with one click.

[0138] In one embodiment, the discontinuity score is determined based on the following parameters:

[0139] - Highest black bar adjacent contrast;

[0140] - Lowest black bar adjacent contrast.

[0141] Here, the discontinuity score of the barcode can be determined based on the following formula:

[0142] Modulation i =(Dk1 i -Dl1 i ) / (Dk1 i +Dl1 i )

[0143] Among them, Modulation i represents the discontinuity score of the ith barcode, Dk1 iIndicates the highest black bar adjacent contrast (Darkness) in the i-th barcode, Dl1 i Indicates the lowest black bar adjacent contrast (Lightness) in the i-th barcode.

[0144] Here, the discontinuity score of the barcode indicates the degree of influence of barcode defects and discontinuities. The higher the value, the better the continuity. The corresponding barcode quality score P i The higher.

[0145] The present application calculates the discontinuity score of the barcode based on the highest black bar adjacent contrast ratio and the lowest black bar adjacent contrast ratio of the barcode, and then determines the barcode quality score of the barcode. The preferred decoding score corresponding to the highest barcode quality score in the tuning process can be obtained, and then the preferred tuning parameters (preferred exposure value, preferred gain value) can be determined to achieve the most stable preferred tuning parameters with the largest number of decodings, and then the preferred tuning parameters are used to tune the barcode reader to achieve the function of automatically completing parameter tuning of the barcode reader with one click.

[0146] In one embodiment, the wide-narrow contrast ratio score is determined based on the following parameters:

[0147] - the contrast between the widest black area and the adjacent non-black bars;

[0148] -The contrast between the narrowest black area and the adjacent non-black bars.

[0149] Here, the width-to-narrow contrast ratio score of the barcode can be determined based on the following formula:

[0150] SC i =MinX i / MaxX i

[0151] Among them, SC i Indicates the width-to-narrow contrast ratio score of the i-th barcode, MaxX i Indicates the contrast between the widest black area and the adjacent non-black bar in the i-th barcode, MinX i Indicates the contrast between the narrowest black area and the adjacent non-black bar in the i-th barcode.

[0152] Traverse each pixel of the barcode in the barcode, find the bar with the most pixels in the black barcode area from left to right as the widest element bar, traverse the pixels of the widest element bar, the lowest pixel and the highest pixel in the adjacent non-black barcode as the contrast MaxX of the wide element bar i Similarly, find the element strip with the least pixels in the black barcode as the narrowest element strip, traverse the pixels of the narrowest element strip, the lowest pixel and the highest pixel in the adjacent non-black barcode as the contrast MinX of the narrow element strip. i .

[0153] The present application calculates the width-narrow contrast ratio score of the barcode based on the contrast between the widest black area of ​​the barcode and the adjacent non-black bars, and the contrast between the narrowest black area and the adjacent non-black bars, and then determines the barcode quality score of the barcode. The preferred decoding score corresponding to the highest barcode quality score in the tuning process can be obtained, and then the preferred tuning parameters (preferred exposure value, preferred gain value) can be determined to achieve the most stable preferred tuning parameters with the largest number of decodings, and then the preferred tuning parameters are used to tune the barcode reader to achieve the function of the barcode reader automatically completing parameter tuning with one click.

[0154] Figure 3 It is a flowchart of a code reader tuning method provided in an application embodiment of the present application.

[0155] like Figure 3 As shown, S31, the code reader automatically tunes.

[0156] S32, 26 grayscale intervals are circulated and disrupted as target brightness. For example, 26 continuous intervals of [0-9], [10-19], [20-29], [30-39], ... (and so on), [250-255] are disrupted into non-continuous tuning sequences of [20-29], [60-69], [0-9], [150-159], [90-99], ... [10-19]. The average value of each interval is taken and rounded as the target brightness, and 26 target brightnesses are obtained.

[0157] S33, adjust the image brightness to reach the target brightness range (tuning target), collect images (images to be rated), and record the exposure gain (tuning parameters) at this time. Here, a target brightness range is used as the tuning target, the corresponding images to be rated are collected, and the tuning parameters at this time are recorded.

[0158] S341, obtaining the number of barcodes of the image to be rated through a decoding algorithm.

[0159] S342: For one or more barcodes in the image to be rated, calculate the image barcode quality score of each barcode.

[0160] S343: For one or more barcodes in the image to be scored, calculate the minimum contrast score of each barcode.

[0161] S344, for one or more barcodes in the image to be scored, calculate the discontinuity score of each barcode.

[0162] S345, for one or more barcodes in the image to be scored, calculate the width-to-narrow contrast ratio score of each barcode.

[0163] S346, calculating the image sharpness of the image to be rated.

[0164] S35, calculating the decoding score of the image to be scored.

[0165] S36, determine whether the loop is finished, that is, determine whether the decoding scores of the images to be scored corresponding to the 26 tuning targets have been calculated. If not, return to S32 to recalculate the decoding scores of the images to be scored corresponding to the remaining tuning targets. If they have been calculated, enter S37.

[0166] S37, output the exposure gain of the image brightness with the highest score.

[0167] According to the scheme of the present application, by obtaining an image to be decoded and a plurality of different tuning targets, the image to be decoded is adjusted based on the plurality of different tuning targets, and a plurality of images to be scored and a plurality of tuning parameters are obtained when the image to be decoded reaches a plurality of different tuning targets, and then the decoding scores of the plurality of images to be scored are respectively calculated to obtain the decoding score of at least one image to be scored, and based on the preferred decoding score in the decoding score of at least one image to be scored, the corresponding relationship between the image to be scored and the tuning parameters, the preferred tuning parameters are determined, and the reader is tuned using the preferred tuning parameters. The present application can determine the preferred tuning parameters based on the preferred decoding scores, define the decoding stability of the reader using the decoding scores of the images to be scored, and output the preferred tuning parameters corresponding to the preferred decoding scores, so as to realize the function of the reader to automatically complete parameter tuning with one click. The present application can enable the reader to realize stable decoding capability based on the preferred tuning parameters, and automatically complete the functions of exposure, gain, code system and code system number selection, so that the user can quickly get started and use it conveniently. In addition, the present application greatly reduces the number of adjustment times of the gain range and exposure range by defining a limited number of tuning targets, and greatly improves the parameter tuning efficiency.

[0168] Figure 4 It is a structural schematic diagram of a code reader tuning device provided in one embodiment of the present application.

[0169] like Figure 4 As shown, the code reader tuning device 4 includes:

[0170] A tuning target acquisition module 41, used to obtain a to-be-decoded image and a plurality of different tuning targets;

[0171] A scoring image obtaining module 42 is used to adjust the image to be decoded based on the multiple different tuning targets to obtain multiple images to be scored and multiple tuning parameters when the image to be decoded achieves the multiple different tuning targets, wherein the image to be scored forms a corresponding relationship with the tuning parameters;

[0172] A decoding score obtaining module 43, configured to calculate decoding scores for the plurality of images to be rated respectively, so as to obtain a decoding score for at least one image to be rated;

[0173] A tuning parameter determination module 44, configured to determine a preferred tuning parameter based on a preferred decoding score among the decoding scores of the at least one image to be scored and a corresponding relationship between the image to be scored and the tuning parameter;

[0174] The code reader tuning module 45 is used to tune the code reader using the preferred tuning parameters.

[0175] Another embodiment of the present invention discloses a code reader tuning device 4. Figure 4 On the basis of the corresponding embodiment, the code reader tuning device 4 further includes:

[0176] A first calculation module, used to determine a barcode quality score and a barcode quantity of one or more barcodes of at least one image to be rated among the multiple images to be rated;

[0177] The decoding score obtaining module 43 is further used to determine the decoding score of at least one image to be rated based on the barcode quality scores of one or more barcodes and the number of barcodes of the at least one image to be rated.

[0178] Another embodiment of the present invention discloses a code reader tuning device 4. Figure 4 On the basis of the corresponding embodiment, the code reader tuning device 4 further includes:

[0179] A second calculation module is used to determine the image sharpness of at least one image to be rated among the multiple images to be rated;

[0180] The decoding score obtaining module 43 is further used to determine the decoding score of at least one image to be rated based on the barcode quality score of one or more barcodes of the at least one image to be rated, the number of barcodes, and the image sharpness.

[0181] Another embodiment of the present invention discloses a code reader tuning device 4. Figure 4 In the corresponding embodiment, the barcode quality score is determined based on at least one of the following parameters:

[0182] -Image barcode quality score;

[0183] - minimum contrast score;

[0184] -Discontinuity fraction;

[0185] -Wide-narrow contrast ratio score.

[0186] Another embodiment of the present invention discloses a code reader tuning device 4. Figure 4 Based on the corresponding embodiment, the image barcode quality score is determined based on the following parameters:

[0187] -Number of black pixels;

[0188] -Number of non-black pixels;

[0189] -Number of black pixel intervals;

[0190] - The number of non-black pixel gaps.

[0191] Another embodiment of the present invention discloses a code reader tuning device 4. Figure 4 According to the corresponding embodiment, the minimum contrast score is determined based on the following parameters:

[0192] - Highest black bar adjacent contrast;

[0193] - The second highest black bar adjacent contrast;

[0194] - lowest black bar adjacent contrast;

[0195] - The second lowest black bar adjacent contrast.

[0196] Another embodiment of the present invention discloses a code reader tuning device 4. Figure 4 According to the corresponding embodiment, the discontinuity score is determined based on the following parameters:

[0197] - Highest black bar adjacent contrast;

[0198] - Lowest black bar adjacent contrast.

[0199] Another embodiment of the present invention discloses a code reader tuning device 4. Figure 4 Based on the corresponding embodiment, the wide-narrow contrast ratio score is determined based on the following parameters:

[0200] - the contrast between the widest black area and the adjacent non-black bars;

[0201] -The contrast between the narrowest black area and the adjacent non-black bars.

[0202] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0203] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0204] The present application also provides a terminal device, such as Figure 5 As shown, the terminal device 5 includes: at least one processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, and when the processor 50 executes the computer program 52, the steps in any of the above-mentioned method embodiments are implemented.

[0205] An embodiment of the present application further provides a code reader, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps of any of the above-mentioned method embodiments when executing the computer program.

[0206] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0207] An embodiment of the present application provides a computer program product. When the computer program product is executed on a terminal device, the terminal device executes the steps in the above-mentioned method embodiments.

[0208] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0209] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0210] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0211] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0212] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0213] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A code reader tuning method, It is characterized in that include: Obtaining an image to be decoded and a plurality of different tuning targets; Based on the multiple different tuning targets, the image to be decoded is adjusted to obtain multiple images to be scored and multiple tuning parameters when the image to be decoded achieves the multiple different tuning targets, wherein the image to be scored forms a corresponding relationship with the tuning parameters; Calculating decoding scores for the multiple images to be rated respectively to obtain a decoding score of at least one image to be rated; Determining a preferred tuning parameter based on a preferred decoding score among the decoding scores of the at least one image to be scored and a corresponding relationship between the image to be scored and the tuning parameter; The preferred tuning parameters are used to tune the code reader.

2. The code reader tuning method according to claim 1, It is characterized in that Before respectively calculating the decoding scores of the plurality of images to be rated to obtain the decoding score of at least one image to be rated, the method further includes: Determine a barcode quality score and a barcode quantity of one or more barcodes of at least one image to be rated among the plurality of images to be rated; The step of respectively calculating decoding scores of the plurality of images to be rated to obtain a decoding score of at least one image to be rated comprises: A decoding score of at least one image to be rated is determined based on the barcode quality scores of one or more barcodes and the number of barcodes of the at least one image to be rated.

3. The code reader tuning method according to claim 2, It is characterized in that Before respectively calculating the decoding scores of the plurality of images to be rated to obtain the decoding score of at least one image to be rated, the method further includes: Determining the image sharpness of at least one image to be rated among the plurality of images to be rated; The step of respectively calculating the decoding scores of the plurality of images to be rated to obtain a decoding score of at least one image to be rated further comprises: A decoding score of at least one image to be rated is determined based on the barcode quality score of one or more barcodes of the at least one image to be rated, the number of barcodes, and the image sharpness.

4. The code reader tuning method according to claim 2 or 3, It is characterized in that The barcode quality score is determined based on at least one of the following parameters: -Image barcode quality score; - minimum contrast score; -Discontinuity fraction; -Wide-to-narrow contrast ratio score.

5. The code reader tuning method according to claim 4, It is characterized in that The image barcode quality score is determined based on the following parameters: -Number of black pixels; -Number of non-black pixels; -Number of black pixel intervals; - The number of non-black pixel gaps.

6. The code reader tuning method according to claim 4, It is characterized in that The minimum contrast score is determined based on the following parameters: - Highest black bar adjacent contrast; - The second highest black bar adjacent contrast; - lowest black bar adjacent contrast; - The second lowest black bar adjacent contrast.

7. The code reader tuning method according to claim 4, It is characterized in that The discontinuity score is determined based on the following parameters: - Highest black bar adjacent contrast; - Lowest black bar adjacent contrast.

8. The code reader tuning method according to claim 4, It is characterized in that The wide-narrow contrast ratio score is determined based on the following parameters: - the contrast between the widest black area and the adjacent non-black bars; -The contrast between the narrowest black area and the adjacent non-black bars.

9. A code reader tuning device, It is characterized in that include: A tuning target acquisition module, used to obtain an image to be decoded and a plurality of different tuning targets; A scoring image obtaining module, configured to adjust the image to be decoded based on the multiple different tuning targets, to obtain multiple images to be scored and multiple tuning parameters when the image to be decoded achieves the multiple different tuning targets, wherein the images to be scored form a corresponding relationship with the tuning parameters; A decoding score obtaining module, used to calculate decoding scores for the multiple images to be rated respectively, so as to obtain a decoding score of at least one image to be rated; a tuning parameter determination module, configured to determine a preferred tuning parameter based on a preferred decoding score among the decoding scores of the at least one image to be scored and a corresponding relationship between the image to be scored and the tuning parameter; The code reader tuning module is used to tune the code reader using the preferred tuning parameters.

10. A code reader comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the code reader tuning method according to any one of claims 1 to 8 is implemented.