CN111178111A - Two-dimensional code detection method, electronic device, storage medium and system - Google Patents

Two-dimensional code detection method, electronic device, storage medium and system Download PDF

Info

Publication number
CN111178111A
CN111178111A CN201911416546.4A CN201911416546A CN111178111A CN 111178111 A CN111178111 A CN 111178111A CN 201911416546 A CN201911416546 A CN 201911416546A CN 111178111 A CN111178111 A CN 111178111A
Authority
CN
China
Prior art keywords
dimensional code
image
detection
gray
edge
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.)
Pending
Application number
CN201911416546.4A
Other languages
Chinese (zh)
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.)
Aisino Corp
Original Assignee
Aisino Corp
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 Aisino Corp filed Critical Aisino Corp
Priority to CN201911416546.4A priority Critical patent/CN111178111A/en
Publication of CN111178111A publication Critical patent/CN111178111A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1452Methods for optical code recognition including a method step for retrieval of the optical code detecting bar code edges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • G06T2207/10008Still image; Photographic image from scanner, fax or copier
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details

Landscapes

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

Abstract

The invention discloses a two-dimensional code detection method, electronic equipment, a storage medium and a system. The method comprises the following steps: carrying out graying processing on the acquired two-dimensional code image to obtain a two-dimensional code grayscale image; denoising the two-dimensional code gray level image to remove abrupt noise in the two-dimensional code gray level image and reduce detail levels; performing edge detection on the two-dimensional code gray image subjected to denoising processing to obtain edge points of the two-dimensional code in the two-dimensional code gray image; performing morphological closing operation processing on the two-dimensional code gray image subjected to edge detection to fill cracks in the two-dimensional code and remove small particle noise; and carrying out contour detection on the two-dimensional code gray image subjected to the morphological closed operation processing, and acquiring the rectangular contour of the two-dimensional code in the two-dimensional code gray image according to the edge point to finish the detection of the two-dimensional code. And the quick and accurate detection of the two-dimensional code is realized.

Description

Two-dimensional code detection method, electronic device, storage medium and system
Technical Field
The invention relates to the technical field of two-dimensional code identification, in particular to a two-dimensional code detection method, electronic equipment, a storage medium and a system.
Background
The two-dimensional code records data symbol information by black and white patterns which are distributed on a plane (two-dimensional direction) according to a certain rule by using a certain specific geometric figure. The matrix type two-dimensional bar code is coded in a rectangular space through different distribution of black and white pixels in a matrix, on corresponding element positions of the matrix, binary '1' is represented by the appearance of points (square points, round points or other shapes), binary '0' is represented by the absence of the points, and the meaning represented by the matrix type two-dimensional bar code is determined by the arrangement and combination of the points. The two-dimension code is a new pattern and symbol automatic recognizing and reading processing code system based on computer image processing technology and combined coding principle. The method has the characteristics of high-density coding, large information capacity, wide coding range, strong fault-tolerant capability, error correction function, high decoding reliability, capability of introducing encryption measures, low cost, easiness in manufacturing, durability and the like. The method is widely applied to the fields of product tracking, certificate bill information storage, storage management, confidential information and the like.
At present, the condition such as illumination inhomogeneous or the dirty impaired of two-dimensional code can exist among the two-dimensional code testing process, leads to the two-dimensional code size distortion of collection or fuzzy, and then leads to the unable location detection of two-dimensional code effective area.
In order to solve the above problems, an existing recognition method is to effectively locate a two-dimensional code in a picture for recognition through a trained classifier. The method can be used for positioning the two-dimensional code with distorted size and local damage or fuzziness, but a large number of labeled training samples are needed, and the trained model is too large, so that the speed of detecting and positioning the two-dimensional code is influenced. The other method is to adopt an image processing method, which comprises the steps of grey-scale image conversion, median filtering, edge detection, parallel coordinate positioning and the like, and 3 corner point characteristics of the two-dimensional code are searched to position the two-dimensional code for detection, although the median filtering can eliminate some random noises, the parallel coordinate positioning is inaccurate under the conditions of some uneven illumination, two-dimensional code missing needles and two-dimensional code distortion deformation, and the positioning effect is poor.
Therefore, a method for rapidly and accurately detecting the two-dimensional code needs to be provided.
Disclosure of Invention
The invention aims to provide a two-dimensional code detection method, electronic equipment, a storage medium and a system, which are used for realizing the rapid and accurate detection of a two-dimensional code.
In order to achieve the above object, the present invention provides a two-dimensional code detection method, including:
step 1: carrying out graying processing on the acquired two-dimensional code image to obtain a two-dimensional code grayscale image;
step 2: denoising the two-dimensional code gray level image to remove abrupt noise in the two-dimensional code gray level image and reduce detail levels;
and step 3: performing edge detection on the two-dimensional code gray image subjected to denoising processing to obtain edge points of the two-dimensional code in the two-dimensional code gray image;
and 4, step 4: performing morphological closing operation processing on the two-dimensional code gray image subjected to edge detection to fill cracks in the two-dimensional code and remove small particle noise;
and 5: and carrying out contour detection on the two-dimensional code gray image subjected to the morphological closed operation processing, and acquiring a rectangular contour of the two-dimensional code in the two-dimensional code gray image according to the edge point to finish the detection of the two-dimensional code.
Optionally, in the step 1, the acquired two-dimensional code image is grayed by the following formula:
W=0.3R+0.59G+0.11B,
wherein, W represents the gray value of a pixel, R represents the red component of a pixel, G represents the green component of a pixel, and B represents the blue component of a pixel.
Optionally, the step 2 includes: and denoising the two-dimensional code gray image by a Gaussian smoothing filter algorithm.
Optionally, the step 3 includes: and carrying out edge detection on the two-dimensional code in the two-dimensional code gray image by using a Sobel algorithm.
Optionally, the step 4 includes: and constructing a rectangular morphological kernel, and sequentially performing expansion operation processing and corrosion operation processing on the two-dimensional code gray-scale image based on the rectangular morphological kernel.
Optionally, the step 5 includes: and constructing lines by all the edge points in the two-dimensional code gray image, finding out a convex polygon forming a closed curve at the outermost layer, and calculating the minimum enclosing rectangle of the convex polygon by a rotating caliper algorithm.
The present invention also proposes an electronic device, 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 two-dimensional code detection method described above.
The present invention also proposes a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the above-mentioned two-dimensional code detection method.
The invention also provides a two-dimensional code detection system, which comprises:
the gray processing module is used for carrying out gray processing on the acquired two-dimensional code image so as to obtain a two-dimensional code gray image;
the denoising processing module is used for denoising the two-dimensional code gray level image so as to remove abrupt noise in the two-dimensional code gray level image and reduce detail levels;
the edge detection module is used for carrying out edge detection on the two-dimensional code gray level image subjected to denoising processing to obtain edge points of the two-dimensional code in the two-dimensional code gray level image;
the morphology closing operation processing module is used for performing morphology closing operation processing on the two-dimensional code gray level image subjected to edge detection so as to fill cracks in the two-dimensional code and remove small particle noise;
and the contour detection module is used for carrying out contour detection on the two-dimensional code gray image subjected to the morphological closed operation processing, acquiring a rectangular contour of the two-dimensional code in the two-dimensional code gray image according to the edge point and finishing the detection of the two-dimensional code.
Optionally, the grayscale processing module performs graying processing on the acquired two-dimensional code image through the following formula:
W=0.3R+0.59G+0.11B,
wherein W represents the gray value of a pixel, R represents the red component of a pixel, G represents the green component of a pixel, and B represents the blue component of a pixel;
the denoising processing module is used for denoising the two-dimensional code gray level image through a Gaussian smooth filtering algorithm;
the edge detection module carries out edge detection on the two-dimensional code in the two-dimensional code gray level image through a Sobel algorithm;
the morphology close operation processing module constructs a rectangular morphology core and sequentially performs expansion operation processing and corrosion operation processing on the two-dimensional code gray level image on the basis of the rectangular morphology core;
the contour detection module forms lines by all the edge points in the two-dimensional code gray image, finds out a convex polygon forming a closed curve at the outermost layer, and calculates the minimum enclosing rectangle of the convex polygon by a rotating caliper algorithm.
The invention has the beneficial effects that:
through carrying out graying processing, denoising processing, edge detection, morphology close operation and contour detection in proper order to the two-dimensional code image of gathering, the operand is little and can detect out the region that the two-dimensional code was located in the image fast to cut out the picture of two-dimensional code, supply follow-up procedure to go discerning information wherein, can accomplish to trail the two-dimensional code region in real time, to some illumination inhomogeneous, shadow and noise condition, interference is got rid of that also can be fine, has fine detection effect.
The apparatus of the present invention has other features and advantages which will be apparent from or are set forth in detail in the accompanying drawings and the following detailed description, which are incorporated herein, and which together serve to explain certain principles of the invention.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent by describing in more detail exemplary embodiments thereof with reference to the attached drawings, in which like reference numerals generally represent like parts.
Fig. 1 shows a step diagram of a two-dimensional code detection method according to the present invention.
Detailed Description
The invention will be described in more detail below with reference to the accompanying drawings. While the preferred embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
The invention discloses a two-dimensional code detection method, which comprises the following steps:
step 1: carrying out graying processing on the acquired two-dimensional code image to obtain a two-dimensional code grayscale image;
step 2: denoising the two-dimensional code gray level image to remove abrupt noise in the two-dimensional code gray level image and reduce detail levels;
and step 3: performing edge detection on the two-dimensional code gray image subjected to denoising processing to obtain edge points of the two-dimensional code in the two-dimensional code gray image;
and 4, step 4: performing morphological closing operation processing on the two-dimensional code gray image subjected to edge detection to fill cracks in the two-dimensional code and remove small particle noise;
and 5: and carrying out contour detection on the two-dimensional code gray image subjected to the morphological closed operation processing, and acquiring the rectangular contour of the two-dimensional code in the two-dimensional code gray image according to the edge point to finish the detection of the two-dimensional code.
Specifically, through carrying out graying processing, denoising processing, edge detection, morphology close operation and contour detection on the collected two-dimensional code image in sequence, the calculation amount is small, the region where the two-dimensional code is located in the image can be detected quickly, the picture of the two-dimensional code is cut out, a follow-up program can identify information in the two-dimensional code, the two-dimensional code region can be tracked in real time, interference can be well removed under the conditions of uneven illumination, shadow and noise, and the detection effect is good.
In this embodiment, in step 1, the collected two-dimensional code image is grayed by the following formula:
W=0.3R+0.59G+0.11B,
wherein, W represents the gray value of a pixel, R represents the red component of a pixel, G represents the green component of a pixel, and B represents the blue component of a pixel.
Specifically, the input two-dimensional code image is an image acquired by using an acquisition device such as a smartphone, and is usually a color image, each pixel of the two-dimensional code image has R, G, B three components, and each component has 256 values. In order to reduce the data processing amount, it is necessary to perform graying processing on the acquired various color digital images. The graying of the color image is calculated by adopting the following formula: w is 0.3R +0.59G + 0.11B.
In this embodiment, step 2 includes: and denoising the two-dimensional code gray image by a Gaussian smoothing filter algorithm.
Specifically, the noise of the two-dimensional code image is mainly surface fouling and image shadow, and in order to reduce the influence of the noise on the image, a Gaussian smoothing filter algorithm is adopted for processing, and the Gaussian smoothing filter algorithm can weaken the part with large change in the regional edge gray value in the image without influencing the part gray value with small change; the method can eliminate abrupt noise or tiny abrupt noise, and can connect tiny intervals of targets at the same time, and the method is similar to the composition structure of the two-dimensional code image. The gaussian smoothing process of the image is a process of convolving the image with a convolution kernel of a normal distribution, which is used to reduce image noise and detail level, and the kernel size (array) in this embodiment uses a convolution kernel of 3 × 3. The gaussian smoothing filter algorithm is prior art, and the detailed principle thereof is not described herein.
In this embodiment, step 3 includes: and the Sobel algorithm carries out edge detection on the two-dimensional code in the two-dimensional code gray image.
Specifically, the edge detection of the Sobel algorithm is performed on the image, that is, the image is regarded as a two-dimensional discrete function, the gradient of the image is obtained, and since the direction is on the maximum change rate of the image gray scale, the gray scale change on the image edge can be just reflected. Here, we respectively derive the horizontal direction component and the vertical direction component of the image, and because the components are discrete functions, the edge is detected by utilizing the phenomenon that the edge reaches an extreme value directly according to the gray scale weighting difference of upper, lower, left and right adjacent points of a pixel point. The method has a smoothing effect on noise, can provide more accurate edge direction information, and is fast in calculation speed because pixel points with new gray values larger than or equal to the threshold value are edge points when the algorithm is output. The Sobel algorithm is prior art, and the detailed principle thereof is not described herein.
In this embodiment, step 4 includes: and constructing a rectangular morphological kernel, and sequentially performing expansion operation processing and corrosion operation processing on the two-dimensional code gray level image based on the rectangular morphological kernel.
Specifically, a rectangular morphological kernel of size (array) 9 × 9 is first constructed, and the image is subjected to a morphological closing operation that fills in small holes, bridges small cracks, and fills in gaps in the two-dimensional code without changing the overall position and shape. The closing operation is to expand and then corrode, to enlarge the target area, to combine the background points contacting with the target morphological area into the target, to expand the target boundary to the outside, to fill some holes in the target area and eliminate the small particle noise in the target area; the target area range is made to be smaller, which substantially causes the boundary of the image to shrink, and can be used for eliminating small and meaningless target objects. The morphological closing operation is prior art and the detailed principle thereof will not be described herein.
In this embodiment, step 5 includes: and constructing lines by all edge points in the two-dimensional code gray image, finding out a convex polygon forming a closed curve at the outermost layer, and calculating the minimum enclosing rectangle of the convex polygon by a rotating caliper algorithm.
Specifically, all edge points in the image form lines, the outermost layer of the curve (contour) connected in a closed manner is found, namely the inner part does not have a closed curve, then a rotary caliper algorithm is used, the minimum bounding rectangle of the convex polygon can be calculated, the time consumption is reduced to O (n log n), specifically, certain two pole points in the lines form parallel lines, two lines are rotated, when the lines coincide with one side of the polygon, the area of the formed rectangle is calculated, and the smallest rectangle (closed bag) in the lines, namely the two-dimensional code image area is found.
The method provided by the embodiment of the invention can detect the area of the two-dimensional code in the image in a short time, and cut out the picture of the two-dimensional code for a subsequent program to identify the information in the picture. The minimum closure of the rectangle where the two-dimensional code is located, namely the image area of the two-dimensional code, is obtained through a series of image processing algorithms such as gray-scale image conversion, gradient edge detection, Gaussian smoothing, morphology closing operation, corrosion, expansion operation, contour detection, rotating caliper algorithm and the like. The invention directly solves the gradient or geometric minimum value of the gray 8-bit pixel image, and then carries out filtering and other processing on the gray image, thereby further reducing the operation amount; because large-scale matrix multiplication and addition operation is not involved, the calculation speed is high, and the real-time tracking of the two-dimensional code area can be realized; and interference can be well removed under the conditions of uneven illumination, shadow and noise, and a good detection effect is achieved.
The invention also proposes an electronic device 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, and the instructions are executable by the at least one processor to enable the at least one processor to perform the two-dimensional code detection method.
The present invention also proposes a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the above-mentioned two-dimensional code detection method.
The invention also provides a two-dimensional code detection system, which comprises:
the gray processing module is used for carrying out gray processing on the acquired two-dimensional code image so as to obtain a two-dimensional code gray image;
the denoising processing module is used for denoising the two-dimensional code gray level image so as to remove abrupt noise in the two-dimensional code gray level image and reduce detail levels;
the edge detection module is used for carrying out edge detection on the two-dimensional code gray image subjected to denoising processing to obtain edge points of the two-dimensional code in the two-dimensional code gray image;
the morphology closing operation processing module is used for performing morphology closing operation processing on the two-dimensional code gray image subjected to edge detection so as to fill cracks in the two-dimensional code and remove small particle noise;
and the contour detection module is used for carrying out contour detection on the two-dimensional code gray image subjected to the morphological closed operation processing, acquiring a rectangular contour of the two-dimensional code in the two-dimensional code gray image according to the edge point, and completing the detection of the two-dimensional code.
In this embodiment, the grayscale processing module performs graying processing on the acquired two-dimensional code image through the following formula:
W=0.3R+0.59G+0.11B,
wherein W represents the gray value of a pixel, R represents the red component of a pixel, G represents the green component of a pixel, and B represents the blue component of a pixel;
the denoising processing module is used for denoising the two-dimensional code gray level image through a Gaussian smooth filtering algorithm;
the edge detection module carries out edge detection on the two-dimensional code in the two-dimensional code gray image through a Sobel algorithm;
the morphology close operation processing module is used for sequentially performing expansion operation processing and corrosion operation processing on the two-dimensional code gray level image by constructing a rectangular morphology core and based on the rectangular morphology core;
the contour detection module forms lines by all edge points in the two-dimensional code gray image, finds out a convex polygon of which the outermost layer forms a closed curve, and calculates the minimum enclosing rectangle of the convex polygon by a rotating caliper algorithm.
The embodiment of the invention adopts the existing basic image processing method, can greatly accelerate the calculation speed, is suitable for tracking and detecting the area of the two-dimensional code in real time, and has good detection effect on the two-dimensional code of most pictures with uneven illumination. Meanwhile, the invention can realize the quick tracking detection of the two-dimension code in a short time under the environment of limited resources (an embedded platform), and can accurately position the two-dimension code area under the condition of uneven illumination, thereby greatly enhancing the practicability.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments.

Claims (10)

1. A two-dimensional code detection method is characterized by comprising the following steps:
step 1: carrying out graying processing on the acquired two-dimensional code image to obtain a two-dimensional code grayscale image;
step 2: denoising the two-dimensional code gray level image to remove abrupt noise in the two-dimensional code gray level image and reduce detail levels;
and step 3: performing edge detection on the two-dimensional code gray image subjected to denoising processing to obtain edge points of the two-dimensional code in the two-dimensional code gray image;
and 4, step 4: performing morphological closing operation processing on the two-dimensional code gray image subjected to edge detection to fill cracks in the two-dimensional code and remove small particle noise;
and 5: and carrying out contour detection on the two-dimensional code gray image subjected to the morphological closed operation processing, and acquiring a rectangular contour of the two-dimensional code in the two-dimensional code gray image according to the edge point to finish the detection of the two-dimensional code.
2. The two-dimensional code detection method according to claim 1, wherein in the step 1, the collected two-dimensional code image is grayed by the following formula:
W=0.3R+0.59G+0.11B,
wherein, W represents the gray value of a pixel, R represents the red component of a pixel, G represents the green component of a pixel, and B represents the blue component of a pixel.
3. The two-dimensional code detection method according to claim 1, wherein the step 2 includes:
and denoising the two-dimensional code gray image by a Gaussian smoothing filter algorithm.
4. The two-dimensional code detection method according to claim 1, wherein the step 3 includes:
and carrying out edge detection on the two-dimensional code in the two-dimensional code gray image through a Sobel algorithm.
5. The two-dimensional code detection method according to claim 1, wherein the step 4 includes:
and constructing a rectangular morphological kernel, and sequentially performing expansion operation processing and corrosion operation processing on the two-dimensional code gray-scale image based on the rectangular morphological kernel.
6. The two-dimensional code detection method according to claim 1, wherein the step 5 comprises:
and constructing lines by all the edge points in the two-dimensional code gray image, finding out a convex polygon forming a closed curve at the outermost layer, and calculating the minimum enclosing rectangle of the convex polygon by a rotating caliper algorithm.
7. An electronic device, characterized in that the electronic device comprises:
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 two-dimensional code detection method of any of claims 1-6.
8. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the two-dimensional code detection method according to any one of claims 1 to 6.
9. A two-dimensional code detection system, comprising:
the gray processing module is used for carrying out gray processing on the acquired two-dimensional code image so as to obtain a two-dimensional code gray image;
the denoising processing module is used for denoising the two-dimensional code gray level image so as to remove abrupt noise in the two-dimensional code gray level image and reduce detail levels;
the edge detection module is used for carrying out edge detection on the two-dimensional code gray level image subjected to denoising processing to obtain edge points of the two-dimensional code in the two-dimensional code gray level image;
the morphology closing operation processing module is used for performing morphology closing operation processing on the two-dimensional code gray level image subjected to edge detection so as to fill cracks in the two-dimensional code and remove small particle noise;
and the contour detection module is used for carrying out contour detection on the two-dimensional code gray image subjected to the morphological closed operation processing, acquiring a rectangular contour of the two-dimensional code in the two-dimensional code gray image according to the edge point and finishing the detection of the two-dimensional code.
10. The two-dimensional code detection system according to claim 9, wherein the grayscale processing module grays the acquired two-dimensional code image according to the following formula:
W=0.3R+0.59G+0.11B,
wherein W represents the gray value of a pixel, R represents the red component of a pixel, G represents the green component of a pixel, and B represents the blue component of a pixel;
the denoising processing module is used for denoising the two-dimensional code gray level image through a Gaussian smooth filtering algorithm;
the edge detection module carries out edge detection on the two-dimensional code in the two-dimensional code gray level image through a Sobel algorithm;
the morphology close operation processing module constructs a rectangular morphology core and sequentially performs expansion operation processing and corrosion operation processing on the two-dimensional code gray level image on the basis of the rectangular morphology core;
the contour detection module forms lines by all the edge points in the two-dimensional code gray image, finds out a convex polygon forming a closed curve at the outermost layer, and calculates the minimum enclosing rectangle of the convex polygon by a rotating caliper algorithm.
CN201911416546.4A 2019-12-31 2019-12-31 Two-dimensional code detection method, electronic device, storage medium and system Pending CN111178111A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911416546.4A CN111178111A (en) 2019-12-31 2019-12-31 Two-dimensional code detection method, electronic device, storage medium and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911416546.4A CN111178111A (en) 2019-12-31 2019-12-31 Two-dimensional code detection method, electronic device, storage medium and system

Publications (1)

Publication Number Publication Date
CN111178111A true CN111178111A (en) 2020-05-19

Family

ID=70657751

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911416546.4A Pending CN111178111A (en) 2019-12-31 2019-12-31 Two-dimensional code detection method, electronic device, storage medium and system

Country Status (1)

Country Link
CN (1) CN111178111A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112651259A (en) * 2020-12-29 2021-04-13 芜湖哈特机器人产业技术研究院有限公司 Two-dimensional code positioning method and mobile robot positioning method based on two-dimensional code
CN112907612A (en) * 2021-03-31 2021-06-04 深圳市华汉伟业科技有限公司 Bar code region positioning method and image rectangular region fitting method

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030072489A1 (en) * 2001-08-28 2003-04-17 Sick Ag Method of recognizing a code
JP2011170882A (en) * 2011-04-28 2011-09-01 Toshiba Tec Corp Two dimensional code reader and its method
CN104197899A (en) * 2014-09-24 2014-12-10 中国科学院宁波材料技术与工程研究所 Mobile robot location method and system
CN104636701A (en) * 2014-12-12 2015-05-20 浙江工业大学 Laser two-dimension code identification method based on image restoration
CN106529368A (en) * 2016-09-29 2017-03-22 上海正雅齿科科技有限公司 Method for localizing recognition region of two-dimensional code
CN106845314A (en) * 2016-12-28 2017-06-13 广州智慧城市发展研究院 A kind of method for rapidly positioning of Quick Response Code
CN107609451A (en) * 2017-09-14 2018-01-19 斯坦德机器人(深圳)有限公司 A kind of high-precision vision localization method and system based on Quick Response Code
CN109101856A (en) * 2018-09-25 2018-12-28 广东工业大学 A kind of image in 2 D code recognition methods and device
CN109800615A (en) * 2018-12-28 2019-05-24 新大陆数字技术股份有限公司 The detection localization method and system of two-dimension code area

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030072489A1 (en) * 2001-08-28 2003-04-17 Sick Ag Method of recognizing a code
JP2011170882A (en) * 2011-04-28 2011-09-01 Toshiba Tec Corp Two dimensional code reader and its method
CN104197899A (en) * 2014-09-24 2014-12-10 中国科学院宁波材料技术与工程研究所 Mobile robot location method and system
CN104636701A (en) * 2014-12-12 2015-05-20 浙江工业大学 Laser two-dimension code identification method based on image restoration
CN106529368A (en) * 2016-09-29 2017-03-22 上海正雅齿科科技有限公司 Method for localizing recognition region of two-dimensional code
CN106845314A (en) * 2016-12-28 2017-06-13 广州智慧城市发展研究院 A kind of method for rapidly positioning of Quick Response Code
CN107609451A (en) * 2017-09-14 2018-01-19 斯坦德机器人(深圳)有限公司 A kind of high-precision vision localization method and system based on Quick Response Code
CN109101856A (en) * 2018-09-25 2018-12-28 广东工业大学 A kind of image in 2 D code recognition methods and device
CN109800615A (en) * 2018-12-28 2019-05-24 新大陆数字技术股份有限公司 The detection localization method and system of two-dimension code area

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
潘观潮等: "基于OpenCV 和Zbar 的二维码图像提取与识别", 电脑知识与技术, vol. 15, no. 16, pages 192 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112651259A (en) * 2020-12-29 2021-04-13 芜湖哈特机器人产业技术研究院有限公司 Two-dimensional code positioning method and mobile robot positioning method based on two-dimensional code
CN112907612A (en) * 2021-03-31 2021-06-04 深圳市华汉伟业科技有限公司 Bar code region positioning method and image rectangular region fitting method

Similar Documents

Publication Publication Date Title
CN111612781B (en) Screen defect detection method and device and head-mounted display equipment
CN108369650B (en) Method for identifying possible characteristic points of calibration pattern
CN105069394B (en) Quick Response Code weighted average gray level method coding/decoding method and system
CN110309808B (en) Self-adaptive smoke root node detection method in large-scale space
CN107945111B (en) Image stitching method based on SURF (speeded up robust features) feature extraction and CS-LBP (local binary Pattern) descriptor
CN106709500B (en) Image feature matching method
Yoo et al. Image matching using peak signal-to-noise ratio-based occlusion detection
CN108921813A (en) Unmanned aerial vehicle detection bridge structure crack identification method based on machine vision
CN104123554A (en) SIFT image characteristic extraction method based on MMTD
CN111178111A (en) Two-dimensional code detection method, electronic device, storage medium and system
CN115587966A (en) Method and system for detecting whether parts are missing or not under condition of uneven illumination
CN103745236A (en) Texture image identification method and texture image identification device
CN106778766B (en) Positioning point-based rotating number identification method and system
CN109784328B (en) Method for positioning bar code, terminal and computer readable storage medium
CN117557565B (en) Detection method and device for lithium battery pole piece
CN110929598A (en) Unmanned aerial vehicle-mounted SAR image matching method based on contour features
CN112184723B (en) Image processing method and device, electronic equipment and storage medium
CN115880683B (en) Urban waterlogging ponding intelligent water level detection method based on deep learning
CN110633705A (en) Low-illumination imaging license plate recognition method and device
CN116309780A (en) Water gauge water level identification method based on target detection
CN116110069A (en) Answer sheet identification method and device based on coding mark points and relevant medium thereof
CN102073868A (en) Digital image closed contour chain-based image area identification method
CN112923852B (en) SD card position detection method based on dynamic angular point positioning
CN113505811A (en) Machine vision imaging method for hub production
Liu et al. Lane line detection based on OpenCV

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