CN113947097B - Two-dimensional code identification method and electronic equipment - Google Patents

Two-dimensional code identification method and electronic equipment Download PDF

Info

Publication number
CN113947097B
CN113947097B CN202010830616.7A CN202010830616A CN113947097B CN 113947097 B CN113947097 B CN 113947097B CN 202010830616 A CN202010830616 A CN 202010830616A CN 113947097 B CN113947097 B CN 113947097B
Authority
CN
China
Prior art keywords
dimensional code
line
electronic device
electronic equipment
line segment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010830616.7A
Other languages
Chinese (zh)
Other versions
CN113947097A (en
Inventor
钟伟才
池育浩
王昱璇
田新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Device Co Ltd
Petal Cloud Technology Co Ltd
Original Assignee
Petal Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Petal Cloud Technology Co Ltd filed Critical Petal Cloud Technology Co Ltd
Publication of CN113947097A publication Critical patent/CN113947097A/en
Application granted granted Critical
Publication of CN113947097B publication Critical patent/CN113947097B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • G06K7/1473Methods for optical code recognition the method including quality enhancement steps error correction

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Electromagnetism (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses a two-dimensional code identification method and electronic equipment, wherein the method comprises the following steps: the electronic device acquires an image containing a two-dimensional code, wherein edge line segments of a black pixel block and a white pixel block in the two-dimensional code are bent. The electronic device builds a horizontal folding line and a vertical folding line for the two-dimensional code image, and the horizontal folding line and the vertical folding line build the two-dimensional code image into a grid chart. The electronic device divides the two-dimensional code into a plurality of lattices through the grid pattern and acquires a topological relation between each lattice (i.e., a positional relation of one lattice with other lattices, for example, adjacent). The electronic equipment reconstructs the grids into the two-dimensional code with flatness according to the acquired topological relation of the grids. Finally, the electronic device decodes the reconstructed two-dimensional code. Thus, the electronic device can accurately decode the deformed, bent or wrinkled two-dimensional code.

Description

Two-dimensional code identification method and electronic equipment
Technical Field
The application relates to the technical field of image processing, in particular to a two-dimensional code identification method and electronic equipment.
Background
Along with the development of the internet of things, the two-dimensional code is increasingly applied to life. The user can utilize the electronic equipment to scan the two-dimensional code to realize payment, information acquisition, account login and the like. Generally, a two-dimensional code image is printed or stuck on the surface of an object (such as a sharing bicycle, an article package, an electronic device, etc.) of any shape. When the surface of the object to which the two-dimensional code image is attached is uneven, curved, or wrinkled, distortion such as deformation, bending, or wrinkling of the two-dimensional code image may also occur.
When the two-dimensional code only deforms in the frame, or the edge line segment deformation of the black pixel block and the white pixel block in the two-dimensional code is consistent with the deformation direction of the frame, the two-dimensional code identification method based on the perspective principle provided by the prior art can identify the two-dimensional code. For example, the two-dimensional code shown in fig. 1A has a frame a1A2a3a4 deformed but still has flatness. In the prior art, after correcting the deformed frame a1a2a3a4 of the two-dimensional code into b1b2b3b4, the two-dimensional code can be identified and decoded.
However, when the two-dimensional code image is wrinkled, bent, deformed, or the like, so that the two-dimensional code does not have flatness, the prior art cannot correctly decode the two-dimensional code.
Therefore, how to correctly and effectively decode the two-dimensional code without flatness is a problem to be solved.
Disclosure of Invention
The application provides a two-dimensional code identification method and electronic equipment, which realize that a two-dimensional code which does not have flatness is accurately decoded.
In a first aspect, the present application provides a method for identifying a two-dimensional code, including: the electronic equipment acquires an image to be identified, wherein the image to be identified contains a first two-dimensional code image which is not flat; the first two-dimensional code consists of n x m grids; the electronic equipment detects an edge line segment in the first two-dimensional code image; the edge line segments comprise a first edge line segment in a first direction and a second edge line segment in a second direction, and the first direction is perpendicular to the second direction; the electronic equipment constructs (n+1) first-direction folding lines according to the first edge line segments, and constructs (m+1) second-direction folding lines according to the second edge line segments; the electronic device determines position information and coding information of n x m grids forming the first two-dimensional code image according to the (n+1) first direction folding lines and the (m+1) second direction folding lines; the electronic equipment constructs a two-dimensional code image according to the position information of n x m grids and the coding information, wherein the two-dimensional code image is a two-dimensional code image with flatness; and the electronic equipment decodes the two-dimensional code image and displays a decoding result.
In one possible implementation, the first direction may be a horizontal direction and the second direction may be a vertical direction. n may be equal to m.
In one possible implementation, the first two-dimensional code image is a deformed, bent or wrinkled two-dimensional code image.
According to the two-dimensional code identification method, when a user scans deformed, bent or wrinkled two-dimensional code images by using the electronic equipment area, the electronic equipment acquires the position information and the coding information of each grid in the two-dimensional code by constructing folding lines. Then, the electronic device may reconstruct a two-dimensional code having flatness according to the position information of each lattice in the two-dimensional code, the encoding information, and the topological relation between the lattices (for example, two lattices are adjacent or not adjacent). And finally, the electronic equipment decodes the reconstructed two-dimensional code and displays a decoding result. Therefore, when a user scans the deformed, bent or wrinkled two-dimensional code image by using the electronic equipment area, the electronic equipment can still display the decoding result, and the user experience is improved.
With reference to the first aspect, in one possible implementation manner, the electronic device constructs (n+1) first direction folding lines according to the first edge line segment, constructs (m+1) second direction folding lines according to the second edge line segment, and specifically includes: the electronic equipment takes a first edge line segment with the slope smaller than a first preset threshold value as a first direction target line segment and takes a second edge line segment with the slope smaller than a second preset threshold value as a second direction target line segment; the electronic device constructs (n+1) first-direction folding lines according to the first-direction target line segments, and constructs (m+1) second-direction folding lines according to the second-direction target line segments. Generally, an edge line segment in a two-dimensional code is a straight line, i.e., a slope is 0. When the two-dimensional code is inclined or deformed, bent and wrinkled to a certain extent, the edge line segments in the two-dimensional code are inclined to a certain extent. When the slope of the edge line segment is too large, the edge line segment may not be a true edge line segment in the two-dimensional code. Errors may occur due to the edge segment detection by the electronic device. In this way, the wrong edge line segments can be reduced, so that the electronic device can recognize the two-dimensional code more readily.
In one possible implementation, the first preset threshold may be equal to the second preset threshold.
With reference to the first aspect, in one possible implementation manner, the electronic device constructs (n+1) first direction folding lines according to the first direction target line segment, constructs (m+1) second direction folding lines according to the second direction target line segment, and specifically includes: the electronic equipment divides the first two-dimensional code image into R first intervals and L second intervals; r, L is a positive integer; r is smaller than n, L is smaller than m; the electronic equipment constructs one or more first direction folding lines according to the first direction target line segments in each first interval, and the sum of the numbers of the first direction folding lines in the R first intervals is (n+1); and constructing one or more second direction folding lines according to the second direction target line segments in each second interval, wherein the sum of the numbers of the second direction folding lines in the L second intervals is (m+1). Dividing the two-dimensional code image into smaller areas, wherein the deformation, bending and wrinkling degrees or directions of the target line segments in one area are consistent. Thus, the two-dimensional code can be reconstructed more accurately.
In one possible implementation, R may be equal to L.
With reference to the first aspect, in a possible implementation manner, the electronic device constructs one or more first direction fold lines according to the first direction target line segment in each first interval, and specifically includes: the electronic equipment constructs a first direction broken line by two or more first direction target line segments with the first projection distance smaller than a first preset distance in a first interval; the first projection distance is the projection of the central point connecting line of two adjacent first direction target line segments in the first interval on a first vector, the first vector is the normal vector of a first unit vector, and the first unit vector is determined according to the line segment length and the inclination angle of the first direction target line segments in the first interval.
With reference to the first aspect, in a possible implementation manner, the electronic device constructs one or more second direction fold lines according to the second direction target line segments in each second interval, and specifically includes: the electronic equipment constructs a second direction broken line by using two or more second direction target line segments of which the second projection distance is smaller than a second preset distance in the first second interval; the second projection distance is the projection of the central point connecting line of two adjacent second direction target line segments in the second section on a second vector, the second vector is the normal vector of a second unit vector, and the second unit vector is determined according to the line segment length and the inclination angle of the second direction target line segments in the second section.
With reference to the first aspect, in one possible implementation manner, after the electronic device constructs (n+1) first direction folding lines according to the first edge line segment and constructs (m+1) second direction folding lines according to the second edge line segment, the method further includes: the electronic equipment determines a first error folding line and a second error folding line which do not meet preset conditions in the first direction folding line and the second direction folding line; the electronic equipment constructs a first direction broken line of the second target line segment according to the first average inclination angle of the first target line segment, and constructs a second direction broken line of the fourth target line segment according to the second average inclination angle of the third target line segment.
The first target line segment is a first direction target line segment for constructing a first broken line, the first broken line is a first direction broken line adjacent to the first error broken line, and the second target line segment comprises a plurality of first edge line segments in a first section where the first error broken line is located.
The third target line segment is a second direction target line segment for constructing a second broken line, the second broken line is a second direction broken line adjacent to the second error broken line, and the fourth target line segment is a plurality of second edge line segments in a second section where the second error broken line is located.
Thus, the electronic device can correct the error folding line and reconstruct the edge line segment of the area where the error folding line is located into the correct folding line.
In one possible implementation, the preset conditions include: the distance between adjacent first direction folds is in a first distance interval and the distance between adjacent second direction folds is in a second distance interval.
In one possible implementation, the first distance interval is determined by the median of the distances of all adjacent first direction fold lines; the second distance interval is determined by the median of the distances of all adjacent second direction fold lines.
With reference to the first aspect, in one possible implementation manner, the electronic device constructs a second target line segment into the first direction polyline according to a first average inclination angle of the first target line segment, and specifically includes: the electronic equipment performs coordinate transformation on a first coordinate of a central point on the second target line segment according to the first average inclination angle to obtain a second coordinate; and the electronic equipment constructs two or more second target line segments of which the longitudinal coordinate difference value of the second coordinates belongs to the first distance interval into a first direction broken line.
With reference to the first aspect, in a possible implementation manner, the electronic device constructs a fourth target line segment into the second direction fold line according to a second average inclination angle of the third target line segment, and specifically includes: the electronic equipment performs coordinate transformation on the third coordinate of the center point on the fourth target line segment according to the second average angle to obtain a fourth coordinate; and the electronic equipment constructs two or more fourth target line segments of which the longitudinal coordinate difference value of the fourth coordinate belongs to the second distance interval into a second direction broken line.
With reference to the first aspect, in one possible implementation manner, the n×m lattices include a first lattice; the position information and the code information of the first lattice are determined as follows: the electronic equipment determines the position information of the first grid according to the intersection points of the first folding line and the second folding line with the third folding line and the fourth folding line respectively; the first direction folding line comprises a first folding line and a second folding line, and the first folding line is adjacent to the second folding line; the second direction fold line comprises a third fold line and a fourth fold line; the third folding line is adjacent to the fourth folding line; the electronic equipment determines the coding information of the first grid according to the proportion of the pixels in the first grid; the pixels in the first lattice are pixels in a range determined in the first two-dimensional code image according to the position information of the first lattice.
With reference to the first aspect, in one possible implementation manner, the determining, by the electronic device, location information of the first grid according to intersection points of the first fold line and the second fold line with the third fold line and the fourth fold line, where the determining includes: the electronic equipment determines the coordinates of a first intersection point of the first folding line and the third folding line; the electronic equipment determines the coordinates of a second intersection point of the first folding line and the fourth folding line; the electronic equipment determines the coordinates of a third intersection point of the second folding line and the third folding line; the electronic equipment determines the coordinates of a fourth intersection point of the second folding line and the fourth folding line; the first intersection point, the second intersection point, the third intersection point and the fourth intersection point are four vertexes of the first lattice.
With reference to the first aspect, in a possible implementation manner, the determining, by the electronic device, coordinates of a first intersection point of the first fold line and the third fold line specifically includes: the electronic equipment converts the first folding line into a first rectangle, and converts the third folding line into a second rectangle; the electronic device determines an intersecting rectangle of the first rectangle and the second rectangle; the electronic device determining one or more first coordinate points on the first fold line and on the third fold line within the intersecting rectangle; and the electronic equipment determines the coordinates of a first intersection point of the first broken line and the third broken line according to the one or more first coordinate points.
With reference to the first aspect, in one possible implementation manner, the determining, by the electronic device, encoding information of the first grid according to a proportion of pixels at the first grid in the first two-dimensional code image specifically includes: if the proportion of the pixels in the first grid is greater than or equal to a preset proportion, the electronic equipment determines that the coding information of the first grid is a first preset number; if the proportion of the pixels in the first grid is smaller than the preset proportion, the electronic equipment determines that the coding information of the first grid is a second preset number.
In one possible implementation, the preset proportion is 50%.
In one possible implementation, the pixel is a black pixel.
In a second aspect, the present application provides an electronic device comprising one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, the one or more memories being configured to store computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform the method of two-dimensional code identification in any of the possible implementations of the first aspect described above.
In a third aspect, embodiments of the present application provide a computer storage medium including computer instructions that, when executed on an electronic device, cause a communication apparatus to perform a method of two-dimensional code recognition in any one of the possible implementations of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer program product, which when run on a computer causes the computer to perform the method of two-dimensional code recognition in any one of the possible implementations of the first aspect.
Drawings
Fig. 1A is a schematic diagram of two-dimensional code recognition based on perspective principle according to an embodiment of the present application;
fig. 1B is a schematic diagram of a two-dimensional code according to an embodiment of the present application;
fig. 2 is a schematic diagram of two-dimensional code construction provided in an embodiment of the present application;
fig. 3 is a flow chart of a two-dimensional code recognition method provided in the prior art;
fig. 4 is a flowchart of a method for identifying a two-dimensional code according to an embodiment of the present application;
fig. 5 is a schematic diagram of a user interface for scanning a two-dimensional code according to an embodiment of the present application;
fig. 6 is a schematic diagram of a two-dimensional code image according to an embodiment of the present application;
fig. 7 is a schematic diagram of a horizontal target line segment in a two-dimensional code according to an embodiment of the present application;
fig. 8 is a schematic diagram of a vertical target line segment in a two-dimensional code according to an embodiment of the present application;
FIG. 9A is a schematic diagram of a horizontal segment according to an embodiment of the present disclosure;
FIG. 9B is a schematic view of a vertical section according to an embodiment of the present disclosure;
FIG. 9C is a schematic diagram of a target segment according to an embodiment of the present disclosure;
FIG. 9D is a schematic diagram illustrating calculation of projection distances of two reticle segments according to an embodiment of the present application;
fig. 10 is a schematic view of a horizontal broken line in a two-dimensional code according to an embodiment of the present application;
fig. 11 is a schematic view of a vertical folding line in a two-dimensional code according to an embodiment of the present application;
fig. 12 is a schematic diagram of a horizontal error broken line in a two-dimensional code according to an embodiment of the present application;
fig. 13 is a schematic diagram of a vertical direction error broken line in a two-dimensional code according to an embodiment of the present application;
fig. 14 is a schematic view of a projection histogram according to an embodiment of the present application;
FIG. 15 is a schematic view of a corrected horizontal polyline provided in an embodiment of the present application;
FIG. 16 is a schematic illustration of a corrected vertical polyline provided in an embodiment of the present application;
fig. 17 is a two-dimensional code raster pattern provided in an embodiment of the present application;
fig. 18 is a schematic diagram of intersection points of horizontal fold lines and vertical fold lines in a two-dimensional code according to an embodiment of the present application;
FIG. 19 is a schematic diagram of solving intersection points of a horizontal polyline and a vertical polyline according to an embodiment of the present disclosure;
fig. 20 is a schematic diagram of a grid in a two-dimensional code according to an embodiment of the present application;
Fig. 21 is a schematic diagram of a two-dimensional code after reconstruction according to an embodiment of the present application;
FIG. 22 is a schematic diagram of a user interface provided in an embodiment of the present application;
fig. 23 is a schematic flow chart of reconstructing a curved two-dimensional code by an electronic device according to an embodiment of the present application;
fig. 24 is a schematic flow chart of reconstruction of a two-dimensional code of a crease of an electronic device according to an embodiment of the present application;
fig. 25 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
The following description will be given in detail of the technical solutions in the embodiments of the present application with reference to the accompanying drawings. Wherein, in the description of the embodiments of the present application, "/" means or is meant unless otherwise indicated, for example, a/B may represent a or B; the text "and/or" is merely an association relation describing the associated object, and indicates that three relations may exist, for example, a and/or B may indicate: the three cases where a exists alone, a and B exist together, and B exists alone, and in addition, in the description of the embodiments of the present application, "plural" means two or more than two.
The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
Concepts, such as flatness, to which embodiments of the present application relate are explained first.
(1) Flatness of
In the embodiment of the application, flatness refers to that an edge line segment of a two-dimensional code and an edge line segment of a black pixel block and a white pixel block in the two-dimensional code are still straight after being scanned by electronic equipment. And, the relative positions of a plurality of edge line segments of the black pixel block and the white pixel block in the two-dimensional code are kept unchanged.
(2) Edge line segment
In the embodiment of the application, the edge line segments of the two-dimensional code and the edge line segments of the black pixel block and the white pixel block in the two-dimensional code are all called edge line segments. As shown in fig. 1B, the line segment 10a and the line segment 10c are both edge line segments of the two-dimensional code. The line segment 10b is an edge line segment of the black pixel block and the white pixel block.
(3) Position information
In this embodiment of the present application, the position information of each grid in the two-dimensional code image refers to positions of four vertices of each grid in the two-dimensional code image. It is understood that the two-dimensional code image is composed of n×m lattices. In the embodiments of the present application, n and m may be equal. In the embodiment of the present application, one pixel block is one of n×m lattices of the two-dimensional code image. A pixel block may include a black pixel block or a white pixel block.
The code system that two-dimensional code is commonly used has: quick Response (QR) codes, data Matrix (DM), AZTEC (AZTEC), etc. Each code has its specific character set; each character occupies a certain width; has a certain checking function and the like. Meanwhile, the method has the characteristics of automatic identification function for information of different rows, capability of processing graphic rotation change and the like. The two-dimensional codes can be divided into various types of two-dimensional codes according to different code systems, such as QR codes, DM codes, AZTC codes and the like. The identification process of the two-dimensional code is described below by taking the QR code as an example.
1. QR code constitution
Fig. 2 exemplarily shows a schematic structural diagram of a QR code. As shown in fig. 2, the QR code is composed of symbols such as a position-detecting image 201, a position-detecting image 202, a position-detecting image 203, format information 204, format information 205, format information 206, version information 207, version information 208, positioning pattern 209, positioning pattern 210, correction pattern 211, correction pattern 212, correction pattern 213, correction pattern 214, correction pattern 215, correction pattern 216, position-detecting pattern separator 217, and some data (not shown) and error correction code words (not shown).
The position detection image 201, the position detection image 202, and the position detection image 203 are used to determine a rectangular area where the two-dimensional code is located.
The positioning graph 209 and the positioning graph 210 are used for determining two-dimensional code coordinates.
The position detection pattern separator 217 is used to separate the position detection image 201, the position detection image 202, and the position detection image 203 from other symbols.
The correction patterns 211, 212, 213, 214, 215, and 216 are used for aligning the two-dimensional code patterns and correcting the two-dimensional code.
The format information 204, the format information 205, and the format information 206 are used for storing format information of the two-dimensional code, for example, a coding format of the two-dimensional code.
The version information 207 and the version information 208 include version information and error correction related information. The two-dimensional codes of different versions are mainly different in modules for storing data (each black/white block is a module).
2. QR code identification process
(1) Image preprocessing
After the electronic equipment acquires the first image containing the two-dimensional code, preprocessing the first image. The pretreatment may include one or more of graying treatment, denoising treatment, binarizing treatment, swelling treatment, and etching treatment.
The specific procedures of the graying process and the denoising process may refer to the prior art, and will not be described herein.
The binarization processing is a processing mode in which the gradation value of each pixel block in an image is set to a first value or a second value (the first value and the second value may be different greatly, so that distinction is facilitated). After binarization processing, the image only comprises two pixel blocks with larger gray value difference. For example, the electronic device may determine whether the gray value of each pixel block in the binarized image is greater than a preset threshold value when performing the binarization processing. When the electronic device determines that the gradation value of a certain pixel block is greater than or equal to the preset threshold value, the electronic device may set the pixel block to white (the gradation value of white is 255 in 256 gradations). When the electronic device determines that the gradation value of a certain pixel block is smaller than the preset threshold value, the electronic device may set the pixel block to black (the gradation value of black is 0 in 256-level gradation). Until the electronic device completes processing each pixel block in the image. The binarized image may be referred to as a binarized image.
The particular operation of the dilation process is to scan each element in the binarized image with one structural element (typically 3 x 3 in size), convolve each pixel with its covered pixels with a pixel of the structural element, which is 0 if both are 0, and 1 otherwise. In other words, when the structural element traverses to a certain position in the binarized image, all the surroundings thereof are black, and remain black, otherwise become white.
The specific operation of the erosion process is to scan each element in the binarized image with one structural element (typically 3 x 3 in size), convolve each pixel of the structural element with its covered pixel, which is 1 if both are 1, otherwise 0. In other words, the structural element is fully white around it when traversing to a certain position in the binarized image, remains white, otherwise turns black.
The electronic device may perform the expansion process on the binary image first and then perform the etching process. This fills in small voids in the object in the image and smoothes the object boundary. The electronic device may also perform the corrosion treatment and then the expansion treatment on the binary image. This eliminates fine noise in the image and smoothes the object boundary.
Preprocessing the first image by the electronic device may improve the quality of the first image and reduce the impact of noise (e.g., illumination) in the environment.
(2) Positioning
And the electronic equipment positions the two-dimensional code in the preprocessed first image. First, the electronic device locates a position detection pattern of the two-dimensional code (e.g., a position detection image 201, a position detection image 202, a position detection image 203 shown in fig. 2). The electronic device can determine the area of the two-dimensional code in the first image according to the position detection pattern.
(3) Decoding
The electronic device decodes the data according to the encoding format information (for example, format information 204, format information 205, format information stored in the format information shown in fig. 2) and the error correction code of the two-dimensional code, and obtains decoding results (for example, web addresses, personal business cards, commodity prices, and the like).
When the two-dimensional code scanned by the electronic device cannot maintain flatness, the electronic device cannot recognize each module (e.g., black pixel block, white pixel block) and symbol (e.g., position detection pattern, format information, correction pattern, positioning pattern, etc.) in the two-dimensional code. Thus, the electronic device cannot decode the two-dimensional code correctly.
In one possible implementation manner of the prior art, the two-dimensional code identification method based on the perspective principle provided in the prior art may include: the electronic device firstly preprocesses a first image, wherein the first image contains a two-dimensional code. And then, the electronic equipment positions and rotationally corrects the two-dimensional code in the first image according to the frame characteristics of the two-dimensional code. The electronic equipment divides the two-dimension code, and decodes the two-dimension code after acquiring the sampling information of the two-dimension code. The method can be specifically referred to as a method flow chart of two-dimensional code identification shown in fig. 3. As shown in fig. 3, taking a DM code as an example, the preprocessing of the first image by the electronic device may include: 1. graying, filtering, binarizing, filtering, and extracting edges. The above image preprocessing method can refer to the prior art, and will not be described herein. The electronic device locating the first image may include: 5. the initial positioning, i.e. the electronic device locates the position of the DM code in the first image. 6. And detecting the straight line, namely detecting the straight line in the DM code by the electronic device. The method for dividing the DM code by the electronic device specifically comprises the steps that the electronic device respectively projects the DM code in the horizontal direction and the vertical direction, respectively obtains a horizontal dividing line and a vertical dividing line, and then divides the DM code by the horizontal dividing line and the vertical dividing line.
The method in the prior art is only suitable for scenes in which the two-dimensional code image can keep flatness. When the two-dimensional code is deformed or bent, a frame line segment or an edge line segment of the black pixel block and the white pixel block in the two-dimensional code is bent or deformed, and flatness cannot be maintained. The electronic device cannot correctly judge that each pixel block of the two-dimensional code is a black pixel block or a white pixel block, so that the electronic device cannot correctly recognize the two-dimensional code.
Aiming at the problem that electronic equipment in the prior art cannot correctly identify the two-dimensional code without flatness, the embodiment of the application provides a two-dimensional code identification method. The method comprises the following steps: the electronic equipment acquires an image to be identified, wherein the image to be identified contains a first two-dimensional code image which is not flat; the first two-dimensional code consists of n x m grids; the electronic equipment detects an edge line segment in the first two-dimensional code image; the edge line segments comprise a first edge line segment in a first direction and a second edge line segment in a second direction, and the first direction is perpendicular to the second direction; the electronic equipment constructs (n+1) first-direction folding lines according to the first edge line segments, and constructs (m+1) second-direction folding lines according to the second edge line segments; the electronic device determines position information and coding information of n x m grids forming the first two-dimensional code image according to the (n+1) first direction folding lines and the (m+1) second direction folding lines; the electronic equipment constructs a two-dimensional code image according to the position information of n x m grids and the coding information, wherein the two-dimensional code image is a two-dimensional code image with flatness; and the electronic equipment decodes the two-dimensional code image and displays a decoding result.
The following describes a two-dimensional code identification method provided by the embodiment of the application with reference to the accompanying drawings. Referring to fig. 4, fig. 4 is a schematic flow chart of a two-dimensional code recognition method provided in an embodiment of the present application. As shown in fig. 4, taking an AZTEC code as an example, a method for identifying a two-dimensional code provided in the embodiments of the present application may include:
s101, the electronic device acquires a first image containing a two-dimensional code image.
The electronic device may obtain a first image including the two-dimensional code. The electronic device may acquire the first image through the camera, or may acquire the first image in a gallery of the electronic device. The first image contains a two-dimensional code image.
It is understood that the image to be identified in the embodiment of the present application may include the first image. The two-dimensional code image included in the first image may be referred to as a first two-dimensional code image.
In one possible implementation, the electronic device may receive an operation that a user triggers two-dimensional code recognition, and in response to the operation, the electronic device obtains a first image that includes the two-dimensional code. The operation of triggering the two-dimensional code recognition by the user can be various, for example, the operation of triggering the two-dimensional code recognition by the user can be that the user clicks a two-dimensional code recognition key in the electronic equipment. The two-dimensional code recognition key may include a swipe key in various applications. The operation of triggering the two-dimensional code recognition by the user may be that the user inputs a voice command for recognizing the two-dimensional code to the electronic device. And are not limited herein. In response to the user operation, the electronic device may enter the two-dimensional code recognition interface 200 as shown in fig. 5. The electronic device can continuously acquire the first image through the camera, and the first image can be displayed in the two-dimensional code identification interface.
Fig. 5 is a schematic diagram of an electronic device 100 acquiring an image at a two-dimensional code scanning interface 200. As shown in fig. 5, the two-dimensional code scanning interface 200 shown in fig. 5 may include a control 201, a scan box 202, a gallery icon 203, and a flashlight icon 204. The control 201 is used for returning to the previous interface of the scanned two-dimensional code/bar code interface. The scan box 202 is used to display an image scanned by a camera, such as image 205 shown in fig. 10. The image 205 may be the first image in embodiments of the present application. The gallery icon 203 is used by the user to select an image in the gallery of the electronic device 100. The user may click on the gallery icon 203, and in response to this operation, the electronic device 100 may display the image saved in the gallery. The user may select the images stored in the gallery to scan. Flashlight icon 204 the user turns on the flashlight of electronic device 100. When the environment in which the electronic device captures an image is dark and the camera cannot clearly capture the image, the user may click on the flashlight icon 204 to turn on the flashlight.
Generally, a two-dimensional code is composed of n×m lattices (each lattice may be circular, square, or the like). n may be equal to m, and specific values of n and m are not limited herein. The embodiments of the present application are described by taking n and m as the same examples. For example, the AZTEC code in the image 205 shown in fig. 5 in the embodiment of the present application is composed of a grid of 27 x 27 squares. That is, the electronic device has 27 rows of lattices, and 27 lattices in each row are stacked. When the two-dimensional code maintains flatness, each row of lattices in the horizontal direction in the two-dimensional code should be on a straight line, and each row of lattices in the vertical direction should be on a straight line. Each cell is a block of pixels. If the bin binary coded information is 0, the color of the bin is black, and the bin with the color of black is referred to as a black pixel block in the embodiment of the present application. If the bin binary coded information is 1, the bin color is white, and the bin with the white color is referred to as a white pixel block in the embodiment of the present application.
It is understood that the encoded information in the two-dimensional code is not limited to 0 or 1, and the encoded information may be a first preset number and a second preset number. When the encoded information of the lattice is a first preset number, the color of the lattice is a first color (e.g., white). When the encoded information of the lattice is a second preset number, the color of the lattice is a second color (e.g., black).
In one scenario, the two-dimensional code is a curved, deformed or wrinkled two-dimensional code, that is, edge line segments of black pixel blocks and white pixel blocks in the two-dimensional code do not have flatness. When the two-dimensional code is bent, deformed or wrinkled, lattices in the same row in the two-dimensional code may not be on a straight line.
S102, the electronic equipment preprocesses the first image.
The electronic device may pre-process the first image including performing one or more of a binarization process, a graying process, an expanding process, a corrosion process on the first image. Reference is specifically made to the above description of preprocessing, and no further description is given here. The electronic device can extract the two-dimensional code image contained in the first image through preprocessing. For example, after the image 205 shown in fig. 5 is preprocessed, a two-dimensional code image as shown in fig. 6 can be extracted. The two-dimensional code image shown in fig. 6 may be a first two-dimensional code image in the embodiment of the present application. As shown in fig. 6, edge line segments of the black pixel block and the white pixel block in the first two-dimensional code image are curved, deformed, and the deformed directions are not uniform, and do not have flatness.
In one possible implementation, preprocessing the first image of the electronic device further includes filtering and amplifying the first image. The method for filtering the first image by the electronic device may be various, for example, a bilateral filtering method, and in particular, reference may be made to the prior art, which is not described herein. The electronic device may also amplify the first image by using a plurality of methods, for example, a nearest neighbor interpolation algorithm, and specific reference may be made to the prior art, which is not described herein. Thus, the interference of noise on the two-dimensional code image can be reduced, and the edge information (such as edge line segments) of the two-dimensional code can be enhanced.
In one possible implementation manner, after the electronic device preprocesses the first image, decoding the two-dimensional code image in the first image, and if the decoding is successful, displaying a decoding result. If the decoding fails, step S103-step S106 are performed.
In the embodiment of the present application, step S102 may not be performed, that is, the electronic device does not perform the operation of preprocessing the first image.
S103, the electronic equipment builds a folding line in the two-dimensional code.
The electronic device may divide the two-dimensional code into a plurality of areas. When the two-dimensional code is distorted (such as deformed, bent, wrinkled and the like), the electronic equipment can more accurately determine the distorted area in the two-dimensional code. And the subsequent electronic equipment is convenient to correct the distorted region in the two-dimensional code.
In one possible implementation manner, the electronic device dividing the two-dimensional code may include the following steps:
1. the electronic equipment detects edge line segments (edge line segments of black pixel blocks and white pixel blocks and edge line segments of the two-dimensional code) in the two-dimensional code, and determines a target line segment from the edge line segments of the two-dimensional code, wherein the target line segment is the edge line segment meeting preset conditions.
Fig. 7 illustrates a target line segment in a horizontal direction in a two-dimensional code image. As shown in fig. 7, the black line segment in the figure is a target line segment in the horizontal direction in the two-dimensional code image detected by the electronic device. Fig. 8 exemplarily shows a target line segment in a vertical direction in a two-dimensional code image. As shown in fig. 8, the black line segment in fig. 8 is a target line segment in the vertical direction in the two-dimensional code image detected by the electronic device. The two-dimensional code shown in fig. 7 and 8 is an AZTEC code. In the embodiment of the present application, the horizontal direction may be referred to as a first direction, and the vertical direction may be referred to as a second direction. The first direction may be a horizontal direction or other directions. The second direction may be a vertical direction or other directions. The first direction is perpendicular to the second direction, and specific directions of the first direction and the second direction are not limited in this embodiment of the present application. The edge line segment in the horizontal direction may be referred to as a first edge line segment. The edge line segment in the vertical direction may be referred to as a second edge line segment. The horizontal-direction target line segment may be referred to as a first-direction target line segment, and the vertical-direction target line segment may be referred to as a second-direction target line segment.
In one possible implementation, the preset condition may be that the slope of the edge line segment is less than a preset threshold. That is, the electronic device may detect all edge line segments in the horizontal direction and the vertical direction in the two-dimensional code image through a line detection algorithm, and then use a line segment with a slope smaller than a preset threshold value of the edge line segment as a target line segment. It is understood that the electronic device may be preconfigured with the preset threshold. In this embodiment of the present application, the preset threshold of the edge line segment in the horizontal direction may be referred to as a first preset threshold, and the preset threshold of the edge line segment in the vertical direction may be referred to as a second preset threshold. The first preset threshold may be equal to the second preset threshold. The specific values of the first preset threshold and the second preset threshold are not limited in the embodiment of the application. The electronic device can detect the slopes of all edge line segments in the horizontal direction and the vertical direction in the two-dimensional code image. Generally, a two-dimensional code having flatness, the slope of a line segment in the two-dimensional code approaches 0. When the slope of the edge line segment exceeds a preset threshold, the edge line segment is an error line segment detected by the electronic equipment. I.e., the line segment may not be the correct edge line segment in the two-dimensional code image. Therefore, the electronic equipment only takes the line segment with the slope smaller than the preset threshold value as the target line segment, and some error line segments can be eliminated.
Further, the electronic device may merge two target line segments having a distance less than a distance threshold and a slope having a difference absolute value less than a first threshold into one line segment. In this way, the repetitive line segments can be reduced.
2. The electronic device clusters the target line segments into polylines.
The electronic device clusters the target line segments in the horizontal direction into polylines in the horizontal direction, which may be referred to as first-direction polylines. The electronic device clusters the vertically oriented target line segments into vertically oriented polylines, which may be referred to as second-orientation polylines.
In one possible implementation, the electronic device divides the first two-dimensional code image into R first intervals and L second intervals; r, L is a positive integer, R is less than n, L is less than m; the electronic equipment constructs one or more first direction folding lines according to the first direction target line segments in each first interval, and the sum of the numbers of the first direction folding lines in the R first intervals is (n+1); and constructing one or more second direction folding lines according to the second direction target line segments in each second interval, wherein the sum of the numbers of the second direction folding lines in the L second intervals is (m+1). R and L may be equal.
For example, let R and L equal 2. Fig. 9A exemplarily shows a schematic diagram of a horizontal section in a first two-dimensional code image when r=2. When r=2, the first two-dimensional code image is divided into two first sections. Each first interval comprises a plurality of target line segments. Fig. 9B exemplarily shows a schematic view of a vertical section in the first two-dimensional code image when l=2. When l=2, the first two-dimensional code is divided into two second sections. Each second interval comprises a plurality of target line segments. For example, fig. 9A shows a two-dimensional code with 27 x 27 grids, that is, n=m=27, and then the number of broken lines that can be constructed by the target line segments in the R horizontal sections is 28. When r=2, the target line segments in the 2 first intervals may respectively construct 14 polylines.
The values of R and L are related to the pixel values of the two-dimensional code image and the number of target line segments. In one possible implementation, the larger the pixel value of the two-dimensional code image, the greater the number of target line segments, and the larger the values of R and L. In one possible implementation, R and L are fixed values configured for the electronic device, e.g., R, L may be equal to 12. And are not limited herein.
It will be appreciated that the larger the value of R, the more first segments, and that the direction of deformation, bending or wrinkling of the target line segment in each first segment is consistent.
Taking the example that the electronic device clusters the target line segments in the horizontal direction as the broken lines in the horizontal direction, the electronic device clustering the target line segments into the broken lines specifically may include:
(1) Dividing the interval.
As described above, in the first two-dimensional code composed of 27×27 lattices, the two-dimensional code may be divided into 12 (i.e., r=12) first sections. Each first interval range (e.g., height and width) may be determined from the endpoint coordinates of the target line segment.
In one possible example, the target line segment may be represented by the end point coordinates of the line segment. Illustratively, one target line segment in the horizontal direction shown in fig. 9A, i.e., target line segment L2, may be represented as [ (x 0, y 0), (x 1, y 1) ]. (x 0, y 0) represents the left end point of the target line segment L2 (i.e., point a in fig. 9A), and (x 1, y 1) represents the right end point of the target line segment L2 (i.e., point B in fig. 9A). Taking a target line segment in the horizontal direction as an example, the electronic device may divide the two-dimensional code into R first intervals, where R is a positive integer. As shown in fig. 9A, there are two first intervals. And the electronic equipment clusters the target line segments in each first interval into broken lines. In this way, the deformation, bending or wrinkling directions of the target line segments in each first interval are consistent, and the electronic equipment can reconstruct the two-dimensional code more accurately according to the folding lines in the first interval.
In one possible implementation, the electronic device may divide the first interval according to the target line segment. The height of each first interval may be the difference between the maximum value and the minimum value of the y coordinates of the end points of the horizontal direction target line segment divided by the number of first intervals (i.e., divided by R). For example, if the target line segments in the horizontal direction are [ (60.98, 23.16), (71.08, 23.95) ], [ (155, 36.46), (263.04, 46.04) ], [ (68.01, 47.72), (100, 48.9) ]. The maximum and minimum values of the y-coordinate are 648.64, 23.16, respectively. Then, the height of the first interval may be (648.64-23.16)/R. The length of the first section is the difference between the maximum value and the minimum value of the x-coordinate of the end point of the horizontal direction target line segment. And the electronic equipment clusters the target line segments in each first interval into broken lines.
It can be understood that the above-mentioned manner of dividing the electronic device into sections is to divide all the target line segments into a plurality of sets. The electronic device determines a target line segment with two endpoint coordinates. The electronic device may obtain the endpoint coordinates of all the target line segments. The electronic device may then divide these endpoint coordinates into a plurality of intervals, each interval including one or more target line segments.
It can be understood that the electronic device may also divide the original two-dimensional code image into the sections directly by averaging, which is not limited in the specific manner of dividing the sections.
(2) And clustering the target line segments in each interval into broken lines.
Further, in one possible implementation, the electronic device clustering the target line segments within each interval (the first interval or the second interval) into polylines may include the following steps:
A. the electronic device obtains a weighted average angle alpha according to the length and the inclination angle of each line segment, and obtains a corresponding unit vector v=sinα+cos α.
For example, assume that there are 3 target line segments L1, L2, and L3 in a first interval. As shown in fig. 9C, the target line L1 has a length d1 and an inclination angle α1. The target line L2 has a length d2 and an inclination angle α2. The target line segment L3 has a length d3 and an inclination angle α3. Then the weighted average angle α= (d1α1+d2α2+d3α3)/(d1+d2+d3). The electronic device may then determine the unit vector v=sinα+cos α for the first interval from the weighted average angle of the first interval. The projected distance between every two reticle segments in the first interval may be calculated from the unit vector v.
The target line segment L1 shown in fig. 9C may be the target line segment L1 in fig. 9A. The target line segment L2 shown in fig. 9C may be the target line segment L2 in fig. 9A. The target line segment L3 shown in fig. 9C may be the target line segment L3 in fig. 9A.
B. The electronic device calculates the projection distance d of the midpoint connecting line of any two marking lines in the first interval on the normal vector of the unit vector v.
Fig. 9D illustrates the projected distance D of the midpoint of the target line segment connecting on the normal vector of the unit vector v. As shown in fig. 9D, fig. 9D includes a target line segment L2 and a target line segment L3, and a unit vector v in the first section. The center point line m is a line segment connecting the midpoint of the target line segment L2 and the midpoint of the target line segment L3. The electronic device may obtain the projected distance d of the center point join line m to the normal vector of the unit vector v. The target line segment L2 and the target line segment L3 shown in fig. 9D are the target line segment L2 and the target line segment L3 shown in fig. 9A.
C. The electronic equipment clusters two marked lines with the projection distance d smaller than the preset distance into broken lines.
The electronic device may be configured with a preset distance. If D is smaller than the preset distance, the electronic device may cluster the target line segment L2 and the target line segment L3 in fig. 9D into a polyline. For example, the target line segment L2 and the target line segment L3 in fig. 9D may be clustered into a broken line C2 as shown in fig. 9C. I.e., the right end point of the target line segment L2 and the left end point of the target line segment L3 are connected to form a broken line.
In one possible implementation manner, the electronic device constructs a first direction polyline from two or more first direction target line segments with a first projection distance smaller than a first preset distance in a first interval; the first projection distance is the projection of the central point connecting line of two adjacent first direction target line segments in the first interval on a first vector, and the first vector is the normal vector of the first unit vector; the first unit vector is determined according to the length and the inclination angle of a first direction target line segment in the first section; the electronic equipment constructs a second direction broken line by using two or more second direction target line segments of which the second projection distance is smaller than a second preset distance in a second interval; the second projection distance is the projection of the central point connecting line of two adjacent target line segments in the second direction in the second interval on a second vector, and the second vector is the normal vector of the second unit vector; the second unit vector is determined according to the line segment length and the inclination angle of the second direction target line segment in the second section.
In this embodiment of the present application, the first preset distance may be equal to the second preset distance. The specific values of the first preset distance and the second preset distance are not limited.
It can be understood that the projection distance between the target line segment L2 and the left adjacent target line segment L1 is smaller than the preset distance, and the target line segment L2 and the target line segment L1 may form the fold line C1. The projection distance between the target line segment L2 and the target line segment L3 adjacent to the right is smaller than the preset distance, and the target line segment L2 and the target line segment L3 may form a fold line C2. The fold line C1 and the fold line C2 may constitute one continuous fold line C (the fold line C shown in fig. 10).
According to the method, the electronic equipment can cluster all target line segments in the horizontal direction and the vertical direction into the broken line. It can be understood that the target line segments detected in the same row of lattices in a general two-dimensional code are clustered into a broken line. Fig. 10 exemplarily shows a horizontal fold line in a two-dimensional code. The polyline shown in FIG. 10 is a target line segment illustrated in FIG. 7. Specifically, the electronic device may cluster the target line segments shown in fig. 7 into the polylines shown in fig. 10 according to the above-described method of clustering target line segments into polylines. Fig. 11 exemplarily shows a broken line in a vertical direction of the two-dimensional code. The polyline shown in FIG. 11 is a target line segment illustrated in FIG. 8. Specifically, the electronic device may cluster the target line segments shown in fig. 8 into the polylines shown in fig. 11 according to the above-described method of clustering target line segments into polylines.
The electronic device builds a horizontal polyline and a vertical polyline. Under the condition that errors do not occur on the horizontal folding lines and the vertical folding lines constructed by the electronic equipment, the electronic equipment can determine a grid in the two-dimensional code according to the two adjacent horizontal folding lines and the two adjacent vertical folding lines. Thus, the electronic device can determine each grid in the two-dimensional code according to the broken line. And then the electronic equipment reconstructs each determined grid into the two-dimensional code with flatness. Here, specific reference may be made to the description in step S105, which is not described in detail here.
However, if some target line segments are classified as being wrong or missing when the electronic device constructs the target line segments into the polylines, the polylines constructed in the areas in the two-dimensional code may be wrong or missing. In order to reduce occurrence of errors or deletions of the broken lines constructed in the area of the two-dimensional code, the electronic device corrects the broken lines constructed in the two-dimensional code, that is, the electronic device executes step S104.
S104, the electronic equipment corrects the broken line constructed in the two-dimensional code.
In one possible implementation manner, the electronic device correcting the broken line constructed in the two-dimensional code may include the following steps:
1. and searching for the error broken line and/or the area of the missing broken line in the two-dimensional code.
The electronic device can calculate the distances between all fold lines and adjacent fold lines in the horizontal direction and the vertical direction. Taking a horizontal fold line as an example. The electronic device calculates a distance t1 between the first folding line and the second folding line in the horizontal direction. Distance t2 between the second folding line and the third folding line. Distance tw between nth fold line and n+1th fold line. The electronic device determines the distance interval [ T1, T2] between the correct folding lines according to the distances T1, T2, …, tw between the folding lines. Wherein the first fold line is adjacent to the second fold line, the second fold line is adjacent to the third fold line, and the nth fold line is adjacent to the n+1th fold line. If the distances between the folding line and all the adjacent folding lines are in the distance intervals [ T1, T2], the electronic equipment determines that the folding line is a correct folding line. If the distance between the folding line and any adjacent folding line is not in the distance interval [ T1, T2], the electronic equipment determines that the folding line is an error folding line. It will be appreciated that when the distance between two adjacent fold lines in the horizontal direction is less than T1, it is illustrated that the two fold lines may overlap or intersect. When the distance between two adjacent folding lines in the horizontal direction is greater than T2, it is indicated that there should be a missing folding line between the two folding lines. For example, if the distance T1 between the first folding line and the second folding line is not within the distance interval [ T1, T2], the electronic device determines that the first folding line is a wrong folding line. If the distance T1 between the second folding line and the first folding line and the distance T2 between the second folding line and the third folding line are both within the distance interval [ T1, T2], the electronic device determines that the second folding line is the correct folding line. If the distance T1 between the second folding line and the first folding line and/or the distance T2 between the second folding line and the third folding line are not in the distance interval [ T1, T2], the electronic device determines that the second folding line is the wrong folding line.
In one possible implementation, t1=0.7ts, t2=1.3ts, ts is the median in T1, T2, …, tw. The distance interval is determined by the median, so that the distance interval is not easily influenced by extreme values in the distance data between the folding lines.
The electronic device searches for the wrong folding lines and the areas with missing folding lines in all horizontal directions according to the mode. Likewise, the electronic device can find all the wrong folding lines in the vertical direction and the areas where the folding lines are missing in the above manner. Fig. 12 exemplarily shows a horizontal error broken line in the two-dimensional code. As shown in fig. 12, the broken line portion in the figure represents a broken line. Fig. 13 exemplarily shows a wrong-fold line in a vertical direction in a two-dimensional code. As shown in fig. 13, the broken line portion in the figure represents a broken line.
2. Correcting the wrong polyline and/or filling in the missing polyline.
In one possible implementation manner, the electronic device determines a first error fold line and a second error fold line which do not meet a preset condition in the first direction fold line and the second direction fold line; the electronic equipment constructs a first direction broken line of the second target line segment according to the first average inclination angle of the first target line segment, and constructs a second direction broken line of the fourth target line segment according to the second average inclination angle of the third target line segment.
The first target line segment is a first direction target line segment for constructing a first broken line, the first broken line is a first direction broken line adjacent to the first error broken line, and the second target line segment comprises a plurality of first edge line segments in a first section where the first error broken line is located.
The third target line segment is a second direction target line segment for constructing a second broken line, the second broken line is a second direction broken line adjacent to the second error broken line, and the fourth target line segment is a plurality of second edge line segments in a second section where the second error broken line is located.
In one possible implementation manner, the electronic device constructs a second target line segment into the first direction fold line according to a first average inclination angle of the first target line segment, and specifically includes: the electronic equipment performs coordinate transformation on a first coordinate of a central point on the second target line segment according to the first average inclination angle to obtain a second coordinate; and the electronic equipment constructs two or more second target line segments of which the longitudinal coordinate difference value of the second coordinates belongs to the first distance interval into a first direction broken line.
With reference to the first aspect, in a possible implementation manner, the electronic device constructs a fourth target line segment into the second direction fold line according to a second average inclination angle of the third target line segment, and specifically includes: the electronic equipment performs coordinate transformation on the third coordinate of the center point on the fourth target line segment according to the second average angle to obtain a fourth coordinate; and the electronic equipment constructs two or more fourth target line segments of which the longitudinal coordinate difference value of the fourth coordinate belongs to the second distance interval into a second direction broken line.
In one possible implementation, the electronic device correcting the wrong polyline and/or filling in the missing polyline specifically includes: determining an average inclination angle beta of a correct folding line adjacent to the wrong folding line; according to the average inclination angle beta, rotating and projecting a wrong broken line in the two-dimensional code and a target line segment of the region where the broken line is missing to obtain a projection histogram; and re-clustering the target line segments of the error polyline and the missing polyline areas into polylines according to the projection histogram.
Illustratively, taking a horizontal fold line as an example, if the electronic device determines that the first fold line and the second fold line are wrong fold lines, the third fold line is correct fold lines. The electronic device may obtain the average inclination angle β from the inclination angles of all the target line segments in the third polyline. And then carrying out rotation projection on the coordinates of the central points of all the target line segments in the two-dimensional code, namely if the coordinates of the central points are (x, y), the coordinates after rotation projection are (x 2, y 2). x2=xcos β+ysin β, y2=xsin (- β) +ycos β. And for the target line segments of the error area in the horizontal direction, the electronic equipment rotates the projected coordinates according to the coordinates of the central points of all the target line segments of the error area to obtain a projection histogram. The horizontal axis in the projection histogram represents the ordinate y2 of the target line segment after the center point is rotationally projected, and the vertical axis represents the number of target line segments with the ordinate y2 of the center point after the center point is rotationally projected. Fig. 14 exemplarily shows a projection histogram of a target line segment in a horizontal direction. As shown in fig. 14, the horizontal axis in fig. 14 represents the ordinate y1 after the target line segment center point is rotationally projected. The vertical axis represents the number of target line segments. For example, when y2=12, the number of target line segments is 1. y2=78, the number of target line segments is 2. The electronic equipment determines the peak position in the projection histogram, and clusters the target line segments in the neighborhood of the peak position to form a broken line by taking the peak position as the center. Thus, the electronic apparatus can correct the erroneous folding lines in the horizontal direction and the vertical direction and the folding lines that complement the missing horizontal direction and the vertical direction by using the above method.
The polyline corrected in the horizontal direction in the two-dimensional code may be as shown in fig. 15. Fig. 15 exemplarily shows a broken line schematic diagram after horizontal direction correction in the two-dimensional code. The corrected broken line in the vertical direction in the two-dimensional code may be as shown in fig. 16. Fig. 16 exemplarily shows a schematic diagram of a broken line after vertical direction correction in a two-dimensional code.
S105, the electronic equipment rebuilds the two-dimensional code according to the corrected broken line.
The electronic equipment determines the coordinates of the grids in the two-dimensional code according to the intersection points of the first direction fold lines and the second direction fold lines; then determining coding information of the grids according to the positions of the determined grids in the two-dimensional code, wherein the coding information is a first preset number or a second preset number; and finally reconstructing the two-dimensional code according to the number of the lattices and the coding information of each lattice.
Wherein the first preset number may be 0 and the second preset number may be 1.
Specifically, the intersection point of the first horizontal fold line and the first vertical fold line is the top left vertex of the first lattice in the two-dimensional code. The intersection point of the first horizontal fold line and the second vertical fold line is the top right vertex of the first grid in the two-dimensional code. The intersection point of the second horizontal fold line and the first vertical fold line is the lower left vertex of the first grid in the two-dimensional code. The intersection point of the second horizontal fold line and the second vertical fold line is the lower right vertex of the first grid in the two-dimensional code. Thus, the electronic device can determine one grid in the two-dimensional code through the two first direction folding lines and the two second direction folding lines. Thus, the electronic device can determine each grid in the two-dimensional code according to the broken line. The lattice formed by the first direction folding line and the second direction folding line may be as shown in fig. 17. Fig. 17 exemplarily shows a grid pattern of a two-dimensional code. The grid in fig. 17 is composed of first direction folding lines and second direction folding lines. The electronic device can determine four vertex coordinates of one grid according to the intersection point of the first direction broken line and the second direction broken line. In turn, the electronic device may determine the vertices of all the lattices. The grid vertices in the two-dimensional code determined by the electronic device may be as shown in fig. 18. Fig. 18 exemplarily shows a schematic diagram of lattice vertices in a two-dimensional code. And the electronic equipment takes each grid into the two-dimensional code for cutting, and if the proportion of pixels corresponding to the cut pixel blocks is greater than or equal to a preset proportion, the coding information of the grid is determined to be a first preset number (for example, 0). If the proportion of the pixels corresponding to the clipped pixel block is lower than the preset proportion, determining the coding information of the grid as a second preset number (for example, 1). In this way, the electronic device can obtain the encoded information of all lattices. And then the electronic equipment redraws the two-dimensional code according to the number, the size (it can be understood that the size of each grid in the two-dimensional code is the same), the coordinates and the coding information of each grid, namely the reconstructed two-dimensional code. The reconstructed two-dimensional code is a two-dimensional code with flatness. The preset ratio may be 50%, or may be another value, for example, 60%, which is not limited herein. The pixels corresponding to the pixel block may be black pixels or pixels of other colors, which is not limited herein.
In one possible implementation, the electronic device determining the coordinates of the first grid may include: the electronic device determines position information and coding information of n x m grids forming the first two-dimensional code image according to the (n+1) first direction folding lines and the (m+1) second direction folding lines; the method specifically comprises the following steps: the electronic equipment determines the position information of the first grid according to the intersection points of the first folding line and the second folding line with the third folding line and the fourth folding line respectively; the first direction folding line comprises a first folding line and a second folding line, and the first folding line is adjacent to the second folding line; the second direction fold line comprises a third fold line and the fourth fold line; the third folding line is adjacent to the fourth folding line; n x m lattices include a first lattice; the position information of the first lattice includes coordinates of four vertices of the first lattice; the electronic device determines the encoding information of the first grid according to the proportion of pixels at the first grid in the first two-dimensional code image. As shown in fig. 17, first and second folding lines adjacent in the horizontal direction are shown in fig. 17. Also included in fig. 17 are third and fourth fold lines that are vertically adjacent. The intersections of the first fold line and the second fold line with the third fold line and the fourth fold line respectively form a first grid.
The process of the electronic device determining the coordinates of the intersection of one first directional polyline and one second directional polyline may refer to FIG. 19. Fig. 19 exemplarily shows a schematic view of the first direction folding line L3 and the second direction folding line C5. As shown in fig. 19, the first direction folding line L3 is composed of a target line segment AB, a target line segment BC, a target line segment CD, a target line segment DE, and a target line segment EF. The electronic equipment can acquire coordinates of points A, B, C, D, E and F of the end points of the target line segment. The abscissa of the upper left vertex Q1 of the horizontal rectangle 2401 is equal to the minimum value of the abscissas among the end points a, B, C, D, E, F, that is, the abscissas of the point a. The ordinate of Q1 is equal to the minimum value of the ordinate of the endpoints A, B, C, D, E and F, namely the ordinate of the endpoint F. It will be appreciated that in fig. 24, the abscissa increases gradually from left to right and the ordinate increases gradually from top to bottom. The abscissa of the lower right vertex Q3 of the horizontal rectangle 2401 is equal to the maximum value of the abscissas among the end points a, B, C, D, E, F, that is, the abscissas of the F. The ordinate of Q3 is equal to the maximum value of the ordinate of the endpoints A, B, C, D, E and F, namely the ordinate of E. After the electronic device determines the upper left vertex Q1 and the lower right vertex Q3 of the horizontal rectangle 2401, the lower left vertex Q2 and the upper right vertex F may be determined according to Q1 and Q3. Thus, the electronic device can determine the horizontal rectangle 2401 from the four vertices Q1, Q2, Q3, and F.
The second directional folding line C5 in fig. 19 may be composed of a target line segment GH, a target line segment HI, a target line segment IJ, a target line segment JK, a target line segment KM, a target line segment MN. The electronic equipment can acquire coordinates of the end points H point, the end points I point, the end points J point, the end points K point, the end points M point and the end points N point of the target line segment. The abscissa of the upper left vertex Q4 of the vertical rectangle 2402 is equal to the minimum of the abscissas of the end points H, I, J, K, M, N, i.e., the abscissas of the H. The ordinate of Q4 is equal to the minimum value of the ordinate of the endpoints of H point, I point, J point, K point, M point and N point, namely the ordinate of G point. The abscissa of the lower right vertex N, N points of the vertical rectangle 2402 is the maximum value of the abscissas among the end points H, I, J, K, M, N points. The ordinate of the N point is the maximum value of the ordinate of the end points H, I, J, K, M and N. The electronic device can determine the coordinates of the lower left vertex Q6 and the upper right vertex Q5 of the vertical rectangle 2402 based on the coordinates of the upper left vertex Q4 and the lower right vertex N. In this way, the electronic device can determine the vertical rectangle 2402 from the four vertex coordinates.
In fig. 19, points P1, P2, P3, and P4 are four vertices of a rectangle where the horizontal rectangle 2401 and the vertical rectangle 2402 intersect. The electronic equipment determines an intersecting rectangle P1P2P3P4, then the intersecting target line segments in the first direction fold line L3 and the second direction fold line C5 in the intersecting rectangle are respectively a first direction target line segment CD and a second direction target line segment IJ, and finally the coordinate of the intersecting point P point is determined according to the first direction target line segment CD and the second direction target line segment IJ. Since the coordinates of the two end points of the first direction target line segment CD are known, a first linear equation of the line where the first direction target line segment CD is located can be obtained according to the coordinates of the two end points. Similarly, the coordinates of two end points of the second direction target line segment IJ are known, and a second linear equation of the line where the second direction target line segment is located can be obtained according to the coordinates of the two end points. And solving the first linear equation and the second linear equation by the electronic equipment to obtain the coordinate of the intersection point P. In this way, the electronic apparatus can sequentially determine the intersections of all the first-direction folding lines and the second-direction folding lines shown in fig. 23 in and out according to the above-described method.
With reference to the first aspect, in one possible implementation manner, the determining, by the electronic device, location information of the first grid according to intersection points of the first fold line and the second fold line with the third fold line and the fourth fold line, where the determining includes: the electronic equipment determines the coordinates of a first intersection point of the first folding line and the third folding line; the electronic equipment determines the coordinates of a second intersection point of the first folding line and the fourth folding line; the electronic equipment determines the coordinates of a third intersection point of the second folding line and the third folding line; the electronic equipment determines the coordinates of a fourth intersection point of the second folding line and the fourth folding line; the first intersection point, the second intersection point, the third intersection point and the fourth intersection point are four vertexes of the first lattice.
With reference to the first aspect, in a possible implementation manner, the determining, by the electronic device, coordinates of a first intersection point of the first fold line and the third fold line specifically includes: the electronic equipment converts the first folding line into a first rectangle, and converts the third folding line into a second rectangle; the electronic device determines an intersecting rectangle of the first rectangle and the second rectangle; the electronic device determining one or more first coordinate points on the first fold line and on the third fold line within the intersecting rectangle; and the electronic equipment determines the coordinates of a first intersection point of the first broken line and the third broken line according to the one or more first coordinate points.
Wherein the abscissa of the top left vertex of the first horizontal rectangle is the minimum value of the abscissas of all points on the first folding line, and the ordinate of the top left vertex of the first horizontal rectangle is the minimum value of the ordinates of all points on the first folding line; the lower right vertex coordinates of the first horizontal rectangle are the maximum values of the abscissas of all points on the first folding line, and the lower right vertex ordinate of the first horizontal rectangle is the maximum value of the ordinates of all points on the first folding line; the left upper vertex abscissa of the first vertical rectangle is the minimum value of the abscissas of all points on the second folding line, and the left upper vertex ordinate of the first vertical rectangle is the minimum value of the ordinates of all points on the second folding line; the abscissa of the lower right vertex of the first vertical rectangle is the maximum value of the abscissas of all points on the second folding line, and the ordinate of the lower right vertex of the first vertical rectangle is the maximum value of the ordinates of all points on the second folding line. Here, the horizontal axis positive direction is rightward, and the vertical axis positive direction is downward.
The electronic device determines that among all the intersections, four intersections can determine a grid of one two-dimensional code. As shown in fig. 20, the lattice 2501 in fig. 20 is defined by four intersecting points. The electronic device can determine the position and size of the lattice 2501 in the two-dimensional code. The electronic device may crop with the grid 2501 at the same location in the first two-dimensional code pattern. When the proportion of the black pixel value in the lattice 2501 is greater than or equal to 50%, the encoded information of the lattice 2501 is 0. That is, the position of the grid 2501 in the two-dimensional code reconstructed by the electronic device is a black pixel block.
The two-dimensional code image reconstructed by the electronic device may be as shown in fig. 21. The two-dimensional code image shown in fig. 21 has flatness.
S106, the electronic equipment decodes the reconstructed two-dimensional code and displays a decoding result.
And the electronic equipment decodes the reconstructed two-dimensional code. The electronic device can read the coding information of each grid in the middle two-dimensional code. And finally, the electronic equipment obtains a decoding result according to the coding information of each grid. Reference may be made specifically to the prior art and will not be described here in detail.
For example, the decoding result of the two-dimensional code by the electronic device may be as shown in fig. 22. Fig. 22 shows a schematic diagram of decoding results of the electronic device. As shown in fig. 22, fig. 22 shows a user interface 300 that presents the decoding results of an electronic device. Control 301 may be included in user interface 300. Control 301 is used to return to the previous level interface. The text prompt 302 is used to prompt the user for the content displayed on the current interface (e.g., a "scan result" is a result of decoding the two-dimensional code after the current interface displays the scan code of the electronic device). The decoding result 303 is used to show specific decoding results, such as the website "http:// xxx.com".
Thus, when the two-dimensional code image scanned by the electronic equipment is distorted, such as deformed, bent, folded and the like, the electronic equipment cannot directly identify the two-dimensional code to obtain a decoding result. The embodiment of the application provides a two-dimensional code identification method, firstly, electronic equipment constructs a first direction folding line and a second direction folding line for a two-dimensional code image, and the first direction folding line and the second direction folding line construct the two-dimensional code image into a grid graph. The electronic device divides the two-dimensional code into a plurality of lattices through the grid pattern and acquires a topological relation between each lattice (i.e., a positional relation of one lattice with other lattices, for example, adjacent). The electronic equipment reconstructs the grids into a two-dimensional code with flatness according to the acquired topological relation of the grids, and then decodes the two-dimensional code. Thus, the electronic device can accurately decode the two-dimensional code distorted by deformation, bending, wrinkling, and the like. Thereby improving the user experience.
In one scenario, the two-dimensional code image acquired by the electronic device is curved. Fig. 23 exemplarily shows a reconstruction process of a curved two-dimensional code by an electronic device. As shown in fig. 23, the two-dimensional code image (i.e., the original image shown in the drawing) acquired by the electronic device is curved and does not have flatness. The two-dimensional code recognition process shown in fig. 23 may specifically include: the electronic equipment acquires an image to be identified, wherein the image to be identified contains a first two-dimensional code image which is not flat; the first two-dimensional code consists of n x m grids; the electronic equipment detects an edge line segment in the first two-dimensional code image; the edge line segments comprise a first edge line segment in a first direction and a second edge line segment in a second direction, and the first direction is perpendicular to the second direction; the electronic equipment constructs (n+1) first-direction folding lines according to the first edge line segments, and constructs (m+1) second-direction folding lines according to the second edge line segments; the electronic device determines position information and coding information of n x m grids forming the first two-dimensional code image according to the (n+1) first direction folding lines and the (m+1) second direction folding lines; the electronic equipment constructs a two-dimensional code image according to the position information of n x m grids and the coding information, wherein the two-dimensional code image is a two-dimensional code image with flatness; and the electronic equipment decodes the two-dimensional code image and displays a decoding result. Reference may be made specifically to the descriptions of step S101 to step S106, and the description is omitted here.
In another scenario, the two-dimensional code image acquired by the electronic device is wrinkled. Fig. 24 exemplarily shows a reconstruction process of the two-dimensional code of the fold by the electronic device. As shown in fig. 24, the two-dimensional code image (i.e., the original image shown in the drawing) acquired by the electronic device is wrinkled and does not have flatness. The two-dimensional code recognition process shown in fig. 24 may specifically include: the electronic equipment acquires an image to be identified, wherein the image to be identified contains a first two-dimensional code image which is not flat; the first two-dimensional code consists of n x m grids; the electronic equipment detects an edge line segment in the first two-dimensional code image; the edge line segments comprise a first edge line segment in a first direction and a second edge line segment in a second direction, and the first direction is perpendicular to the second direction; the electronic equipment constructs (n+1) first-direction folding lines according to the first edge line segments, and constructs (m+1) second-direction folding lines according to the second edge line segments; the electronic device determines position information and coding information of n x m grids forming the first two-dimensional code image according to the (n+1) first direction folding lines and the (m+1) second direction folding lines; the electronic equipment constructs a two-dimensional code image according to the position information of n x m grids and the coding information, wherein the two-dimensional code image is a two-dimensional code image with flatness; and the electronic equipment decodes the two-dimensional code image and displays a decoding result. Reference may be made specifically to the descriptions of step S101 to step S106, and the description is omitted here.
Fig. 25 shows a schematic structural diagram of the electronic device 100.
The embodiment will be specifically described below taking the electronic device 100 as an example. It should be understood that the electronic device 100 shown in fig. 25 is only one example, and that the electronic device 100 may have more or fewer components than shown in fig. 25, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The electronic device 100 may include: processor 110, external memory interface 120, internal memory 121, universal serial bus (universal serial bus, USB) interface 130, charge management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headset interface 170D, sensor module 180, keys 190, motor 191, indicator 192, camera 193, display 194, and subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, SCL). The I2S interface may be used for audio communication. PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. The UART interface is a universal serial data bus for asynchronous communications. The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing functions of electronic device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display functionality of the electronic device 100.
In one possible implementation manner, in an embodiment of the present application, an image to be identified, which includes a two-dimensional code and is captured by the camera 193, may be transmitted to the processor 110 through the CSI interface. The processor 110 processes the image to be identified and transmits the processed image to the display 194 through the DSI interface. In this way, the user can see the image to be recognized on the display screen 194.
In one possible implementation, the processor 110 decodes the two-dimensional code in the image to be identified to obtain a decoding result. The decoding result is transmitted to the display 194 through the DSI interface. Thus, the user can see the decoding result of the two-dimensional code (e.g., web address, personal name card, commodity price, etc.) on the display screen 194.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present invention is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1. In the embodiment of the present application, the display screen 194 may display an image to be identified including the two-dimensional code, and display a decoding result of the two-dimensional code in the image to be identified.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and is converted into an image visible to the naked eye (for example, an image to be recognized comprising a two-dimensional code). ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193. In the embodiment of the present application, the ISP may perform preprocessing on the image to be identified, and the preprocessing process may refer to the above description, which is not repeated herein.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1. In the embodiment of the present application, the camera 193 may be used to capture an image to be recognized including a two-dimensional code.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or to hands-free conversations, through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 100 is answering a telephone call or voice message, voice may be received by placing receiver 170B in close proximity to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. The air pressure sensor 180C is used to measure air pressure. The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip cover using the magnetic sensor 180D. The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it may be determined that there is an object in the vicinity of the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there is no object in the vicinity of the electronic device 100. The electronic device 100 can detect that the user holds the electronic device 100 close to the ear by using the proximity light sensor 180G, so as to automatically extinguish the screen for the purpose of saving power. The proximity light sensor 180G may also be used in holster mode, pocket mode to automatically unlock and lock the screen.
The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 180J is for detecting temperature. The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, i.e.: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above. The specific working processes of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which are not described herein.
The functional units in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic or optical disk, and the like.
The above embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (17)

1. The two-dimensional code identification method is characterized by comprising the following steps of:
the electronic equipment acquires a first non-flat two-dimensional code image; the first two-dimensional code consists of n * m lattices;
the electronic equipment detects an edge line segment in the first two-dimensional code image; the edge line segments comprise a first edge line segment in a first direction and a second edge line segment in a second direction, and the first direction is perpendicular to the second direction;
the electronic equipment constructs (n+1) first-direction folding lines according to the first edge line segments, and constructs (m+1) second-direction folding lines according to the second edge line segments;
the electronic equipment determines n which forms the first two-dimensional code image according to the (n+1) first direction folding lines and the (m+1) second direction folding lines * Position information and coding information of m lattices;
the electronic equipment is according to the n * m lattice ofThe position information and the coding information construct a second two-dimensional code image, wherein the second two-dimensional code image is a two-dimensional code image with flatness;
and the electronic equipment decodes the second two-dimensional code image and displays a decoding result.
2. The method of claim 1, wherein the first two-dimensional code image is a deformed, bent or wrinkled two-dimensional code image.
3. The method according to any one of claims 1 or 2, wherein the electronic device constructs (n+1) first directional folding lines according to the first edge line segment, and constructs (m+1) second directional folding lines according to the second edge line segment, and specifically comprises:
the electronic equipment takes the first edge line segment with the slope smaller than a first preset threshold value as a first direction target line segment; taking the second edge line segment with the slope smaller than a second preset threshold value as a second direction target line segment;
the electronic equipment constructs the (n+1) first-direction folding lines according to the first-direction target line segments, and constructs the (m+1) second-direction folding lines according to the second-direction target line segments.
4. A method according to claim 3, wherein the electronic device constructs the (n+1) first directional polylines from the first directional target line segments and constructs the (m+1) second directional polylines from the second directional target line segments, specifically comprising:
the electronic equipment divides the first two-dimensional code image into R first intervals and L second intervals; the R, L is a positive integer, the R is smaller than the n, and the L is smaller than the m;
the electronic equipment constructs one or more first direction folding lines according to the first direction target line segments in each first interval, and the sum of the numbers of the first direction folding lines in the R first intervals is (n+1); and constructing one or more second direction folding lines according to the second direction target line segments in each second section, wherein the sum of the numbers of the second direction folding lines in the L second sections is (m+1).
5. The method of claim 4, wherein the electronic device constructs one or more first direction polylines from the first direction target line segments in each of the first intervals; the method specifically comprises the following steps:
the electronic equipment constructs the first direction folding line by using two or more first direction target line segments with the first projection distance smaller than a first preset distance in the first interval; the first projection distance is the projection of the central point connecting line of two adjacent first direction target line segments in the first interval on a first vector, and the first vector is the normal vector of a first unit vector; the first unit vector is determined according to the line segment length and the inclination angle of the first direction target line segment in the first section;
The electronic device builds one or more second direction folding lines according to the second direction target line segments in each second interval, and the method specifically comprises the following steps:
the electronic equipment constructs the second direction folding line by using two or more second direction target line segments of which the second projection distance is smaller than a second preset distance in the second interval; the second projection distance is the projection of the central point connecting line of two adjacent target line segments in the second direction on a second vector, and the second vector is the normal vector of a second unit vector; the second unit vector is determined according to the line segment length and the inclination angle of the second direction target line segment in the second section.
6. The method of any of claims 4 or 5, wherein the electronic device constructs (n+1) first directional polylines from the first edge line segment, and after constructing (m+1) second directional polylines from the second edge line segment, the method further comprises:
the electronic equipment determines a first error folding line and a second error folding line which do not meet preset conditions in the first direction folding line and the second direction folding line;
The electronic equipment constructs a second target line segment into the first direction fold line according to a first average inclination angle of the first target line segment, and constructs a fourth target line segment into the second direction fold line according to a second average inclination angle of a third target line segment;
the first target line segment is the first direction target line segment for constructing a first broken line, the first broken line is the first direction broken line adjacent to the first error broken line, and the second target line segment comprises a plurality of first edge line segments in the first section where the first error broken line is located;
the third target line segment is the second direction target line segment for constructing a second broken line, the second broken line is the second direction broken line adjacent to the second error broken line, and the fourth target line segment is a plurality of second edge line segments in the second interval including the second error broken line.
7. The method of claim 6, wherein the preset conditions include: the distance between adjacent first direction folding lines is in a first distance interval, and the distance between adjacent second direction folding lines is in a second distance interval.
8. The method of claim 7, wherein the first distance interval is determined by a median of distances of all adjacent first direction fold lines; the second distance interval is determined by the median of the distances of all adjacent second-direction folding lines.
9. The method according to any one of claims 7 or 8, wherein the electronic device constructs a second target line segment into the first direction polyline according to a first average inclination angle of the first target line segment, specifically comprising:
the electronic equipment performs coordinate transformation on a first coordinate of a central point on the second target line segment according to the first average inclination angle to obtain a second coordinate;
the electronic equipment constructs two or more second target line segments of which the longitudinal coordinate difference value of the second coordinate belongs to the first distance interval into the first direction folding line;
the electronic device constructs a fourth target line segment into the second direction fold line according to a second average inclination angle of the third target line segment, and specifically includes:
the electronic equipment performs coordinate transformation on the third coordinate of the center point on the fourth target line segment according to the second average angle to obtain a fourth coordinate;
And the electronic equipment constructs two or more fourth target line segments of which the longitudinal coordinate difference value of the fourth coordinate belongs to the second distance interval into the second direction folding line.
10. The method of claim 1, wherein n is * The m lattices include a first lattice; the position information and the coding information of the first lattice are determined as follows:
the electronic equipment determines the position information of the first grid according to the intersection points of the first folding line and the second folding line with the third folding line and the fourth folding line respectively; the first direction folding line comprises a first folding line and a second folding line, and the first folding line and the second folding line are adjacent; the second direction fold line comprises the third fold line and the fourth fold line; the third folding line is adjacent to the fourth folding line;
the electronic device determines the coding information of the first grid according to the proportion of pixels in the first grid; the pixels in the first lattice are pixels in a range determined in the first two-dimensional code image according to the position information of the first lattice.
11. The method of claim 10, wherein the determining, by the electronic device, the position information of the first grid according to the intersection points of the first fold line and the second fold line with the third fold line and the fourth fold line, respectively, specifically includes:
The electronic equipment determines the coordinates of a first intersection point of the first broken line and the third broken line;
the electronic equipment determines coordinates of a second intersection point of the first broken line and the fourth broken line;
the electronic equipment determines the coordinates of a third intersection point of the second broken line and the third broken line;
the electronic equipment determines coordinates of a fourth intersection point of the second broken line and the fourth broken line;
the first intersection point, the second intersection point, the third intersection point and the fourth intersection point are four vertexes of the first lattice.
12. The method of claim 11, wherein the electronic device determines coordinates of a first intersection of the first polyline and the third polyline, specifically comprising:
the electronic equipment converts the first folding line into a first rectangle, and converts the third folding line into a second rectangle;
the electronic device determining an intersecting rectangle of the first rectangle and the second rectangle;
the electronic device determining one or more first coordinate points on the first fold line and on the third fold line within the intersecting rectangle;
and the electronic equipment determines the intersection point coordinates of the first broken line and the third broken line according to the one or more first coordinate points.
13. The method according to claim 10, wherein the electronic device determines the encoded information of the first grid according to the proportion of pixels in the first grid, specifically comprising:
if the proportion of the pixels in the first grid is greater than or equal to a preset proportion, the electronic equipment determines that the coding information of the first grid is a first preset number;
and if the proportion of the pixels in the first grid is smaller than the preset proportion, the electronic equipment determines that the coding information of the first grid is a second preset number.
14. The method of claim 13, wherein the predetermined proportion is 50%.
15. The method of any one of claims 10-14, wherein the pixel is a black pixel.
16. An electronic device, comprising: one or more processors, one or more memories; the one or more memories are respectively coupled with the one or more processors; the one or more memories are used to store computer program code, including computer instructions; the computer instructions, when run on the processor, cause the electronic device to perform the two-dimensional code recognition method of any one of claims 1-15.
17. A computer readable storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the two-dimensional code recognition method of any one of claims 1-15.
CN202010830616.7A 2020-07-15 2020-08-18 Two-dimensional code identification method and electronic equipment Active CN113947097B (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN2020106824373 2020-07-15
CN202010682437 2020-07-15
CN2020107619573 2020-07-31
CN202010761957 2020-07-31

Publications (2)

Publication Number Publication Date
CN113947097A CN113947097A (en) 2022-01-18
CN113947097B true CN113947097B (en) 2024-04-09

Family

ID=79327154

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010830616.7A Active CN113947097B (en) 2020-07-15 2020-08-18 Two-dimensional code identification method and electronic equipment

Country Status (1)

Country Link
CN (1) CN113947097B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI814550B (en) * 2022-08-25 2023-09-01 華碩電腦股份有限公司 Reading method and reading device for two-dimensional code

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007026428A (en) * 2005-06-13 2007-02-01 Yutaka Kiuchi Two-dimensional code generation method and reading method, and executable program
JP2011070477A (en) * 2009-09-28 2011-04-07 Npo Japan Association For The Visually-Impaired Information Support Two-dimensional code reading method, two-dimensional code to be read by two-dimensional code reading method, and recording medium with the two-dimensional code reading method recorded thereon
CN104657700A (en) * 2015-03-25 2015-05-27 广州宽度信息技术有限公司 Two-dimensional code anti-damaging decoding method
CN105701434A (en) * 2015-12-30 2016-06-22 广州卓德信息科技有限公司 Image correction method for two-dimensional code distorted image
CN106485183A (en) * 2016-07-14 2017-03-08 深圳市华汉伟业科技有限公司 A kind of Quick Response Code localization method and system
CN107742089A (en) * 2017-09-05 2018-02-27 广东职业技术学院 A kind of method that Quick Response Code automatic identification is realized using electrical form
CN108438417A (en) * 2018-05-23 2018-08-24 李晓明 A kind of express delivery carton that can be recycled and its application method
CN108985419A (en) * 2018-07-10 2018-12-11 广州多米诺区块链技术有限公司 Two-dimensional code generation method, device and two dimensional code
CN109211251A (en) * 2018-09-21 2019-01-15 北京理工大学 A kind of instant positioning and map constructing method based on laser and two dimensional code fusion

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4419269B2 (en) * 2000-04-18 2010-02-24 富士通株式会社 Two-dimensional code extraction method

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007026428A (en) * 2005-06-13 2007-02-01 Yutaka Kiuchi Two-dimensional code generation method and reading method, and executable program
JP2011070477A (en) * 2009-09-28 2011-04-07 Npo Japan Association For The Visually-Impaired Information Support Two-dimensional code reading method, two-dimensional code to be read by two-dimensional code reading method, and recording medium with the two-dimensional code reading method recorded thereon
CN104657700A (en) * 2015-03-25 2015-05-27 广州宽度信息技术有限公司 Two-dimensional code anti-damaging decoding method
CN105701434A (en) * 2015-12-30 2016-06-22 广州卓德信息科技有限公司 Image correction method for two-dimensional code distorted image
CN106485183A (en) * 2016-07-14 2017-03-08 深圳市华汉伟业科技有限公司 A kind of Quick Response Code localization method and system
CN107742089A (en) * 2017-09-05 2018-02-27 广东职业技术学院 A kind of method that Quick Response Code automatic identification is realized using electrical form
CN108438417A (en) * 2018-05-23 2018-08-24 李晓明 A kind of express delivery carton that can be recycled and its application method
CN108985419A (en) * 2018-07-10 2018-12-11 广州多米诺区块链技术有限公司 Two-dimensional code generation method, device and two dimensional code
CN109211251A (en) * 2018-09-21 2019-01-15 北京理工大学 A kind of instant positioning and map constructing method based on laser and two dimensional code fusion

Also Published As

Publication number Publication date
CN113947097A (en) 2022-01-18

Similar Documents

Publication Publication Date Title
CN109409161B (en) Graphic code identification method, device, terminal and storage medium
CN108830186B (en) Text image content extraction method, device, equipment and storage medium
EP4361954A1 (en) Object reconstruction method and related device
CN112215227B (en) Image target detection model attack method and device, terminal equipment and storage medium
JP2018018173A (en) Image processing device, image processing method, and computer program
CN114549718A (en) Rendering method and device of virtual information, augmented reality device and storage medium
CN110991457A (en) Two-dimensional code processing method and device, electronic equipment and storage medium
CN113723136A (en) Bar code correction method, device, equipment and storage medium
CN113051950B (en) Multi-bar code identification method and related equipment
US11978231B2 (en) Wrinkle detection method and terminal device
CN113947097B (en) Two-dimensional code identification method and electronic equipment
CN111259907A (en) Content identification method and device and electronic equipment
CN116341586B (en) Code scanning method, electronic equipment and storage medium
CN115735226B (en) Image processing method and chip
US20210232853A1 (en) Object Recognition Method and Terminal Device
CN114827442B (en) Method for generating image and electronic equipment
CN109492451B (en) Coded image identification method and mobile terminal
CN114970576A (en) Identification code identification method, related electronic equipment and computer readable storage medium
CN116343247B (en) Form image correction method, device and equipment
KR101625751B1 (en) AR marker having boundary code, and system, and method for providing augmented reality using the same
CN106023114B (en) Image processing method and device
JP2007080108A (en) Card
CN114510192B (en) Image processing method and related device
CN115633255B (en) Video processing method and electronic equipment
CN115205868B (en) Image verification method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220510

Address after: 523799 Room 101, building 4, No. 15, Huanhu Road, Songshanhu Park, Dongguan City, Guangdong Province

Applicant after: Petal cloud Technology Co.,Ltd.

Address before: 523808 Southern Factory Building (Phase I) Project B2 Production Plant-5, New Town Avenue, Songshan Lake High-tech Industrial Development Zone, Dongguan City, Guangdong Province

Applicant before: HUAWEI DEVICE Co.,Ltd.

Effective date of registration: 20220510

Address after: 523808 Southern Factory Building (Phase I) Project B2 Production Plant-5, New Town Avenue, Songshan Lake High-tech Industrial Development Zone, Dongguan City, Guangdong Province

Applicant after: HUAWEI DEVICE Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Applicant before: HUAWEI TECHNOLOGIES Co.,Ltd.

GR01 Patent grant
GR01 Patent grant