CN113643274A - Method and device for screening two-dimensional code candidate area - Google Patents

Method and device for screening two-dimensional code candidate area Download PDF

Info

Publication number
CN113643274A
CN113643274A CN202110973916.5A CN202110973916A CN113643274A CN 113643274 A CN113643274 A CN 113643274A CN 202110973916 A CN202110973916 A CN 202110973916A CN 113643274 A CN113643274 A CN 113643274A
Authority
CN
China
Prior art keywords
dimensional code
area
code candidate
data matrix
candidate area
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
CN202110973916.5A
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.)
Shenzhen Lingyun Shixun Technology Co ltd
Luster LightTech Co Ltd
Original Assignee
Shenzhen Lingyun Shixun Technology Co ltd
Luster LightTech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Lingyun Shixun Technology Co ltd, Luster LightTech Co Ltd filed Critical Shenzhen Lingyun Shixun Technology Co ltd
Priority to CN202110973916.5A priority Critical patent/CN113643274A/en
Publication of CN113643274A publication Critical patent/CN113643274A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)

Abstract

The present application relates to the field of two-dimensional code technologies, and in particular, to a method and an apparatus for screening two-dimensional code candidate regions. In order to solve the problem that some non-data matrix code areas can be positioned. The method comprises the following steps: acquiring a binary image of a two-dimensional code candidate area to be screened, wherein the two-dimensional code candidate area is an image area which is determined from the image and possibly contains a two-dimensional code; performing connected domain analysis on the binary image, and screening out a first two-dimensional code candidate area determined as a data matrix code; partitioning the first two-dimensional code candidate area according to the length-width transverse proportion or the length-width longitudinal proportion of the first two-dimensional code candidate area to obtain a plurality of rectangular areas; for each rectangular area, performing connected domain analysis on the rectangular area, calculating the number of edge points, and screening out a second two-dimensional code candidate area determined as a data matrix code; and sequencing the second two-dimensional code candidate regions according to a preset sequencing strategy to generate a two-dimensional code candidate region recommendation list.

Description

Method and device for screening two-dimensional code candidate area
Technical Field
The application relates to the technical field of two-dimensional codes, in particular to a method and a device for screening two-dimensional code candidate areas.
Background
The two-dimensional code is a pattern which is distributed on a plane according to a certain rule by using a certain specific geometric figure, is black and white and is alternated and records data symbol information; the concept of '0' and '1' bit stream forming the internal logic foundation of the computer is skillfully utilized in code establishment, a plurality of geometric shapes corresponding to binary systems are used for representing character numerical value information, and the information is automatically read through an image input device or an optoelectronic scanning device so as to realize automatic information processing: it has some commonality of barcode technology: each code system has its specific character set; each character occupies a certain width; has certain checking function and the like. Meanwhile, the method has the functions of automatically identifying information of different rows, processing graph rotation change points, and having large storage capacity, strong data error correction capability and strong reliability.
The data matrix code is one of two-dimensional codes, has the characteristics of small size, strong error correction capability and the like, and is widely applied to the field of industrial automation. The known data matrix code positioning method is mainly used for positioning according to the pattern edge characteristics of the data matrix code boundary. When the background of the data matrix code image is complex or the background features are close to the pattern edge features, some non-data matrix code areas are also located, resulting in low data matrix code identification accuracy.
Disclosure of Invention
The application provides a method and a device for screening two-dimensional code candidate areas, which can solve the problems that some non-data matrix code areas can be located and the identification accuracy of data matrix codes is low to a certain extent by carrying out gray level analysis on the located two-dimensional code candidate areas, comparing the gray level distribution difference between the data matrix code areas and the non-database matrix code areas and filtering the non-data matrix code areas.
The embodiment of the application is realized as follows:
a first aspect of the embodiments of the present application provides a method for screening two-dimensional code candidate regions, including:
acquiring a binary image of a two-dimensional code candidate area to be screened, wherein the two-dimensional code candidate area is an image area which is determined from the image and possibly contains a two-dimensional code;
performing connected domain analysis on the binary image, and screening out a first two-dimensional code candidate area determined as a data matrix code;
partitioning the first two-dimensional code candidate area according to the length-width transverse proportion or the length-width longitudinal proportion of the first two-dimensional code candidate area to obtain a plurality of rectangular areas;
for each rectangular area, performing connected domain analysis on the rectangular area, calculating the number of edge points, and screening out a second two-dimensional code candidate area determined as a data matrix code;
and sequencing the second two-dimensional code candidate regions according to a preset sequencing strategy to generate a two-dimensional code candidate region recommendation list.
In some embodiments, the blocking the first two-dimensional code candidate region according to the length-width lateral ratio or the length-width longitudinal ratio of the first two-dimensional code candidate region to obtain a plurality of rectangular regions includes:
determining a block boundary according to the length-width transverse proportion or the length-width longitudinal proportion of the first two-dimensional code candidate region; and partitioning the first two-dimensional code candidate area according to the partitioning boundary to obtain a plurality of rectangular areas.
In some embodiments, the connected domain analysis is performed on the binarized image to screen out a first two-dimensional code candidate region determined as a data matrix code, and the specific execution steps include:
performing connected domain analysis on the binary image to acquire first connected domain information; judging whether the corresponding binary image is a non-data matrix code area or not according to the first connected domain information; and filtering the non-data matrix code area determined in the binary image, and screening out a first two-dimensional code candidate area determined as a data matrix code.
In some embodiments, for each rectangular region, performing connected domain analysis on the rectangular region, calculating the number of edge points, and screening out a second two-dimensional code candidate region determined as a data matrix code, specifically performing the steps including:
for each rectangular area, performing connected domain analysis on the rectangular area and calculating the number of edge points to obtain second connected domain information and the number of edge points of the rectangular area; judging whether the second connected domain information is an invalid rectangular region or not according to the second connected domain information and the number of the edge points; judging whether the corresponding first two-dimensional code candidate area is a non-data matrix code area or not according to the number of the invalid rectangular areas judged in the first two-dimensional code candidate area; if the number of the invalid rectangular areas is determined to be the majority in the first two-dimensional code candidate areas, determining the corresponding first two-dimensional code candidate areas as non-data matrix code areas; and filtering the first two-dimensional code candidate area to determine a non-data matrix code area, and screening a second two-dimensional code candidate area determined as a data matrix code.
In some embodiments, the first and second connected domain information comprise: the number of connected domains and the area of the connected domains.
In some embodiments, the determining, according to the first connected domain information, whether the corresponding binarized image is a non-data matrix code region specifically includes:
if the number of connected domains of the first connected domain information is small and the area of the connected domains of the first connected domain information is large, determining that the corresponding binary image is a non-data matrix code region; and if the number of the connected domains of the first connected domain information is large and the area of the connected domains of the first connected domain information is small, determining that the corresponding binary image is a data matrix code region.
In some embodiments, the determining whether the rectangular area is an invalid rectangular area according to the second connected domain information and the number of edge points specifically includes:
and if the number of the connected domains of the second connected domain information is small and the number of the edge points is small, determining that the rectangular area is an invalid rectangular area.
In some embodiments, the preset ordering policy comprises: sorting according to a rule that the more likely the two-dimensional code candidate area is, the more front the sorting is, wherein the more likely the two-dimensional code candidate area is determined according to the following criteria: and comprehensively analyzing the first connected domain information, the second connected domain information and the number of the invalid rectangular areas.
A second aspect of the embodiments of the present application provides an apparatus for two-dimensional code candidate region screening, including:
the device comprises an acquisition module, a selection module and a selection module, wherein the acquisition module is used for acquiring a binary image of a two-dimensional code candidate area to be screened, wherein the two-dimensional code candidate area is an image area which is determined from the image and possibly contains a two-dimensional code;
the blocking module is used for blocking the first two-dimensional code candidate area according to the length-width transverse proportion or the length-width longitudinal proportion of the first two-dimensional code candidate area to obtain a plurality of rectangular areas;
the screening module is used for analyzing the connected domain of the two-dimensional code candidate area and screening out the two-dimensional code candidate area determined as the data matrix code;
and the sorting module is used for sorting the second two-dimensional code candidate regions according to a preset sorting strategy to generate a two-dimensional code candidate region recommendation list.
The technical scheme provided by the application comprises the following beneficial technical effects: through connected domain analysis of the positioned two-dimensional code candidate area, part of non-data matrix code areas can be quickly filtered out, and the screening efficiency is improved; further, the two-dimensional code candidate regions are partitioned to obtain a plurality of rectangular regions and are analyzed one by one, so that the screening accuracy is improved; further sorting the screened two-dimension code candidate areas to generate a two-dimension code candidate area recommendation list so as to realize that the more probable the two-dimension code candidate areas can enter the subsequent steps preferentially and improve the working efficiency; and further, the rectangular areas are obtained by partitioning according to the length-width transverse proportion or the length-width longitudinal proportion of the two-dimensional code candidate area, so that the mode of correspondingly dividing small areas is selected for different scenes, the non-data matrix code area is efficiently and flexibly filtered, and high accuracy is ensured.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart illustrating a method for screening a two-dimensional code candidate area according to an embodiment of the present application;
fig. 2 shows a schematic diagram of partitioning a two-dimensional code candidate area according to an embodiment of the present application.
Detailed Description
Certain exemplary embodiments will now be described to provide an overall understanding of the principles of the structure, function, manufacture, and use of the devices and methods disclosed herein. One or more examples of these embodiments are illustrated in the accompanying drawings. Those of ordinary skill in the art will understand that the devices and methods specifically described herein and illustrated in the accompanying drawings are non-limiting exemplary embodiments and that the scope of the various embodiments of the present invention is defined solely by the claims. Features illustrated or described in connection with one exemplary embodiment may be combined with features of other embodiments. Such modifications and variations are intended to be included within the scope of the present invention.
Reference throughout this specification to "embodiments," "some embodiments," "one embodiment," or "an embodiment," etc., means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Thus, appearances of the phrases "in various embodiments," "in some embodiments," "in at least one other embodiment," or "in an embodiment," or the like, throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Thus, the particular features, structures, or characteristics shown or described in connection with one embodiment may be combined, in whole or in part, with the features, structures, or characteristics of one or more other embodiments, without limitation. Such modifications and variations are intended to be included within the scope of the present invention.
A Data Matrix (Data Matrix) is a two-dimensional bar code consisting of black and white color blocks (cells) in squares or rectangles, and encoded information may be text or digital Data. The data size is typically a few to 1556 bytes. The length of the encoded data determines the number of patches in the matrix. Error correction codes are often used when encoding to increase reliability: even if one or more color blocks are damaged and unreadable, the information in the color blocks can still be read. A data matrix may store up to 2335 numbers or letters.
Inputting image data, carrying out gray level analysis on the image data to obtain a gray level image, and carrying out morphological operation and binarization processing on the basis of the gray level image to obtain a binarization image of the image. The binary image of the image is detected through the algorithm, a plurality of small areas can be located in the image, and the located small areas may or may not be real two-dimensional code areas, so in the embodiment of the application, the small areas located in the image are collectively referred to as two-dimensional code candidate areas. And comparing the gray distribution difference of the areas of the data matrix code and the non-data matrix code to comprehensively judge whether the two-dimensional code candidate area is the data matrix code.
The image gray level analysis is the most basic content in the image; the histogram is the most basic image analysis tool (not only can determine whether the image includes a region that can be segmented from the background, whether the saturation and contrast of the image meet the detection task, but also can determine how to adjust the image acquisition system to obtain a higher-quality image), and besides the histogram, a line gray distribution curve (line profile), an image line gray mean (line averages), an ROI boundary gray curve, an image centroid (geometric center), an image centroid (central of mass), a gray quantitative description (gray quantitative description), and an image structure similarity (structural similarity index) analysis are also more effective image gray analysis tools.
In image processing techniques, there are operations that change the morphology of an image, and these operations are generally called morphological operations (learning). Image morphology is an image processing method based on set theory, and is the earliest to appear in biological morphology and structure, and morphological operations in image processing are used as the basis for image and processing operations (denoising and shape simplification) image enhancement (skeleton extraction, refinement, convex hull and object marking), object background segmentation and object morphological operations.
The present application mainly aims at data matrix codes, and the following takes a data matrix two-dimensional code as an example to further describe the present application in detail by combining the detailed implementation with the accompanying drawings.
Fig. 1 is a schematic flowchart illustrating a method for screening a two-dimensional code candidate area according to an embodiment of the present application.
In step 101, a binary image of a two-dimensional code candidate area to be screened is obtained, wherein the two-dimensional code candidate area is an image area which is determined from the image and may contain a two-dimensional code.
The number of the obtained binary images of the two-dimension code candidate areas to be screened is a plurality of binary images, the binary images may be the binary images of five two-dimension code candidate areas to be screened, the binary images of ten two-dimension code candidate areas to be screened may be the binary images of a plurality of two-dimension code candidate areas to be screened.
In step 102, connected domain analysis is performed on the binarized image, and a first two-dimensional code candidate area determined as a data matrix code is screened out.
In some embodiments, the connected domain analysis is performed on the binarized image to screen out a first two-dimensional code candidate region determined as a data matrix code, and the specific execution steps include: performing connected domain analysis on the binary image to acquire first connected domain information; judging whether the corresponding binary image is a non-data matrix code area or not according to the first connected domain information; and filtering the non-data matrix code area determined in the binary image, and screening out a first two-dimensional code candidate area determined as a data matrix code.
Connected component analysis is an image processing operation, and usually for binary images, connected components in the image are found and marked. Wherein the connected regions refer to adjacent regions in the image having the same pixel value.
It should be noted that: the connected domain information includes: the number of connected domains and the area of the connected domains.
In some embodiments, the determining, according to the first connected domain information, whether the corresponding binarized image is a non-data matrix code region specifically includes:
if the number of connected domains of the first connected domain information is small and the area of the connected domains of the first connected domain information is large, determining that the corresponding binary image is a non-data matrix code region; and if the number of the connected domains of the first connected domain information is large and the area of the connected domains of the first connected domain information is small, determining that the corresponding binary image is a data matrix code region.
Due to the characteristics of the black and white module of the data matrix code, the number of connected domains in the data matrix code area is large, and the area of the connected domains is small. Therefore, if the number of connected domains acquired by a certain binary image is small and the area of the connected domains is large, the binary image is considered as a non-data matrix code region, and the non-data matrix code region is removed, so that part of the non-data matrix code region is rapidly filtered, and the screening efficiency is improved. And if the number of connected domains obtained by a certain binary image is large and the area of the connected domains is small, the binary image is regarded as a data matrix code region and reserved.
In some embodiments, after performing connected domain analysis on the binarized image, 6 first two-dimensional code candidate regions determined as data matrix codes are screened out, which are respectively: the first two-dimensional code candidate area A, the first two-dimensional code candidate area B, the first two-dimensional code candidate area C, the first two-dimensional code candidate area D, the first two-dimensional code candidate area E and the first two-dimensional code candidate area F.
Fig. 2 is a schematic diagram of blocking a two-dimensional code candidate area image according to an embodiment of the present application.
In step 103, the first two-dimensional code candidate region is partitioned according to the length-width transverse proportion or the length-width longitudinal proportion of the first two-dimensional code candidate region to obtain a plurality of rectangular regions.
In some embodiments, the blocking the first two-dimensional code candidate region according to the length-width lateral ratio or the length-width longitudinal ratio of the first two-dimensional code candidate region to obtain a plurality of rectangular regions includes:
determining a block boundary according to the length-width transverse proportion or the length-width longitudinal proportion of the first two-dimensional code candidate region; and partitioning the first two-dimensional code candidate area according to the partitioning boundary to obtain a plurality of rectangular areas.
When the first two-dimensional code candidate area is analyzed block by block, the block boundary can be determined according to the length-width ratio, or the length-width longitudinal ratio, or other shapes of the first two-dimensional code candidate area. The method can realize different modes of dividing small areas according to different scenes, flexibly and efficiently filter the non-data matrix code area, and ensure higher accuracy.
In step 104, for each rectangular region, performing connected domain analysis on the rectangular region and calculating the number of edge points, and screening out a second two-dimensional code candidate region determined as a data matrix code.
The two-dimensional code candidate regions are analyzed block by block, so that information in the rectangular region is better utilized and is not influenced by other rectangular regions.
In some embodiments, for each rectangular region, performing connected domain analysis on the rectangular region, calculating the number of edge points, and screening out a second two-dimensional code candidate region determined as a data matrix code, specifically performing the steps including:
for each rectangular area, performing connected domain analysis on the rectangular area and calculating the number of edge points to obtain second connected domain information and the number of edge points of the rectangular area; judging whether the second connected domain information is an invalid rectangular region or not according to the second connected domain information and the number of the edge points; judging whether the corresponding first two-dimensional code candidate area is a non-data matrix code area or not according to the number of the invalid rectangular areas judged in the first two-dimensional code candidate area; if the number of the invalid rectangular areas is determined to be the majority in the first two-dimensional code candidate areas, determining the corresponding first two-dimensional code candidate areas as non-data matrix code areas; and filtering the first two-dimensional code candidate area to determine a non-data matrix code area, and screening a second two-dimensional code candidate area determined as a data matrix code.
In some embodiments, after the first two-dimensional code candidate area is divided into blocks and analyzed one by one, the first two-dimensional code candidate area a is determined as a non-data matrix code, the first two-dimensional code candidate area B is determined as a data matrix code, the first two-dimensional code candidate area C is determined as a data matrix code, the first two-dimensional code candidate area D is determined as a non-data matrix code, the first two-dimensional code candidate area E is determined as a data matrix code, and the first two-dimensional code candidate area F is determined as a data matrix code. A second two-dimension code candidate area B, a second two-dimension code candidate area C, a second two-dimension code candidate area E, and a second two-dimension code candidate area F are obtained.
In some embodiments, the determining whether the rectangular area is an invalid rectangular area according to the second connected domain information and the number of edge points specifically includes:
and if the number of the connected domains of the second connected domain information is small and the number of the edge points is small, determining that the rectangular area is an invalid rectangular area.
In some embodiments, the connected component analysis is performed by performing connected component analysis on the rectangular area and calculating the number of edge points in the rectangular area. If the number of connected domains in the rectangular area is small and the number of edge points is small, the rectangular area is considered as an invalid rectangular area. And when the number of the invalid rectangular areas is more, the corresponding first two-dimensional code candidate area is considered as a non-data matrix code area, and the non-data matrix code area is removed. The gray information of the data matrix two-dimensional code candidate area is fully utilized to divide the first two-dimensional code candidate area into rectangles and analyze the rectangles one by one, and therefore the screening accuracy is improved.
For example, if a first two-dimensional code candidate area is divided into 4 rectangular areas, as shown in fig. 2. In some embodiments, if the rectangular areas 1, 3, and 4 are determined as invalid rectangular areas, the first two-dimensional code candidate area is determined as a non-data matrix code area and filtered. In some embodiments, only if the rectangular area 1 is determined as an invalid rectangular area, the first two-dimensional code candidate area is determined as a data matrix code area and is reserved.
In some embodiments, the first and second connected domain information comprise: the number of connected domains and the area of the connected domains.
In step 105, the second two-dimensional code candidate regions are sorted according to a preset sorting strategy, and a two-dimensional code candidate region recommendation list is generated.
In some embodiments, the preset ordering policy comprises: sorting according to a rule that the more likely the two-dimensional code candidate area is, the more front the sorting is, wherein the more likely the two-dimensional code candidate area is determined according to the following criteria: and comprehensively analyzing the first connected domain information, the second connected domain information and the number of the invalid rectangular areas. The set sorting strategy utilizes the information of the connected domain information of the whole second two-dimensional candidate region, the number of edge points in the rectangular region after the block division and the like.
In some embodiments, the second two-dimensional code candidate region is sorted according to a preset sorting strategy by combining information such as analyzing the number of connected domains, the area of the connected domains, and the number of the determined invalid rectangular regions of the second two-dimensional code candidate region, and the more probable the two-dimensional code candidate region of the data matrix is sorted, the earlier the two-dimensional code candidate region is sorted, so that the prior entering of the data matrix code region into the subsequent step is ensured, and the efficiency is improved.
The application also provides a device of two-dimensional code candidate area screening, includes:
the device comprises an acquisition module, a selection module and a selection module, wherein the acquisition module is used for acquiring a binary image of a two-dimensional code candidate area to be screened, wherein the two-dimensional code candidate area is an image area which is determined from the image and possibly contains a two-dimensional code;
the blocking module is used for blocking the first two-dimensional code candidate area according to the length-width transverse proportion or the length-width longitudinal proportion of the first two-dimensional code candidate area to obtain a plurality of rectangular areas;
the screening module is used for analyzing the connected domain of the two-dimensional code candidate area and screening out the two-dimensional code candidate area determined as the data matrix code;
and the sorting module is used for sorting the second two-dimensional code candidate regions according to a preset sorting strategy to generate a two-dimensional code candidate region recommendation list.
By adopting the device for screening the two-dimensional code candidate area provided by the embodiment of the application, each step in the method for screening the two-dimensional code candidate area can be implemented, and the same beneficial effect can be obtained. By adopting the device for screening the two-dimension code candidate areas, provided by the embodiment of the application, the connected domain analysis is carried out on the positioned two-dimension code candidate areas, so that part of non-data matrix code areas can be quickly filtered out, and the screening efficiency is improved; further, the two-dimensional code candidate regions are partitioned to obtain a plurality of rectangular regions and are analyzed one by one, so that the screening accuracy is improved; further sorting the screened two-dimension code candidate areas to generate a two-dimension code candidate area recommendation list so as to realize that the more probable the two-dimension code candidate areas can enter the subsequent steps preferentially and improve the working efficiency; and further, the rectangular areas are obtained by partitioning according to the length-width transverse proportion or the length-width longitudinal proportion of the two-dimensional code candidate area, so that the mode of correspondingly dividing small areas is selected for different scenes, the non-data matrix code area is efficiently and flexibly filtered, and high accuracy is ensured.
Additionally, the order in which elements and sequences of the processes described herein are processed, the use of alphanumeric characters, or the use of other designations, is not intended to limit the order of the processes and methods described herein, unless explicitly claimed. While various presently contemplated embodiments of the invention have been discussed in the foregoing disclosure by way of example, it is to be understood that such detail is solely for that purpose and that the appended claims are not limited to the disclosed embodiments, but, on the contrary, are intended to cover all modifications and equivalent arrangements that are within the spirit and scope of the embodiments herein.
It is noted that relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that an article or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
It will be understood that the present application is not limited to what has been described above and shown in the accompanying drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (9)

1. A method for screening two-dimension code candidate areas is characterized by comprising the following steps:
acquiring a binary image of a two-dimensional code candidate area to be screened, wherein the two-dimensional code candidate area is an image area which is determined from the image and possibly contains a two-dimensional code;
performing connected domain analysis on the binary image, and screening out a first two-dimensional code candidate area determined as a data matrix code;
partitioning the first two-dimensional code candidate area according to the length-width transverse proportion or the length-width longitudinal proportion of the first two-dimensional code candidate area to obtain a plurality of rectangular areas;
for each rectangular area, performing connected domain analysis on the rectangular area, calculating the number of edge points, and screening out a second two-dimensional code candidate area determined as a data matrix code;
and sequencing the second two-dimensional code candidate regions according to a preset sequencing strategy to generate a two-dimensional code candidate region recommendation list.
2. The method of claim 1, wherein the partitioning the first two-dimensional code candidate region according to a length-width horizontal ratio or a length-width vertical ratio of the first two-dimensional code candidate region to obtain a plurality of rectangular regions is specifically performed by:
determining a block boundary according to the length-width transverse proportion or the length-width longitudinal proportion of the first two-dimensional code candidate region;
and partitioning the first two-dimensional code candidate area according to the partitioning boundary to obtain a plurality of rectangular areas.
3. The method according to claim 1, wherein the connected component analysis is performed on the binarized image to screen out a first two-dimensional code candidate region determined as a data matrix code, and the specific implementation steps include:
performing connected domain analysis on the binary image to acquire first connected domain information;
judging whether the corresponding binary image is a non-data matrix code area or not according to the first connected domain information;
and filtering the non-data matrix code area determined in the binary image, and screening out a first two-dimensional code candidate area determined as a data matrix code.
4. The method according to claim 1, wherein for each rectangular region, performing connected component analysis on the rectangular region and calculating the number of edge points to screen out a second two-dimensional code candidate region determined as a data matrix code, and the specific implementation steps include:
for each rectangular area, performing connected domain analysis on the rectangular area and calculating the number of edge points to obtain second connected domain information and the number of edge points of the rectangular area;
judging whether the second connected domain information is an invalid rectangular region or not according to the second connected domain information and the number of the edge points;
judging whether the corresponding first two-dimensional code candidate area is a non-data matrix code area or not according to the number of the invalid rectangular areas judged in the first two-dimensional code candidate area;
if the number of the invalid rectangular areas is determined to be the majority in the first two-dimensional code candidate areas, determining the corresponding first two-dimensional code candidate areas as non-data matrix code areas;
and filtering the first two-dimensional code candidate area to determine a non-data matrix code area, and screening a second two-dimensional code candidate area determined as a data matrix code.
5. The method of claim 3 or 4, wherein the first and second connected domain information comprise: the number of connected domains and the area of the connected domains.
6. The method according to claim 5, wherein the determining whether the corresponding binarized image is a non-data matrix code region according to the first connected domain information specifically comprises the following steps:
if the number of connected domains of the first connected domain information is small and the area of the connected domains of the first connected domain information is large, determining that the corresponding binary image is a non-data matrix code region;
and if the number of the connected domains of the first connected domain information is large and the area of the connected domains of the first connected domain information is small, determining that the corresponding binary image is a data matrix code region.
7. The method according to claim 5, wherein the determining whether the rectangular area is invalid according to the second connected component information and the number of edge points specifically comprises:
and if the number of the connected domains of the second connected domain information is small and the number of the edge points is small, determining that the rectangular area is an invalid rectangular area.
8. The method of claim 5, wherein the predetermined ordering policy comprises:
sorting according to a rule that the more likely the two-dimensional code candidate area is, the more front the sorting is, wherein the more likely the two-dimensional code candidate area is determined according to the following criteria: and comprehensively analyzing the first connected domain information, the second connected domain information and the number of the invalid rectangular areas.
9. An apparatus for two-dimensional code candidate area screening, comprising:
the device comprises an acquisition module, a selection module and a selection module, wherein the acquisition module is used for acquiring a binary image of a two-dimensional code candidate area to be screened, wherein the two-dimensional code candidate area is an image area which is determined from the image and possibly contains a two-dimensional code;
the blocking module is used for blocking the first two-dimensional code candidate area according to the length-width transverse proportion or the length-width longitudinal proportion of the first two-dimensional code candidate area to obtain a plurality of rectangular areas;
the screening module is used for analyzing the connected domain of the two-dimensional code candidate area and screening out the two-dimensional code candidate area determined as the data matrix code;
and the sorting module is used for sorting the second two-dimensional code candidate regions according to a preset sorting strategy to generate a two-dimensional code candidate region recommendation list.
CN202110973916.5A 2021-08-24 2021-08-24 Method and device for screening two-dimensional code candidate area Pending CN113643274A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110973916.5A CN113643274A (en) 2021-08-24 2021-08-24 Method and device for screening two-dimensional code candidate area

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110973916.5A CN113643274A (en) 2021-08-24 2021-08-24 Method and device for screening two-dimensional code candidate area

Publications (1)

Publication Number Publication Date
CN113643274A true CN113643274A (en) 2021-11-12

Family

ID=78423608

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110973916.5A Pending CN113643274A (en) 2021-08-24 2021-08-24 Method and device for screening two-dimensional code candidate area

Country Status (1)

Country Link
CN (1) CN113643274A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113822091A (en) * 2021-11-23 2021-12-21 北京紫光青藤微系统有限公司 Method and device for correcting errors of two-dimensional code pattern, electronic equipment and storage medium
CN117725943A (en) * 2024-02-06 2024-03-19 浙江码尚科技股份有限公司 Dot matrix code identification method and system based on digital graph processing
CN117725943B (en) * 2024-02-06 2024-06-04 浙江码尚科技股份有限公司 Dot matrix code identification method and system based on digital graph processing

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070297679A1 (en) * 2006-06-21 2007-12-27 Namco Bandai Games Inc. Two-dimensional code generation method, two-dimensional code, two-dimensional code recognition method, and image recognition device
CN104636706A (en) * 2015-03-04 2015-05-20 深圳市金准生物医学工程有限公司 Complicated background bar code image automatic partitioning method based on gradient direction consistency
CN108073849A (en) * 2016-11-18 2018-05-25 杭州海康威视数字技术股份有限公司 Code detection method, apparatus and system
CN109359497A (en) * 2018-09-17 2019-02-19 四川长虹电器股份有限公司 A kind of positioning and recognition methods in VAT invoice two-dimensional image code region
CN109409163A (en) * 2018-11-12 2019-03-01 凌云光技术集团有限责任公司 A kind of QR code method for rapidly positioning based on texture features
CN109800615A (en) * 2018-12-28 2019-05-24 新大陆数字技术股份有限公司 The detection localization method and system of two-dimension code area
CN109993019A (en) * 2019-04-15 2019-07-09 苏州国芯科技股份有限公司 Two-dimensional code identification method, system and equipment and medium based on connected domain analysis
CN111489367A (en) * 2020-06-24 2020-08-04 浙江大学 Positioning method for automatically selecting feasible coding area of hub two-dimensional code

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070297679A1 (en) * 2006-06-21 2007-12-27 Namco Bandai Games Inc. Two-dimensional code generation method, two-dimensional code, two-dimensional code recognition method, and image recognition device
CN104636706A (en) * 2015-03-04 2015-05-20 深圳市金准生物医学工程有限公司 Complicated background bar code image automatic partitioning method based on gradient direction consistency
CN108073849A (en) * 2016-11-18 2018-05-25 杭州海康威视数字技术股份有限公司 Code detection method, apparatus and system
CN109359497A (en) * 2018-09-17 2019-02-19 四川长虹电器股份有限公司 A kind of positioning and recognition methods in VAT invoice two-dimensional image code region
CN109409163A (en) * 2018-11-12 2019-03-01 凌云光技术集团有限责任公司 A kind of QR code method for rapidly positioning based on texture features
CN109800615A (en) * 2018-12-28 2019-05-24 新大陆数字技术股份有限公司 The detection localization method and system of two-dimension code area
CN109993019A (en) * 2019-04-15 2019-07-09 苏州国芯科技股份有限公司 Two-dimensional code identification method, system and equipment and medium based on connected domain analysis
CN111489367A (en) * 2020-06-24 2020-08-04 浙江大学 Positioning method for automatically selecting feasible coding area of hub two-dimensional code

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘家昕;刘家朋;赵宇明;: "基于边缘增强的二维码区域快速检测定位算法", 计算机工程, no. 12 *
高飞;令狐乾锦;葛一粟;卢书芳;肖刚;: "基于位置判别的激光QR二维码定位方法", 计算机辅助设计与图形学学报, no. 06 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113822091A (en) * 2021-11-23 2021-12-21 北京紫光青藤微系统有限公司 Method and device for correcting errors of two-dimensional code pattern, electronic equipment and storage medium
CN113822091B (en) * 2021-11-23 2022-03-15 北京紫光青藤微系统有限公司 Method and device for correcting errors of two-dimensional code pattern, electronic equipment and storage medium
CN117725943A (en) * 2024-02-06 2024-03-19 浙江码尚科技股份有限公司 Dot matrix code identification method and system based on digital graph processing
CN117725943B (en) * 2024-02-06 2024-06-04 浙江码尚科技股份有限公司 Dot matrix code identification method and system based on digital graph processing

Similar Documents

Publication Publication Date Title
CN110516208B (en) System and method for extracting PDF document form
CN106407883B (en) Complex form and identification method for handwritten numbers in complex form
Yu et al. An approach to Korean license plate recognition based on vertical edge matching
CN106960208B (en) Method and system for automatically segmenting and identifying instrument liquid crystal number
CN108596166A (en) A kind of container number identification method based on convolutional neural networks classification
CN101122953A (en) Picture words segmentation method
Gaur et al. Recognition of 2D barcode images using edge detection and morphological operation
CN111626146A (en) Merging cell table segmentation and identification method based on template matching
CN113177959B (en) QR code real-time extraction method in rapid movement process
CN108229232B (en) Method and device for scanning two-dimensional codes in batch
CN112580383B (en) Two-dimensional code identification method and device, electronic equipment and storage medium
CN111507344A (en) Method and device for recognizing characters from image
JPH05225378A (en) Area dividing system for document image
Rebelo et al. Staff line detection and removal in the grayscale domain
CN113643274A (en) Method and device for screening two-dimensional code candidate area
KR100383858B1 (en) Character extracting method and device
CN112699704B (en) Method, device, equipment and storage device for detecting bar code
CN112200789B (en) Image recognition method and device, electronic equipment and storage medium
CN110084117B (en) Document table line detection method and system based on binary image segmentation projection
CN110378337B (en) Visual input method and system for drawing identification information of metal cutting tool
CN113033562A (en) Image processing method, device, equipment and storage medium
CN114445814B (en) Character region extraction method and computer-readable storage medium
CN115880228A (en) Multi-defect merging method and device, computer equipment and storage medium
CN112633289A (en) Method and system for segmenting sticky characters
JP4244692B2 (en) Character recognition device and character recognition program

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