CN110764685A - Method and device for identifying two-dimensional code - Google Patents

Method and device for identifying two-dimensional code Download PDF

Info

Publication number
CN110764685A
CN110764685A CN201911015361.2A CN201911015361A CN110764685A CN 110764685 A CN110764685 A CN 110764685A CN 201911015361 A CN201911015361 A CN 201911015361A CN 110764685 A CN110764685 A CN 110764685A
Authority
CN
China
Prior art keywords
dimensional code
determining
outline
pattern
identifying
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.)
Granted
Application number
CN201911015361.2A
Other languages
Chinese (zh)
Other versions
CN110764685B (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.)
Shanghai Zhangmen Science and Technology Co Ltd
Original Assignee
Shanghai Zhangmen Science and 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 Shanghai Zhangmen Science and Technology Co Ltd filed Critical Shanghai Zhangmen Science and Technology Co Ltd
Priority to CN201911015361.2A priority Critical patent/CN110764685B/en
Publication of CN110764685A publication Critical patent/CN110764685A/en
Application granted granted Critical
Publication of CN110764685B publication Critical patent/CN110764685B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • 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

Abstract

The embodiment of the application discloses a method and equipment for identifying a two-dimensional code. One embodiment of a method for recognizing a two-dimensional code includes: responding to the simultaneous touch of the user on at least two areas on the picture, and determining whether two-dimensional code recognition is carried out or not; if the two-dimensional code identification is determined, determining the outline of the two-dimensional code on the picture based on the positions of the at least two areas; and identifying the two-dimensional code based on the outline of the two-dimensional code. According to the embodiment, the two-dimension code area on the picture is rapidly positioned through the at least two areas on the picture simultaneously touched by the user, and the two-dimension code is identified by detecting the two-dimension code area. The whole picture does not need to be detected, the time consumption of two-dimensional code identification is greatly shortened, and the two-dimensional code identification efficiency is improved.

Description

Method and device for identifying two-dimensional code
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and equipment for identifying a two-dimensional code.
Background
Along with the popularization of intelligent equipment, the use of two-dimensional codes is more and more extensive. The two-dimensional code is also called as a two-dimensional bar code, and is a pattern which is distributed on a plane (two-dimensional direction) by using a certain specific geometric figure according to a certain rule and records literal numerical information at intervals of black and white. The concept of bit stream of '0' and '1' forming the internal logic base of computer is used skillfully in coding, and a plurality of geometric shapes corresponding to binary system are used for representing literal numerical value information. Through image input equipment or photoelectric scanning equipment, can realize the automatic reading and discernment of two-dimensional code, leisurely realize information automatic processing function.
At present, if a two-dimensional code on a picture is to be identified, scanning of the whole picture is usually triggered in a long-time picture mode, so that the position of the two-dimensional code is identified from the whole picture, and then the two-dimensional code is analyzed. This type of identification has become a design practice in the art.
Disclosure of Invention
The embodiment of the application provides a method and equipment for identifying a two-dimensional code.
In a first aspect, an embodiment of the present application provides a method for identifying a two-dimensional code, including: responding to the simultaneous touch of the user on at least two areas on the picture, and determining whether two-dimensional code recognition is carried out or not; if the two-dimensional code identification is determined, determining the outline of the two-dimensional code on the picture based on the positions of the at least two areas; and identifying the two-dimensional code based on the outline of the two-dimensional code.
In a second aspect, an embodiment of the present application provides an apparatus for identifying a two-dimensional code, including: a first determination unit configured to determine whether to perform two-dimensional code recognition in response to a user simultaneously touching at least two areas on a picture; a second determination unit configured to determine an outline of the two-dimensional code on the picture based on the positions of the at least two regions if it is determined that the two-dimensional code recognition is performed; and the identification unit is configured to identify the two-dimensional code based on the outline of the two-dimensional code.
In a third aspect, an embodiment of the present application provides a computer device, including: one or more processors; a storage device on which one or more programs are stored; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation of the first aspect.
In a fourth aspect, the present application provides a computer-readable medium, on which a computer program is stored, which, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
The method and the device for identifying the two-dimensional code provided by the embodiment of the application respond to the condition that a user touches at least two areas on a picture at the same time, and determine whether to identify the two-dimensional code; determining the outline of the two-dimensional code on the picture based on the positions of the at least two areas under the condition that the two-dimensional code identification is determined; and then identifying the two-dimensional code based on the outline of the two-dimensional code. The embodiment of the application breaks through the design habit in the field, the two-dimensional code area on the picture is rapidly positioned through the at least two areas on the picture simultaneously touched by the user, and the two-dimensional code is identified by detecting the two-dimensional code area. The whole picture does not need to be detected, the time consumption for identifying the two-dimensional code is shortened, and the identification efficiency of the two-dimensional code is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram to which some embodiments of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for identifying two-dimensional codes according to the present application;
fig. 3 is a flowchart of yet another embodiment of a method for recognizing a two-dimensional code according to the present application;
fig. 4 is a flowchart of another embodiment of a method for recognizing a two-dimensional code according to the present application;
FIG. 5 is a schematic block diagram of a computer system suitable for use with the computer device of some embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which the method for recognizing a two-dimensional code of the present application can be applied.
As shown in fig. 1, system architecture 100 may include devices 101, 102 and network 103. Network 103 is the medium used to provide communication links between devices 101 and 102. Network 103 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The devices 101, 102 may be hardware devices or software that support network connectivity to provide various network services. When the device is hardware, it can be a variety of electronic devices including, but not limited to, smart phones, tablets, laptop portable computers, desktop computers, servers, and the like. In this case, the hardware device may be implemented as a distributed device group including a plurality of devices, or may be implemented as a single device. When the device is software, the software can be installed in the electronic devices listed above. At this time, as software, it may be implemented as a plurality of software or software modules for providing a distributed service, for example, or as a single software or software module. And is not particularly limited herein.
In practice, a device may provide a respective network service by installing a respective client application or server application. After the device has installed the client application, it may be embodied as a client in network communications. Accordingly, after the server application is installed, it may be embodied as a server in network communications.
As an example, in fig. 1, device 101 is embodied as a client and device 102 is embodied as a server. For example, the device 101 may be a client installed with two-dimensional code recognition software, and the device 102 may be a server of the two-dimensional code recognition software.
It should be noted that the method for identifying a two-dimensional code provided in the embodiment of the present application may be executed by the device 101, and may also be executed by the device 102. In the case of execution by device 101, system architecture 100 may not provide device 102.
It should be understood that the number of networks and devices in fig. 1 is merely illustrative. There may be any number of networks and devices, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for identifying two-dimensional codes according to the present application is shown. The method for identifying the two-dimensional code comprises the following steps:
step 201, responding to the user touching at least two areas on the picture at the same time, and determining whether to perform two-dimensional code recognition.
In the present embodiment, in response to a user touching at least two areas on a picture at the same time, an execution subject (e.g., the devices 101, 102 shown in fig. 1) of the method for recognizing a two-dimensional code may determine whether to perform two-dimensional code recognition. The two-dimensional code can be a pattern which is distributed on a plane (two-dimensional direction) by using a certain specific geometric figure according to a certain rule and records literal numerical information at intervals of black and white. The literal numerical information recorded by the two-dimensional code may include, but is not limited to, a website, an address, business card information, commodity information, transaction information, a password, and the like. The pattern of the two-dimensional code may include, but is not limited to, a taiji pattern, a square pattern, a daisy pattern, a ring pattern, and the like.
In practice, the execution body may be a terminal. The terminal can detect the operation of the user on the picture. If the fact that the user touches at least two areas on the picture at the same time is detected, the terminal can determine whether two-dimensional code recognition is carried out or not. In addition, the execution main body may be a server. If the fact that the user touches at least two areas on the picture at the same time is detected, the terminal can send a two-dimensional code identification triggering request to the server. Under the condition that a two-dimension code identification triggering request is received, the server side can determine whether to perform two-dimension code identification. The two-dimensional code identification trigger request can include a picture touched by a user and positions of at least two areas touched by the user.
In some embodiments, in response to a user touching at least two areas on the picture at the same time, the executing body may determine a plurality of first operation options for presentation; responding to the selection of a user on a two-dimension code identification option, and determining to perform two-dimension code identification; and responding to the selection of the first operation options except the two-dimensional code identification option in the plurality of first operation options by the user, and determining to perform the operation corresponding to the selected first operation option. Wherein the plurality of first operation options for presenting may include a two-dimensional code identification option. Further, the plurality of first operation options may further include a picture sending option, a picture collecting option, a picture saving option, a picture editing option, and the like.
Generally, if the execution main body is a terminal and it is detected that the user touches at least two areas on the picture at the same time, the terminal may directly present a plurality of first operation options for the user to select. If the user is detected to select the two-dimension code identification option, the terminal can determine to perform two-dimension code identification. If it is detected that the user selects a first operation option other than the two-dimensional code identification option from the plurality of first operation options, the terminal may determine not to perform two-dimensional code identification but to perform an operation corresponding to the selected first operation option. If the execution main body is a server and receives the two-dimension code identification triggering request, the server can determine a plurality of first operation options for presentation and send the first operation options to the terminal. Subsequently, the terminal may present a plurality of first operation options. If the user is detected to select the two-dimension code identification option, the terminal can send a two-dimension code identification request to the server. Under the condition of receiving the two-dimension code identification request, the server side can determine to perform two-dimension code identification. If it is detected that the user selects a first operation option except the two-dimensional code identification option from the plurality of first operation options, the terminal may send an operation request corresponding to the selected first operation option to the server. When the operation request corresponding to the selected first operation option is received, the server may determine not to perform two-dimensional code recognition but to perform an operation corresponding to the selected first operation option.
In some embodiments, if the execution subject is a terminal, the terminal may determine a scanning area on the picture based on the positions of at least two areas touched by the user; scanning the scanning area; if the two-dimension code is scanned, determining to perform two-dimension code identification; and if the two-dimensional code is not scanned, determining not to perform two-dimensional code identification. In general, the scan region may be a region including at least two regions touched by a user, and the area is related to a distance between the at least two regions. For example, the scan area may be a square area centered on a center of a line connecting the two areas touched by the user, having a length of the line of a preset multiple (e.g., 2.5 times) as a side, and including at least two areas touched by the user. For another example, the scan area may be a circular area with a center of a line connecting the two areas touched by the user as a center and a radius of a preset multiple (e.g., 2.5 times) of the length of the line.
In addition, under the condition that the two-dimensional code is not scanned, the terminal can present a plurality of second operation options; in response to the user selecting a second operation option of the plurality of second operation options, the terminal may determine to perform an operation corresponding to the selected second operation option. The plurality of second operation options may not include the two-dimensional code identification option, but include a picture sending option, a picture collecting option, a picture saving option, a picture editing option, and the like.
Step 202, if the two-dimensional code identification is determined, determining the outline of the two-dimensional code on the picture based on the positions of the at least two areas.
In this embodiment, if it is determined to perform two-dimensional code recognition, the execution main body may determine an outline of the two-dimensional code on the picture based on the positions of the at least two areas touched by the user. Wherein the at least two areas touched by the user may be locator areas of the two-dimensional code. Since the position of the locator in the two-dimensional code is fixed, after the position of the locator is determined, the outline of the two-dimensional code is also determined.
In some embodiments, the executing body may first perform locator identification on at least two regions, and determine a pattern of the at least two locators; the outline of the two-dimensional code is then determined based on the positions of the at least two regions and the pattern of the at least two locators. Since the specific pattern of the locator exists in the specific pattern of the two-dimensional code and the position of the specific pattern of the locator in the specific pattern of the two-dimensional code is fixed, after the pattern and the position of the locator are determined, the outline of the two-dimensional code is also determined. The pattern of the locator may include, but is not limited to, a fisheye pattern, a frame pattern, a bull's eye pattern, and the like. The two-dimensional code in which the fish-eye-style locator exists is a taiji-chart-style two-dimensional code. The two-dimensional code in which the circular-frame-style locators exist is a square-style two-dimensional code. The two-dimensional code in which the big bull's eye-shaped locator exists is a two-dimensional code in a chrysanthemum shape.
In some embodiments, if the at least two locators touched by the user are at least two frames, the executing body may first determine a candidate region of the two-dimensional code in a square pattern on the picture based on the positions of the at least two frames; and then identifying an outline of the square-style two-dimensional code in a candidate area of the square-style two-dimensional code.
Generally, a two-dimensional code in which a frame-shaped locator is present is a square-shaped two-dimensional code. And, the frame of the clip is at the vertex of the outer frame of the square-style two-dimensional code. If the user touches the three clip frames at the same time, the execution main body can search the positioning corner points of the three clip frames and enclose a triangle. And the positioning corner point of the maximum angle of the triangle is the upper left position point of the square two-dimensional code. And the positioning angular points of the other two corners are the lower left position point and the upper right position point of the square two-dimensional code. According to the three position points, a square area, namely a candidate area of the two-dimensional code in a square mode can be positioned. If the user touches two frames, the execution body may determine another frame near the two frames touched by the user, and then locate the candidate region of the square two-dimensional code by using the method. In addition, the execution body may further analyze positions of the two frames touched by the user. If the two square frames are in the diagonal positions, the positioning corner points of the two square frames are the lower left position point and the upper right position point of the square two-dimensional code. According to the two position points, a square area with the connecting line of the two position points as a diagonal line can be positioned, namely a candidate area of the two-dimensional code in a square mode. If the two square frames are located on the same side, the positioning corner points of the two square frames are the upper left position point and the lower left position point or the upper right position point of the square two-dimensional code. According to the two position points, a rectangular area with the connecting line of the two position points as the central axis, namely a candidate area of the two-dimensional code in a square mode can be positioned.
In some embodiments, if the outline of the outer frame of the square-shaped two-dimensional code is a trapezoid, the execution main body may determine three frames of the square-shaped two-dimensional code; and then correcting the two-dimensional code of the shape style based on the three frames. In general, if there is distortion in the square two-dimensional code on the picture, the outline of the square two-dimensional code will be a trapezoid. The execution body may determine a twist angle of the square-style two-dimensional code according to the three square-shaped frames. The two-dimensional code in the square form is corrected according to the distortion angle, so that the distortion of the two-dimensional code in the square form can be corrected. The influence of the twist angle of the square two-dimensional code on the identification result of the square two-dimensional code is avoided, and therefore the identification accuracy of the square two-dimensional code is improved.
And step 203, identifying the two-dimensional code based on the outline of the two-dimensional code.
In this embodiment, the execution body may identify the two-dimensional code based on the outline of the two-dimensional code. Specifically, the executing body may extract stored information from within an outline of the two-dimensional code to recognize the two-dimensional code.
In some embodiments, the execution body may first identify a coding region within an outline of the two-dimensional code; then extracting a binary number group from the first preset sequence in the coding region; and finally, decoding the binary array to obtain the information stored in the two-dimensional code. Wherein the first preset sequence comprises at least two preset points. The binary array may be information obtained by encoding literal numerical information recorded by the two-dimensional code. The literal numerical information recorded by the two-dimensional code is usually a character string, and the character string can be composed of letters, numbers, symbols, Chinese characters and the like. In order to facilitate the two-dimensional code to record the character string, the character string is usually converted into a corresponding binary number group by using a binary coding method, and then the binary number group is stored in a first preset sequence in a coding region of the two-dimensional code, so that the binary number group extracted from the first preset sequence can be the binary number group corresponding to the character string. Typically, a string corresponds to only one binary array.
In practice, the two-dimensional code is generated by sequentially rendering a specific geometric figure corresponding to a binary number in a binary number group corresponding to a character string on a first preset sequence in an encoding area of the two-dimensional code. Therefore, the specific geometric figures on the preset points included in the first preset sequence can be sequentially identified, and the binary number groups corresponding to the character strings can be determined according to the corresponding relation between the specific geometric figures and the binary numbers. Here, the specific geometry corresponding to the binary number may match both the shape and size of the preset points. The specific geometric figure is typically a solid color figure. For example, a black point may represent a binary number of 1 and a white point may represent a binary number of 0.
In some embodiments, in order to make the color distribution of the two-dimensional code more uniform, the binary number group is usually masked with a mask, and the masked binary number group is stored. Therefore, before decoding the binary number array, the execution body may further extract the mask from the second preset sequence in the encoding region; the binary array is masked with a mask. Wherein the mask of the two-dimensional code may be stored in a second preset sequence. The second preset sequence may include at least two preset points, and the first preset sequence and the second preset sequence include different preset points.
The method for identifying the two-dimensional code, provided by the embodiment of the application, responds to the condition that a user touches at least two areas on a picture at the same time, and determines whether the two-dimensional code is identified; determining the outline of the two-dimensional code on the picture based on the positions of the at least two areas under the condition that the two-dimensional code identification is determined; and then identifying the two-dimensional code based on the outline of the two-dimensional code. The area of the two-dimensional code on the picture is rapidly positioned through at least two areas on the picture simultaneously touched by the user, and the two-dimensional code is recognized by detecting the area of the two-dimensional code. The whole picture does not need to be detected, the time consumption of two-dimensional code identification is greatly shortened, and the two-dimensional code identification efficiency is improved.
With further reference to fig. 3, a flow 300 of yet another embodiment of a method for identifying a two-dimensional code according to the present application is shown. The method for identifying the two-dimensional code comprises the following steps:
step 301, responding to the user touching at least two areas on the picture at the same time, and determining whether to perform two-dimensional code recognition.
In this embodiment, the specific operation of step 301 has been described in detail in step 201 in the embodiment shown in fig. 2, and is not described herein again.
Step 302, if it is determined that two-dimensional code recognition is performed and at least two locators are two fisheyes, determining a candidate region of the two-dimensional code of the taiji diagram pattern on the picture based on the positions of the two fisheyes.
In this embodiment, if it is determined to perform two-dimensional code recognition, an executing body (for example, the devices 101 and 102 shown in fig. 1) of the method for recognizing a two-dimensional code may perform locator recognition on at least two areas touched by a user, and determine the patterns of the at least two locators. If the at least two locators touched by the user are two fisheyes, the execution main body can determine the candidate region of the two-dimensional code in the Taiji diagram mode on the picture based on the positions of the two fisheyes.
Generally, a two-dimensional code in which a fish-eye pattern of locators exists is a taiji pattern of two-dimensional codes. The taiji diagram is also called yin-yang taiji diagram, and the shape of the taiji diagram is that yin and yang fish are mutually entangled, and can include a yang fish region, a yin fish region and the like. The positive fish region may also include a positive fish body region and a positive fish eye region. The negative fish region may also include a negative fish body region and a negative fish eye region. The positive fisheye region and the negative fisheye region are locator regions of the two-dimensional code of the Taiji diagram pattern. Because the center of the connecting line of the two fisheyes is the center of the outer circle contour of the two-dimensional code in the Taiji diagram style, and the length of the connecting line is equal to the radius of the outer circle contour of the two-dimensional code in the Taiji diagram style, the execution main body can position a circular region which takes the center of the connecting line of the two fisheyes as the center of the circle and takes the length of the connecting line as the radius according to the positions of the two fisheyes, namely a candidate region of the two-dimensional code in the Taiji diagram style.
Step 303, identifying the excircle outline of the two-dimensional code in the Taiji diagram pattern in the candidate area of the two-dimensional code in the Taiji diagram pattern.
In this embodiment, the execution body may identify an outer circle contour of the two-dimensional code of the taiji diagram pattern in a candidate region of the two-dimensional code of the taiji diagram pattern.
In some embodiments, if the outer circle contour of the two-dimensional code of the taiji diagram pattern is an ellipse, the execution body may correct the two-dimensional code of the taiji diagram pattern based on two fish eyes. In general, if there is distortion in the taiji diagram style two-dimensional code on the picture, its outline will be an ellipse. The execution body can determine the twist angle of the two-dimensional code of the Taiji diagram pattern according to the two fish eyes. The two-dimensional code of the Taiji diagram pattern is corrected according to the distortion angle, so that the distortion of the two-dimensional code of the Taiji diagram pattern can be corrected. The method and the device avoid the influence of the distortion angle of the two-dimensional code of the Taiji diagram pattern on the two-dimensional code identification result of the Taiji diagram pattern, thereby improving the identification accuracy of the two-dimensional code of the Taiji diagram pattern.
And 304, identifying the two-dimensional code based on the outline of the two-dimensional code.
In this embodiment, the specific operation of step 304 has been described in detail in step 203 in the embodiment shown in fig. 2, and is not described herein again.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 2, the flow 300 of the method for issuing information in the present embodiment highlights the identification step of the two-dimensional code of the taiji diagram pattern. Therefore, the scheme described in this embodiment positions the two-dimensional code in the taiji diagram style based on the two fisheyes, and improves the positioning accuracy of the two-dimensional code in the taiji diagram style. In addition, in the case where the two-dimensional code of the taiji diagram pattern is distorted, the two-dimensional code of the taiji diagram pattern is corrected based on the positions of the two fisheyes, and the distortion of the two-dimensional code of the taiji diagram pattern can be corrected. The method and the device avoid the influence of the distortion angle of the two-dimensional code of the Taiji diagram pattern on the two-dimensional code identification result of the Taiji diagram pattern, thereby improving the identification accuracy of the two-dimensional code of the Taiji diagram pattern.
With further reference to fig. 4, a flow 400 of another embodiment of a method for identifying a two-dimensional code according to the present application is shown. The method for identifying the two-dimensional code comprises the following steps:
step 401, in response to the user touching at least two areas on the picture at the same time, determining whether to perform two-dimensional code recognition.
In this embodiment, the specific operation of step 401 has been described in detail in step 201 in the embodiment shown in fig. 2, and is not described herein again.
Step 402, if it is determined that two-dimensional code recognition is performed and the at least two locators are at least two big bulls eyes, determining a candidate region of the two-dimensional code in the chrysanthemum pattern on the picture based on the positions of the at least two big bulls eyes.
In this embodiment, if it is determined to perform two-dimensional code recognition, an execution subject (for example, the devices 101 and 102 shown in fig. 1) of the method for recognizing a two-dimensional code may perform locator recognition on at least two regions to determine patterns of at least two locators. If the at least two locators are the at least two big bulls eyes, the executing body may determine the candidate region of the two-dimensional code in the chrysanthemum pattern on the picture based on the positions of the at least two big bulls eyes.
Generally, a two-dimensional code in which a big bull's eye style locator exists is a two-dimensional code in a chrysanthemum style. The big bull's eye is the inscribed circle of the excircle of two-dimensional code of chrysanthemum style, and the triangle that three big bull's eyes enclose is the inscribed isosceles right triangle of the excircle of two-dimensional code of chrysanthemum style. If the user touches the three big bull eyes simultaneously, the center of the largest side of the triangle formed by the three big bull eyes is the dot of the excircle of the chrysanthemum-shaped two-dimensional code. Therefore, the execution main body can position a circular region which takes the center of the maximum side of a triangle formed by the three big bull eyes as the center of a circle and the length of the maximum side as the diameter, namely the candidate region of the chrysanthemum-shaped two-dimensional code according to the positions of the three big bull eyes.
It should be noted that, if the user touches two big bulls eyes at the same time, the execution main body may first determine another big bulls eye near the two big bulls eyes touched by the user, and then locate the candidate region of the two-dimensional code in the daisy style by using the above method.
And step 403, identifying the outer circle contour of the two-dimensional code in the chrysanthemum pattern in the candidate area of the two-dimensional code in the chrysanthemum pattern.
In this embodiment, the execution body may identify an outer circle contour of the two-dimensional code in the daisy pattern in the candidate region of the two-dimensional code in the daisy pattern.
In some embodiments, if the outer circle contour of the two-dimensional code in the chrysanthemum pattern is an ellipse, the executing body may first determine three big eyes of the two-dimensional code in the chrysanthemum pattern; and then correcting the two-dimensional code in the chrysanthemum style based on the three big bulleyes. In general, if there is distortion in the two-dimensional code in the chrysanthemum shape on the picture, the outline of the outer circle will be an ellipse. The execution main body can determine the distortion angle of the two-dimensional code in the chrysanthemum style according to the three big bull eyes. The two-dimensional code of the chrysanthemum pattern is corrected according to the distortion angle, and the distortion of the two-dimensional code of the chrysanthemum pattern can be corrected. The influence of the distortion angle of the two-dimensional code of the chrysanthemum pattern on the two-dimensional code recognition result of the chrysanthemum pattern is avoided, and therefore the recognition accuracy of the two-dimensional code of the chrysanthemum pattern is improved.
And step 404, identifying the two-dimensional code based on the outline of the two-dimensional code.
In this embodiment, the specific operation of step 404 has been described in detail in step 203 in the embodiment shown in fig. 2, and is not described herein again.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for issuing information in the present embodiment highlights the identification step of the two-dimensional code in the daisy style. Therefore, the scheme described in the embodiment is based on the two-dimensional codes of the three big bull eyes positioning chrysanthemum patterns, and the positioning accuracy of the two-dimensional codes of the chrysanthemum patterns is improved. In addition, under the condition that the two-dimensional code of chrysanthemum pattern has the distortion, rectify the two-dimensional code of chrysanthemum pattern based on the position of three big bull eyes, can correct the distortion of the two-dimensional code of chrysanthemum pattern. The influence of the distortion angle of the two-dimensional code of the chrysanthemum pattern on the two-dimensional code recognition result of the chrysanthemum pattern is avoided, and therefore the recognition accuracy of the two-dimensional code of the chrysanthemum pattern is improved.
Referring now to FIG. 5, a block diagram of a computer system 500 suitable for use in implementing a computing device (e.g., devices 101, 102 shown in FIG. 1) of an embodiment of the present application is shown. The computer device shown in fig. 5 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present application.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the method of the present application when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or electronic device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a first determination unit, a second determination unit, and an identification unit. Here, the names of the units do not constitute a limitation to the unit itself in this case, and for example, the first determination unit may also be described as a "unit that determines whether or not to perform two-dimensional code recognition in response to a user touching at least two areas on a picture at the same time".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the computer device described in the above embodiments; or may exist separately and not be incorporated into the computer device. The computer readable medium carries one or more programs which, when executed by the computing device, cause the computing device to: responding to the simultaneous touch of the user on at least two areas on the picture, and determining whether two-dimensional code recognition is carried out or not; if the two-dimensional code identification is determined, determining the outline of the two-dimensional code on the picture based on the positions of the at least two areas; and identifying the two-dimensional code based on the outline of the two-dimensional code.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (16)

1. A method for recognizing a two-dimensional code, comprising:
responding to the simultaneous touch of the user on at least two areas on the picture, and determining whether two-dimensional code recognition is carried out or not;
if the two-dimensional code identification is determined, determining the outline of the two-dimensional code on the picture based on the positions of the at least two areas;
and identifying the two-dimension code based on the outline of the two-dimension code.
2. The method of claim 1, wherein the determining whether to perform two-dimensional code recognition comprises:
determining a plurality of first operation options for presentation, wherein the plurality of first operation options comprise two-dimension code identification options;
and responding to the selection of the two-dimension code identification option by the user, and determining to perform two-dimension code identification.
3. The method of claim 2, wherein the method further comprises:
and responding to the selection of the first operation options except the two-dimensional code identification option from the plurality of first operation options by the user, and determining to perform the operation corresponding to the selected first operation option.
4. The method of claim 1, applied to a terminal, wherein the determining whether to perform two-dimensional code recognition comprises:
determining a scanning area on the picture based on the positions of the at least two areas;
scanning the scanning area;
and if the two-dimensional code is scanned, determining to perform two-dimensional code identification.
5. The method of claim 4, applied to a terminal, wherein the method further comprises:
if the two-dimension code is not scanned, determining a plurality of second operation options, wherein the plurality of second operation options do not comprise the two-dimension code identification option;
and responding to the selection of the user on a second operation option in the plurality of second operation options, and determining to perform the operation corresponding to the selected second operation option.
6. The method of claim 1, wherein the determining the outline of the two-dimensional code on the picture based on the positions of the at least two regions comprises:
performing locator identification on the at least two regions, and determining the patterns of the at least two locators;
determining an outline of the two-dimensional code based on the positions of the at least two regions and the pattern of the at least two locators.
7. The method of claim 6, wherein the determining the outline of the two-dimensional code based on the locations of the at least two regions and the pattern of the at least two locators comprises:
if the at least two locators are two fisheyes, determining a candidate region of the two-dimensional code of the Taiji diagram pattern on the picture based on the positions of the two fisheyes;
and identifying the outer circle contour of the two-dimensional code of the Taiji diagram pattern in the candidate area of the two-dimensional code of the Taiji diagram pattern.
8. The method of claim 7, wherein before the identifying the two-dimensional code based on the outline of the two-dimensional code, further comprising:
and if the excircle outline of the two-dimensional code in the Taiji diagram pattern is an ellipse, correcting the two-dimensional code in the Taiji diagram pattern based on the two fisheyes.
9. The method of claim 6, wherein the determining the outline of the two-dimensional code based on the locations of the at least two regions and the pattern of the at least two locators comprises:
if the at least two locators are at least two square frames, determining a candidate area of the square-shaped two-dimensional code on the picture based on the positions of the at least two square frames;
and identifying an outer frame outline of the square-shaped two-dimensional code in a candidate area of the square-shaped two-dimensional code.
10. The method of claim 9, wherein before the identifying the two-dimensional code based on the outline of the two-dimensional code, further comprising:
if the outline of the outer frame of the square two-dimensional code is a trapezoid, determining three square frames of the square two-dimensional code;
and correcting the square-style two-dimensional code based on the three square-shaped frames.
11. The method of claim 6, wherein the determining the outline of the two-dimensional code based on the locations of the at least two regions and the pattern of the at least two locators comprises:
if the at least two locators are at least two big bull eyes, determining a candidate region of the two-dimensional code in the chrysanthemum pattern on the picture based on the positions of the at least two big bull eyes;
and identifying the excircle outline of the two-dimensional code in the chrysanthemum pattern in the candidate area of the two-dimensional code in the chrysanthemum pattern.
12. The method of claim 11, wherein before the identifying the two-dimensional code based on the outline of the two-dimensional code, further comprising:
if the outer circle contour of the two-dimensional code in the chrysanthemum shape is an ellipse, determining three big eyes of the two-dimensional code in the chrysanthemum shape;
correcting the two-dimensional code of the chrysanthemum pattern based on the three big bull eyes.
13. The method according to one of claims 1 to 12, wherein the identifying the two-dimensional code based on the outline of the two-dimensional code comprises:
identifying a coding region within a contour of the two-dimensional code;
extracting a binary number array from a first preset sequence in the coding region, wherein the first preset sequence comprises at least two preset points;
and decoding the binary number array to obtain the information stored in the two-dimensional code.
14. The method of claim 13, wherein before the decoding the binary array to obtain the information stored in the two-dimensional code, further comprising:
extracting a mask code from a second preset sequence in the coding region, wherein the second preset sequence comprises at least two preset points, and the first preset sequence and the second preset sequence comprise different preset points;
and performing mask operation on the binary number array by using the mask.
15. A computer device, comprising:
one or more processors;
a storage device on which one or more programs are stored;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-14.
16. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-14.
CN201911015361.2A 2019-10-24 2019-10-24 Method and device for identifying two-dimensional code Active CN110764685B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911015361.2A CN110764685B (en) 2019-10-24 2019-10-24 Method and device for identifying two-dimensional code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911015361.2A CN110764685B (en) 2019-10-24 2019-10-24 Method and device for identifying two-dimensional code

Publications (2)

Publication Number Publication Date
CN110764685A true CN110764685A (en) 2020-02-07
CN110764685B CN110764685B (en) 2023-04-18

Family

ID=69333768

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911015361.2A Active CN110764685B (en) 2019-10-24 2019-10-24 Method and device for identifying two-dimensional code

Country Status (1)

Country Link
CN (1) CN110764685B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111652011A (en) * 2020-02-20 2020-09-11 中国银联股份有限公司 Method and device for reading two-dimensional code
CN113255389A (en) * 2020-12-18 2021-08-13 深圳怡化电脑股份有限公司 Image recognition method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104573597A (en) * 2013-10-10 2015-04-29 腾讯科技(深圳)有限公司 Two-dimension code identification method and identification device
US20170004651A1 (en) * 2014-07-24 2017-01-05 Youngzone Culture (Shanghai) Co., Ltd. Augmented reality technology-based handheld viewing device and method thereof
CN106384071A (en) * 2016-09-28 2017-02-08 乐视控股(北京)有限公司 Two-dimensional code scanning recognition processing method and device
CN106909270A (en) * 2016-07-20 2017-06-30 阿里巴巴集团控股有限公司 Chat data input method, device and communicating terminal
CN109085982A (en) * 2018-06-08 2018-12-25 Oppo广东移动通信有限公司 content identification method, device and mobile terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104573597A (en) * 2013-10-10 2015-04-29 腾讯科技(深圳)有限公司 Two-dimension code identification method and identification device
US20170004651A1 (en) * 2014-07-24 2017-01-05 Youngzone Culture (Shanghai) Co., Ltd. Augmented reality technology-based handheld viewing device and method thereof
CN106909270A (en) * 2016-07-20 2017-06-30 阿里巴巴集团控股有限公司 Chat data input method, device and communicating terminal
CN106384071A (en) * 2016-09-28 2017-02-08 乐视控股(北京)有限公司 Two-dimensional code scanning recognition processing method and device
CN109085982A (en) * 2018-06-08 2018-12-25 Oppo广东移动通信有限公司 content identification method, device and mobile terminal

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111652011A (en) * 2020-02-20 2020-09-11 中国银联股份有限公司 Method and device for reading two-dimensional code
WO2021165931A1 (en) * 2020-02-20 2021-08-26 中国银联股份有限公司 Method and apparatus for reading two-dimensional bar code
CN111652011B (en) * 2020-02-20 2023-08-04 中国银联股份有限公司 Method and device for reading two-dimensional code
CN113255389A (en) * 2020-12-18 2021-08-13 深圳怡化电脑股份有限公司 Image recognition method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110764685B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
US10762387B2 (en) Method and apparatus for processing image
CN110046529B (en) Two-dimensional code identification method, device and equipment
US20200013386A1 (en) Method and apparatus for outputting voice
CN109977718B (en) Method and equipment for identifying two-dimensional code
CN108665041B (en) Two-dimensional code generation and identification method and device, computer equipment and storage medium
CN108563559A (en) A kind of test method of identifying code, device, terminal device and storage medium
CN110764685B (en) Method and device for identifying two-dimensional code
WO2020029467A1 (en) Video frame processing method and apparatus
CN112818852A (en) Seal checking method, device, equipment and storage medium
WO2019144756A1 (en) Method and system for processing verification short message
CN111507122A (en) Graphic code identification method and device, storage medium and terminal
CN110765795A (en) Two-dimensional code identification method and device and electronic equipment
US11068682B2 (en) QR code generation method and apparatus for terminal device
CN108304815A (en) A kind of data capture method, device, server and storage medium
WO2018184255A1 (en) Image correction method and device
CN111797642B (en) Bar code identification method and terminal
CN107992872B (en) Method for carrying out text recognition on picture and mobile terminal
CN113837194A (en) Image processing method, image processing apparatus, electronic device, and storage medium
CN110969042B (en) Two-dimensional code identification method and device and hardware device
CN105069393A (en) Two-dimensional code malicious reading-preventing method and device
JP2023133274A (en) Training method for roi detection model, detection method, apparatus therefor, device therefor, and medium therefor
CN109271826A (en) The method and apparatus of two dimensional code for identification
CN114549624B (en) Label identification method and device, electronic equipment, storage medium and label
US11863995B2 (en) Method for generating wireless access point information, device, and computer readable medium
CN112751799B (en) Verification method and device based on picture verification code

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
GR01 Patent grant
GR01 Patent grant