CN115376131A - Design and identification method of dot-shaped coding mark - Google Patents

Design and identification method of dot-shaped coding mark Download PDF

Info

Publication number
CN115376131A
CN115376131A CN202211016220.4A CN202211016220A CN115376131A CN 115376131 A CN115376131 A CN 115376131A CN 202211016220 A CN202211016220 A CN 202211016220A CN 115376131 A CN115376131 A CN 115376131A
Authority
CN
China
Prior art keywords
mark
image
coding
point
template
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
CN202211016220.4A
Other languages
Chinese (zh)
Inventor
权芳
张奥丽
荆创利
徐柱
慎利
蔡国林
李友兵
杨世恩
常燕敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Geological Surveying And Mapping Institute Co ltd
Southwest Jiaotong University
Original Assignee
Sichuan Geological Surveying And Mapping Institute Co ltd
Southwest Jiaotong University
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 Sichuan Geological Surveying And Mapping Institute Co ltd, Southwest Jiaotong University filed Critical Sichuan Geological Surveying And Mapping Institute Co ltd
Priority to CN202211016220.4A priority Critical patent/CN115376131A/en
Publication of CN115376131A publication Critical patent/CN115376131A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/15Cutting or merging image elements, e.g. region growing, watershed or clustering-based techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/18Extraction of features or characteristics of the image
    • G06V30/1801Detecting partial patterns, e.g. edges or contours, or configurations, e.g. loops, corners, strokes or intersections

Landscapes

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

Abstract

The invention discloses a design and identification method of a dot-shaped coding mark, which relates to the technical field of dot-shaped coding marks and comprises the following working steps: firstly, the method comprises the following steps: design of dot coding mark, two: identification algorithm of dot-shaped coding marks, III: and (4) performing experiment and analysis. The design of the mark in the first step comprises the following steps: the mark takes black as a background and white as a foreground, the foreground consists of a white frame, four template points and a plurality of coding points, the four template points A, B, C and D are respectively designed on two straight lines, the straight line AB is parallel to the upper edge of the mark outer frame/white frame and is vertical to the straight line CD, and the point C is positioned in the center of the mark and is equally divided into four blocks to be colored in black and white. The invention designs a dot-shaped coding mark aiming at monitoring large and weak texture structures, the gray level difference of the mark is obvious, the background is black, the foreground is white, the mark is composed of a white frame, four template points and a plurality of coding points, and the relative position of each template point is only needed to be considered when the template points are determined.

Description

Design and identification method of dot-shaped coding mark
Technical Field
The invention relates to the technical field of dot coding marks, in particular to a design and identification method of a dot coding mark.
Background
The coding mark points are indispensable parts in photogrammetry, and each coding mark value corresponds to different unique code values, so that the coding mark points have important application value in image identification, but the use of the existing point-shaped coding marks still has certain defects.
The design and identification method of a dot-shaped coding mark in the prior art has the defects that:
patent document CN107578051B discloses a method for detecting and identifying an annular encoded mark point, "comprising: collecting pictures with annular coding mark points; denoising, graying and binaryzation processing are carried out on the image; adopting canny to carry out edge detection; 8, extracting the contour by using a neighborhood algorithm; judging whether the image is formed by the circular mark points; and performing decoding operation of the annular coding mark points to obtain the serial number. The invention has the advantages that: the method has the advantages that the precise positioning of the annular coding mark points is realized, and the identification accuracy and the running speed of the annular coding mark points are improved.
Disclosure of Invention
The present invention is directed to a method for designing and identifying a dot-shaped code mark, so as to solve the problems mentioned in the background art.
In order to achieve the above object, the present invention provides the following technical solution, a method for designing and identifying a dot code mark, comprising the following working steps:
1. designing a mark;
2. identification algorithm of dot code mark;
3. and (4) experiment and analysis.
Preferably, the sign designing in the first step includes: the mark takes black as a background and white as a foreground, the foreground consists of four template points, a plurality of coding points and a white frame, the four template points are A, B, C and D respectively and are designed on two straight lines, a straight line AB is parallel to the upper edge of the mark outer frame/white frame and is vertical to a straight line CD, and the point C is positioned in the center of the mark and is divided into four blocks which are respectively colored in black and white;
the coding mark has strong expansibility, the coding capacity can be doubled by adding one coding point every time, the coding mark can be taken out from a plurality of standby coding points according to requirements in actual production, in order to further improve the identification efficiency of the mark, the radius of the template point and the radius of the coding point are designed to be different, in the decoding process, the coding mark can be directly distinguished according to the radius, wherein the radius is the maximum of the template point C, the coding point is the minimum of other template points, and in order to avoid that the target is similar to the background color of the mark, the mark cannot be effectively identified, a white frame is added in the mark.
Preferably, the algorithm for identifying the dot-shaped coded mark in the second step includes: the method comprises three parts of image preprocessing, mark identification and mark decoding, wherein the image preprocessing refers to the steps of carrying out noise reduction and data enhancement on an image; the mark identification refers to a process of identifying and extracting a coding mark in a picture; the mark decoding is a process of positioning the template points of the extracted coding mark picture through a set screening principle, correcting the coding mark picture by affine transformation based on the template points, and further judging whether the coding points at the corresponding positions exist or not, so that the number of the coding mark is obtained, and automatic identification is realized.
Preferably, the experiment and analysis in step three comprises: for the algorithm used by the invention, a corresponding dot-shaped coding mark detection program is compiled, in order to verify the effectiveness of the dot-shaped coding mark design and the identification method thereof, the marks of 8 standby coding points are taken as an example for experimental analysis, a large cement structure is selected, artificial dot-shaped marks are pasted on the surface of the large cement structure, a plurality of groups of pictures are taken under different light rays, different angles and different distances, the experiment also compares the results with the results of the traditional dot-shaped coding mark and the identification method thereof, and the selected evaluation mark has identification accuracy and identification efficiency.
Preferably, the image preprocessing in the second step includes: in the image acquisition process, various random interferences exist, so that the image quality is reduced, and therefore, the image is enhanced by adopting a graying, binaryzation, gaussian filtering and edge extraction method;
the graying method of the image comprises three methods, namely a component method, a maximum value method, an average value method and a weighted average method, and in order to enhance the contrast to the maximum extent, the invention adopts the maximum value method to graye:
g(i,j)=Max(R,G,B)
in the formula, R, G and B are three wave bands of red, green and blue of the image respectively, and G (i, j) is the image after graying;
the image binarization is to set a threshold value for the grayed image, unify the gray values above and below the threshold value to obtain a binarized image capable of reflecting the overall and local characteristics of the image, and because the designed coding mark only adopts two colors, namely black and white, the coding mark imaging has the characteristic of high brightness, and the gray histogram of the grayed image presents the obvious double-peak characteristic, therefore, the invention adopts a histogram double-peak binarization method or a 0tsu double-threshold segmentation method, and selects the gray level corresponding to the valley between the two peaks as the threshold value to perform binarization segmentation on the image;
the presence of a threshold Th allows all the pixels in the image to be classified into two classes C 0 、C 1 And C is 0 、C 1 The probability of occurrence is P 0 、P 1 The gray levels are respectively m 0 、m 1 Then the class variance formula is:
σ 2 =P 0 P 1 (m 0 -m 1 ) 2
traversing all gray levels, obtaining the threshold Th of the OTSU, and binarizing the image according to the threshold:
Figure BDA0003812620420000041
wherein g (i, j) is a grayed image, and f (i, j) is a binary image;
in order to reduce the influence of noise and environmental pollution on subsequent identification, a Gaussian filter is adopted to smooth the binarized image, the Gaussian filter is very effective in restraining the noise which follows normal distribution, and the mathematical model is as follows:
Figure BDA0003812620420000042
in the formula, (i, j) is the coordinate of a pixel point, sigma is a standard deviation, the value of each pixel point during filtering is obtained by weighted average of the gray values of the pixel point and other surrounding pixel points, and the closer the distance to the central pixel is, the larger the weight is;
preferably, the identifying of the marker in the second step includes:
(1) Extracting the outline in the image, and reserving outline information which is rectangular, wherein the original coding mark is integrally square and is influenced by the shooting angle of the picture, the coding mark in the image is deformed into a quadrangle, but partial rectangular information is reserved;
(2) Establishing tree-shaped contour information for the reserved contour and extracting the outermost contour;
(3) Reserving image information inside the outermost layer outline, unifying the pixel values outside the outermost layer outline to be 0, and forming a new image;
(4) And cutting the newly formed graph by utilizing the outline of the outermost layer to obtain the coding mark.
Preferably, the flag decoding in the second step includes: the mark decoding process comprises four steps of template point identification, template point number determination, mark image correction and code value acquisition, wherein the template point identification is to position the template points through a set screening principle after extracting the edge of the code mark, and as the dot-shaped code mark only uses the circle characteristic, the invention only needs to adopt two screening principles of roundness and size to calculate the roundness of the graph, and then sets a threshold value to judge whether the graph is the type of the circle or not, wherein the roundness formula is as follows:
E=4πA/L 2
in the formula, A is the area, L is the perimeter, E is the roundness, the graph with the roundness closer to 1 is closer to the circle, the perimeter of the circle with the same area is the shortest, the roundness E is 1, and the value of E of other graphs is smaller along with the increase of the perimeter;
the circle in the mark is inevitably deformed into an ellipse by being limited by a shooting angle, the cut rectangular image is required to be a square image at first, the circular mark is adjusted accordingly, and then a roundness threshold value is selected to judge whether a target in the edge of the coding mark is a circle;
in addition, three kinds of circles with the largest radius are used for designing the coding mark, wherein the circle with the largest radius is the template point C, the coding point is arranged next, and the template points A, B and D are arranged finally.
Taking eight encoding points as an example, the specific decoding process is as follows:
(1) Coarse affine transformation: affine transformation is carried out on the cut rectangular mark image to form a square, and the influence of the shooting angle problem on the roundness of the circle is eliminated;
(2) And (3) template point identification: screening out template points according to two principles of roundness and size;
(3) Determining a template point: directly determining the point C according to the radius, and determining the point D to be closest to the point C in the rest template points, so that the points D can be determined by respectively calculating the distances between the template points A, B, D and the point C; then, judging the point A and the point B by utilizing the rule that the point A is positioned on the left side of the straight line CD and the point B is positioned on the right side;
(4) Affine transformation: carrying out affine change by utilizing coordinates of three points A, B and D in the original image and three point positions in the template mark image, wherein the size of the transformed image is consistent with that of the designed real mark, the affine transformation is to establish a mapping relation between a shot image and a target image by calculating affine parameters, and the shot image is mapped to obtain the target image, and the calculation is as follows:
Figure BDA0003812620420000061
in the formula, i ', j' represents an undistorted coordinate, i and h represent original coordinates, and the affine transformation matrix M to be solved is:
Figure BDA0003812620420000062
to solve the affine transformation matrix, the individual elements of the matrix M are placed here in a 6 × 1 matrix X to be solved:
X=[a 11 ,a 12 ,a 13 ,a 21 ,a 22 ,a 23 ] T
according to A (i 'on the target image' 1 ,j′ 1 )、B(i′ 2 ,j′ 2 )、D(i′ 3 ,j′ 3 ) Three-point coordinates construct a 6 × 1 constant matrix:
B=[i 1 ’,j 1 ’,i 2 ’,j 2 ’,i 3 ’j 3 ’] T
then according to the original A (i) on the original image 1 ,j 1 )、B(i 2 ,j 2 )、D(i 3 ,j 3 ) Constructing a 6 × 6 coefficient matrix by three points: the affine transformation can be expressed as:
Figure BDA0003812620420000071
the affine transformation can be expressed as:
A X=B
by utilizing the solving equation system, each solved element in the X is the element in the affine transformation matrix M;
(5) Acquiring a coded value: and judging whether points exist at the positions of corresponding coding points in the corrected image according to the template point rule in the mark template, if so, outputting 1, otherwise, outputting 0, and finally, converting the output binary system into a decimal system.
Compared with the prior art, the invention has the following beneficial effects:
the invention designs a dot-shaped coding mark aiming at monitoring large and weak texture structures, the gray difference of the mark is obvious, the background is black, the foreground is white and consists of a white frame, four template points and a plurality of coding points, when the template points are determined, only the relative positions of the template points need to be considered, and the accurate position does not need to be calculated; whether the points exist or not is only considered during decoding, the specific coordinates of the coding points do not need to be resolved, the resolving efficiency and the decoding success rate are greatly improved by utilizing the novel coding mark and the decoding algorithm, and experimental results show that the coding mark point design method and the decoding algorithm thereof provided by the invention have the advantages of simple structural design, convenience in extraction and identification, large coding capacity, high decoding accuracy, strong robustness, small influence of target color and shooting angle and the like, and can meet the requirements of camera calibration, image splicing, target monitoring and other work in photogrammetry of large and weak texture structures.
Drawings
FIG. 1 is a schematic diagram of the workflow of the present invention;
FIG. 2 is a schematic diagram of a coded mark structure according to the present invention;
FIG. 3 is an original image of an encoding mark according to the present invention;
fig. 4 is a diagram illustrating an example of encoding according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that the terms "upper", "lower", "inner", "outer", "front", "rear", "both ends", "one end", "the other end", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it is to be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "disposed," "connected," and the like are to be construed broadly, and for example, "connected" may be a fixed connection, a detachable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
Referring to fig. 1-4, the present invention provides a technical solution, a method for designing and identifying a dot code mark, comprising the following steps:
1. designing a mark;
2. a recognition algorithm of the dot-shaped coding marks;
3. and (4) experiment and analysis.
The design of the mark in the first step comprises the following steps: the mark takes black as a background and white as a foreground, the foreground consists of four template points, a plurality of coding points and a white frame, the four template points are respectively A, B, C and D and are designed on two straight lines, a straight line AB is parallel to the upper edge of the mark outer frame/white frame and is vertical to a straight line CD, and the C point is positioned in the center of the mark and is divided into four blocks to be colored in black and white;
the coding mark has strong expansibility, the coding capacity can be doubled when adding one coding point, the coding mark can be randomly taken out from a plurality of standby coding points according to requirements in actual production, in order to further improve the identification efficiency of the mark, the radius of the template point and the radius of the coding point are designed to be different, in the decoding process, the coding mark can be directly distinguished according to the radius, wherein the radius is the maximum of the template point C, the coding point is the next largest, the other template points are the smallest, and in order to avoid the condition that the target is similar to the background color of the mark, and the mark cannot be effectively identified, a white frame is added in the mark.
The second algorithm for identifying the dot-shaped encoding mark comprises the following steps: the method comprises three parts of image preprocessing, mark identification and mark decoding, wherein the image preprocessing refers to the steps of carrying out noise reduction and data enhancement on an image; the mark identification refers to a process of identifying and extracting coding marks in the picture; the mark decoding is a process of positioning the template points of the extracted coding mark picture through a set screening principle, correcting the coding mark picture by affine transformation based on the template points, and further judging whether the coding points at the corresponding positions exist or not, so that the number of the coding mark is obtained, and automatic identification is realized.
The experiment and analysis in the third step comprises the following steps: for the algorithm used by the invention, a corresponding dot-shaped coding mark detection program is compiled, in order to verify the effectiveness of the dot-shaped coding mark design and the identification method thereof, the marks of 8 standby coding points are taken as an example for experimental analysis, a large cement structure is selected, artificial dot-shaped marks are pasted on the surface of the large cement structure, a plurality of groups of pictures are taken under different light rays, different angles and different distances, the experiment also compares the results with the results of the traditional dot-shaped coding mark and the identification method thereof, and the selected evaluation mark has identification accuracy and identification efficiency.
The image preprocessing in the second step comprises the following steps:
in the image acquisition process, various random interferences exist, so that the image quality is reduced, and therefore, the image is enhanced by adopting a graying method, a binarization method, a Gaussian filter method and an edge extraction method;
the graying method of the image comprises three methods, namely a component method, a maximum value method, an average value method and a weighted average method, and in order to enhance the contrast to the maximum extent, the invention adopts the maximum value method to graye:
g(i,j)=Max(R,G,B)
in the formula, R, G and B are three wave bands of red, green and blue of the image respectively, and G (i, j) is the image after graying;
the image binarization is to set a threshold value for the grayed image, unify the gray values above and below the threshold value to obtain a binarized image capable of reflecting the overall and local characteristics of the image, and because the designed coding mark only adopts two colors, namely black and white, the coding mark imaging has the characteristic of high brightness, and the gray histogram of the grayed image presents the obvious double-peak characteristic, therefore, the invention adopts a histogram double-peak binarization method or an Otsu double-threshold segmentation method, and selects the gray level corresponding to the valley between the two peaks as the threshold value to perform binarization segmentation on the image;
the presence of a threshold Th allows all the pixels in the image to be classified into two classes C 0 、C 1 And C is 0 、C 1 The probability of occurrence is P 0 、P 1 The average value of the gray levels is m 0 、m 1 Then the class variance formula is:
σ 2 =P 0 P 1 (m 0 -m 1 ) 2
traversing all gray levels, obtaining the threshold Th of the OTSU, and binarizing the image according to the threshold:
Figure BDA0003812620420000111
wherein g (i, j) is a grayed image, and f (i, j) is a binary image;
in order to reduce the influence of noise and environmental pollution on subsequent identification, a Gaussian filter is adopted to smooth the binarized image, the Gaussian filter is very effective in inhibiting the noise which obeys normal distribution, and the mathematical model is as follows:
Figure BDA0003812620420000112
in the formula, (i, j) is the coordinate of a pixel point, sigma is a standard deviation, the value of each pixel point during filtering is obtained by weighted average of the gray values of the pixel point and other surrounding pixel points, and the closer the distance to the central pixel is, the larger the weight is;
on the basis of image enhancement, extracting the outline in the picture and establishing outline tree information, and further cutting the original picture by the outline of the outermost layer to obtain the approximate position of a mark, wherein the mark places a round point in a black background, the boundary between the mark and the background is clear, an edge-based segmentation method can be selected, and the image segmentation is completed by searching the boundary between different regions, namely, the boundary of different regions of a scene to be segmented is extracted by using a proper edge detection operator, and the boundary pixels are communicated and labeled;
the invention uses Sobel operator to realize the extraction of the mark edge, the Sobel operator is a first order differential operator, which uses the gradient value of the adjacent area of the pixel to calculate the gradient of the pixel:
Figure BDA0003812620420000121
in the formula, dx is a transverse gradient value, dy is a direction gradient value, and the gradient values in two directions are combined to serve as an output value of the point.
The identification of the marker in the second step comprises the following steps:
(1) Extracting the outline in the image, and reserving outline information which is rectangular, wherein the original coding mark is integrally square and is influenced by the shooting angle of the picture, the coding mark in the image is deformed into a quadrangle, but partial rectangular information is reserved;
(2) Establishing tree-shaped contour information for the reserved contour and extracting the outermost contour;
(3) Retaining the image information inside the outermost layer outline, unifying the pixel values outside the outermost layer outline to be 0, and forming a new image;
(4) And cutting the newly formed graph by utilizing the outline of the outermost layer to obtain the coding mark.
The flag decoding in the second step comprises: the mark decoding process comprises four steps of template point identification, template point number determination, mark image correction and code value acquisition, wherein the template point identification is to position the template points through a set screening principle after extracting the edge of the code mark, and as the dot-shaped code mark only uses the circle characteristic, the invention only needs to adopt two screening principles of roundness and size to calculate the roundness of the graph, and then sets a threshold value to judge whether the graph is the type of the circle or not, wherein the roundness formula is as follows:
E=4πA/L 2
in the formula, A is the area, L is the perimeter, E is the roundness, the graph with the roundness closer to 1 is closer to the circle, the perimeter of the circle with the same area is the shortest, the roundness E is 1, and the value of E of other graphs is smaller along with the increase of the perimeter;
the circle in the mark is inevitably deformed into an ellipse by being limited by a shooting angle, the cut rectangular image is required to be roughly matched into a square image, the circular mark is adjusted, and then a roundness threshold value is selected to judge whether the target in the edge of the coding mark is a circle or not;
in addition, three kinds of circles with the radius are used for designing the coding mark, wherein the circle with the largest radius is the template point C, the next is the coding point, and the last is the template points A, B and D.
The flag decoding process in the second step includes:
(1) Coarse affine transformation: affine transformation is carried out on the cut rectangular mark image into a square, and the influence of the shooting angle problem on the roundness of the circle is eliminated;
(2) And (3) template point identification: screening out template points according to two principles of roundness and size;
(3) Determining template points: directly determining the point C according to the radius, and the point D is closest to the point C in the rest template points, so that the point D can be determined by respectively calculating the distances between the template points A, B, D and the point C; then, judging the point A and the point B by utilizing the rule that the point A is positioned on the left side of the straight line CD and the point B is positioned on the right side;
(4) Affine transformation: carrying out affine change by utilizing coordinates of three points A, B and D in an original image and three point positions in a template mark image, wherein the size of a transformed image is consistent with that of a designed real mark, the affine transformation is to establish a mapping relation between a shot image and a target image by calculating affine parameters, and mapping the shot image to obtain the target image, and the calculation is as follows:
Figure BDA0003812620420000141
in the formula, i ', j' represents an undistorted coordinate, i and h represent original coordinates, and the affine transformation matrix M to be solved is:
Figure BDA0003812620420000142
to solve the affine transformation matrix, the individual elements of the matrix M are placed here in a 6 × 1 matrix X to be solved:
X=[a 11 ,a 12 ,a 13 ,a 21 ,a 22 ,a 23 ] T
according to A (i 'on the target image' 1 ,h′ 1 )、B(i′ 2 ,j′ 2 )、D(i′ 3 ,h′ 3 ) Three-point coordinates construct a 6 × 1 constant matrix:
B=[i 1 ’,j 1 ’,i 2 ’,h 2 ’,i 3 ’,j 3 ’] T
then according to the original A (i) on the original image 1 ,j 1 )、B(i 2 ,h 2 )、D(i 3 ,j 3 ) Three points construct a 6 × 6 coefficient matrix: the affine transformation can be expressed as:
Figure BDA0003812620420000151
the affine transformation can be expressed as:
AX=B
by using the solution equation set, each element in the solved X is an element in the affine transformation matrix M;
(5) Acquiring a coded value: and judging whether points exist at the positions of corresponding coding points in the corrected image according to the template point rule in the mark template, if so, outputting 1, otherwise, outputting 0, and finally, converting the output binary system into a decimal system.
According to the technical solutions provided in fig. 1-4 in combination with the above, the first embodiment:
(1) And designing a mark:
the mark takes black as a background and white as a foreground, the foreground consists of four template points, a plurality of coding points and a white frame, the four template points are respectively A, B, C and D and are designed on two straight lines, the straight line AB is parallel to the upper edge of the mark outer frame/white frame and is vertical to the straight line CD, and the C point is positioned in the center of the mark and is divided into four blocks to be colored in black and white.
(2) And the identification algorithm of the dot-shaped coding mark comprises the following steps:
the identification algorithm is divided into three parts of image preprocessing, mark identification and mark decoding, wherein the image preprocessing refers to the noise reduction and data enhancement processing of an image; the mark identification refers to a process of identifying and extracting a coding mark in a picture; the mark decoding is a process of positioning the template points of the extracted coding mark picture through a set screening principle, correcting the coding mark picture by affine transformation based on the template points, and further judging whether the coding points at the corresponding positions exist or not, so that the number of the coding mark is obtained, and automatic identification is realized.
(3) And the experiment and analysis comprise:
taking marks of 8 standby coding points as an example for experimental analysis, selecting a large cement structure, pasting artificial point marks on the surface of the large cement structure, taking a plurality of groups of pictures under different light rays, different angles and different distances, comparing the results of the experiment with the results of the traditional point coding marks and the identification method thereof, and selecting an evaluation mark with identification accuracy and identification efficiency.
According to the technical scheme provided by combining the figures 1-4, embodiment two;
(1) And designing a mark:
the mark takes black as a background and white as a foreground, the foreground consists of four template points, a plurality of coding points and a white frame, the four template points are A, B, C and D respectively and are designed on two straight lines, the straight line AB is parallel to the upper edge of the mark outer frame/white frame and is vertical to the straight line CD, and the point C is positioned in the center of the mark and is equally divided into four blocks to be colored in black and white.
(2) And the identification algorithm of the dot-shaped coding mark comprises the following steps:
the identification algorithm is divided into three parts of image preprocessing, mark identification and mark decoding, wherein the image preprocessing refers to the steps of carrying out noise reduction and data enhancement on an image; the mark identification refers to a process of identifying and extracting a coding mark in a picture; the mark decoding is a process of positioning template points through a set screening principle on the extracted coding mark picture, correcting a coding mark image by affine transformation based on the template points, and further judging whether coding points in corresponding positions exist or not, so that the number of the coding mark is obtained, and automatic identification is realized.
(3) And the experiment and analysis comprise:
taking the marks of 8 standby coding points as an example for experimental analysis, selecting a large cement structure, pasting artificial point marks on the surface of the large cement structure, taking a plurality of groups of pictures under different light rays, different angles and different distances, comparing the results of the experiment with the results of the traditional point coding marks and the identification method thereof, and selecting the evaluation marks with identification accuracy and identification efficiency.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.

Claims (8)

1. A design and identification method of dot-shaped coding marks is characterized in that: the method comprises the following working steps:
1. designing a mark;
2. a recognition algorithm of the dot-shaped coding marks;
3. and (4) experiment and analysis.
2. The method for designing and identifying a dot code symbol according to claim 1, wherein: the design of the mark in the first step comprises the following steps: the mark takes black as a background and white as a foreground, the foreground consists of four template points, a plurality of coding points and a white frame, the four template points are respectively A, B, C and D and are designed on two straight lines, a straight line AB is parallel to the upper edge of the mark outer frame/white frame and is vertical to a straight line CD, and the C point is positioned in the center of the mark and is divided into four blocks to be colored in black and white;
the coding mark has strong expansibility, the coding capacity can be doubled when adding one coding point, the coding mark can be randomly taken out from a plurality of standby coding points according to requirements in actual production, in order to further improve the identification efficiency of the mark, the radius of the template point and the radius of the coding point are designed to be different, in the decoding process, the coding mark can be directly distinguished according to the radius, wherein the radius is the maximum of the template point C, the coding point is the next largest, the other template points are the smallest, and in order to avoid the condition that the target is similar to the background color of the mark, and the mark cannot be effectively identified, a white frame is added in the mark.
3. The method for designing and identifying a dot-shaped code mark according to claim 1, wherein: the second algorithm for identifying the dot-shaped encoding mark comprises the following steps: the method comprises three parts of image preprocessing, mark identification and mark decoding, wherein the image preprocessing refers to the steps of carrying out noise reduction and data enhancement on an image; the mark identification refers to a process of identifying and extracting a coding mark in a picture; the mark decoding is a process of positioning the template points of the extracted coding mark picture through a set screening principle, correcting the coding mark picture by affine transformation based on the template points, and further judging whether the coding points at the corresponding positions exist or not, so that the number of the coding mark is obtained, and automatic identification is realized.
4. The method for designing and identifying a dot-shaped code mark according to claim 1, wherein: the experiment and analysis in the third step comprises the following steps: for the algorithm used by the invention, a corresponding dot-shaped coding mark detection program is compiled, in order to verify the effectiveness of the dot-shaped coding mark design and the identification method thereof, the marks of 8 standby coding points are taken as an example for experimental analysis, a large cement structure is selected, artificial dot-shaped marks are pasted on the surface of the large cement structure, a plurality of groups of pictures are taken under different light rays, different angles and different distances, the experiment also compares the results with the results of the traditional dot-shaped coding mark and the identification method thereof, and the selected evaluation mark has identification accuracy and identification efficiency.
5. The method for designing and identifying a dot-shaped code mark according to claim 3, wherein: the image preprocessing in the second step comprises the following steps:
in the image acquisition process, various random interferences exist, so that the image quality is reduced, and therefore, the image is enhanced by adopting a graying, binaryzation, gaussian filtering and edge extraction method;
the graying method of the image comprises three methods, namely a component method, a maximum value method, an average value method and a weighted average method, and in order to enhance the contrast to the maximum extent, the invention adopts the maximum value method to graye:
g(i,j)=Max(R,G,B)
in the formula, R, G and B are three wave bands of red, green and blue of the image respectively, and G (i, j) is the image after graying;
the image binarization is to set a threshold value for the grayed image, unify the gray values above and below the threshold value to obtain a binarized image capable of reflecting the overall and local characteristics of the image, and because the designed coding mark only adopts two colors, namely black and white, the coding mark imaging has the characteristic of high brightness, and the gray histogram of the grayed image presents the obvious double-peak characteristic, therefore, the invention adopts a histogram double-peak binarization method or an Otsu double-threshold segmentation method, and selects the gray level corresponding to the valley between the two peaks as the threshold value to perform binarization segmentation on the image;
the presence of a threshold Th allows all the pixels in the image to be classified into two classes C 0 、C 1 And C is 0 、C 1 The probability of occurrence is P 0 、P 1 The average value of the gray levels is m 0 、m 1 Then the class variance formula is:
σ 2 =P 0 P 1 (m 0 -m 1 ) 2
traversing all gray levels, obtaining the threshold Th of the OTSU, and binarizing the image according to the threshold:
Figure FDA0003812620410000031
wherein g (i, j) is a grayed image, and f (i, j) is a binary image;
in order to reduce the influence of noise and environmental pollution on subsequent identification, a Gaussian filter is adopted to smooth the binarized image, the Gaussian filter is very effective in restraining the noise which follows normal distribution, and the mathematical model is as follows:
Figure FDA0003812620410000032
in the formula, (i, j) is the coordinate of a pixel point, sigma is a standard deviation, the value of each pixel point during filtering is obtained by weighted average of the gray values of the pixel point and other surrounding pixel points, and the closer the distance to the central pixel is, the larger the weight is;
on the basis of image enhancement, extracting the outline in the picture and establishing outline tree information, and further cutting the original picture by the outline of the outermost layer to obtain the approximate position of a mark, wherein the mark places a round point in a black background, the boundary between the mark and the background is clear, an edge-based segmentation method can be selected, and the image segmentation is completed by searching the boundary between different regions, namely, the boundary of different regions of a scene to be segmented is extracted by using a proper edge detection operator, and the boundary pixels are communicated and labeled;
the invention uses Sobel operator to realize the extraction of the mark edge, the Sobel operator is a first order differential operator, which uses the gradient value of the adjacent area of the pixel to calculate the gradient of the pixel:
Figure FDA0003812620410000041
in the formula, dx is a transverse gradient value, dy is a mean gradient value, and the gradient values in two directions are combined to serve as an output value of the point.
6. The method of claim 3, wherein the method comprises the steps of: the identification of the marker in the second step comprises the following steps:
(1) Extracting the outline in the image, and reserving outline information which is rectangular, wherein the original coding mark is integrally square and is influenced by the shooting angle of the picture, the coding mark in the image is deformed into a quadrangle, but partial rectangular information is reserved;
(2) Establishing tree-shaped contour information for the reserved contour and extracting the outermost contour;
(3) Reserving image information inside the outermost layer outline, unifying the pixel values outside the outermost layer outline to be 0, and forming a new image;
(4) And cutting the newly formed graph by utilizing the outline of the outermost layer to obtain the coding mark.
7. The method of claim 3, wherein the method comprises the steps of: the flag decoding in the second step comprises: the mark decoding process comprises four steps of template point identification, template point number determination, mark image correction and code value acquisition, wherein the template point identification is to position the template points through a set screening principle after extracting the edge of the code mark, and as the dot-shaped code mark only uses the circle characteristic, the invention only needs to adopt two screening principles of roundness and size to calculate the roundness of the graph, and then sets a threshold value to judge whether the graph is the type of the circle or not, wherein the roundness formula is as follows:
E=4πA/L 2
in the formula, A is the area, L is the perimeter, E is the roundness, the graph with the roundness closer to 1 is closer to the circle, the perimeter of the circle with the same area is the shortest, the roundness E is 1, and the value of E of other graphs is smaller along with the increase of the perimeter;
the circle in the mark is inevitably deformed into an ellipse by being limited by a shooting angle, the cut rectangular image is required to be a square image at first, the circular mark is adjusted accordingly, and then a roundness threshold value is selected to judge whether a target in the edge of the coding mark is a circle;
in addition, three kinds of circles with the largest radius are used for designing the coding mark, wherein the circle with the largest radius is the template point C, the coding point is arranged next, and the template points A, B and D are arranged finally.
8. The method for designing and identifying a dot-shaped code mark according to claim 7, wherein: the flag decoding process in the second step includes:
(1) Coarse affine transformation: affine transformation is carried out on the cut rectangular mark image into a square, and the influence of the shooting angle problem on the roundness of the circle is eliminated;
(2) And (3) template point identification: screening out template points according to two principles of roundness and size;
(3) Determining a template point: directly determining the point C according to the radius, and the point D is closest to the point C in the rest template points, so that the point D can be determined by respectively calculating the distances between the template points A, B, D and the point C; then, judging the point A and the point B by utilizing the rule that the point A is positioned on the left side of the straight line CD and the point B is positioned on the right side;
(4) Affine transformation: carrying out affine change by utilizing coordinates of three points A, B and D in an original image and three point positions in a template mark image, wherein the size of a transformed image is consistent with that of a designed real mark, the affine transformation is to establish a mapping relation between a shot image and a target image by calculating affine parameters, and mapping the shot image to obtain the target image, and the calculation is as follows:
Figure FDA0003812620410000061
in the formula, i ', j' represents an undistorted coordinate, i, j represent an original coordinate, and the affine transformation matrix M to be solved is:
Figure FDA0003812620410000062
to solve the affine transformation matrix, the individual elements of the matrix M are placed here in a 6 × 1 matrix X to be solved:
X=[a 11 ,a 12 ,a 13 ,a 21 ,a 22 ,a 23 ] T
according to A (i 'on the target image' 1 ,j′ 1 )、B(i′ 2 ,j′ 2 )、D(i′ 3 ,j′ 3 ) Three-point coordinates construct a 6 × 1 constant matrix:
B=[i 1 ’,j 1 ’,i 2 ’,j 2 ’,i 3 ’,j’ 3 ] T
then according to the original A (i) on the original image 1 ,j 1 )、B(i 2 ,j 2 )、D(i 3 ,j 3 ) Constructing a 6 × 6 coefficient matrix by three points: the affine transformation can be expressed as:
Figure FDA0003812620410000071
the affine transformation can be expressed as:
AX=B
by using the solution equation set, each element in the solved X is an element in the affine transformation matrix M;
(5) Acquiring a code value: and judging whether a point exists at the position of a corresponding coding point in the corrected image according to a template point rule in the mark template, if so, outputting 1, otherwise, outputting 0, and finally converting the output binary system into a decimal system.
CN202211016220.4A 2022-08-24 2022-08-24 Design and identification method of dot-shaped coding mark Pending CN115376131A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211016220.4A CN115376131A (en) 2022-08-24 2022-08-24 Design and identification method of dot-shaped coding mark

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211016220.4A CN115376131A (en) 2022-08-24 2022-08-24 Design and identification method of dot-shaped coding mark

Publications (1)

Publication Number Publication Date
CN115376131A true CN115376131A (en) 2022-11-22

Family

ID=84067009

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211016220.4A Pending CN115376131A (en) 2022-08-24 2022-08-24 Design and identification method of dot-shaped coding mark

Country Status (1)

Country Link
CN (1) CN115376131A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117705815A (en) * 2024-02-06 2024-03-15 天津滨海环球印务有限公司 Printing defect detection method based on machine vision

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117705815A (en) * 2024-02-06 2024-03-15 天津滨海环球印务有限公司 Printing defect detection method based on machine vision
CN117705815B (en) * 2024-02-06 2024-05-28 天津滨海环球印务有限公司 Printing defect detection method based on machine vision

Similar Documents

Publication Publication Date Title
CN114723701B (en) Gear defect detection method and system based on computer vision
CN110210409B (en) Method and system for detecting form frame lines in form document
CN106960208B (en) Method and system for automatically segmenting and identifying instrument liquid crystal number
CN107945200B (en) Image binarization segmentation method
CN110210477B (en) Digital instrument reading identification method
CN110569857B (en) Image contour corner detection method based on centroid distance calculation
CN114549981A (en) Intelligent inspection pointer type instrument recognition and reading method based on deep learning
CN114913177B (en) Automobile part defect detection method based on Hough circle
CN109190742B (en) Decoding method of coding feature points based on gray feature
CN110427979B (en) Road water pit identification method based on K-Means clustering algorithm
JP6890427B2 (en) Car number recognition device
CN109635799B (en) Method for recognizing number of character wheel of gas meter
CN114037691A (en) Carbon fiber plate crack detection method based on image processing
CN111695373A (en) Zebra crossing positioning method, system, medium and device
CN115376131A (en) Design and identification method of dot-shaped coding mark
CN116542968A (en) Intelligent counting method for steel bars based on template matching
CN113313628B (en) Affine transformation and mean pixel method-based annular coding point robustness identification method
CN113989771A (en) Traffic signal lamp identification method based on digital image processing
CN112036391B (en) Electronic inspection method and system based on shale gas field production station
CN112818983A (en) Method for judging character inversion by using picture acquaintance
CN115880683B (en) Urban waterlogging ponding intelligent water level detection method based on deep learning
CN116110069A (en) Answer sheet identification method and device based on coding mark points and relevant medium thereof
KR100606404B1 (en) Method and apparatus for detecting color code image
CN115578343A (en) Crack size measuring method based on image communication and skeleton analysis
CN113516121A (en) Multi-feature fusion non-motor vehicle license plate region positioning method

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