Dot matrix two-dimensional code identification method and device, electronic equipment and readable storage medium
By acquiring and reconstructing the dot matrix QR code images on the plastic packaging film, identifying and reconstructing distorted code points, the problem of low recognition success rate caused by deformation of light and plastic film is solved, and the success rate and clarity of the QR code are improved Spend.
Patent Information
- Application Number
- CN202411118640.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-12-13
AI Technical Summary
The dot matrix QR code is blurred or damaged due to factors such as light and deformation of the plastic film, resulting in a low recognition success rate.
By obtaining the dot matrix QR code image, determining the normal code point, detecting and reconstructing the distorted code point, generating and reconstructing the reconstructed image, and performing QR code decoding operations on the reconstructed image, including using preset QR code to extract the model, distortion prediction model and Code point reconstruction algorithm.
The success rate of identification of dot matrix QR codes has been improved, the completeness and clarity of the QR codes have been enhanced, and the problem of low recognition success rate of dot matrix QR codes on plastic packaging film has been solved.
Smart Images

Figure CN119129625A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of two-dimensional code recognition, and in particular to a dot matrix two-dimensional code recognition method, device, electronic device and readable storage medium. Background Art
[0002] In the fields of modern logistics, product traceability and anti-counterfeiting, dot matrix QR codes are widely used on various packaging materials, especially plastic packaging films, as an efficient information storage and identification technology. In actual application, especially when it is printed on plastic packaging films, the dot matrix QR codes are often blurred or damaged due to various factors such as light, plastic film deformation, and damage during transportation. At present, most electronic devices such as mobile phones are used to directly scan and identify the dot matrix QR codes on plastic packaging films. It is difficult to successfully identify blurred or damaged dot matrix QR codes, and thus there is a technical problem that the recognition success rate of dot matrix QR codes on plastic packaging films is not high.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of the present application is to provide a dot matrix two-dimensional code recognition method, device, electronic device and readable storage medium, aiming to solve the technical problem of low recognition success rate of dot matrix two-dimensional code.
[0005] To achieve the above object, the present application provides a dot matrix two-dimensional code recognition method, the method comprising: obtaining a dot matrix two-dimensional code image, and determining normal code points in the dot matrix two-dimensional code image;
[0006] According to each of the normal code points, respectively detecting adjacent distorted code points of each of the normal code points;
[0007] Reconstructing the distorted code points in the dot matrix two-dimensional code image to obtain a reconstructed image;
[0008] A two-dimensional code decoding operation is performed on the reconstructed image.
[0009] In one embodiment, the step of obtaining the dot matrix two-dimensional code includes:
[0010] Acquire a first image containing a dot matrix QR code;
[0011] Calling a preset two-dimensional code extraction model to identify the outline of the dot matrix two-dimensional code in the first image;
[0012] Extracting a contour image from the first image according to the contour;
[0013] Based on a preset correction rule, the contour image is corrected to obtain the dot matrix two-dimensional code image.
[0014] In one embodiment, the step of detecting adjacent distorted code points of each normal code point according to each normal code point includes:
[0015] Determine the first code point position of each normal code point in the dot matrix two-dimensional code image;
[0016] A preset distortion prediction model is called to detect adjacent distorted code points at each of the first code point positions based on the first code point positions.
[0017] In one embodiment, the step of determining the first code point position of each normal code point in the dot matrix two-dimensional code image includes:
[0018] Performing filtering processing on the dot matrix two-dimensional code image to obtain a low-frequency image;
[0019] Calculating the difference between each first pixel value in the dot matrix two-dimensional code image and the corresponding low-frequency pixel value in the low-frequency image to obtain a high-frequency image;
[0020] Detecting the code point contours present in the high frequency image, and determining the contour positions of the code point contours;
[0021] The contour position is used as the first code point position.
[0022] In one embodiment, the step of calling a preset distortion prediction model and detecting adjacent distorted code points at each first code point position based on each first code point position includes:
[0023] Calling a preset distortion prediction model, for each first code point position, detecting at least one implicit distortion position adjacent to the first code point position according to the first code point position, and determining the distortion probability of each implicit distortion position;
[0024] Among the distortion probabilities, the implicit distortion position corresponding to the target distortion probability that satisfies the preset maximum condition is taken as the target distortion position;
[0025] The distorted code point adjacent to the first code point position is determined according to the target distorted position.
[0026] In one embodiment, the step of reconstructing the distorted code points in the dot matrix two-dimensional code image to obtain a reconstructed image includes:
[0027] Calculate the code point distance between each distorted code point and the corresponding normal code point according to the target distorted position of each distorted code point in the dot matrix two-dimensional code image and the first code point position corresponding to each normal code point;
[0028] Calculating the code point area of each of the distorted code points according to the code point distance corresponding to each of the distorted code points and the preset code point coefficient;
[0029] According to the preset code point shape and the code point area of each distorted code point, the corresponding distorted code point is reconstructed at each target distorted position to obtain a reconstructed image.
[0030] In one embodiment, the step of performing a two-dimensional code decoding operation on the reconstructed image includes:
[0031] Performing grayscale binarization processing on the reconstructed image to obtain an image to be identified;
[0032] Calling a QR code recognition component to perform a QR code decoding operation on the image to be recognized;
[0033] In the case where it is detected that the two-dimensional code recognition component fails to recognize, rotating, flipping, scaling, grayscale and / or binarization processing is performed on the reconstructed image to obtain an adjusted image;
[0034] The adjusted image is decoded and identified.
[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a dot matrix two-dimensional code recognition device, the device comprising:
[0036] An acquisition module, used to acquire a dot matrix two-dimensional code image and determine normal code points in the dot matrix two-dimensional code image;
[0037] A detection module, configured to detect adjacent distorted code points of each normal code point according to each normal code point;
[0038] A reconstruction module, used to reconstruct the distorted code points in the dot matrix two-dimensional code image to obtain a reconstructed image;
[0039] A decoding module is used to perform a two-dimensional code decoding operation on the reconstructed image.
[0040] In addition, to achieve the above-mentioned purpose, the present application also provides an electronic device, which includes: a memory, a processor, and a program of the dot matrix two-dimensional code recognition method stored in the memory and executable on the processor. When the program of the dot matrix two-dimensional code recognition method is executed by the processor, the steps of the dot matrix two-dimensional code recognition method as described above can be implemented.
[0041] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, on which is stored a program for implementing the dot matrix two-dimensional code recognition method. When the program of the dot matrix two-dimensional code recognition method is executed by a processor, the steps of the dot matrix two-dimensional code recognition method as described above are implemented.
[0042] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned dot matrix two-dimensional code recognition method when executed by a processor.
[0043] One or more technical solutions proposed in this application have at least the following technical effects: this application can first obtain a dot matrix two-dimensional code image, determine the normal code points in the dot matrix two-dimensional code image, and then detect the adjacent distorted code points of each normal code point according to each normal code point, so that the distorted code points (for example, blurred or damaged code points) in the dot matrix two-dimensional code image can be reasonably identified according to the normal code points, and the distorted code points in the dot matrix two-dimensional code can be reconstructed, so that the distorted code points in the dot matrix two-dimensional code can be restored to obtain a reconstructed two-dimensional code, so as to improve the integrity and clarity of the two-dimensional code, instead of directly identifying the dot matrix two-dimensional code with distorted code points, thereby improving the recognition success rate of the reconstructed two-dimensional code. The technical problem of low recognition success rate of dot matrix two-dimensional codes on plastic packaging films is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the description, are used to explain the principles of the present application.
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1 This is a flow chart of an embodiment of a dot matrix two-dimensional code recognition method of the present application;
[0047] Figure 2 This is a flow chart of another embodiment of the dot matrix two-dimensional code recognition method of the present application;
[0048] Figure 3 A schematic diagram of the process of dot matrix two-dimensional code recognition in the dot matrix two-dimensional code recognition method of the present application;
[0049] Figure 4 A schematic diagram of a high-frequency image in the dot matrix two-dimensional code recognition method of the present application;
[0050] Figure 5 A schematic diagram of image reconstruction and image adjustment in the dot matrix two-dimensional code recognition method of the present application;
[0051] Figure 6 This is a schematic diagram of the structure of a dot matrix two-dimensional code recognition device according to an embodiment of the present application;
[0052] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the dot matrix two-dimensional code recognition method in the embodiment of the present application.
[0053] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0054] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0055] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0056] Dot matrix QR code is a QR code that encodes information by arranging black and white dots on a plane. Traditional QR code recognition technology has problems of slow speed and low accuracy when recognizing dot matrix QR codes. In particular, when the QR code printed on a transparent film is affected by reflection, expansion, and blurring when the QR code is too small, the recognition success rate of the dot matrix QR code on the transparent film will be greatly reduced.
[0057] In this regard, the main solution of the embodiment of the present application is: obtain a first image containing a dot matrix two-dimensional code, extract the dot matrix two-dimensional code image from the first image through a preset two-dimensional code extraction model, detect the first code point position of the normal code point in the dot matrix two-dimensional code image, determine the distorted code point in the dot matrix two-dimensional code image according to the first code point position, reconstruct the distorted code point to obtain a reconstructed image, perform grayscale binarization processing on the reconstructed image to obtain an image to be identified, call a two-dimensional code recognition component, perform a two-dimensional code decoding operation on the image to be identified, and when it is detected that the two-dimensional code recognition component fails to identify, rotate, flip, scale, grayscale and / or binarize the image to be identified to obtain an adjusted image, and perform a two-dimensional code recognition operation on the adjusted image to improve the recognition success rate of the dot matrix two-dimensional code. If the adjustment image still fails to be identified after the two-dimensional code recognition operation, an image re-acquisition prompt is output to prompt the user to provide the first image again.
[0058] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device that can realize the above functions.
[0059] Based on this, the embodiment of the present application provides a dot matrix two-dimensional code recognition method, which is applied to a cash register terminal. Figure 1 , Figure 1 This is a flow chart of an embodiment of a dot matrix two-dimensional code recognition method of the present application.
[0060] In this embodiment, the dot matrix two-dimensional code recognition method includes steps S10 to S40:
[0061] Step S10, obtaining a dot matrix two-dimensional code image, and determining normal code points in the dot matrix two-dimensional code image;
[0062] It should be noted that the dot matrix two-dimensional code image includes the dot matrix two-dimensional code, and the outline of the dot matrix two-dimensional code image is the outline of the dot matrix two-dimensional code. A normal code point is a code point whose code point outline can be detected from the dot matrix two-dimensional code image, and the dot matrix two-dimensional code image may include multiple normal code points. In this embodiment, the dot matrix two-dimensional code image can be obtained by shooting an electronic device, such as a mobile phone. In other embodiments, the dot matrix two-dimensional code image can also be extracted from a first image, which is an image containing a dot matrix two-dimensional code. In addition to displaying the dot matrix two-dimensional code, the first image also displays the environment where the dot matrix two-dimensional code is located.
[0063] Exemplarily, a dot matrix two-dimensional code image is acquired, code points existing in the dot matrix two-dimensional code image are detected, and the detected code points are used as normal code points.
[0064] In a feasible embodiment, step S10 further includes steps S11 to S14:
[0065] Step S11, obtaining a first image including a dot matrix two-dimensional code;
[0066] Step S12, calling a two-dimensional code extraction model to identify the outline of the dot matrix two-dimensional code in the first image;
[0067] It should be noted that the first image can be taken by an electronic device, and the electronic device can be a mobile terminal, a camera, or the like, and the mobile terminal can be a terminal such as a mobile phone. After the first image is acquired, in addition to the dot matrix QR code, the first image also displays an image of the environment where the dot matrix QR code is located, and the acquired first image may be affected by light, deformation of plastic packaging film, etc., resulting in deformation, blurring, and other problems of the dot matrix QR code. Therefore, after acquiring the first image containing the dot matrix QR code, the QR code extraction model can be called to extract the dot matrix QR code image in the first image. The QR code extraction model is used to extract dot matrix QR code images in different forms and under different lighting conditions.
[0068] The QR code extraction model can be obtained by training a neural network model. The structure of the neural network model can include a feature pyramid network (FPN), a region proposal network (RPN) and a mask branch of Mask-RCNN, wherein the feature pyramid network and the region proposal network can be used to improve the adaptability and detection accuracy of the preset QR code extraction model. The mask branch is used to improve the accuracy of extracting dotted QR codes. The outline of a dot matrix QR code refers to the overall outline of the dot matrix QR code.
[0069] Step S13, extracting a contour image from the first image according to the contour;
[0070] Step S14: correcting the outline image based on a preset correction rule to obtain the dot matrix two-dimensional code image.
[0071] It should be noted that the contour image refers to an image obtained by cropping along the contour of the dot matrix two-dimensional code in the first image. Since the contour image may be deformed, the contour image can be corrected to obtain a standard dot matrix two-dimensional code image; that is, the contour image may be an irregular quadrilateral, and the contour of a standard dot matrix two-dimensional code image is a square. After correcting the dot matrix two-dimensional code image, the recognition success rate of the dot matrix two-dimensional code image can be improved. The contour image is corrected based on a preset correction rule. The preset correction rule may include a preset standard image. The preset standard image refers to an image with a standard shape. For example, the preset standard image may be a square, and the irregular contour image can be corrected to a square image.
[0072] Exemplarily, a first image containing a dot matrix two-dimensional code is obtained, a two-dimensional code extraction model is called, the outline of the dot matrix two-dimensional code in the first image is detected, and the first image is cropped along the outline to obtain an outline image containing the dot matrix two-dimensional code, and the outline image is corrected to obtain the dot matrix two-dimensional code image. This embodiment extracts the dot matrix two-dimensional code image through the two-dimensional code extraction model, so that even if the dot matrix two-dimensional code is affected by lighting, deformation, etc., the dot matrix two-dimensional code image can be extracted therefrom for subsequent decoding and recognition. Moreover, extracting the dot matrix two-dimensional code image from the first image can also solve the problem of large image and small code, avoid directly recognizing the first image, and further avoid the problem of unsuccessful recognition of the dot matrix two-dimensional code.
[0073] Step S20, according to each of the normal code points, respectively detecting adjacent distorted code points of each of the normal code points;
[0074] It should be noted that distorted code points refer to blurred or damaged code points in a dot matrix two-dimensional code. There may be one or more distorted code points in a dot matrix two-dimensional code. It is possible to predict whether there are distorted code points near normal code points. For any normal code point in a dot matrix two-dimensional code, it is possible to predict the distorted code points adjacent to the normal code point. A normal code point may have adjacent distorted code points or may not have adjacent distorted code points.
[0075] Exemplarily, for any normal code point, predict whether there is a distorted code point adjacent to the normal code point. If there is a distorted code point adjacent to the normal code point, obtain the distorted code point. If not, predict whether there is a distorted code point among other normal code points in the dot matrix two-dimensional code image.
[0076] Step S30, reconstructing the distorted code points in the dot matrix two-dimensional code image to obtain a reconstructed image;
[0077] It should be noted that there may be one or more distorted code points in the dot matrix two-dimensional code image, and the reconstructed image is the dot matrix two-dimensional code image reconstructed from the distorted code points, and the reconstructed image includes normal code points and reconstructed distorted code points.
[0078] For example, based on the code point position corresponding to the distorted code point in the dot matrix two-dimensional code, the distorted code point can be reconstructed at the code point position. Reconstructing the distorted code point can be deepening the color of the distorted code point at the code point position, completing the distorted code point, etc.
[0079] Step S40: performing a two-dimensional code decoding operation on the reconstructed image.
[0080] It should be noted that after obtaining the reconstructed image, the two-dimensional code recognition component can be called to recognize the reconstructed image, so as to perform a two-dimensional code decoding operation on the reconstructed image to realize the recognition of the reconstructed image.
[0081] Exemplarily, the two-dimensional code recognition component is called to recognize the two-dimensional code displayed in the reconstructed image to obtain a result corresponding to the reconstructed image, and the result may be text, image, etc. This embodiment does not impose any specific limitation on this.
[0082] Further, see Figure 2 In one feasible embodiment, step S20 further includes steps S21 to S22:
[0083] Step S21, determining the first code point position of each normal code point in the dot matrix two-dimensional code image;
[0084] It should be noted that the first code point position refers to the code point position of a normal code point on the dot matrix two-dimensional code image. The dot matrix two-dimensional code image may include multiple normal code points, and each normal code point has its own corresponding first code point position.
[0085] Exemplarily, the code point outline in the dot matrix two-dimensional code image is detected, and the code point outline is used as the first code point position.
[0086] In a feasible embodiment, step S21 further includes steps S211 to S214:
[0087] Step S211, filtering the dot matrix two-dimensional code image to obtain a low-frequency image;
[0088] Step S212, calculating the difference between each first pixel value in the dot matrix two-dimensional code image and the corresponding low-frequency pixel value in the low-frequency image to obtain a high-frequency image;
[0089] It should be noted that filtering the dot matrix two-dimensional code image can be performed by spatial filtering, mean filtering, or gaussian filtering (Gaussian smoothing filtering) to obtain a low-frequency image. Spatial filtering, mean filtering, or gaussian filtering can transform the pixel values of the image to achieve the purpose of smoothing, sharpening, denoising, etc. The low-frequency image is the low-frequency information in the dot matrix two-dimensional code, and the low-frequency information refers to the image area with relatively small grayscale changes in the dot matrix two-dimensional code image. The high-frequency image is an image obtained by removing the low-frequency information in the dot matrix two-dimensional code image. The high-frequency image shows the area in the dot matrix two-dimensional code image with large grayscale changes. For example, the high-frequency image shows the edges of the code points in the dot matrix two-dimensional code image, and it can be understood that the high-frequency image shows the outlines of the code points of each normal code point in the dot matrix two-dimensional code.
[0090] The first pixel value refers to the pixel value of the first pixel point in the dot matrix two-dimensional code image, and the low-frequency pixel value refers to the pixel value of the second pixel point in the low-frequency image.
[0091] Exemplarily, filtering is performed on the dot matrix two-dimensional code image, such as spatial domain filtering, mean filtering, etc., to obtain a low-frequency image, and the difference between each first pixel value in the dot matrix two-dimensional code image and the corresponding low-frequency pixel value in the low-frequency image is calculated, and the difference is the difference in absolute value to obtain a high-frequency image. The first pixel value and the corresponding low-frequency pixel value in the low-frequency image refer to: the position of the first pixel point of the first pixel value in the dot matrix two-dimensional code image is the same as the position of the second pixel point of the low-frequency pixel value in the low-frequency image.
[0092] For example, based on the dot matrix two-dimensional code image and the low-frequency image, the expression for determining the high-frequency image can be:
[0093] g a (x,y)=abs(f(x,y)-f a (x,y)
[0094] Among them, g a(x, y) represents a high-frequency image, abs is the abbreviation of absolute, which means taking the absolute value operation in mathematics, f(x, y) represents a dot matrix QR code image, f a (x,y) represents a low-frequency image, and (x,y) can be used to represent the position of a pixel in the image.
[0095] Step S213, detecting the code point contour existing in the high-frequency image, and determining the contour position of the code point contour;
[0096] Step S214: taking the contour position as the first code point position.
[0097] It should be noted that since the high-frequency image is a dot matrix two-dimensional code image with low-frequency information filtered out, the contours of each code point displayed in the high-frequency image are clearer, so that the normal code points in the high-frequency image can be better detected. For example, the code point contour detected in the high-frequency image is the normal code point in the dot matrix two-dimensional code image, and the contour position of the code point contour is the first code point position of the normal code point; the number of code point contours detected in the high-frequency image can be the same as the number of normal code points. The contour position corresponds to the first code point position one by one.
[0098] Exemplarily, the code point contour existing in the high-frequency image is detected, the contour position of the code point contour in the high-frequency image is detected, and the contour position is used as the first code point position. The high-frequency image may include multiple code point contours, each code point contour corresponds to a first code point position, and the first code point position corresponds to the contour position one by one. In other embodiments, after the step of correcting the contour image and obtaining the dot matrix two-dimensional code image, it may also include that when the dot matrix two-dimensional code image is enlarged, there may be a situation where the image edge is unclear or the clarity is not high, so the resolution of the dot matrix two-dimensional code image can be improved. Specifically, the two-dimensional code extraction model can also be preset to enhance the resolution. The structure of the neural network model corresponding to the preset two-dimensional code extraction model can also include: dense connection (Dense Concat), depth convolution (Depthwise Convolution), deconvolution (Deconvolution), residual learning (Residual Learning), etc.; wherein, dense connection is used to enhance feature transfer, depth convolution is used to reduce the number of parameters while maintaining effective feature extraction, deconvolution is used to enlarge the feature map (for example, dot-shaped two-dimensional code image), and residual learning is used to accelerate the training process and improve the convergence speed. As a result, the preset QR code extraction model can effectively improve the resolution of the dot-shaped QR code image, so that it still maintains clear edges and high recognizability after magnification.
[0099] This embodiment can more accurately detect the normal code points in the dot matrix two-dimensional code image and more accurately determine the position of the first code point in the dot matrix two-dimensional code image by determining the high-frequency image of the dot matrix two-dimensional code image. Figure 3 , Figure 3 is a schematic diagram of a high-frequency image. The outline of the code points corresponding to the dot matrix two-dimensional code can be detected in the high-frequency image. Among them, A1 refers to the schematic diagram of the high-frequency image, and A2 is a schematic diagram of a local magnification of the high-frequency image. The outline of the code points corresponding to the dot matrix two-dimensional code can be detected in the high-frequency image. For example, the local part of the high-frequency image can be magnified to detect the outline of the code points, and then the normal code points in the dot matrix two-dimensional code image can be detected more accurately.
[0100] In addition, it should be noted that the training process of the preset QR code extraction model may include: determining a first model to be trained, the first model to be trained is a neural network model; obtaining a first training sample, the step of obtaining the first training sample may include: obtaining a large number of training images including dot matrix QR codes, and marking the labels of the training images, and then processing the marked training images through data enhancement technology, including but not limited to rotation, flipping, scaling, cropping, color change and other operations, so as to improve the diversity of training samples while ensuring label consistency; inputting the training image into the first model to be trained, outputting the image features, calculating the distance between the image features and the labels corresponding to the training images, obtaining the training loss, and judging whether the training loss is less than or equal to the preset loss value. If the training loss is less than or equal to the preset loss value, it is determined that the first model to be trained is successfully trained, and the preset QR code extraction model is obtained; if the training loss is greater than the preset loss value, the training image is re-acquired, and the first model to be trained is trained until the training loss is less than or equal to the preset loss value, and the preset QR code extraction model is obtained.
[0101] Step S22: calling a preset distortion prediction model, and based on each of the first code point positions, respectively detecting adjacent distorted code points existing at each of the first code point positions.
[0102] It should be noted that, based on the first code point position of the normal code point, it is possible to predict whether there is a distorted code point near the normal code point. The preset distortion prediction model is used to predict the adjacent distorted code points existing at the first code point position. The preset distortion prediction model can be obtained based on the training of the neural network model.
[0103] Exemplarily, each first code point position may be input into a preset distortion prediction model together, and the preset distortion model may respectively detect adjacent distorted code points existing at each first code point position.
[0104] This embodiment detects the distorted code points adjacent to the first code point position based on the first code point position of the normal code point, so that the distorted code points can be detected more reasonably and the accuracy of distorted code point detection can be improved.
[0105] In a feasible embodiment, step S22 further includes steps S221 to S223:
[0106] Step S221, calling a preset distortion prediction model, for each first code point position, detecting at least one implicit distortion position adjacent to the first code point position according to the first code point position, and determining the distortion probability of each implicit distortion position;
[0107] Step S222, among the distortion probabilities, taking the implicit distortion position corresponding to the target distortion probability that satisfies the preset maximum condition as the target distortion position;
[0108] Step S223: Determine the distorted code point adjacent to the first code point position according to the target distorted position.
[0109] It should be noted that the preset distortion prediction model can determine whether there are adjacent distorted code points at each first code point position, and can output the adjacent distorted code points corresponding to each first code point position. The implicit distortion position refers to the position of the adjacent distorted code point that may exist at the first code point position, and the distortion probability refers to the probability that a distorted code point exists at the implicit distortion position. The preset maximum condition includes that the target distortion probability is greater than the preset probability threshold, and the target distortion probability is the largest among the distortion probabilities corresponding to the first code point position. The preset probability threshold can be determined based on the actual situation. The target distortion probability of the target distortion position meets the preset maximum condition.
[0110] The target distortion position is the position where the distorted code point is located, so the distorted code point can be determined based on the target distortion position. The distorted code point in the dot matrix two-dimensional code image can be a blurred or damaged code point in the dot matrix two-dimensional code, or a code point that does not exist in the dot matrix two-dimensional code image, but a code point that should exist in the actual dot matrix two-dimensional code. This is because in the process of shooting the dot matrix two-dimensional code image, it is affected by light, deformation, etc., which may cause code points to be lost in the electronic two-dimensional code image.
[0111] When the preset distortion prediction model detects that there are no distorted code points in the dot matrix two-dimensional code image, all normal code points displayed in the dot matrix two-dimensional code image can also be strengthened. For example, all normal code points can also be reconstructed, and the corresponding normal code points are reconstructed according to the preset code point shape and preset code point area at the position where each normal code point is located, so as to strengthen the characteristics of the normal code points in the dot matrix two-dimensional code image, and also facilitate the improvement of the success rate of subsequent two-dimensional code decoding. When there are distorted code points in the dot matrix two-dimensional code image, the normal code points in the dot matrix two-dimensional code image can also be reconstructed to strengthen the characteristics of all code points in the dot matrix two-dimensional code image, so as to facilitate the improvement of the recognition success rate of the reconstructed image. There may be adjacent distorted code points at the first code point position, or there may be no adjacent distorted code points. For example, the distortion probability of each invisible distorted position corresponding to the first code point position does not meet the preset maximum condition, which can indicate that there are no adjacent distorted code points at the first code point position. When there are no adjacent distorted code points at each first code point position in the dot matrix two-dimensional code image, it means that there are no adjacent distorted code points in the dot matrix two-dimensional code image.
[0112] Exemplarily, calling a preset distortion prediction model, for each first code point position, detecting at least one implicit distortion position adjacent to the first code point position according to the first code point position, and determining the distortion probability of each implicit distortion position;
[0113] According to each implicit distortion position and each corresponding distortion probability, it is determined whether there is an adjacent distorted code point at the first code point position; if there is a target distortion probability that meets a preset maximum condition among each distortion probability, the implicit distortion position corresponding to the target distortion probability is used as the target distortion position, and the distorted code point adjacent to the first code point position is determined according to the target distortion position; if there is no target distortion probability that meets the preset maximum condition among each distortion probability of the first code point position, it is determined that there is no adjacent distorted code point at the first code point position.
[0114] This embodiment determines the implicit distortion position of the first code point position and determines the distortion probability corresponding to each implicit distortion position, so as to more accurately predict the distorted code point corresponding to the first code point, thereby facilitating the subsequent successful recognition of the dot matrix two-dimensional code.
[0115] In a feasible embodiment, step S30 further includes steps S31 to S33:
[0116] Step S31, calculating the code point distance between each of the distorted code points and the corresponding normal code point according to the target distorted position of each of the distorted code points in the dot matrix two-dimensional code image and the first code point position corresponding to each of the normal code points;
[0117] Step S32, calculating the code point area of each of the distorted code points according to the code point distance corresponding to each of the distorted code points and the preset code point coefficient;
[0118] Step S33, reconstructing the corresponding distorted code points at each target distorted position according to the preset code point shape and the code point area of each distorted code point, to obtain a reconstructed image.
[0119] It should be noted that each distorted code point has its own corresponding target distorted position, and the code point area corresponding to each distorted code point can be determined respectively, and the code point area can be used to describe the code point size of the distorted code point. The preset code point coefficient can be determined based on actual conditions, and the preferred preset code point coefficient is generally greater than 1. For example, in this embodiment, the preset code point coefficient can be 1.1.
[0120] The preset code point shape may be a square, a circle, etc. In this embodiment, the preset code point shape may be a square. Based on the preset code point shape and the code point area of the distorted code point, a code point having a shape of the preset code point shape and a size of the code point area may be marked at the target distorted position to reconstruct the distorted code point. After all distorted code points are reconstructed, a reconstructed image may be obtained.
[0121] The code point distance is the code point distance between a distorted code point and an adjacent distorted code point. Specifically, the code point distance may be the minimum distance between a distorted code point and a corresponding adjacent normal code point. A distorted code point may correspond to multiple adjacent normal code points. The distance between the distorted code point and each adjacent normal code point may be calculated, and the code point distance with the smallest distance is selected as the code point distance corresponding to the distorted code point.
[0122] Exemplarily, according to each target distorted position and each first code point position, the code point distance between each distorted code point and the corresponding normal code point is calculated respectively; for any distorted code point, the code point distance and the preset code point coefficient are substituted into the preset area calculation formula to obtain the code point area corresponding to the distorted code point, and according to the preset code point shape and the code point area of each distorted code point, the corresponding distorted code point is reconstructed at each target distorted position to obtain a reconstructed image. In this way, the distorted code points in the dot matrix two-dimensional code image can be restored, and then a complete reconstructed image can be obtained. This facilitates improving the success rate of subsequent two-dimensional code recognition and decoding.
[0123] The preset area calculation formula may be:
[0124] M=round(Dmin*a)
[0125] Where M is the code point area of the distorted code point, Dmin is the code point distance corresponding to the distorted code point, and the code point distance is the minimum distance corresponding to the distorted code point. The distorted code point may correspond to multiple adjacent normal code points. The distance between the distorted code point and each adjacent normal code point can be calculated, and the smallest distance is selected as the code point distance corresponding to the distorted code point. a is the preset code point coefficient. round means rounding the product to ensure that the product is an integer.
[0126] In a feasible embodiment, step S40 further includes steps S41 to S44:
[0127] Step S41, performing grayscale binarization processing on the reconstructed image to obtain an image to be recognized;
[0128] It should be noted that the grayscale binarization processing of the reconstructed image to obtain the image to be identified can make the code points displayed in the reconstructed image more obvious, which is convenient for the subsequent decoding and identification of the dot matrix two-dimensional code. Grayscale binarization includes dynamic grayscale processing and binarization processing of the reconstructed image in sequence. Dynamic grayscale processing can be processed by proportional linear transformation, for example, the dynamic range of the grayscale value of the reconstructed image is linearly extended to a preset range to enhance the contrast of the image, for example, the maximum value of the preset range is less than 255, and the minimum value of the preset range is greater than 0, that is, the preset range is within 0 to 255.
[0129] For example, the expression for dynamic grayscale processing of the reconstructed image can be:
[0130] g(x,y)=(f b (x,y)-mn) / (mx-mn)
[0131] Among them, g(x,y) represents the pixel value of the pixel in the grayscale reconstructed image, and f b (x, y) represents the pixel value of the pixel in the reconstructed image, mn is the minimum value of the preset range, and mx is the maximum value of the preset range.
[0132] The grayscale reconstructed image is binarized and the percentage method can be used to binarize the grayscale reconstructed image to obtain the image to be identified. The percentage method (Percentage Thresholding), also known as the P-Tile method or the P quantile method, is an image binarization method that sets a threshold based on a priori probability.
[0133] Step S42, calling a two-dimensional code recognition component to perform a two-dimensional code decoding operation on the image to be recognized;
[0134] It should be noted that the QR code recognition component is used to recognize and decode dot matrix QR codes. The QR code recognition component includes multiple sub-recognition components, each of which can be a component of ZXing (Zebra Crossing), opencv (Open Source Computer Vision Library), WeChat applet qrcode, etc. Among them, ZXing is an open source barcode and QR code recognition library that can recognize and decode barcodes and QR codes in various formats. ZXing can quickly and accurately recognize barcodes and QR codes, and is one of the commonly used recognition tools in many applications and systems. OpenCV is an open source computer vision library with powerful image processing and machine learning functions. It can also be used to recognize dot matrix QR codes. WeChat applet qrcode can provide a QR code recognition interface that can recognize and parse QR codes in real time. The interface can support multiple types of QR codes, including links, text information, etc. Through this interface, QR code scanning, recognition and processing functions can be easily realized.
[0135] Exemplarily, each sub-recognition component in the QR code recognition component is called to decode the image to be recognized, and each sub-recognition component can store the recognition result of the recognized image to be recognized, and the recognition result is the decoding data of the dot matrix QR code in the image to be recognized. When any sub-recognition component repeatedly recognizes the image to be recognized, the recognition result of the image to be recognized can be directly returned for the user to view without repeated recognition. This embodiment expands the scope of application of QR code recognition by calling multiple sub-recognition components for recognition, and any sub-recognition component can be selected to decode the image to be recognized.
[0136] Step S43, when it is detected that the two-dimensional code recognition component fails to recognize, the reconstructed image is rotated, flipped, scaled, grayscaled and / or binarized to obtain an adjusted image;
[0137] Step S44: decoding and identifying the adjusted image.
[0138] It should be noted that when any sub-recognition component fails to recognize, the reconstructed image can be rotated, flipped, scaled, grayscaled and / or binarized to obtain an adjusted image, and the adjusted image is decoded and recognized. Due to the different decoding methods of different sub-recognition components, some sub-recognition components have weak decoding capabilities and may not be able to successfully decode the image to be recognized. Therefore, in this embodiment, the reconstructed image is adjusted to obtain an adjusted image, and then the sub-recognition component is called to decode the adjusted image. Scaling can be proportionally reducing the image to be recognized, and rotation can include counterclockwise rotation and clockwise rotation. Clockwise rotation can be converting the nth row of pixels in the image to be recognized to the nth column of the adjusted image, where n is the total number of rows or columns in the image to be recognized; counterclockwise rotation can be converting the nth row of the image to be recognized to the nth column of the adjusted image. And the first pixel of the nth row in the image to be recognized is the last pixel in the nth column of the adjusted image. Flipping is to obtain the adjusted image after horizontally flipping the image to be recognized.
[0139] Exemplarily, the reconstructed image can be rotated, flipped, scaled, grayscaled and / or binarized to obtain an adjusted image. In other embodiments, the reconstructed image is rotated, flipped, scaled, grayscaled and binarized in sequence to obtain an adjusted image, and the corresponding sub-recognition component is called to re-recognize the adjusted image. Since the reconstructed image can be rotated, flipped, scaled, grayscaled and binarized in sequence, the reconstructed image can be adjusted more comprehensively, thereby facilitating the improvement of the recognition success rate of the adjusted image and the improvement of the recognition efficiency of the adjusted image. For example, reference can be made to Figure 4 , Figure 4 shows schematic diagrams of rotating, horizontally flipping, vertically flipping, scaling, binarizing and gray-scaling the reconstructed image respectively; wherein TI refers to the reconstructed image, T2 refers to the image after the reconstructed image is rotated, T3 refers to the image after the reconstructed image is horizontally flipped, T4 refers to the image after the reconstructed image is vertically flipped, T5 refers to the image after the reconstructed image is scaled, T6 refers to the image after the reconstructed image is binarized, and T7 refers to the image after the reconstructed image is gray-scaled.
[0140] When the adjusted image is still not recognized successfully, or the adjusted image cannot be successfully recognized by each sub-recognition component, a prompt for re-acquiring the dot matrix QR code image can be output to prompt the user to re-shoot the dot matrix QR code image, or the first image, and re-perform distorted code point detection, distorted code point reconstruction, etc. on the dot matrix QR code image and the first image.
[0141] For a better understanding of this embodiment, please refer to Figure 5, the process of this embodiment is briefly described, including steps X10 to X52, step X10: obtaining a first image containing a dot matrix two-dimensional code, the first image can be taken by an electronic device, step X20: extracting a dot matrix two-dimensional code image from the first image, step X30: reconstructing the code points of the dot matrix two-dimensional code image to obtain a reconstructed image, specifically, determining the distorted code points in the dot matrix two-dimensional code image, reconstructing the distorted code points to obtain a reconstructed image, restoring the reconstructed image to binary, and obtaining an image to be identified; step X40: reconstructing the image Perform a two-dimensional code recognition and decoding operation, the image may include an image to be recognized and an adjusted image. For example, after obtaining the image to be recognized, step X50: perform a two-dimensional code recognition and decoding operation on the image to be recognized, step X51: if the decoding is successful, then end; step X52: if the decoding is unsuccessful, rotate, flip, scale, grayscale and binarize the reconstructed image to obtain an adjusted image, and then perform a two-dimensional code recognition and decoding operation on the adjusted image. When the decoding is successful, the process of recognizing the dot matrix two-dimensional code in the first image ends. When the decoding fails, a decoding failure prompt is output. The contrast of the dot matrix two-dimensional code displayed in the image to be recognized is greater than the contrast of the reconstructed image.
[0142] This application also provides a dot matrix two-dimensional code recognition device, please refer to Figure 6 , the device comprises:
[0143] An acquisition module 10 is used to acquire a dot matrix two-dimensional code image and determine normal code points in the dot matrix two-dimensional code image;
[0144] A detection module 20, configured to detect adjacent distorted code points of each normal code point according to each normal code point;
[0145] A reconstruction module 30, used to reconstruct the distorted code points in the dot matrix two-dimensional code image to obtain a reconstructed image;
[0146] The decoding module 40 is used to perform a two-dimensional code decoding operation on the reconstructed image.
[0147] The dot matrix two-dimensional code recognition device provided by the present application adopts the dot matrix two-dimensional code recognition method in the above-mentioned embodiment, aiming to solve the technical problem of low recognition success rate of dot matrix two-dimensional code. Compared with the prior art, the beneficial effects of the dot matrix two-dimensional code recognition method provided by the embodiment of the present application are the same as the beneficial effects of the dot matrix two-dimensional code recognition method provided by the above-mentioned embodiment, and other technical features in the dot matrix two-dimensional code recognition device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here. The embodiment of the present application provides an electronic device, which can be a playback device, and the electronic device includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that at least one processor can execute the dot matrix two-dimensional code recognition method in the above-mentioned embodiment.
[0148] Reference below Figure 7 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0149] like Figure 7 As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM) 1004. In RAM 1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM 1002, and RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device may allow the electronic device to communicate wirelessly or wired with other devices to exchange data. Although the electronic device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have instead.
[0150] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1009, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0151] The electronic device provided by the present application adopts the dot matrix two-dimensional code recognition method in the above-mentioned embodiment 1 to solve the technical problem of low recognition success rate of dot matrix two-dimensional code. Compared with the prior art, the beneficial effect of product flow data distribution provided by the embodiment of the present application is the same as the beneficial effect of the dot matrix two-dimensional code recognition method provided by the above-mentioned embodiment, and the other technical features in the dot matrix two-dimensional code recognition device are the same as the features disclosed by the above-mentioned embodiment method, which will not be repeated here. It should be understood that the various parts of the present disclosure can be implemented by hardware, software, firmware or a combination thereof. In the description of the above-mentioned embodiments, specific features, structures, materials or characteristics can be combined in a suitable manner in any one or more embodiments or examples. The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims. The present embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon, and the computer-readable program instructions are used to execute the dot matrix two-dimensional code recognition method in the above-mentioned embodiment 1. The computer-readable storage medium provided in the embodiment of the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor devices, equipment or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable EPROM (Electrical Programmable Read Only Memory) or flash memory, an optical fiber, a portable compact disk CD-ROM (compact disc read-only memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution device, device or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency, radio frequency), etc., or any suitable combination of the above. The above-mentioned computer-readable storage medium may be contained in an electronic device; it may also exist alone without being assembled into an electronic device.The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device: obtains a dot matrix two-dimensional code image and determines normal code points in the dot matrix two-dimensional code image; detects adjacent distorted code points of each normal code point according to each normal code point; reconstructs the distorted code points in the dot matrix two-dimensional code image to obtain a reconstructed image; and performs a two-dimensional code decoding operation on the reconstructed image.
[0152] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a LAN (local area network) or WAN (Wide Area Network), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0153] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based device that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0154] The modules involved in the embodiments described in the present disclosure can be implemented by software or by hardware. The name of the module does not constitute a limitation on the unit itself under certain circumstances. The computer-readable storage medium provided in the present application stores computer-readable program instructions for executing the above-mentioned dot matrix two-dimensional code recognition method, which aims to solve the technical problem of low recognition success rate of dot matrix two-dimensional code. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the embodiments of the present application are the same as the beneficial effects of the dot matrix two-dimensional code recognition method provided in the above-mentioned embodiments, which will not be repeated here.
[0155] The present application also provides a computer program product, including a computer program, which implements the steps of the dot matrix two-dimensional code recognition method as described above when the computer program is executed by a processor. The computer program product provided by the present application is intended to solve the technical problem of low recognition success rate of dot matrix two-dimensional code. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present application are the same as the beneficial effects of the dot matrix two-dimensional code recognition method provided by the above embodiment, and are not repeated here. The above is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the description and drawings of this application, or directly or indirectly used in other related technical fields, are similarly included in the patent processing scope of the present application.
Claims
1. A dot matrix two-dimensional code recognition method, characterized in that: The method includes: Acquire a dot matrix two-dimensional code image, and determine normal code points in the dot matrix two-dimensional code image; According to each of the normal code points, respectively detecting adjacent distorted code points of each of the normal code points; Reconstructing the distorted code points in the dot matrix two-dimensional code image to obtain a reconstructed image; A two-dimensional code decoding operation is performed on the reconstructed image.
2. The method according to claim 1, characterized in that The step of obtaining the dot matrix two-dimensional code comprises: Acquire a first image containing a dot matrix QR code; Calling a preset two-dimensional code extraction model to identify the outline of the dot matrix two-dimensional code in the first image; Extracting a contour image from the first image according to the contour; Based on a preset correction rule, the contour image is corrected to obtain the dot matrix two-dimensional code image.
3. The method according to claim 1, characterized in that The step of respectively detecting adjacent distorted code points of each normal code point according to each normal code point comprises: Determine the first code point position of each normal code point in the dot matrix two-dimensional code image; A preset distortion prediction model is called to detect adjacent distorted code points at each of the first code point positions based on the first code point positions.
4. The method according to claim 3, characterized in that The step of determining the first code point position of each normal code point in the dot matrix two-dimensional code image comprises: Performing filtering processing on the dot matrix two-dimensional code image to obtain a low-frequency image; Calculating the difference between each first pixel value in the dot matrix two-dimensional code image and the corresponding low-frequency pixel value in the low-frequency image to obtain a high-frequency image; Detecting the code point contours present in the high frequency image, and determining the contour positions of the code point contours; The contour position is used as the first code point position.
5. The method according to claim 3, characterized in that The step of calling a preset distortion prediction model and detecting adjacent distorted code points at each first code point position based on each first code point position comprises: Calling a preset distortion prediction model, for each first code point position, detecting at least one implicit distortion position adjacent to the first code point position according to the first code point position, and determining the distortion probability of each implicit distortion position; Among the distortion probabilities, the implicit distortion position corresponding to the target distortion probability that satisfies the preset maximum condition is taken as the target distortion position; The distorted code point adjacent to the first code point position is determined according to the target distorted position.
6. The method according to claim 1, characterized in that The step of reconstructing the distorted code points in the dot matrix two-dimensional code image to obtain a reconstructed image comprises: Calculate the code point distance between each distorted code point and the corresponding normal code point according to the target distorted position of each distorted code point in the dot matrix two-dimensional code image and the first code point position corresponding to each normal code point; Calculating the code point area of each of the distorted code points according to the code point distance corresponding to each of the distorted code points and the preset code point coefficient; According to the preset code point shape and the code point area of each distorted code point, the corresponding distorted code point is reconstructed at each target distorted position to obtain a reconstructed image.
7. The method according to claim 1, characterized in that The step of performing a two-dimensional code decoding operation on the reconstructed image comprises: Performing grayscale binarization processing on the reconstructed image to obtain an image to be identified; Calling a QR code recognition component to perform a QR code decoding operation on the image to be recognized; In the case where it is detected that the two-dimensional code recognition component fails to recognize, rotating, flipping, scaling, grayscale and / or binarization processing is performed on the reconstructed image to obtain an adjusted image; The adjusted image is decoded and identified.
8. A dot matrix two-dimensional code recognition device, characterized in that: The device comprises: An acquisition module, used to acquire a dot matrix two-dimensional code image and determine normal code points in the dot matrix two-dimensional code image; A detection module, configured to detect adjacent distorted code points of each normal code point according to each normal code point; A reconstruction module, used to reconstruct the distorted code points in the dot matrix two-dimensional code image to obtain a reconstructed image; A decoding module is used to perform a two-dimensional code decoding operation on the reconstructed image.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; Wherein, the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the dot matrix two-dimensional code recognition method described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium is a computer-readable storage medium, on which is stored a program for implementing a dot matrix two-dimensional code recognition method. The program for implementing a dot matrix two-dimensional code recognition method is executed by a processor to implement the steps of the dot matrix two-dimensional code recognition method as described in any one of claims 1 to 7.
