Code scanning distance evaluation method and device for microscopic coding code pattern, and mobile terminal

By evaluating the element spacing of the micro-coded code map to determine whether the scanning distance is appropriate, the problem of blurring caused by inappropriate distance in the scanning and recognition of micro-coded code maps is solved, and the code scanning recognition rate and user experience are improved.

CN118569287AInactive Publication Date: 2024-08-30SHENZHEN QIANHAI QUANTUM CLOUD TECH CO LTD +1

Patent Information

Application Number
CN202411060692.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Due to the high operational requirements for scanning and identifying microscopic code images, users are prone to blurring and unclear code images captured by the scanning device due to improper distance, resulting in recognition failure and poor user experience.

Method used

By obtaining the code image of the micro-coding code image, the current element spacing is determined, and based on the preset optimal element spacing, it is judged whether the scanning distance is appropriate, and adjustment guidance is provided to improve the code scanning recognition rate.

Benefits of technology

Effectively evaluate the scanning distance, help users adjust to the appropriate position, improve the scanning recognition rate and experience, and ensure that the code image is clearly captured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569287A
    Figure CN118569287A
Patent Text Reader

Abstract

The invention discloses a code scanning distance evaluation method and device for a microscopic coding code pattern, and a mobile terminal, and relates to the technical field of code pattern recognition. The method comprises the following steps: acquiring a code pattern image of a to-be-processed microscopic coding code pattern; determining a current element spacing in the code graph image; and determining whether the current code scanning distance is appropriate or not according to the current element spacing and a preset optimal element spacing. According to the technical scheme provided by the embodiment of the invention, the code scanning distance is simply and effectively evaluated through the element spacing in the code pattern image, and the evaluation result can be used as a basis for a user to adjust the code scanning distance so as to adjust the code scanning distance to a proper code scanning distance, so that a clear code pattern is more easily captured in the code scanning operation process of the user, and the user experience is improved. And the code scanning recognition rate and the code scanning experience are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of code pattern recognition, and in particular to a method, device and mobile terminal for evaluating the scanning distance of a microscopic coded code pattern. Background Art

[0002] Compared with QR codes, micro-coded code images have relatively higher operational requirements for scanning and identifying. Since micro-coded code images are relatively small and hidden, the effective distance for scanning and identifying them requires higher accuracy than that for QR codes. Usually, users who are exposed to micro-coded code images for the first time or occasionally, when scanning and identifying micro-coded code images, are prone to being too close to the code image or too far away from the code image. Both of these situations will cause the micro-code captured by the scanning device to be blurred or unclear. These problems are usually imperceptible to users, but they may cause long periods of no response due to the inability to identify them, resulting in a poor scanning and identification experience for users. Summary of the invention

[0003] The embodiments of the present invention provide a method, device and mobile terminal for evaluating the scanning distance of a micro-coded code image, so as to accurately evaluate whether the user's current scanning distance is appropriate, thereby being used as a basis for the user to adjust the scanning distance.

[0004] In a first aspect, an embodiment of the present invention provides a method for evaluating a scanning distance of a microscopic coded code diagram, the method comprising:

[0005] Obtaining a code image of a microscopic coding code to be processed;

[0006] Determining a current element spacing in the code map image;

[0007] Whether the current scanning distance is appropriate is determined according to the current element spacing and the preset optimal element spacing.

[0008] Optionally, determining the current element spacing in the code image includes:

[0009] Obtaining edge coordinates of each graphic element in the code image;

[0010] Determine the shortest distance between every two of the graphic elements according to the edge coordinates;

[0011] The current element spacing is determined according to an average value of all the shortest distances.

[0012] Optionally, obtaining edge coordinates of each graphic element in the code image includes:

[0013] Gray-scaling and binarizing the code image to obtain a binary image;

[0014] Detecting edge contours in the binary image using a Canny operator;

[0015] According to the edge contour, the findContours function is used to obtain the edge coordinates.

[0016] Optionally, determining whether the current scanning distance is appropriate according to the current element spacing and the preset optimal element spacing includes:

[0017] Determining whether the current element spacing is within the range of the preset optimal element spacing;

[0018] If so, determining that the current scanning distance is appropriate;

[0019] Otherwise, if the current element spacing is greater than the range of the preset optimal element spacing, it is determined that the current scanning distance is too close; if the current element spacing is less than the range of the preset optimal element spacing, it is determined that the current scanning distance is too far.

[0020] Optionally, before determining whether the current scanning distance is appropriate according to the current element spacing and the preset optimal element spacing, the method further includes:

[0021] A plurality of reference code map images of a reference microscopic code map are obtained by photographing at a plurality of preset code scanning distances;

[0022] Determining the reference element spacing in each of the reference code image images respectively;

[0023] The preset optimal element spacing is obtained according to the calibration of each reference element spacing.

[0024] Optionally, the step of obtaining the preset optimal element spacing according to the calibration of each reference element spacing includes:

[0025] Arrange the reference element spacings according to the corresponding preset code scanning distances, and determine the median element spacing of the reference element spacings after arrangement;

[0026] The preset optimal element spacing is determined according to the median element spacing and a preset offset.

[0027] In a second aspect, an embodiment of the present invention further provides a device for evaluating the scanning distance of a microscopic coded code diagram, the device comprising:

[0028] A code image acquisition module, used to acquire a code image of a microscopic coding code to be processed;

[0029] A current element spacing determination module, used to determine the current element spacing in the code image;

[0030] The code scanning distance evaluation module is used to determine whether the current code scanning distance is appropriate based on the current element spacing and the preset optimal element spacing.

[0031] In a third aspect, an embodiment of the present invention further provides a mobile terminal, the mobile terminal comprising:

[0032] one or more processors;

[0033] A memory for storing one or more programs;

[0034] When the one or more programs are executed by the one or more processors, the one or more processors implement the scanning distance evaluation method of the micro-encoded code image provided by any embodiment of the present invention.

[0035] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the scanning distance evaluation method for the microscopic coded code image provided by any embodiment of the present invention.

[0036] In a fifth aspect, an embodiment of the present invention further provides a computer program product, which includes a computer program, and when the program is executed by a processor, it implements the scanning distance evaluation method of the micro-coded code image provided by any embodiment of the present invention.

[0037] The embodiment of the present invention provides a method for evaluating the scanning distance of a micro-encoded code image, which first obtains a code image of the micro-encoded code image to be processed, then determines the current element spacing in the code image, and then determines whether the current scanning distance is appropriate based on the current element spacing and the preset optimal element spacing. The method for evaluating the scanning distance of a micro-encoded code image provided by the embodiment of the present invention simply and effectively realizes the evaluation of the scanning distance through the element spacing in the code image, and the evaluation result can be used as a basis for the user to adjust the scanning distance, so as to adjust to a suitable scanning distance, thereby making it easier to capture a clear code image during the user's scanning operation, thereby improving the scanning recognition rate and scanning experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A flowchart of a method for evaluating the scanning distance of a micro-encoded code diagram provided in Embodiment 1 of the present invention;

[0039] Figure 2 An exemplary reference code image provided in the first embodiment of the present invention;

[0040] Figure 3 A schematic diagram of exemplary reference element spacing provided in Embodiment 1 of the present invention;

[0041] Figure 4A schematic diagram of an exemplary preset optimal element spacing provided in the first embodiment of the present invention;

[0042] Figure 5 This is a schematic diagram of an exemplary distance prompt record provided in the first embodiment of the present invention;

[0043] Figure 6 A schematic diagram of the structure of a device for evaluating the scanning distance of a microscopic coded code image provided in the second embodiment of the present invention;

[0044] Figure 7 This is a schematic diagram of the structure of a mobile terminal provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0045] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0046] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0047] Embodiment 1

[0048] Figure 1 This is a flow chart of a method for evaluating the scanning distance of a microscopic coded code image provided in the first embodiment of the present invention. This embodiment is applicable to the situation where the current scanning distance is evaluated in real time during the scanning operation of a microscopic coded code image by a user holding a mobile terminal. This method can be executed by a scanning distance evaluation device for a microscopic coded code image provided in an embodiment of the present invention. The device can be implemented by hardware and / or software, and can generally be integrated into a mobile terminal (such as a mobile phone, tablet computer, etc.). Figure 1 As shown, the specific steps include:

[0049] S11, obtaining a code image of a microscopic coding code image to be processed.

[0050] S12: Determine the current element spacing in the code image.

[0051] S13. Determine whether the current scanning distance is appropriate according to the current element spacing and the preset optimal element spacing.

[0052] The microscopic coding code map is composed of different tiny graphic elements, such as irregular dots, irregular strips, irregular shapes and other graphic elements. When the user performs a code scanning operation, the code map image of the microscopic coding code map to be processed can be obtained by real-time shooting through the camera of the handheld mobile terminal. Under the shooting of different scanning distances, the element spacing between the graphic elements will change. Based on this feature, the scanning distance between the mobile terminal corresponding to the code map image captured during the user's scanning operation and the actual microscopic coding code map to be processed can be reflected according to the element spacing. After obtaining the code map image of the microscopic coding code map to be processed, the current element spacing in the code map image can be calculated, and the overall current element spacing can be determined according to the element spacing between every two graphic elements. At the same time, the preset optimal element spacing can be pre-configured in the mobile terminal used, and the preset optimal element spacing can be specifically a value or an interval. Then the calculated current element spacing can be compared with the preset optimal element spacing to determine whether the current element spacing is equal to or belongs to the preset optimal element spacing, so as to determine whether the current scanning distance is appropriate.

[0053] Wherein, optionally, the determination of the current element spacing in the code image includes: obtaining the edge coordinates of each graphic element in the code image; determining the shortest distance between each two graphic elements according to the edge coordinates; and determining the current element spacing according to the average value of all the shortest distances. Specifically, based on the characteristics of the code image, each graphic element in the code image can be found by edge detection, and the edge coordinates of each graphic element can be determined. For two graphic elements, the two closest coordinate points located on the two graphic elements can be determined according to the edge coordinates of the two graphic elements, so as to determine the shortest distance between the two graphic elements, that is, the distance between the two coordinate points, and the shortest distance can be used as the element spacing between the two graphic elements. For each two graphic elements, the corresponding shortest distance is obtained by processing them respectively, and then the average value of all the shortest distances obtained is calculated as the current element spacing of the entire code image obtained, so as to facilitate comparison.

[0054] Further optionally, the edge coordinates of each graphic element in the code image are obtained, including: graying and binarizing the code image to obtain a binary image; detecting the edge contour in the binary image by the Canny operator; and marking the edge coordinates using the findContours function according to the edge contour. Specifically, edge detection can be performed using the Canny operator in OpenCV. Assume that the initially obtained code image is a Mat image. Since the graphic element itself may be an RGBA graphic in color format, in order to improve the accuracy of edge detection, the initial code image can be converted into a grayscale image by image.convertTo and then binarized by the threshold function to obtain a binary image with only two color values ​​of black and white. The edge contours of each graphic element in the binary image are detected by the Canny operator as Mat edges, and the findContours function is used to mark the contour coordinate points in each edge contour to obtain the edge coordinates of all graphic elements. Further, the pointPolygonTest method can be used to calculate the shortest distance between every two graphic elements according to the edge coordinates of all graphic elements to obtain a spacing array vector. <float>distances, and then calculate the average value of the distances between each element as the current element distance average of the entire code image.

[0055] On the basis of the above technical solution, optionally, determining whether the current scanning distance is appropriate based on the current element spacing and the preset optimal element spacing includes: determining whether the current element spacing is within the range of the preset optimal element spacing; if so, determining that the current scanning distance is appropriate; otherwise, if the current element spacing is greater than the range of the preset optimal element spacing, determining that the current scanning distance is too close; if the current element spacing is less than the range of the preset optimal element spacing, determining that the current scanning distance is too far.

[0056] Specifically, the preset optimal element spacing can be a range. For example, the preset optimal element spacing is 44.625~74.375, or 41.625~69.375, etc. After determining the current element spacing, it can be determined whether the current element spacing is within the range of the preset optimal element spacing. If so, it means that the current scanning distance is appropriate, and the user can be prompted "The scanning distance is appropriate, please wait for the code image to be recognized". If not, it can be further determined on which side of the preset optimal element spacing range the current element spacing is located. If the current element spacing is greater than the range of the preset optimal element spacing, it means that the current scanning distance is too close, and the user can be prompted "The scanning distance is too close, please zoom in on the code image appropriately". If the current element spacing is less than the range of the preset optimal element spacing, it means that the current scanning distance is too far, and the user can be prompted "The scanning distance is too far, please move closer to the code image appropriately". In this way, the user can be guided to adjust the scanning distance based on the element spacing to obtain a clear code image.

[0057] On the basis of the above technical solution, optionally, before determining whether the current scanning distance is appropriate according to the current element spacing and the preset optimal element spacing, it also includes: photographing a plurality of reference code map images of the reference microscopic coding code map at a plurality of preset scanning distances respectively; determining the reference element spacing in each of the reference code map images respectively; and calibrating the preset optimal element spacing according to each of the reference element spacings.

[0058] Specifically, the preset scanning distance can be set based on the focus range of the mobile terminal camera. For example, the preset scanning distances are 6, 7, 8, 9, 10, 11, 12, and 13 (in centimeters). Then, a group of multiple reference code map images of the same reference microscopic code map taken at multiple preset scanning distances can be collected in advance from near to far. For example, Figure 2 As shown, Figure 2 A microscopic coding code image composed of multiple and irregularly arranged points is used as an example. Then the reference element spacing in each reference code image can be determined separately, and its specific determination process can refer to the determination process of the current element spacing mentioned above. Thus, the preset optimal element spacing can be obtained according to the calibration of each reference element spacing, such as the average, median, etc. of each reference element spacing. Furthermore, since different mobile terminals may be equipped with different cameras and the images taken may be different, the preset optimal element spacing can be matched for various mobile terminals, and the corresponding functional compatibility can be achieved by associating the preset optimal element spacing with the mobile terminal identifier.

[0059] Further optionally, the preset optimal element spacing is obtained according to the calibration of each reference element spacing, including: arranging each reference element spacing according to the distance corresponding to the preset code scanning distance, and determining the median element spacing of each reference element spacing after arrangement; determining the preset optimal element spacing according to the median element spacing and the preset offset. Specifically, after determining the reference element spacing in each reference code image, it can be arranged from near to far according to the corresponding preset code scanning distance, and the median of each reference element spacing value can be taken as the median element spacing. Then, the preset optimal element spacing is determined according to the median element spacing and the preset offset. Specifically, a range can be determined near the median element spacing according to the preset offset as the preset optimal element spacing. For example, the preset offset is 25%, then ±25% of the median element spacing, that is, the interval of median element spacing × 0.75 to median element spacing × 1.25 can be taken as the preset optimal element spacing. If the element spacing is too large than the median spacing, the image may be too close to the code image and may be out of focus. If the element spacing is too small than the median spacing, the image may be too far away from the code image and may cause the image element clarity to drop.

[0060] For example, taking two mobile terminals (A and B) in practice as an example, the preset scanning distances are set to 6, 7, 8, 9, 10, 11, 12, and 13 (in centimeters), and the calculated reference element spacing is as follows: Figure 3 As shown, accordingly, the calculated preset optimal element spacing is as follows Figure 4 As shown, accordingly, in the process of evaluating the scanning distance of the mobile terminal A with the preset optimal element spacing deployed, the distance prompt record is as follows Figure 5 shown.

[0061] The technical solution provided by the embodiment of the present invention first obtains the code image of the micro-encoded code image to be processed, then determines the current element spacing in the code image, and then determines whether the current scanning distance is appropriate based on the current element spacing and the preset optimal element spacing. The scanning distance is simply and effectively evaluated through the element spacing in the code image, and the evaluation result can be used as a basis for the user to adjust the scanning distance, so as to adjust to a suitable scanning distance, so that it is easier to capture a clear code image during the user's scanning operation, thereby improving the scanning recognition rate and scanning experience.

[0062] Embodiment 2

[0063] Figure 6 This is a schematic diagram of the structure of the device for evaluating the scanning distance of a microscopic code image provided in the second embodiment of the present invention. The device can be implemented by hardware and / or software, and can generally be integrated in a mobile terminal to execute the method for evaluating the scanning distance of a microscopic code image provided in any embodiment of the present invention. Figure 6 As shown, the device comprises:

[0064] The code image acquisition module 61 is used to acquire the code image of the microscopic coding code image to be processed;

[0065] A current element spacing determination module 62, used to determine the current element spacing in the code image;

[0066] The code scanning distance evaluation module 63 is used to determine whether the current code scanning distance is appropriate according to the current element spacing and the preset optimal element spacing.

[0067] The technical solution provided by the embodiment of the present invention first obtains the code image of the micro-encoded code image to be processed, then determines the current element spacing in the code image, and then determines whether the current scanning distance is appropriate based on the current element spacing and the preset optimal element spacing. The scanning distance is simply and effectively evaluated through the element spacing in the code image, and the evaluation result can be used as a basis for the user to adjust the scanning distance, so as to adjust to a suitable scanning distance, so that it is easier to capture a clear code image during the user's scanning operation, thereby improving the scanning recognition rate and scanning experience.

[0068] Based on the above technical solution, optionally, the current element spacing determination module 62 includes:

[0069] An edge coordinate acquisition unit, used to acquire edge coordinates of each graphic element in the code image;

[0070] A shortest distance determining unit, used for determining the shortest distance between every two of the graphic elements according to the edge coordinates;

[0071] The current element spacing determination unit is used to determine the current element spacing according to an average value of all the shortest distances.

[0072] On the basis of the above technical solution, optionally, the edge coordinate acquisition unit includes:

[0073] The code image processing subunit is used to grayscale and binarize the code image to obtain a binary image;

[0074] An edge contour detection subunit, used for detecting edge contours in the binary image by using a Canny operator;

[0075] The edge coordinate marking subunit is used to obtain the edge coordinates according to the edge contour using the findContours function marking.

[0076] On the basis of the above technical solution, optionally, the code scanning distance evaluation module 63 is specifically used for:

[0077] Determining whether the current element spacing is within the range of the preset optimal element spacing;

[0078] If so, determining that the current scanning distance is appropriate;

[0079] Otherwise, if the current element spacing is greater than the range of the preset optimal element spacing, it is determined that the current scanning distance is too close; if the current element spacing is less than the range of the preset optimal element spacing, it is determined that the current scanning distance is too far.

[0080] On the basis of the above technical solution, optionally, the scanning distance evaluation device of the microscopic coding code diagram further includes:

[0081] A reference code map image acquisition module, used for photographing a plurality of reference code map images of a reference microscopic coding code map at a plurality of preset code map scanning distances before determining whether the current code map scanning distance is appropriate according to the current element spacing and the preset optimal element spacing;

[0082] A reference element spacing determination module, used to respectively determine the reference element spacing in each of the reference code image images;

[0083] The preset optimal element spacing calibration module is used to obtain the preset optimal element spacing according to the calibration of each reference element spacing.

[0084] On the basis of the above technical solution, optionally, the preset optimal element spacing calibration module is specifically used for:

[0085] Arrange the reference element spacings according to the corresponding preset code scanning distances, and determine the median element spacing of the reference element spacings after arrangement;

[0086] The preset optimal element spacing is determined according to the median element spacing and a preset offset.

[0087] The device for evaluating the scanning distance of a microscopic coded code image provided in an embodiment of the present invention can execute the method for evaluating the scanning distance of a microscopic coded code image provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0088] It is worth noting that in the embodiment of the scanning distance evaluation device of the above-mentioned microscopic coded code image, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0089] Embodiment 3

[0090] Figure 7 The structural diagram of the mobile terminal provided for the third embodiment of the present invention shows a block diagram of an exemplary mobile terminal suitable for implementing the implementation mode of the present invention. Figure 7 The mobile terminal shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention. Figure 7 As shown, the mobile terminal includes a processor 71, a memory 72, an input device 73 and an output device 74; the number of processors 71 in the mobile terminal can be one or more. Figure 7 Taking a processor 71 as an example, the processor 71, the memory 72, the input device 73 and the output device 74 in the mobile terminal can be connected through a bus or other means. Figure 7 The example of connecting through bus is taken in the following.

[0091] The memory 72, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the scanning distance evaluation method of the microscopic coded code image in the embodiment of the present invention (for example, the code image acquisition module 61, the current element spacing determination module 62 and the scanning distance evaluation module 63 in the scanning distance evaluation device of the microscopic coded code image). The processor 71 executes various functional applications and data processing of the mobile terminal by running the software programs, instructions and modules stored in the memory 72, that is, realizes the above-mentioned scanning distance evaluation method of the microscopic coded code image.

[0092] The memory 72 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the mobile terminal, etc. In addition, the memory 72 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 72 may further include a memory remotely arranged relative to the processor 71, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0093] The input device 73 can be used to obtain the code image of the microscopic code map to be processed, and generate key signal input related to user settings and function control of the mobile terminal, etc. The output device 74 can include a display screen, which can be used to show the evaluation results to the user, etc.

[0094] Embodiment 4

[0095] Embodiment 4 of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, is used to execute a method for evaluating the scanning distance of a microscopic code diagram, the method comprising:

[0096] Obtaining a code image of a microscopic coding code to be processed;

[0097] Determining a current element spacing in the code map image;

[0098] Whether the current scanning distance is appropriate is determined according to the current element spacing and the preset optimal element spacing.

[0099] The storage medium can be any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the computer system in which the program is executed, or may be located in a different second computer system, which is connected to the computer system via a network (such as the Internet). The second computer system can provide program instructions to the computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). The storage medium may store program instructions (e.g., embodied as a computer program) that may be executed by one or more processors.

[0100] Of course, the storage medium containing computer executable instructions provided in an embodiment of the present invention is not limited to the method operations described above, and the computer executable instructions can also execute related operations in the scanning distance evaluation method of the micro-coded code image provided in any embodiment of the present invention.

[0101] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0102] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0103] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (FLASH), a hard disk or an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0104] Embodiment 5

[0105] Embodiment 5 of the present invention further provides a computer program product, which includes a computer program (also referred to as code, instruction), which can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it is used to execute the scanning distance evaluation method of the micro-coded code image provided in any of the above embodiments, and has the corresponding beneficial effects of the execution method.

[0106] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.< / float>

Claims

1. A method for evaluating the scanning distance of a microscopic code diagram, characterized in that: include: Obtaining a code image of a microscopic coding code to be processed; Determining a current element spacing in the code map image; Whether the current scanning distance is appropriate is determined according to the current element spacing and the preset optimal element spacing.

2. The method for evaluating the scanning distance of a microscopic code diagram according to claim 1, characterized in that: The determining the current element spacing in the code image comprises: Obtaining edge coordinates of each graphic element in the code image; Determine the shortest distance between every two of the graphic elements according to the edge coordinates; The current element spacing is determined according to an average value of all the shortest distances.

3. The method for evaluating the scanning distance of a microscopic code diagram according to claim 2, characterized in that: The obtaining edge coordinates of each graphic element in the code image includes: Gray-scaling and binarizing the code image to obtain a binary image; Detecting edge contours in the binary image using a Canny operator; According to the edge contour, the findContours function is used to obtain the edge coordinates.

4. The method for evaluating the scanning distance of a microscopic code diagram according to claim 1, characterized in that: The determining whether the current scanning distance is appropriate according to the current element spacing and the preset optimal element spacing includes: Determining whether the current element spacing is within the range of the preset optimal element spacing; If so, determining that the current scanning distance is appropriate; Otherwise, if the current element spacing is greater than the range of the preset optimal element spacing, it is determined that the current scanning distance is too close; if the current element spacing is less than the range of the preset optimal element spacing, it is determined that the current scanning distance is too far.

5. The method for evaluating the scanning distance of a microscopic code diagram according to claim 1, characterized in that: Before determining whether the current scanning distance is appropriate according to the current element spacing and the preset optimal element spacing, the method further includes: A plurality of reference code map images of a reference microscopic code map are obtained by photographing at a plurality of preset code scanning distances; Determining the reference element spacing in each of the reference code image images respectively; The preset optimal element spacing is obtained according to the calibration of each reference element spacing.

6. The method for evaluating the scanning distance of a microscopic code diagram according to claim 5, characterized in that: The step of obtaining the preset optimal element spacing according to the calibration of each reference element spacing includes: Arrange the reference element spacings according to the corresponding preset code scanning distances, and determine the median element spacing of the reference element spacings after arrangement; The preset optimal element spacing is determined according to the median element spacing and a preset offset.

7. A device for evaluating the scanning distance of a microscopic code diagram, characterized in that: include: A code image acquisition module, used to acquire a code image of a microscopic coding code to be processed; A current element spacing determination module, used to determine the current element spacing in the code image; The code scanning distance evaluation module is used to determine whether the current code scanning distance is appropriate based on the current element spacing and the preset optimal element spacing.

8. A mobile terminal, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the scanning distance evaluation method of the micro-encoded code image as described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the scanning distance evaluation method of the microscopic coding code image as described in any one of claims 1-6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the scanning distance evaluation method of the microscopic coding code image as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • A parameter-adjustable scanning device and a code scanning method

    CN109934034A

  • Authenticity identification method and device, terminal and storage medium

    CN110533017A

  • Distance measurement method and device, electronic equipment and readable storage medium

    CN114111704A

  • Code scanning method, device and equipment for microcosmic coding image and medium

    CN118378646A

Cited By

  • Microcosmic code image detection method, device and system and medium

    CN120471082A