CN109886059B - QR code image detection method based on width learning - Google Patents

QR code image detection method based on width learning Download PDF

Info

Publication number
CN109886059B
CN109886059B CN201910072722.0A CN201910072722A CN109886059B CN 109886059 B CN109886059 B CN 109886059B CN 201910072722 A CN201910072722 A CN 201910072722A CN 109886059 B CN109886059 B CN 109886059B
Authority
CN
China
Prior art keywords
code
width learning
picture
matrix
learning model
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
CN201910072722.0A
Other languages
Chinese (zh)
Other versions
CN109886059A (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.)
Foshan Shunde Sun Yat-Sen University Research Institute
Sun Yat Sen University
SYSU CMU Shunde International Joint Research Institute
Original Assignee
Foshan Shunde Sun Yat-Sen University Research Institute
Sun Yat Sen University
SYSU CMU Shunde International Joint Research Institute
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 Foshan Shunde Sun Yat-Sen University Research Institute, Sun Yat Sen University, SYSU CMU Shunde International Joint Research Institute filed Critical Foshan Shunde Sun Yat-Sen University Research Institute
Priority to CN201910072722.0A priority Critical patent/CN109886059B/en
Publication of CN109886059A publication Critical patent/CN109886059A/en
Application granted granted Critical
Publication of CN109886059B publication Critical patent/CN109886059B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a QR code image detection method based on width learning, which comprises the steps of inputting original pictures containing QR codes and images without the QR codes, respectively marking the original pictures with different marks, carrying out graying and binaryzation on the original pictures, screening out pictures containing outline characteristics similar to QR code image searching graphs by utilizing the graph outline characteristics of the QR code image searching graphs, using the pictures as input of a width learning model, training the width learning model to establish a QR code detection model, and finally inputting the pictures to be detected into the trained QR code detection model, so that whether the pictures to be detected contain the QR codes can be judged. By adopting the mode of extracting the known picture to construct the model and then training the model, whether the picture contains the QR code or not can be judged. The training can be rapidly carried out by utilizing the width learning model, and the accuracy can be higher when the width learning model is used for testing and judging other pictures.

Description

QR code image detection method based on width learning
Technical Field
The invention relates to the technical field of QR codes, in particular to a QR code image detection method based on width learning.
Background
With the change of times and the scientific development, the QR code has penetrated into the daily life of people, the QR code exists on various packaging bags, advertising boards, commodity labels, electronic equipment and various apps, great convenience is brought to the life of people due to the existence of the QR code, and the functions of payment, information reading, anti-counterfeiting and the like can be realized through the QR code.
The QR code technology is a popular technology at present, the graph is formed by modules with black and white alternating according to a certain rule, and the graph contains abundant information. The system can store various complex information such as Chinese characters, numbers, pictures and the like, and meets the requirement of large data storage. Meanwhile, the QR code has strong encryption and fault-tolerant functions, and has low cost and high durability, so that the QR code can exist and develop stably. The QR code has wide application scene, and can be used for shopping payment in markets, buses, vegetable markets, medical industries and the like. At present, a lot of QR codes are printed on pictures, most QR code detection equipment directly scans and reads the QR codes, but even if the pictures do not have the QR codes, the detection equipment can run a scanning program, scanning failure is finally prompted, and particularly when the pictures contain major elements, resources of the detection equipment can be greatly wasted. Therefore, whether the picture contains the QR code is judged firstly, and then the scanning program is started, so that the resources of the detection equipment can be effectively saved. However, most of the existing methods are improved on how to read information of the QR code, and whether the picture contains the QR code cannot be effectively judged.
Disclosure of Invention
In order to solve the above problems, it is an object of the present invention to provide a QR code image detection method based on width learning, which can determine whether or not a picture contains a QR code.
The technical scheme adopted by the invention for solving the problems is as follows:
in a first aspect, an embodiment of the present invention provides a QR code image detection method based on width learning, including:
inputting a picture containing a QR code and a picture without the QR code as original pictures;
respectively marking the picture containing the QR code and the picture without the QR code differently;
carrying out graying and binaryzation pretreatment on an original picture;
screening out a target picture containing a graph outline similar to the QR code image finding graph from the preprocessed original picture by utilizing the graph outline characteristic of the QR code image finding graph;
taking a target picture as the input of a width learning model, training by using the width learning model, and establishing a QR (quick response) code detection model;
and judging whether the picture to be detected contains the QR code or not by using the QR code detection model.
Furthermore, different binary numbers are adopted to respectively mark the picture containing the QR code and the picture without the QR code.
Further, the preprocessing of graying and binarization on the original picture comprises the following steps:
converting an image of an original picture into a gray image;
converting the gray level image into a binary image by adopting a local self-adaptive threshold value mode;
and filtering and denoising the binary image.
Further, the figure outline features are as follows: contains a contour, which is surrounded by no other contour on the outside and only nests two other contours on the inside.
Further, the step of taking the target picture as the input of the width learning model, training by using the width learning model, and establishing a QR code detection model includes:
converting the target picture into a matrix form, and constructing an input matrix of a width learning model;
performing linear operation on the input matrix to obtain a matrix consisting of characteristic points, performing nonlinear operation on the characteristic points to obtain a matrix consisting of enhancement points, and constructing an intermediate layer of a width learning model by using the matrix consisting of the characteristic points and the matrix consisting of the enhancement points;
and constructing an output matrix of the width learning model by using the mark types on the original picture.
Further, the converting the target picture into a matrix form to construct an input matrix of the width learning model includes:
converting a single target picture into a one-dimensional row vector;
and constructing a two-dimensional matrix by using the converted multiple target pictures.
Further, the output matrix is a two-dimensional matrix, the row vector of the output matrix is the type of the mark on the original picture, and the row number of the output matrix is equal to the number of the output pictures.
In a second aspect, an embodiment of the present invention further provides a QR code image detection system based on width learning, including:
an input unit for inputting an original picture;
the marking unit is used for marking the picture containing the QR code and the picture without the QR code differently;
the preprocessing unit is used for carrying out graying and binaryzation on the original picture;
the screening unit is used for screening a target picture containing a graph outline similar to the QR code image searching graph from the preprocessed original picture by utilizing the graph outline characteristics of the QR code image searching graph;
and the model construction unit is used for training by utilizing the width learning model and establishing a QR code detection model.
In a third aspect, an embodiment of the present invention further provides a QR code image detection apparatus based on width learning, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect of the invention.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, where computer-executable instructions are stored, and the computer-executable instructions are configured to cause a computer to execute the method according to the first aspect of the present invention.
One or more technical schemes provided in the embodiment of the invention have at least the following beneficial effects: according to the QR code image detection method based on width learning provided by the embodiment of the invention, the original images containing the QR code and the images not containing the QR code are input and are respectively marked differently, then the grey level and the binarization are carried out on the original images, the images containing the contour characteristics similar to the QR code image searching pattern are screened out by utilizing the contour characteristics of the image of the QR code image searching pattern and are used as the input of the width learning model, the width learning model is trained to establish the QR code detection model, and finally the images to be detected are input into the trained QR code detection model, so that whether the images to be detected contain the QR code can be judged. By adopting the mode of extracting the known picture to construct the model and then training the model, whether the picture contains the QR code or not can be judged. The training can be rapidly carried out by utilizing the width learning model, and the accuracy can be higher when the width learning model is used for testing and judging other pictures.
According to the QR code image detection system based on width learning provided by the embodiment of the invention, an original image containing a QR code and an original image not containing the QR code are input through an input unit, different marks are respectively made on the original image by using a marking unit, then the original image is subjected to graying and binaryzation by using a preprocessing unit, an image containing the contour characteristics similar to the QR code image-finding image is screened out through a screening unit by using the graphic contour characteristics of the QR code image-finding image, the image is used as the input of a width learning model, the width learning model is trained and established by using a model establishing unit, and finally the image to be detected is input into the trained QR code detection model, so that whether the image to be detected contains the QR code or not can be judged. By adopting the mode of extracting the known picture to construct the model and then training the model, whether the picture contains the QR code or not can be judged. The training can be rapidly carried out by utilizing the width learning model, and the accuracy can be higher when the width learning model is used for testing and judging other pictures.
Drawings
The invention is further illustrated with reference to the following figures and examples.
FIG. 1 is a flow diagram of one embodiment of a QR code image detection method based on width learning of the present invention;
FIG. 2 is a flow chart of the preprocessing of graying and binarizing the original picture in an embodiment of the QR code image detection method based on width learning of the present invention;
FIG. 3 is a flowchart of a QR code image detection method based on width learning according to an embodiment of the present invention, in which a target image is used as an input of a width learning model, and the width learning model is used for training to establish a QR code detection model;
FIG. 4 is a flowchart of an embodiment of a QR code image detection method based on width learning according to the present invention, in which a target image is converted into a matrix form, and an input matrix of a width learning model is constructed;
FIG. 5 is a flow chart of another embodiment of a QR code image detection method based on width learning of the present invention;
FIG. 6 is a schematic diagram of outline features of a QR code image finding graph;
FIG. 7 is a schematic diagram of a QR code image detection system based on width learning, in accordance with an embodiment of the present invention;
fig. 8 is a schematic diagram of a QR code image detection apparatus based on width learning according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It should be noted that, if not conflicted, the various features of the embodiments of the invention may be combined with each other within the scope of protection of the invention. Additionally, while functional block divisions are performed in system schematics, with logical sequences shown in flowcharts, in some cases the steps shown or described may be performed in a different order than the block divisions in the systems, or in the flowcharts.
With the change of times and the scientific development, the QR code has penetrated into the daily life of people, the QR code exists on various packaging bags, advertising boards, commodity labels, electronic equipment and various apps, great convenience is brought to the life of people due to the existence of the QR code, and the functions of payment, information reading, anti-counterfeiting and the like can be realized through the QR code.
The QR code technology is a popular technology at present, the graph is formed by modules with black and white alternating according to a certain rule, and the graph contains abundant information. The system can store various complex information such as Chinese characters, numbers, pictures and the like, and meets the requirement of large data storage. Meanwhile, the QR code has strong encryption and fault-tolerant functions, and has low cost and high durability, so that the QR code can exist and develop stably. The QR code has wide application scene, and can be used for shopping payment in markets, buses, vegetable markets, medical industries and the like. At present, a lot of QR codes are printed on pictures, most QR code detection equipment directly scans and reads the QR codes, but even if the pictures do not have the QR codes, the detection equipment can run a scanning program, scanning failure is finally prompted, and particularly when the pictures contain major elements, resources of the detection equipment can be greatly wasted. Therefore, whether the picture contains the QR code is judged firstly, and then the scanning program is started, so that the resources of the detection equipment can be effectively saved. However, most of the existing methods are improved on how to read information of the QR code, and whether the picture contains the QR code cannot be effectively judged.
Based on the method, the original pictures containing the QR code and the images without the QR code are input and are marked differently, then the grey level and the binarization are carried out on the original pictures, the pictures containing the similar QR code image searching graphs are screened out by utilizing the graph outline characteristics of the QR code image searching graphs and are used as the input of a width learning model, the width learning model is trained to establish the QR code detection model, and finally the pictures to be detected are input into the trained QR code detection model, so that whether the pictures to be detected contain the QR code can be judged.
The embodiments of the present invention will be further explained with reference to the drawings.
Referring to fig. 1, an embodiment of the present invention provides a QR code image detection method based on width learning, including but not limited to the following steps:
s100, inputting a picture containing a QR code and a picture without the QR code as original pictures;
s200, respectively marking the picture containing the QR code and the picture without the QR code differently;
s300, carrying out gray level and binarization preprocessing on the original picture;
s400, screening out a target picture containing the graphic outline similar to the QR code image searching graph from the preprocessed original picture by utilizing the graphic outline characteristic of the QR code image searching graph;
s500, taking the target picture as the input of a width learning model, training by using the width learning model, and establishing a QR code detection model;
and S600, judging whether the picture to be detected contains a QR code or not by using the QR code detection model.
In this embodiment, to make the training effect and the detection effect of the QR code detection model better, the number of the input original pictures may be increased, for example, the number of the original pictures may reach 2000 or more. The number of the pictures containing the QR code and the number of the pictures not containing the QR code are close to each other, and may be 50% or 55% or 45%, and the specific ratio may be freely set according to actual conditions, and are not listed here. In addition, in this embodiment, the content and the scene of the original picture are different, so that the number of the outlines is large, the complexity is high, and the training effect and the detection effect of the QR code detection model are improved.
The picture is grayed in an RGB model, each picture pixel of a gray map only stores a gray value by one byte, and the gray range is 0-255. The color image is grayed by four methods, namely a component method, a maximum value method, an average value method and a weighted average method.
The method comprises the steps of inputting original pictures containing QR codes and original pictures not containing the QR codes, marking the original pictures differently, carrying out graying and binaryzation on the original pictures, screening out pictures containing contour features similar to QR code image finding patterns by utilizing the contour features of the QR code image finding patterns, using the pictures as the input of a width learning model, training the width learning model to establish a QR code detection model, and finally inputting the pictures to be detected into the trained QR code detection model, so that whether the pictures to be detected contain the QR codes can be judged. The method of extracting the known picture to construct the model and then training the model is adopted, so that whether the picture contains the QR code or not can be judged. The training can be rapidly carried out by utilizing the width learning model, and the accuracy can be higher when the width learning model is used for testing and judging other pictures.
Further, based on the first embodiment, a second embodiment of the present invention further provides a QR code image detection method based on width learning, wherein a picture containing a QR code and a picture not containing a QR code are respectively marked by using different binary numbers.
In this embodiment, the picture containing the QR code and the picture without the QR code are respectively marked by using different binary numbers, for example, the picture containing the QR code is marked by 01, and the picture without the QR code is marked by 10. The method has the advantages of simplicity and quickness by adopting the binary number for marking, and the binary number is used as a data type commonly used in a program, so that subsequent data reading processing can be conveniently carried out.
Further, referring to fig. 2, based on the first embodiment, the third embodiment of the present invention further provides a QR code image detection method based on width learning, wherein, in S300, the preprocessing of graying and binarization is performed on an original image, and specifically includes the following steps:
s310, converting the image of the original picture into a gray image;
s320, converting the gray level image into a binary image by adopting a local self-adaptive threshold value mode;
and S330, filtering and denoising the binary image.
In this embodiment, the image of the original image is grayed and binarized, so that the subsequent calculation amount is reduced, the processed image can still reflect the overall and local characteristics of the original image, and the quality of the original image is improved by filtering and denoising.
The local adaptive threshold method is adopted for converting the gray level picture into the binary picture, the binary has a very important position in the image processing, the data volume in the image can be greatly reduced, and the important information of the picture can be reserved, so that the processing efficiency of the picture is improved. Common binarization methods are: the method comprises a histogram method, a local threshold method, a global threshold method, an OTSU (over the Top), and the like, wherein the local adaptive threshold method determines a binarization threshold of each pixel position according to the pixel value distribution of each pixel region block, so that the binarization threshold at each pixel position is not fixed, but is determined according to the pixel values of surrounding pixels. The binarization threshold value of the pixel region with higher brightness is generally higher, and the binarization threshold value of the image region with lower brightness is correspondingly smaller. Local image regions of different brightness, contrast, texture will have corresponding local binarization thresholds. Common local adaptive thresholding methods include local domain block mean, gaussian weighted sum of local domain blocks, etc. In this embodiment, a gaussian weighted sum method of local area blocks is used to perform image binarization processing.
Further, referring to fig. 6, based on the first embodiment, a fourth embodiment of the present invention further provides a QR code image detection method based on width learning, where the graph contour features are: contains a contour, which is surrounded by no other contour on the outside and only nests two other contours on the inside.
Specifically, in this embodiment, there are three finding patterns, which are respectively located at three positions of the upper left corner, the upper right corner, the lower left corner and the lower right corner, and the module width ratio of each finding pattern is 1:1:3:1:1, and this special ratio is helpful for positioning the QR code. In this embodiment, the screening is performed according to the three-layer nesting relationship of the QR code, and the specific steps are as follows: and converting the binarized original picture into a contour map, detecting the original picture, judging that the original picture contains a QR code if one contour exists, the outside of the original picture is not surrounded by other contours, and only two other contours are nested inside the original picture, and screening out the original picture as a target picture.
Further, referring to fig. 3, based on the first embodiment, a fifth embodiment of the present invention further provides a QR code image detection method based on width learning, wherein, in S500, a target image is used as an input of a width learning model, and the width learning model is used for training to establish a QR code detection model, which specifically includes the following steps:
s510, converting the target picture into a matrix form, and constructing an input matrix of a width learning model;
s520, performing linear operation on the input matrix to obtain a matrix consisting of characteristic points, performing nonlinear operation on the characteristic points to obtain a matrix consisting of enhancement points, and constructing an intermediate layer of the width learning model by using the matrix consisting of the characteristic points and the matrix consisting of the enhancement points;
and S530, constructing an output matrix of the width learning model by using the mark types on the original picture.
The width learning model is composed of three layers and is based on a random vector function link neural network model. The specific principle of the width learning training is as follows: and converting the target picture set obtained after screening into a matrix form, and learning an input matrix of the model by the width. The middle layer of the model is composed of feature points and enhancement points, the features mapped by the input data are used as the feature points of the network, and the mapped features are enhanced into enhancement points of the randomly generated weights. Finally, all the mapped feature points and enhancement points are directly connected to the output end, the output end is formed by a matrix of the mark types of the original picture, and the corresponding output coefficients can be obtained through a pseudo-inverse algorithm. In the training process, namely adding the characteristic points and adding the enhancement points, the weight coefficient from the middle layer to the middle of the output layer is updated. But the whole network is not required to be completely updated, and only the pseudo-inverse values of the additionally added characteristic points and the enhanced points are required to be calculated, so that the training process is faster. After the training of the width learning model, the image containing the figure outline of the QR code finding figure but not the QR code may be excluded.
Further, referring to fig. 4, based on the fifth embodiment, a sixth embodiment of the present invention further provides a QR code image detection method based on width learning, wherein in step S510, the target image is converted into a matrix form, and an input matrix of a width learning model is constructed, specifically including the following steps:
s511, converting a single target picture into a one-dimensional row vector;
and S512, constructing a two-dimensional matrix by using the converted multiple target pictures.
In this embodiment, specifically, each target picture obtained after being screened may be regarded as a two-dimensional matrix, and the second row, the third row to the nth row are all connected to the back of the first row, that is, a single target picture is converted into a one-dimensional row vector at the back. Finally, each target picture is regarded as a two-dimensional matrix formed by a single column vector, for example, m x n two-dimensional matrices are formed by m target pictures and are used as input matrices of the width learning model. The input mode of the matrix is favorable for improving the definition of the picture data and the processing efficiency. It should be noted that the construction method of the matrix is not limited to the two-dimensional matrix in this embodiment, and in other embodiments, a matrix with other number of dimensions or arrangement may be adopted.
Further, based on the fifth embodiment, a seventh embodiment of the present invention further provides a QR code image detection method based on width learning, wherein the output matrix is a two-dimensional matrix, a row vector of the output matrix is a kind of a mark on the original picture, and a number of rows of the output matrix is equal to the number of output pictures.
In this embodiment, the type of the mark on the original picture is used as the row vector of the output matrix, and the detection result can be simply and clearly output, for example, if the picture containing the QR code is marked with 01 and the picture without the QR code is marked with 10, the row vector of the output matrix is 01 or 10, and how many pictures are detected and how many rows of the output matrix exist.
In addition, referring to fig. 5, an eighth embodiment of the present invention further provides a QR code image detection method based on width learning, including, but not limited to, the following steps:
s710, inputting a picture containing a QR code and a picture without the QR code as original pictures, and respectively adopting different binary numbers for marking;
s720, converting the image of the original picture into a gray image, converting the gray image into a binary image by adopting a local self-adaptive threshold value mode, and then filtering and denoising;
s730, screening the picture which contains one outline, does not have other outline surrounding outside the outline and only nests two other outlines inside the outline from the original picture as a target picture;
s740, converting the target picture into a matrix form, constructing an input matrix of the width learning model, constructing a middle layer of the width learning model by using the input matrix, constructing an output matrix of the width learning model by using the mark types on the original picture, training by using the obtained width learning model, and establishing a QR code detection model;
and S750, inputting the picture to be detected into the QR code detection model to judge whether the QR code is contained.
In step S740, an intermediate layer of the width learning model is constructed using the input matrix, specifically, a matrix including feature points is obtained by subjecting the input matrix to linear operation, a matrix including enhancement points is obtained by subjecting the feature points to nonlinear operation, and an intermediate layer of the width learning model is constructed using the matrix including feature points and the matrix including enhancement points.
In this embodiment, the original pictures containing the QR code and the original pictures without the QR code are input, and are marked differently, graying and binaryzation are performed on the original pictures, the pictures containing the contour features similar to the QR code image-finding patterns are screened out by using the contour features of the QR code image-finding patterns, and then the pictures are used as the input of the width learning model, the QR code detection model is established by training the width learning model, and finally the pictures to be detected are input into the trained QR code detection model, so that whether the pictures to be detected contain the QR code can be judged. By adopting the mode of extracting the known picture to construct the model and then training the model, whether the picture contains the QR code or not can be judged. The training can be rapidly carried out by utilizing the width learning model, and the accuracy can be higher when the width learning model is used for testing and judging other pictures.
Referring to fig. 7, the ninth embodiment of the present invention further provides a QR code image detection system based on width learning, including but not limited to:
an input unit for inputting an original picture;
the marking unit is used for marking the picture containing the QR code and the picture without the QR code differently;
the preprocessing unit is used for carrying out graying and binaryzation on the original picture;
the screening unit is used for screening a target picture containing a graph outline similar to the QR code image finding graph from the preprocessed original picture by utilizing the outline characteristics of the QR code image finding graph;
and the model construction unit is used for training by utilizing the width learning model and establishing a QR code detection model.
It should be noted that, since the QR code image detection system based on width learning in this embodiment is based on the same inventive concept as any one of the QR code image detection methods based on width learning in the first to eighth embodiments, the corresponding content of any one of the first to eighth embodiments is also applicable to this embodiment, and is not described in detail here.
Referring to fig. 8, a tenth embodiment of the present invention further provides a QR code image detection apparatus based on width learning, including:
at least one processor;
and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to perform any one of the width learning-based QR code image detection methods as described in the first to eighth embodiments above.
The device can be any type of intelligent terminal, such as a mobile phone, a tablet computer, a personal computer, and the like.
The processor and memory may be connected by a bus or other means, such as by a bus in FIG. 8.
The memory, which is a non-transitory computer-readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules corresponding to the QR code image detection method based on width learning in the embodiments of the present invention. The processor executes various functional applications and data processing of the QR code image detection device based on width learning by running non-transitory software programs, instructions and modules stored in the memory, that is, the QR code image detection method based on width learning of any one of the above method embodiments is implemented.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the stored data area may store data created from use of the QR code image detection apparatus based on width learning, and the like. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory remotely located from the processor, and the remote memory may be connected to the apparatus for QR code image detection based on width learning over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory and, when executed by the one or more processors, perform the QR code image detection method based on width learning in any of the above-described method embodiments, for example, perform the method steps S100 to S600 in the first embodiment and the method steps S710 to S750 in the eighth embodiment described above.
The eighth embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, which are executed by one or more control processors, for example, by one of the processors in fig. 8, and may cause the one or more processors to execute a QR code image detection method based on width learning in the above method embodiments, for example, the method steps S100 to S600 in the first embodiment, and the method steps S710 to S750 in the eighth embodiment.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a general hardware platform, and certainly can also be implemented by hardware. It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a computer readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the preferred embodiments of the present invention have been described in detail, it will be understood by those skilled in the art that the foregoing and various other changes, omissions and deviations in the form and detail thereof may be made without departing from the scope of this invention.

Claims (9)

1. A QR code image detection method based on width learning is characterized by comprising the following steps:
inputting a picture containing a QR code and a picture without the QR code as original pictures;
respectively marking the picture containing the QR code and the picture without the QR code differently;
carrying out graying and binaryzation pretreatment on an original picture;
screening out a target picture containing a graphic outline similar to the QR code image searching graph from the preprocessed original picture by utilizing the graphic outline characteristic of the QR code image searching graph;
taking a target picture as the input of a width learning model, training by using the width learning model, and establishing a QR (quick response) code detection model;
judging whether the picture to be detected contains a QR code or not by using the QR code detection model;
the target picture is used as the input of the width learning model, the width learning model is used for training, and a QR code detection model is established, wherein the QR code detection model comprises the following steps:
converting the target picture into a matrix form, and constructing an input matrix of a width learning model;
performing linear operation on the input matrix to obtain a matrix formed by characteristic points, performing nonlinear operation on the characteristic points to obtain a matrix formed by enhanced points, and constructing an intermediate layer of a width learning model by using the matrix formed by the characteristic points and the matrix formed by the enhanced points;
and constructing an output matrix of the width learning model by using the mark types on the original picture.
2. The QR code image detection method based on width learning according to claim 1, characterized in that: and respectively marking the picture containing the QR code and the picture without the QR code by adopting different binary numbers.
3. The QR code image detection method based on width learning according to claim 1, wherein the preprocessing of graying and binarization of the original image comprises:
converting an image of an original picture into a gray image;
converting the gray level image into a binary image by adopting a local self-adaptive threshold value mode;
and filtering and denoising the binary image.
4. The QR code image detection method based on width learning according to claim 1, characterized in that: the figure outline characteristic is as follows: contains a contour, which is surrounded by no other contour on the outside and only nests two other contours on the inside.
5. The QR code image detection method based on width learning of claim 1, wherein the converting the target image into a matrix form to construct the input matrix of the width learning model comprises:
converting a single target picture into a one-dimensional row vector;
and constructing a two-dimensional matrix by using the converted multiple target pictures.
6. The QR code image detection method based on width learning according to claim 1, characterized in that: the output matrix is a two-dimensional matrix, the row vector of the output matrix is the type of the mark on the original picture, and the row number of the output matrix is equal to the number of the output pictures.
7. A QR code image detection system based on width learning is characterized by comprising:
an input unit for inputting an original picture;
the marking unit is used for marking the picture containing the QR code and the picture without the QR code differently;
the preprocessing unit is used for carrying out graying and binaryzation on the original picture;
the screening unit is used for screening a target picture containing a graph outline similar to the QR code image finding graph from the preprocessed original picture by utilizing the graph outline characteristics of the QR code image finding graph;
the model construction unit is used for taking the target picture as the input of the width learning model, utilizing the width learning model for training and establishing a QR code detection model;
the method includes the steps of taking a target picture as an input of a width learning model, training the target picture by using the width learning model, and establishing a QR (quick response) code detection model, and includes the following steps:
converting the target picture into a matrix form, and constructing an input matrix of a width learning model;
performing linear operation on the input matrix to obtain a matrix consisting of characteristic points, performing nonlinear operation on the characteristic points to obtain a matrix consisting of enhancement points, and constructing an intermediate layer of a width learning model by using the matrix consisting of the characteristic points and the matrix consisting of the enhancement points;
and constructing an output matrix of the width learning model by using the mark types on the original picture.
8. A QR code image detection device based on width learning, characterized by comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
9. A computer-readable storage medium having stored thereon computer-executable instructions for causing a computer to perform the method of any one of claims 1-6.
CN201910072722.0A 2019-01-25 2019-01-25 QR code image detection method based on width learning Active CN109886059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910072722.0A CN109886059B (en) 2019-01-25 2019-01-25 QR code image detection method based on width learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910072722.0A CN109886059B (en) 2019-01-25 2019-01-25 QR code image detection method based on width learning

Publications (2)

Publication Number Publication Date
CN109886059A CN109886059A (en) 2019-06-14
CN109886059B true CN109886059B (en) 2022-08-05

Family

ID=66926888

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910072722.0A Active CN109886059B (en) 2019-01-25 2019-01-25 QR code image detection method based on width learning

Country Status (1)

Country Link
CN (1) CN109886059B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111428530B (en) * 2020-02-29 2022-07-15 厦门华联电子股份有限公司 Two-dimensional code image detection and identification equipment, device and method
CN112445849B (en) * 2020-11-27 2022-07-15 深圳前海微众银行股份有限公司 Report form analysis method and device
US11960966B2 (en) 2022-05-16 2024-04-16 Abbyy Development Inc. Decoding of two-dimensional barcodes under unfavorable conditions

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831428A (en) * 2012-06-30 2012-12-19 东南大学 Method for extracting quick response matrix code region in image
CN104809422A (en) * 2015-04-27 2015-07-29 江苏中科贯微自动化科技有限公司 QR code recognizing method based on image processing
CN108388822A (en) * 2018-01-25 2018-08-10 微梦创科网络科技(中国)有限公司 A kind of method and apparatus of detection image in 2 D code
CN108537227A (en) * 2018-03-21 2018-09-14 华中科技大学 A kind of offline false distinguishing method of commodity based on width study and wide-angle micro-image
CN109147938A (en) * 2018-08-02 2019-01-04 广东工业大学 A kind of disease intelligent diagnostics device and equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831428A (en) * 2012-06-30 2012-12-19 东南大学 Method for extracting quick response matrix code region in image
CN104809422A (en) * 2015-04-27 2015-07-29 江苏中科贯微自动化科技有限公司 QR code recognizing method based on image processing
CN108388822A (en) * 2018-01-25 2018-08-10 微梦创科网络科技(中国)有限公司 A kind of method and apparatus of detection image in 2 D code
CN108537227A (en) * 2018-03-21 2018-09-14 华中科技大学 A kind of offline false distinguishing method of commodity based on width study and wide-angle micro-image
CN109147938A (en) * 2018-08-02 2019-01-04 广东工业大学 A kind of disease intelligent diagnostics device and equipment

Also Published As

Publication number Publication date
CN109886059A (en) 2019-06-14

Similar Documents

Publication Publication Date Title
CN109886059B (en) QR code image detection method based on width learning
CN105069394B (en) Quick Response Code weighted average gray level method coding/decoding method and system
US11790198B2 (en) Method and apparatus for processing encoded pattern, storage medium, and electronic apparatus
CN110348264B (en) QR two-dimensional code image correction method and system
TWI696954B (en) Digital object unique identifier (DOI) recognition method and device
CN111626293A (en) Image text recognition method and device, electronic equipment and storage medium
CN106845312B (en) Two-dimensional code image quality pre-judgment method
CN103942762A (en) Two-dimension code preprocessing method and device
CN109389110B (en) Region determination method and device
CN111680690A (en) Character recognition method and device
CN110210467B (en) Formula positioning method of text image, image processing device and storage medium
CN111414779A (en) Anti-counterfeit label identification method and device
CN109961447B (en) Price tag detection method and device, electronic equipment and storage medium
CN113435219B (en) Anti-counterfeiting detection method and device, electronic equipment and storage medium
CN114445410A (en) Circuit board detection method based on image recognition, computer and readable storage medium
CN104346596A (en) Identification method and identification device for QR (Quick Response) code
CN114519788A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN112163443A (en) Code scanning method, code scanning device and mobile terminal
CN112365451A (en) Method, device and equipment for determining image quality grade and computer readable medium
CN115909378A (en) Document text detection model training method and document text detection method
CN115661156A (en) Image generation method, image generation device, storage medium, equipment and computer program product
CN111753842B (en) Method and device for detecting text region of bill
CN109448013B (en) QR code image binarization processing method with local uneven illumination
CN109871910B (en) Handwritten character recognition method and device
CN110502950B (en) Quick self-adaptive binarization method for QR codes with uneven illumination

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