CN113297872A - Dotcode identification method and equipment - Google Patents

Dotcode identification method and equipment Download PDF

Info

Publication number
CN113297872A
CN113297872A CN202110313364.5A CN202110313364A CN113297872A CN 113297872 A CN113297872 A CN 113297872A CN 202110313364 A CN202110313364 A CN 202110313364A CN 113297872 A CN113297872 A CN 113297872A
Authority
CN
China
Prior art keywords
data points
visual data
straight line
point
visual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110313364.5A
Other languages
Chinese (zh)
Other versions
CN113297872B (en
Inventor
郑颖
宋少龙
林少伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuzhou Symbol Information Technology Co ltd
Original Assignee
Fuzhou Symbol Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuzhou Symbol Information Technology Co ltd filed Critical Fuzhou Symbol Information Technology Co ltd
Priority to CN202110313364.5A priority Critical patent/CN113297872B/en
Publication of CN113297872A publication Critical patent/CN113297872A/en
Application granted granted Critical
Publication of CN113297872B publication Critical patent/CN113297872B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps

Landscapes

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

Abstract

The invention relates to a Dotcode identification method, which comprises the following steps: acquiring a first visual data point in an image; starting from the first visual data point, acquiring the visual data point along a specific direction; and estimating an invisible data point in the direction; starting from the acquired visual data points in sequence, and acquiring adjacent visual data points along the other direction; determining a rectangular outline, and acquiring all unknown data points in the rectangular outline; starting from the visual data points on the rectangular outline in sequence, acquiring the visual data points outwards, and continuously updating the rectangular outline and the data points in the rectangular outline until the rectangular outline is not expanded any more; a data bit stream matrix is derived and decoded from all data points within the rectangular outline. The invention fully utilizes the geometric characteristics of the Dotcode, acquires visual data points along a specific direction, estimates the positions of unknown data points by a mode of drawing a rectangle, searches the data points in a line and slice manner, greatly reduces the calculation amount required by searching the data points and improves the decoding speed.

Description

Dotcode identification method and equipment
Technical Field
The invention relates to a Dotcode identification method and device, and belongs to the field of image identification.
Background
The dot code, a variable-size, diverse-shape and extremely high-recognition-efficiency matrix bar code, encodes data into a dot array, belongs to a matrix type two-dimensional code, is a variant of a DPM two-dimensional code, and is a two-dimensional code issued by the International goods coding Association (GS1) for identifying small and difficult-to-mark goods. Compared with a bar code, the bar code can carry more information in unit area, is more suitable for occasions with different printing area requirements and occasions needing more article attributes, and is particularly suitable for occasions needing high-speed ink jet printers and laser printers for printing or laser engraving for printing. Dotcode has high flexibility and high error correction capability, making it attractive to industries that require the use of bar codes for security and robustness. Dotcode is the encoding of data into an array of nominally discontinuous points at selected locations within a regular grid of possible locations. The Dotcode is a dot matrix two-dimensional code, the array shape of the dot matrix two-dimensional code is rectangular, the height of the dot matrix two-dimensional code is H, the width of the dot matrix two-dimensional code is W, only half possible dot positions can be used for printing, the printable data point positions are arranged at intervals in the row direction or the column direction, and about 56% of dot positions are finally printed according to a data coding rule. The Dotcode can compile other attributes of the goods related to the global trade goods code (such as serial number, production date, effective period and the like) into a two-dimensional code, and the two-dimensional code can enable products which are difficult to mark, such as fresh food and agricultural products (meat, cooked food and agricultural products) to have unique identification and identification modes.
The method for decoding the Dotcode in the international standard comprises the following steps: a square area of the original image is processed using fast fourier transform to determine the principal point axis direction, and during subsequent expansion of the rectangular range, other data points are only sought within 24 point position ranges around the data point at a time, requiring hardware with powerful computing power and memory size. Therefore, it is necessary to reduce the amount of calculation of the Dotcode decoding algorithm and to realize fast recognition and decoding of Dotcode.
Patent publication US20190130236a1 system and method for extracting bit stream data in two-dimensional optical codes discloses the following: the data reading system includes: an imager for obtaining an image of an article containing a Dotcode symbol; a processor for analyzing the image to finally decode the data from the Dotcode symbol. The processor analyzes the acquired image to determine a starting pattern of the Dotcode symbol and constructs a Dotcode mesh starting from the starting pattern. Once the Dotcode grid is completed, the processor generates a tag hypothesis from the data points identified on the Dotcode grid. Thereafter, the decoder unit receives the tag hypotheses from the processor and decodes the tag hypotheses to obtain data for the Dotcode symbols. This patent does not process the image using computationally expensive fast fourier transform algorithms, and can identify any combination of groupings of two or more points in different directions, but where the amount of computation required to search for the next data point in the radial direction is still large, the decoding speed is to be further improved.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a Dotcode identification method, which is used for acquiring other visual data points along a specific direction, obtaining the positions of a plurality of unknown data points at one time by a mode of drawing a rectangle, searching the data points in a line-by-line manner, greatly reducing the calculation amount required for searching the data points and improving the decoding speed.
The technical scheme of the invention is as follows:
the first technical scheme is as follows:
a Dotcode identification method comprises the following steps:
s1, acquiring an image, wherein the image comprises a plurality of data points which are arranged at intervals and are divided into visible data points and invisible data points;
s2, acquiring a first visual data point in the image;
s3, starting from the first visual data point, acquiring the visual data points along a first straight line until the number of the visual data points reaches a first threshold value; and estimating the number and position of the invisible data points on the first line;
s4, starting from the acquired visual data points in sequence, and acquiring adjacent visual data points along a second straight line, wherein the second straight line is perpendicular to the first straight line;
s5, determining a minimum rectangular contour containing all known data points, and acquiring all unknown data points in the rectangular contour, wherein the known data points comprise acquired visible data points and invisible data points of which the positions are estimated;
s6, starting from the visual data points on the rectangular outline in sequence, and acquiring the visual data points outwards until the visual data points cannot be found; jumping to step S5 to update the minimum rectangular contour and obtain all data points in the updated rectangular contour until the rectangular contour is not enlarged any more;
and S7, obtaining a data bit stream matrix according to all the data points in the rectangular outline, and decoding the data bit stream matrix.
Further, the step of acquiring the visual data point is as follows:
extracting transition boundary points representing gray level changes in the image; transition boundary point (u) according to change of gray scale from small to large1,v1) And transition boundary point (u) where the gray scale changes from large to small2,v2) Calculating the center point
Figure BDA0002990836700000031
Starting from the central point, searching at least two transition boundary points with the same gray scale change trend along the radial direction; calculating the distance from the central point to each transition boundary, and judging whether the data point is a visual data point or not based on the shape characteristic of the data point;
wherein (u)1,v1) The coordinates of transition boundary points representing the change of the gray scale from small to large in the image; (u)2,v2) The coordinates of a transition boundary point with the gray scale changing from large to small in the image are represented; (x, y) represents the coordinates of the center point in the image.
Further, in step S3, the specific step of obtaining the visual data point along the first straight line from the first visual data point is:
presetting an angle range and a first threshold value;
starting from the first visual data point, acquiring a second visual data point adjacent to the first visual data point in the angle range; and continuously acquiring the visual data points along a first straight line of the geometric centers of the first visual data point and the second visual data point until the number of the visual data points on the first straight line exceeds a first threshold value.
Further, the estimating the number and the position of the invisible data points on the first line is specifically as follows:
calculating a minimum distance value between two adjacent visual data points on the first straight line; and sequentially estimating the number N of the invisible data points between the other two adjacent visible data points according to the minimum distance value, and estimating the coordinates of each invisible data point.
Further, acquiring a certain unknown data point in the rectangular outline specifically includes:
calculating to obtain an unknown data point positioned in the ith row and the jth column; obtaining a third straight line which is parallel to the horizontal straight line of the rectangular outline and is on the known visual data point on the ith row; obtaining a fourth straight line which is parallel to the vertical straight line of the rectangular outline and is provided with known visual data points on the jth column; calculating the coordinates of the intersection point of the third straight line and the fourth straight line; an unknown data point at the coordinates is identified.
Further, the calculation results in that an unknown data point is located in the ith row and the jth column, specifically:
calculating the number of known data points in each row in the rectangular outline from top to bottom, and if the number of the known data points in a certain row is lower than a second threshold, indicating that an unknown data point exists in the row;
from left to right, the number of known data points in each column of the rectangular outline is calculated, and if the number of known data points in a certain column is lower than a third threshold, it indicates that there is an unknown data point in the column.
Further, in step S6, starting from the visual data points on the rectangular outline, the visual data points are obtained outward, specifically:
starting from the visual data points on the rectangular contour in sequence, respectively obtaining the visual data points outwards along a fifth straight line parallel to the first straight line and a sixth straight line parallel to the second straight line until the number of the visual data points on the fifth straight line and the sixth straight line exceeds a fourth threshold; and estimating the number and the position of the invisible data points on the straight line according to the minimum distance value.
Further, the method also comprises the following step of correcting each straight line: and if the number of all the known visual data points on the straight line exceeds a fifth threshold, performing linear fitting according to the positions of all the known visual data points on the straight line to obtain a corrected straight line.
The second technical scheme is as follows:
the Dotcode identification device is characterized by comprising a camera, a memory and a processor, wherein the memory stores instructions;
the camera acquires an image, wherein the image comprises a plurality of data points which are arranged at intervals; wherein the data points are divided into visible data points and invisible data points;
the instructions are adapted to be loaded by a processor and to perform the steps of:
acquiring a first visual data point in an image;
starting from the first visual data point, acquiring the visual data points along a first straight line until the number of the visual data points reaches a first threshold value; and estimating the number and position of the non-visible data points on the first line;
starting from the acquired visual data points in sequence, acquiring adjacent visual data points along a second straight line, wherein the second straight line is perpendicular to the first straight line;
determining a minimum rectangular contour containing all known data points, and acquiring all unknown data points in the rectangular contour, wherein the known data points comprise acquired visible data points and invisible data points of which the positions are estimated;
starting from visual data points on the rectangular outline in sequence, and acquiring the visual data points outwards until the visual data points cannot be found; jumping to step S5 to update the minimum rectangular contour and obtain all data points within the updated rectangular contour until the rectangular contour is no longer enlarged;
and obtaining a data bit stream matrix according to all data points in the rectangular outline, and decoding the data bit stream matrix.
The invention has the following beneficial effects:
1. according to the method, the geometric characteristics (staggered arrangement of data points) of the Dotcode are fully utilized, after the first visual data point is found, other visual data points are obtained along a specific direction (a first straight line and a second straight line), the positions of a plurality of unknown data points are obtained at one time in a rectangular dividing mode, the data points can be found in a line-by-line and slice manner, the calculation amount required for finding the data points is greatly reduced, and the decoding speed is improved.
2. The invention confirms the visual data points in multiple directions by using the geometrical characteristics of the data points, and improves the accuracy of data point identification.
3. According to the method, parameters such as the minimum distance value among all straight lines and data points are continuously corrected according to the known data points, the situations that the data points cannot be found due to image deformation, the data point position is wrong and the like are avoided, and the accuracy of the data bit stream matrix is improved.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a schematic diagram of a coordinate system of a checkerboard matrix;
FIG. 3 is a schematic view of the outer region of a rectangular profile;
FIG. 4 is a schematic diagram of a second embodiment of acquiring a first visual data point;
FIG. 5 is a first line schematic;
fig. 6 to 17 are schematic diagrams of the identification Dotcode process.
Detailed Description
The invention is described in detail below with reference to the figures and the specific embodiments.
Example one
Referring to fig. 1, a Dotcode identification method includes the following steps:
and S1, acquiring an image, wherein the image comprises a plurality of data points which are arranged at intervals and the data points are divided into visual data points and invisible data points.
For example, the following steps are carried out: for a Dotcode placed on white paper, where the black dots are visible data points and the white dots are invisible data points. And for a Dotcode placed on black paper, where white dots are visible data points and black dots are invisible data points.
S2, a first visual data point is acquired in the image.
S3, starting from the first visual data point, acquiring the visual data points along a first straight line until the number of the visual data points reaches a first threshold value; and estimating the number and location of the non-visible data points on the first line.
And S4, sequentially starting from the acquired visual data points, acquiring adjacent visual data points along a second straight line, wherein the second straight line is perpendicular to the first straight line.
And S5, determining a minimum rectangular outline containing all known data points, acquiring all unknown visual data points in the rectangular outline, and estimating all invisible data points in the rectangular outline.
The known data points comprise acquired visual data points and non-visual data points of which the positions are estimated; in contrast, unknown data points include non-acquired visual data points and non-visual data points for which the location was not estimated.
And S6, starting from the visual data points on the rectangular outline in sequence, and acquiring the visual data points outwards until the visual data points cannot be found. Go to step S5 to update the minimum rectangular outline and acquire all data points within the updated rectangular outline until the rectangular outline is no longer expanded.
And S7, obtaining a data bit stream matrix according to all the data points in the rectangular outline, and decoding the data bit stream matrix.
The method has the advantages that the geometric characteristics (staggered arrangement of data points) of the Dotcode are fully utilized, after the first visual data point is found, other visual data points are obtained along the specific direction (the first straight line and the second straight line), the positions of a plurality of unknown data points are obtained at one time in a mode of dividing a rectangle, the data points can be searched in a line-by-line and slice manner, the calculation amount required for searching the data points is greatly reduced, and the decoding speed is improved.
Example two
Referring to fig. 4, the image is scanned from top to bottom and from left to right to find the transition region where the gray level changes from small to large or from large to small. And extracting to obtain paired transition boundary points (u) according to the transition region by using a boundary extraction algorithm1,v1)、(u2,v2) Transition with opposite gray scale variation trendThe boundary points are a pair (as in fig. 4, point 1 and point 2 are taken as a pair of transition boundary points). Calculating a central point:
Figure BDA0002990836700000091
starting from the central point, at least two transition boundary points with the same gray scale change trend are searched along the radial direction (such as a plurality of white lines in figure 4) (such as the transition boundary points with the smaller gray scale, namely point 3, point 4, point 5 and point 6, are searched starting from the central point in figure 4). Calculating the distance from the central point to each transition boundary point (point 3, point 4, point 5, point 6), if the distances are equal (when the data points are circular), determining the data point as a first visual data point, and using the central point to represent a first visual data point a1:(x1,y1) Coordinate information of (i), i.e., (x)1,y1)=(x,y)。
The method has the advantages that the geometric characteristics of the data points are utilized to confirm the visual data points in multiple directions, and the data point identification accuracy is improved.
EXAMPLE III
The positions of the non-visual data points and the visual data points in the Dotcode are alternated, similar to the chessboard matrix. In the embodiment, a chessboard matrix for recording the positions of the data points in the image is set in the Dotcode recognition device, and the elements in the chessboard matrix correspond to the image data points one by one. After the data points are found, the positions of the data points in the image are written into a checkerboard matrix, i.e., the data points are filled into the checkerboard matrix.
S1, acquiring the Dotcode image.
S2, a first visual data point is acquired in the image.
S3, presetting an angle range and a first threshold, in this embodiment, the angle range is an included angle between 45 ° counterclockwise rotation of the horizontal line and 135 ° counterclockwise rotation of the horizontal line, and the first threshold is 5). Starting from the first visual data point, a second visual data point adjacent to the first visual data point is acquired within the angle range.
As shown in fig. 5, the acquisition of the visual data points continues along a first line between the geometric centers of the first and second visual data points until the number of visual data points on the first line exceeds a first threshold.
The problem of image distortion caused by a camera or package deformation attached to the Dotcode is solved, so that a first straight line between the geometric centers of the first visual data point and the second visual data point cannot penetrate through the geometric centers of all the visual data points in the direction, and a certain error exists in the first straight line (as can be visually seen from fig. 5). When the first straight line is taken as a reference object, errors are accumulated continuously, and a situation that a data point cannot be found occurs. The first straight line is corrected in the subsequent step (as in step S4). Similarly, other straight lines in the present invention are also corrected.
And sequentially estimating the number and the positions of the invisible data points on the first straight line according to the minimum spacing value between the adjacent visible data points on the first straight line. (if the minimum distance value obtained on the first straight line is wrong, the difference of the minimum distance values among the data points is found to be large when the data points are obtained along the second straight line in the subsequent steps, and the first data point is obtained again to carry out Dotcode identification)
For example: there are visual data points { a) on the first line1,a2,a3,…,an}. Suppose, as shown in FIG. 5, a visual data point a1,a2A distance d betweena1a2If the minimum value is reached, other adjacent visual data points a are sequentially estimatedi:(xi,yi),ai+1:(xi+1,yi+1) The number N of invisible data points in between is:
Figure BDA0002990836700000101
and estimating the coordinates (x) of each non-viewable data pointN-j+1,yN-j+1) Comprises the following steps:
Figure BDA0002990836700000102
wherein the content of the first and second substances,
Figure BDA0002990836700000111
representing a visual data point aiAnd visual data point ai+1The spacing therebetween; function [ x ]]Representing the largest integer not exceeding x.
A checkerboard matrix is initialized and a coordinate system is set within the checkerboard matrix as shown in fig. 2. For the first visual data point a1:(x1,y1) Mapping to obtain the coordinate (X) of the first visual data point in the coordinate system1,Y1) (in this example, a1:(x1,y1) Is mapped as (X)1,Y1)=(0,0))。
And mapping the remaining visual data points on the first straight line to obtain (X)2,Y2)……(Xn,Yn), (Xi,Yi):Xi=X1+i*dX,Yi=Y1+ i × dY, wherein the offsets dX, dY are:
Figure BDA0002990836700000112
and filling each data point into the chessboard matrix according to the coordinates of each mapped data point.
S4, finding other adjacent data points of the acquired visual data points:
if the number of the acquired visual data points on the first straight line exceeds a fifth threshold (in this embodiment, the fifth threshold is set to 5), then { (x) the coordinates of the acquired visual data points on the Dotcode image1,y1),(x2,y2),…,(xn,yn) And linearly fitting to obtain a corrected first straight line.
And sequentially starting from the acquired visual data points, acquiring adjacent visual data points along a second straight line which is perpendicular to the corrected first straight line. In this embodiment, according to the minimum distance value (the distance between the data points in the first straight line direction is the same as the distance between the data points in the second straight line direction, so the same minimum distance value can be used), one adjacent visible data point in different directions of the second straight line is obtained, which can be referred to in fig. 9.
Suppose that the visual data point (X) is composed ofi,Yi) Starting from the above, if the adjacent visual data point is found by rotating clockwise by 90 ° along the first straight line, the corresponding coordinate on the coordinate system is changed into dX '═ dY, dY' ═ dX; conversely, if an adjacent visual data point is found by rotating 90 ° counterclockwise along the first straight line, the corresponding coordinate on the coordinate system changes to dX '═ dY and dY' ═ dX. Therefore, the coordinate system coordinate corresponding to the visible data point on the second straight line is (X)j,Yj):Xj=Xi+j*dX,Yj=Yi+ j × dY, j is an imaginary number indicating the first linear rotation direction.
And finding a straight line which is parallel to the first straight line and passes through the adjacent visual data points, and mapping the straight line into a coordinate system. Similarly, each adjacent data point is populated into the checkerboard matrix according to the coordinates of each adjacent data point after mapping. When data points are subsequently filled in, the line serves as one of the references to the relative position.
S5, in the chessboard matrix, a minimum rectangular outline containing known data points is determined.
From top to bottom, the number of known data points per row is calculated. In the chessboard matrix, if the number of known data points on a certain row is lower than a second threshold (right-left +1+1)/2, it indicates that there is an unknown data point on the row;
wherein right and left respectively represent the abscissa of the right and left borders of the chessboard matrix.
Similarly, from left to right, the number of known data points per column is calculated. If the number of known data points in a certain column is lower than a third threshold (top-bottom +1+1)/2, it indicates that there is an unknown data point in the column;
wherein top and bottom represent the vertical coordinates of the upper and lower boundaries of the chessboard matrix, respectively.
Obtaining an unknown data point positioned in the ith row and the jth column through the process; obtaining a third straight line which is parallel to the transverse straight line of the rectangular outline and is a known visual data point on the ith row; obtaining a fourth straight line which is parallel to the vertical straight line of the rectangular profile and is provided with known visual data points on the jth column; and calculating the coordinates of the intersection point of the third straight line and the fourth straight line. The coordinates are converted into coordinates in the Dotcode image according to the mapping relationship, and whether the data point is a visible data point or not is confirmed from the coordinates according to the method described in the second embodiment, and if the data point cannot be confirmed as a visible data point, the data point is an invisible data point.
And S6, performing linear fitting again according to the coordinates of the acquired visual data points on the Dotcode image on the first straight line to obtain a corrected first straight line.
And similarly, performing linear fitting according to the coordinates of the acquired visual data points on the Dotcode image on the second straight line to obtain a corrected second straight line. (invisible data point location is estimated, not accurate enough, does not participate in correction)
In the Dotcode image, starting from the visible data points on the rectangular outline, the visible data points are respectively obtained from the outside of the rectangle along a fifth straight line parallel to the corrected first straight line and a sixth straight line parallel to the corrected second straight line until the number of the visible data points on the fifth straight line and the sixth straight line outside the rectangular outline exceeds a fourth threshold (in this embodiment, the fourth threshold is 5). And when the visible data points are acquired outside the rectangle along the fifth straight line and the sixth straight line, updating the minimum distance value by using the newly acquired visible data point positions. And estimating the number and the positions of the invisible data points on the straight line according to the minimum distance value.
Go to step S5 to update the minimum rectangular outline and acquire all data points within the updated rectangular outline until the rectangular outline is no longer expanded.
Mapping the newly obtained visual data point into a coordinate system, e.g., assuming the visual data point (x)0,y0) In the rectangular outline, and in the first region (see fig. 3):
the visible data point resulting from the fifth line (which is 45 ° counterclockwise from the horizontal in this embodiment) is mapped as:
Figure BDA0002990836700000141
the visible data point resulting from the sixth line (in this embodiment, the fifth line is 135 ° counterclockwise from the horizontal) is mapped as:
Figure BDA0002990836700000142
similarly, each data point is filled into the checkerboard matrix according to the coordinates of each mapped data point.
S7, if all data points of the Dotcode are contained in the final rectangular outline, the positions and the types of all the data points are obtained, and accordingly a data bit stream matrix is generated (the visible data points are 1, and the invisible data points are 0); and decoding the data bit stream matrix to obtain the data content in the Dotcode.
The improvement of the embodiment is that parameters such as the minimum distance value among all straight lines and data points are continuously corrected according to known data points, the situations that data points cannot be found due to image deformation, the positions of the data points are wrong and the like are avoided, and the accuracy of the data bit stream matrix is improved.
Example four
Take a Dotcode image to be decoded (fig. 6) as an example:
1. as shown in fig. 7, the image is scanned from top to bottom, left to right, and the first visual data point is obtained. Starting from the first visual data point, the visual data point and a first straight line are found, and the number and the position of the invisible data points on the first straight line are estimated.
2. As shown in FIG. 8, the data points are populated into a checkerboard matrix (i.e., the data point locations are written into the checkerboard matrix).
3. As shown in fig. 9, adjacent visual data points are acquired along a second line, which is perpendicular to the first line, starting from the acquired visual data points in turn.
4. The found visual data points are filled into a checkerboard matrix as shown in FIG. 10.
5. As shown in fig. 11, a minimum rectangular contour containing all known visual data points is determined, and all unknown data points within the rectangular contour are obtained.
6. As shown in FIG. 12, a checkerboard matrix is populated with all data points within the rectangular outline.
7. As shown in fig. 13, starting from the visual data points on the rectangular outline, the visual data points are obtained outwards until the visual data points cannot be found. The found visual data points are filled into a checkerboard matrix as shown in FIG. 14. Jump to step 5 to update the minimum rectangular outline (as shown in fig. 15), acquire all data points in the updated rectangular outline, and fill in the chessboard matrix (as shown in fig. 16) until the rectangular outline is no longer expanded. The resulting checkerboard matrix is shown in FIG. 17.
Example four
The Dotcode identification device is characterized by comprising a camera, a memory and a processor, wherein the memory stores instructions;
the camera acquires an image, wherein the image comprises a plurality of data points which are arranged at intervals; wherein the data points are divided into visible data points and invisible data points;
the instructions are adapted to be loaded by a processor and to perform the steps of:
acquiring a first visual data point in an image;
starting from the first visual data point, acquiring the visual data points along a first straight line until the number of the visual data points reaches a first threshold value; and estimating the number and position of the non-visible data points on the first line;
starting from the acquired visual data points in sequence, acquiring adjacent visual data points along a second straight line, wherein the second straight line is perpendicular to the first straight line;
determining a minimum rectangular contour containing all known data points, and acquiring all unknown data points in the rectangular contour, wherein the known data points comprise acquired visible data points and invisible data points of which the positions are estimated;
starting from visual data points on the rectangular outline in sequence, and acquiring the visual data points outwards until the visual data points cannot be found; jumping to step S5 to update the minimum rectangular contour and obtain all data points within the updated rectangular contour until the rectangular contour is no longer enlarged;
and obtaining a data bit stream matrix according to all data points in the rectangular outline, and decoding the data bit stream matrix.
EXAMPLE five
The instructions are adapted to be loaded by a processor and to perform the steps as described in embodiments two to three.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or applied directly or indirectly to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. A Dotcode identification method is characterized by comprising the following steps:
s1, acquiring an image, wherein the image comprises a plurality of data points which are arranged at intervals and are divided into visible data points and invisible data points;
s2, acquiring a first visual data point in the image;
s3, starting from the first visual data point, acquiring the visual data points along a first straight line until the number of the visual data points reaches a first threshold value; and estimating the number and position of the invisible data points on the first line;
s4, starting from the acquired visual data points in sequence, and acquiring adjacent visual data points along a second straight line, wherein the second straight line is perpendicular to the first straight line;
s5, determining a minimum rectangular contour containing all known data points, and acquiring all unknown data points in the rectangular contour, wherein the known data points comprise acquired visible data points and invisible data points of which the positions are estimated;
s6, starting from the visual data points on the rectangular outline in sequence, and acquiring the visual data points outwards until the visual data points cannot be found; jumping to step S5 to update the minimum rectangular contour and obtain all data points in the updated rectangular contour until the rectangular contour is not enlarged any more;
and S7, obtaining a data bit stream matrix according to all data points in the rectangular outline, and decoding the data bit stream matrix.
2. The Dotcode recognition method according to claim 1, wherein the step of obtaining visual data points is as follows:
extracting transition boundary points representing gray level changes in the image; transition boundary point (u) according to gray scale change from small to large1,v1) And transition boundary point (u) where the gray scale changes from large to small2,v2) Calculating the center point (x, y):
Figure FDA0002990836690000011
starting from the central point, searching at least two transition boundary points with the same gray scale change trend along the radial direction; calculating the distance from the central point to each transition boundary, and judging whether the data point is a visual data point or not based on the shape characteristic of the data point;
wherein (u)1,v1) The coordinates of transition boundary points representing the change of the gray scale from small to large in the image; (u)2,v2) The coordinates of a transition boundary point with the gray scale changing from large to small in the image are represented; (x, y) represents the coordinates of the center point in the image.
3. The Dotcode identification method according to claim 2, wherein in the step S3, the specific step of obtaining the visual data point along the first straight line from the first visual data point is:
presetting an angle range and a first threshold value;
starting from the first visual data point, acquiring a second visual data point adjacent to the first visual data point in the angle range; and continuing to acquire the visual data points along a first straight line of the geometric centers of the first visual data point and the second visual data point until the number of the visual data points on the first straight line exceeds a first threshold value.
4. A Dotcode identification method according to claim 3, characterized in that the estimating the number and location of the invisible data points on the first line is specifically:
calculating a minimum distance value between two adjacent visual data points on the first straight line; and sequentially estimating the number N of the invisible data points between two other adjacent visible data points according to the minimum distance value, and estimating the coordinates of each invisible data point.
5. The Dotcode identification method according to claim 1, wherein the step of obtaining an unknown data point within the rectangular outline specifically comprises:
calculating to obtain an unknown data point positioned in the ith row and the jth column; obtaining a third straight line which is parallel to the horizontal straight line of the rectangular outline and is on the known visual data point on the ith row; obtaining a fourth straight line which is parallel to the vertical straight line of the rectangular outline and is provided with known visual data points on the jth column; calculating the coordinates of the intersection point of the third straight line and the fourth straight line; an unknown data point at the coordinates is identified.
6. The Dotcode identification method according to claim 5, wherein the calculating to obtain an unknown data point is located at the ith row and the jth column, specifically:
calculating the number of known data points in each line of the rectangular outline from top to bottom, and if the number of the known data points in a certain line is lower than a second threshold, indicating that an unknown data point exists in the line;
from left to right, the number of known data points in each column of the rectangular outline is calculated, and if the number of known data points in a certain column is lower than a third threshold, it indicates that there is an unknown data point in the column.
7. The Dotcode identification method according to claim 6, wherein in the step S6, visual data points are sequentially obtained from visual data points on the rectangular outline, specifically:
starting from the visual data points on the rectangular contour in sequence, respectively obtaining the visual data points outwards along a fifth straight line parallel to the first straight line and a sixth straight line parallel to the second straight line until the number of the visual data points on the fifth straight line and the sixth straight line exceeds a fourth threshold; and estimating the number and the position of the invisible data points on the straight line according to the minimum distance value.
8. The Dotcode recognition method according to claim 7, further comprising correcting the respective lines by: and if the number of all the known visual data points on the straight line exceeds a fifth threshold, performing linear fitting according to the positions of all the known visual data points on the straight line to obtain a corrected straight line.
9. The Dotcode identification device is characterized by comprising a camera, a memory and a processor, wherein the memory stores instructions;
the camera acquires an image, wherein the image comprises a plurality of data points which are arranged at intervals; wherein the data points are divided into visible data points and invisible data points;
the instructions are adapted to be loaded by a processor and to perform the steps of:
acquiring a first visual data point in an image;
starting from the first visual data point, acquiring the visual data points along a first straight line until the number of the visual data points reaches a first threshold value; and estimating the number and position of the invisible data points on the first line;
starting from the acquired visual data points in sequence, acquiring adjacent visual data points along a second straight line, wherein the second straight line is perpendicular to the first straight line;
determining a minimum rectangular contour containing all known data points, and acquiring all unknown data points in the rectangular contour, wherein the known data points comprise acquired visible data points and invisible data points of which the positions are estimated;
starting from the visual data points on the rectangular outline in sequence, and acquiring the visual data points outwards until the visual data points cannot be found; jumping to step S5 to update the minimum rectangular contour and obtain all data points in the updated rectangular contour until the rectangular contour is not enlarged any more;
and obtaining a data bit stream matrix according to all data points in the rectangular outline, and decoding the data bit stream matrix.
CN202110313364.5A 2021-03-24 2021-03-24 Dotcode identification method and device Active CN113297872B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110313364.5A CN113297872B (en) 2021-03-24 2021-03-24 Dotcode identification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110313364.5A CN113297872B (en) 2021-03-24 2021-03-24 Dotcode identification method and device

Publications (2)

Publication Number Publication Date
CN113297872A true CN113297872A (en) 2021-08-24
CN113297872B CN113297872B (en) 2024-01-12

Family

ID=77319176

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110313364.5A Active CN113297872B (en) 2021-03-24 2021-03-24 Dotcode identification method and device

Country Status (1)

Country Link
CN (1) CN113297872B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2012241078A1 (en) * 2005-04-28 2012-11-01 Kenji Yoshida Printed Material Printed with a Dot Pattern
CN104809422A (en) * 2015-04-27 2015-07-29 江苏中科贯微自动化科技有限公司 QR code recognizing method based on image processing
CN105122275A (en) * 2012-10-01 2015-12-02 株式会社Ip舍路信 Dot pattern, dot-pattern-forming medium, program for generating image data for dot pattern, dot pattern forming apparatus, optical device, optical device reader, information i/o device, dot pattern reader
CN108334922A (en) * 2018-03-13 2018-07-27 深圳闳宸科技有限公司 The coding and recognition methods of dot matrix Quick Response Code and dot matrix Quick Response Code
US20190130236A1 (en) * 2017-10-26 2019-05-02 Datalogic Ip Tech S.R.L. System and method for extracting bitstream data in two-dimensional optical codes
CN111046872A (en) * 2019-12-12 2020-04-21 深圳市杰恩世智能科技有限公司 Optical character recognition method
CN111832659A (en) * 2020-07-21 2020-10-27 武汉纺织大学 Laser marking system and method based on feature point extraction algorithm detection

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2012241078A1 (en) * 2005-04-28 2012-11-01 Kenji Yoshida Printed Material Printed with a Dot Pattern
CN105122275A (en) * 2012-10-01 2015-12-02 株式会社Ip舍路信 Dot pattern, dot-pattern-forming medium, program for generating image data for dot pattern, dot pattern forming apparatus, optical device, optical device reader, information i/o device, dot pattern reader
CN104809422A (en) * 2015-04-27 2015-07-29 江苏中科贯微自动化科技有限公司 QR code recognizing method based on image processing
US20190130236A1 (en) * 2017-10-26 2019-05-02 Datalogic Ip Tech S.R.L. System and method for extracting bitstream data in two-dimensional optical codes
CN108334922A (en) * 2018-03-13 2018-07-27 深圳闳宸科技有限公司 The coding and recognition methods of dot matrix Quick Response Code and dot matrix Quick Response Code
CN111046872A (en) * 2019-12-12 2020-04-21 深圳市杰恩世智能科技有限公司 Optical character recognition method
CN111832659A (en) * 2020-07-21 2020-10-27 武汉纺织大学 Laser marking system and method based on feature point extraction algorithm detection

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
夏瑞雪;卢荣胜;刘宁;董敬涛;: "基于圆点阵列靶标的特征点坐标自动提取方法", 中国机械工程, no. 16 *
王福生;齐国清;: "二值图像中目标物体轮廓的边界跟踪算法", 大连海事大学学报, no. 01 *

Also Published As

Publication number Publication date
CN113297872B (en) 2024-01-12

Similar Documents

Publication Publication Date Title
CN107633192B (en) Bar code segmentation and reading method based on machine vision under complex background
EP2849115B1 (en) Method for decoding matrix-type two-dimensional code
US9135489B2 (en) System for decoding two dimensional code and method thereof
CN110047109B (en) Camera calibration plate based on self-identification mark and identification detection method thereof
EP2393037B1 (en) Data matrix decoding chip and decoding method thereof
US7571864B2 (en) Method and system for creating and using barcodes
US6758399B1 (en) Distortion correction method in optical code reading
CN113435556B (en) Code generation and decoding method and anti-counterfeiting method of dot matrix code
US20160275443A1 (en) Two-dimensional code, system for creation of two-dimensional code, and analysis program
CN108073966B (en) Conversion method of two-dimensional code and hole array code
CN104346640A (en) Two dimensional code and method of creating same
US9367782B2 (en) High capacity 2D color barcode and method for decoding the same
CN108256375B (en) One-dimensional bar code scanning method
CN101833644B (en) Correction graph searching method based on dynamic template
CN105046183A (en) Decoding method and system for distorted QR (Quick Response) code
US20120298754A1 (en) Two-dimensional optical identification device with same gray level for quick decoding and decoding method therefor
CN105095937A (en) Visual identification method based on linear clustering circular array graphic code
CN111311497B (en) Bar code image angle correction method and device
CN115511031A (en) Capacity-expansion two-dimensional code and three-dimensional code decoding method, system, equipment and medium
CN113297872B (en) Dotcode identification method and device
CN108073963B (en) Fusion two-dimensional code generation method and device
CN113158704B (en) Method and system for rapidly positioning Dotcode code
CN101908144B (en) Bar code image correction method and correction point acquisition method
CN110263597B (en) Quick and accurate QR (quick response) code correction method and system
CN101882213A (en) Method for sampling barcode images

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant