CN113129397B - Decoding method of parallelogram coding mark based on graphic geometric relation - Google Patents

Decoding method of parallelogram coding mark based on graphic geometric relation Download PDF

Info

Publication number
CN113129397B
CN113129397B CN202110392348.XA CN202110392348A CN113129397B CN 113129397 B CN113129397 B CN 113129397B CN 202110392348 A CN202110392348 A CN 202110392348A CN 113129397 B CN113129397 B CN 113129397B
Authority
CN
China
Prior art keywords
coding
parallelogram
zeta
image
pattern
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110392348.XA
Other languages
Chinese (zh)
Other versions
CN113129397A (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.)
Hefei University of Technology
Original Assignee
Hefei University of Technology
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 Hefei University of Technology filed Critical Hefei University of Technology
Publication of CN113129397A publication Critical patent/CN113129397A/en
Application granted granted Critical
Publication of CN113129397B publication Critical patent/CN113129397B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/20Contour coding, e.g. using detection of edges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/66Analysis of geometric attributes of image moments or centre of gravity

Landscapes

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

Abstract

The invention discloses a decoding method of a parallelogram coding mark based on a graph geometric relationship, wherein the parallelogram coding mark is composed of a parallelogram background pattern and a coding pattern, the coding pattern is arranged in the parallelogram background pattern and comprises a positioning pattern, an orientation pattern and a coding combination pattern, and the orientation pattern and the positioning pattern are used for judging the direction of the parallelogram coding mark; the coding combination pattern is used for coding four vertexes of the coding mark for coding. The coding pattern in the parallelogram coding mark provided by the invention can automatically judge the relative rotation direction of the measured target and the camera in the processes of camera calibration, three-dimensional data splicing and the like, thereby improving the flexibility; the positions of the patterns of all the components are distinguished by a method of geometric relationship and vector product of graphs, so that the method has stronger robustness; the decoding method greatly improves the accuracy of decoding; the method has the advantages of high efficiency and high decoding speed, and can realize real-time decoding.

Description

Decoding method of parallelogram coding mark based on graphic geometric relation
Technical Field
The invention relates to the field of vision measurement in computer vision, in particular to a decoding method of a parallelogram coding mark based on a graph geometric relation, which is suitable for the fields of camera calibration, target feature extraction, stereo matching, three-dimensional data splicing and the like.
Background
In visual measurement, feature identification and matching of measured objects are one of the research hotspots in the field. However, under the condition of a high-resolution large field of view or other complex backgrounds, the accuracy of feature extraction and matching cannot meet the precision requirement, and the speed and precision of the current feature extraction and matching can be greatly improved by arranging the coding marks on the surface of the measured object, and meanwhile, the problem of matching of multiple images can be solved. Therefore, the design and identification of coded signs is a key element in visual measurement.
In 1972, russo and Knockeart realized compilation and recognition by using unique characteristics of marker points, and since then, technology for encoding marker points has been rapidly developed. In order to meet the requirements of industrial measurement, there are many types of coding mark points, but most of them are ring, circle or sector, and the coding mark points have the following defects: when the shooting angle changes, part of the codes deform, thereby influencing the precision; the capacity of the code is small, and the code cannot be applied to a target with a large size.
Disclosure of Invention
The invention aims to overcome the defects of the existing coding mark, provides a decoding method of a parallelogram coding mark based on the geometric relation of graphs, is suitable for multi-view stereoscopic vision calibration under a large view field, has good stability on affine transformation images, has large coding capacity, and can also have higher coding precision and accuracy for targets with larger sizes.
In order to realize the effect, the invention adopts the technical scheme that:
a decoding method of a parallelogram coding mark based on a graph geometric relationship is characterized in that the coding mark is a square coding grid, a parallelogram background pattern and a coding pattern are arranged on the surface of the coding grid, the coding pattern is positioned inside the parallelogram background pattern, the coding pattern comprises a positioning pattern, an orientation pattern and a coding combination pattern, the orientation pattern and the positioning pattern are used for judging the direction of the parallelogram coding mark, the coding combination pattern is used for coding each corner point of the parallelogram coding mark, and each coding combination pattern is composed of one coding combination orientation pattern and three coding combination coding patterns. The method for processing the digital image is used for obtaining the coding sequence number and the sub-pixel coordinates of each characteristic corner point in the image which is shot by the camera and contains N parallelogram coding marks, and further completing the decoding of the parallelogram coding marks, and comprises the following steps:
step 1.1, acquiring a coding mark image by utilizing N parallelogram coding marks arranged in a camera shooting space, wherein the coding mark image comprises N parallelogram coding marks;
step 1.2, establishing a pixel coordinate system of an angular point:
in the shot image containing N parallelogram coding marks, taking the upper left corner of the image as the origin o of an angular point pixel coordinate system, taking the upper left corner of the image from left to right as the x-axis direction of the angular point pixel coordinate system, and taking the upper left corner of the image from top to bottom as the y-axis direction of the angular point pixel coordinate system, thereby establishing an angular point pixel coordinate system o-xy;
step 2.1, carrying out 8-bit gray level processing on the coding mark image to obtain a coding mark gray level image P 1 (ii) a Wherein the code marks the grayscale image P 1 Is an 8-bit gray scale map;
step 2.2, the grey image P of the coding mark 1 Copying and backing up to obtain the grey backup image P of the code mark 1 ′;
Step 2.3, the grey level backup image P of the coding mark 1 Performing binarization processing to make the background color of each parallelogram coding mark black (i.e. gray value of 0), the orientation pattern and the positioning pattern in each parallelogram coding mark white (i.e. gray value of 255), and the color of the coding unit pattern can be determined according to the coding rule of the parallelogram coding markWhite or black to obtain a binary image P of the coding mark 2
Step 3, setting a roundness threshold lambda 'of the black connected domain and a pixel number threshold lambda';
step 4.1, calculating a binary image P of the coding mark 2 Circularity value λ of all black connected components in the image n And the number of pixel points c n Wherein the circularity value of each black connected domain can be obtained by equation (1),
Figure GDA0003834588460000021
wherein l n Perimeter, s, representing the contour of the corresponding black connected component n Represents the area corresponding to the black connected domains, n =1,2,3,4;
step 4.2, selecting proper black connected domain roundness threshold value lambda 'and pixel number threshold value lambda' to encode the mark binary image P 2 Black connected domains of the centers of N directional circular rings corresponding to the N parallelogram coding marks are obtained; respectively recording black connected domains at the centers of the N directional circular rings as a binary image P of a coding mark 2 Middle ring black connected domain M 1 Ring black connected domain M 2 Ring black connected domain M 3 823060, circular black connected domain M N And connecting the ring black connected domain M 1 Circular ring black connected domain M 2 Ring black connected domain M 3 823060, circular black connected domain M N Sequentially putting into a ring black connected domain set A', namely a ring black connected domain M 1 Circular ring black connected domain M 2 Circular ring black connected domain M 3 823060, circular black connected domain M N The first element, the second element, the third element, the fourth element, the fifth element, the sixth element and the sixth element in the annular black connected domain set A' respectively; thereby obtaining a coded mark binarized image P 2 Black connected domains inside the directional circular rings in all the N parallelogram coding marks; wherein, the coded mark binarizes the image P 2 Middle ring black connected domain M 1 Ring black connected domainM 2 Circular ring black connected domain M 3 823060, circular black connected domain M N Are all smaller than a roundness threshold lambda', and a black connected domain M of a circular ring 1 Ring black connected domain M 2 Circular ring black connected domain M 3 823060, circular black connected domain M N The number of the pixel points is larger than the threshold value lambda' of the number of the pixel points;
step 4.3, taking an integer variable i and assigning i =1;
step 4.4, calculating the ith ring black connected domain M in the ring black connected domain set A i And the coordinates of the centroid pixel are marked as o ″ d,i (x″ d,i ,y″ d,i ) Obtaining the ith ring black connected domain M i Centroid pixel coordinate o ″) d,i (x″ d,i ,y″ d,i ) The ith element is taken as a centroid set A of the ring black connected domain;
step 4.5, judging whether i is smaller than N, if i is smaller than N, assigning i +1 to i, and returning to the step 4.4 for sequential execution; otherwise, obtaining the binary image P of the coding mark 2 The center of mass pixel coordinate o' of each ring black connected domain d,1 (x″ d,1 ,y″ d,1 )、o″ d,2 (x″ d,2 ,y″ d,2 )、…、o″ d,N (x″ d,N ,y″ d,N ) Sequentially putting the circular ring black connected domain centroid set A into the circular ring black connected domain centroid set A;
step 5, taking an integer variable zeta and assigning zeta =1;
step 6.1, binarization image P of coding mark 2 Copying and backing up twice to respectively obtain a 1 st backup binary image P 'of the zeta group' ζ,1 And the 2 nd backup binary image P 'of the zeta th group' ζ,2
Step 6.2, utilizing a complex background algorithm for removing the coding mark to carry out binarization on the 1 st backup binary image P 'of the zeta-th group' ζ,1 Digital image processing is carried out to obtain the zeta th parallelogram binaryzation image P without complex background ζ,1
At the zeta th non-complex background parallelogram binaryzation image P ″ ζ,1 In, including centroid pixelCoordinate value (x ″) d,ζ ,y″ d,ζ ) The gray value of all pixel points in the parallelogram coding mark is set to be 255 (namely white), and the pixel coordinate value (x ″) containing the centroid is contained d,ζ ,y″ d,ζ ) The gray value of all pixel points outside the parallelogram coding mark is set to be 0 (namely black);
step 7.1, coding the mark gray level image P 1 Copying and backing up again to obtain the zeta th backup gray image P ζ ″′;
Step 7.2, utilizing a corner detection algorithm to carry out binaryzation on the zeta-th non-complex background parallelogram image P ″ ζ,1 Extracting sub-pixel coordinates of 4 corner points, and marking as the zeta th non-complex background parallelogram binaryzation image P ″ ζ,1 4 alternative corner points C ″) ζ,1 (x″ ζ,1 ,y″ ζ,1 )、C″ ζ,2 (x″ ζ,2 ,y″ ζ,2 )、C″ ζ,3 (x″ ζ,3 ,y″ ζ,3 )、C″ ζ,4 (x″ ζ,4 ,y″ ζ,4 );
Step 7.3, in the zeta th parallelogram binaryzation image P ″, without complex background ζ,1 Black connected domain corrosion is performed in the process, so that the zeta-th parallelogram binaryzation image P' without complex background ζ,1 The white connected domain is enlarged, and when the subsequent image multiplication operation is carried out, the complete pixel coordinate value (x') containing the centroid extracted from the operation result image can be ensured d,ζ ,y″ d,ζ ) The 4 characteristic angular points of the gray pattern of the parallelogram coding mark are completely stored; and the zeta th parallelogram binaryzation image P' without complex background ζ,1 The image obtained by the processing in this step is recorded as the ζ -th operation binary image P ″ ζ,2
Step 7.4, the zeta-th operation binaryzation image P ″ ζ,2 Setting the value of the part with the middle gray scale value of 255 as 1, and calculating the zeta-th binary image P ″ ζ,2 Setting the value of the part with the middle gray value of 0 as 0, and then utilizing the zeta-th operation to binarize the image P ″) ζ,2 And the ζ th backup grayscale image P ζ "' multiplication operationRecording the obtained result image as the Zeth coverage result image T ζ (ii) a The ζ th overlay result image T ζ Contains only the coordinate value (x') of the pixel containing centroid d,ζ ,y″ d,ζ ) The image information of the parallelogram coding mark of (1) removes the image information of other parallelogram coding marks;
step 7.5, covering the result image T at the zeta th by utilizing a corner point detection algorithm ζ Extracting sub-pixel coordinates of all corner points and storing the sub-pixel coordinates into a zeta-th primary selection corner point sub-pixel coordinate set B ζ Performing the following steps; wherein, the Zeth primary selection corner sub-pixel coordinate set B ζ In which the ζ th overlay result image T is stored ζ Contains the coordinate value (x ″) of centroid pixel d,ζ ,y″ d,ζ ) The sub-pixel coordinate values of 4 characteristic angular points of the parallelogram coding mark and the sub-pixel coordinate values of interference angular points, wherein the interference angular points are the interference angular points except the characteristic angular points;
step 7.6, taking an integer variable i and assigning i =1;
step 7.7, in the zeta th primary corner point sub-pixel coordinate set B ζ Finding the coordinate value (x ″) of the distance sub-pixel ζ,i ,y″ ζ,i ) Nearest corner sub-pixel coordinate and denoted C' ζ,i (x′ ζ,i ,y′ ζ,i );
7.8, judging whether i is smaller than 4, if i is smaller than 4, assigning i +1 to i and returning to execute the step 7.7; otherwise, the ζ -th overlay result image T has been obtained at this time ζ Contains the coordinate value (x ″) of the centroid pixel d,ζ ,y″ d,ζ ) Of 4 characteristic corner points of the parallelogram-coded logo C' ζ,1 (x′ ζ,1 ,y′ ζ,1 )、C′ ζ,2 (x′ ζ,2 ,y′ ζ,2 )、C′ ζ,3 (x′ ζ,3 ,y′ ζ,3 )、C′ ζ,4 (x′ ζ,4 ,y′ ζ,4 ) And step 8.1 is executed;
step 8.1, backup binarization image P 'at the 2 nd of the zeta group' ζ,2 Above, will contain the centroid pixel coordinate value (x ″) d,ζ ,y″ d,ζ ) The parallelogram coding mark is marked as the zeta th parallelogram coding mark;
step 8.2, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 Wherein the sub-pixel coordinate values are (x' ζ,1 ,y′ ζ,1 )、(x′ ζ,2 ,y′ ζ,2 )、(x′ ζ,3 ,y′ ζ,3 )、(x′ ζ,4 ,y′ ζ,4 ) The 4 pixel points are used as the corner quadrangle S of the zeta-th parallelogram coding mark ζ 4 vertices of the Zeta parallelogram code symbol, and connecting the 4 vertices to obtain the corner quadrangle S of the Zeta parallelogram code symbol ζ
Step 9, backup binarization image P 'at 2 nd of the zeta group' ζ,2 In the above, find the pixel coordinate value (x ″) from the centroid d,ζ ,y″ d,ζ ) The nearest white connected domain, and the gray value of the white connected domain is assigned to be 0;
step 10, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 Corner quadrilateral S of upper Zeta parallelogram coding sign ζ Keeping the gray values of all internal pixel points unchanged, and encoding the corner point quadrangle S of the zeta-th parallelogram encoding mark ζ The gray values of all other pixel points are assigned to be 255;
step 11.1, backup binarization image P 'at 2 nd of zeta group' ζ,2 In the above, the corner point quadrangle S of the Zeth parallelogram coding mark is extracted ζ The inner and outer contours in (1) are marked as a contour set D in the zeta-th parallelogram coding mark ζ
Step 11.2, counting the outline set D in the zeta th parallelogram coding mark ζ The number of pixel points in each contour is recorded as the 2 nd backup binary image P 'of the ζ group' ζ,2 Positioning circle contour G in upper Zeth parallelogram coding mark ζ Calculating the coordinates of the centroid pixel of the binary image and recording the coordinates as the 2 nd backup binary image P 'of the zeta group' ζ,2 Locating circle centroid pixel coordinates o 'within the upper zeta parallelogram encoding logo' l,ζ (x′ l,ζ ,y′ l,ζ );
Step 12, collecting the outline D in the Zeth parallelogram coding sign ζ The inner 4 contours with the least number of pixel points are marked as the contours Z of the coding combination orientation pattern ζ,1 Coded combined orientation pattern profile Z ζ,2 Coded composite directional pattern profile Z ζ,3 Coded combined orientation pattern profile Z ζ,4 And respectively calculate the centroid thereof
Figure GDA0003834588460000051
Figure GDA0003834588460000052
Step 13.1, according to the outline set D in the zeta th parallelogram coding mark ζ In the method, two contours with the largest number of pixel points and 4 contours with the smallest number of pixel points are removed, and the number of remaining contours is kappa ζ The size of (c) is divided into the following cases:
(1) If κ ζ =0, then step 14.1 is performed;
(2) If κ ζ Not equal to 0, then this is κ ζ The individual outline is the outline of the coding combination coding pattern in the zeta-th parallelogram coding mark and is respectively marked as the coding combination pattern
Figure GDA0003834588460000053
Coded composite pattern
Figure GDA0003834588460000054
8230code combined pattern
Figure GDA0003834588460000055
Step 14.1, giving an integer variable i and an initial value i =1;
step 14.2, backup binarization image P 'at the 2 nd of the zeta group' ζ,2 Calculating the code pattern
Figure GDA0003834588460000056
Center of mass of
Figure GDA0003834588460000057
This step continues after reassigning i +1 to i until i > κ ζ Finishing; whereby a corresponding coded composite pattern can be obtained
Figure GDA0003834588460000058
Coded composite pattern
Figure GDA0003834588460000059
823060A combined coding pattern
Figure GDA00038345884600000510
Centroid pixel coordinates of
Figure GDA00038345884600000511
Step 15.1, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 In the above, C is the sub-pixel coordinate of the feature corner point of the ζ -th parallelogram coding mark located in the 1 st coding region, the 2 nd coding region, the 3 rd coding region and the 4 th coding region respectively ζ,1 (x ζ,1 ,y ζ,1 )、C ζ,2 (x ζ,2 ,y ζ,2 )、C ζ,3 (x ζ,3 ,y ζ,3 )、C ζ,4 (x ζ,4 ,y ζ,4 ) (ii) a And the 2 nd backup binary image P 'in the ζ th group' ζ,2 Wherein the pixel coordinate values are (x' d,ζ ,y′ d,ζ ) The pixel point of (1) is recorded as a zeta-group 2 nd backup binary image P' ζ,2 Oriented Ring centroid o 'of the upper ζ -th parallelogram-encoded logo' d,ζ (x′ d,ζ ,y′ d,ζ ) And the sub-pixel coordinate value is (x' ζ,1 ,y′ ζ,1 )、(x′ ζ,2 ,y′ ζ,2 )、(x′ ζ,3 ,y′ ζ,3 )、(x′ ζ,4 ,y′ ζ,4 ) The 4 pixel points are respectively marked as C' ζ,1 (x″′ ζ,1 ,y″′ ζ,1 )、C″′ ζ,2 (x″′ ζ,2 ,y″′ ζ,2 )、C″′ ζ,3 (x″′ ζ,3 ,y″′ ζ,3 )、C″′ ζ,4 (x″′ ζ,4 ,y″′ ζ,4 );
Step 15.2, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 Upper, the direction vector in the ζ -th parallelogram coding index
Figure GDA0003834588460000061
As is derived from the formula (2),
Figure GDA0003834588460000062
step 16, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 In the above, 4 pixel points C' ζ,1 (x″′ ζ,1 ,y″′ ζ,1 )、C″′ ζ,2 (x″′ ζ,2 ,y″′ ζ,2 )、C″′ ζ,3 (x″′ ζ,3 ,y″′ ζ,3 )、C″′ ζ,4 (x″′ ζ,4 ,y″′ ζ,4 ) Pixel coordinate o 'of middle distance positioning circle centroid' l,ζ (x′ l,ζ ,y′ l,ζ ) The nearest 2 pixels are respectively marked as C ζ,1min (x ζ,1min ,y ζ,1min ) And C ζ,2min (x ζ,2min ,y ζ,2min );
Finding out the sub-pixel coordinate values of the characteristic corner points of the 2 nd coding region and the 3 rd coding region in the zeta-th parallelogram coding mark in 4 pixel points and respectively assigning the sub-pixel coordinate values to C ζ,2 (x ζ,2 ,y ζ,2 ) And C ζ,3 (x ζ,3 ,y ζ,3 );
Calculating the 1 st judgment vector in the ζ th parallelogram coding flag by the formulas (3) and (4)
Figure GDA0003834588460000063
And 2 nd decision vector
Figure GDA0003834588460000064
And calculated by the formulas (5) and (6)Dividing the 1 st area into sine values sin alpha ζ And the 2 nd area division sine value sin beta ζ
Figure GDA0003834588460000065
Figure GDA0003834588460000066
Figure GDA0003834588460000067
Figure GDA0003834588460000068
The following two cases are performed:
(1) If sin alpha ζ <0,sinβ ζ Greater than 0, then C ζ,1min (x ζ,1min ,y ζ,1min ) For the characteristic corner of the 3 rd coding region in the ζ -th parallelogram coding index, C ζ,1min (x ζ,1min ,y ζ,1min ) Is assigned to C ζ,3 (x ζ,3 ,y ζ,3 );C ζ,2min (x ζ,2min ,y ζ,2min ) For the characteristic corner of the 2 nd coding region in the ζ th parallelogram coding index, C ζ,2min (x ζ,2min ,y ζ,2min ) Is assigned to C ζ,2 (x ζ,2 ,y ζ,2 );
(2) If sin alpha ζ >0,sinβ ζ Less than 0, then C ζ,2min (x ζ,2min ,y ζ,2min ) For the characteristic corner point of the 3 rd coding region in the ζ th parallelogram coding mark, C ζ,2min (x ζ,2min ,y ζ,2min ) Is assigned to C ζ,3 (x ζ,3 ,y ζ,3 );C ζ,1min (x ζ,1min ,y ζ,1min ) Coding the Zeta-th parallelogram with a logoFeature corner of No. 2 coding region in the notation, C ζ,1min (x ζ,1min ,y ζ,1min ) Is assigned to C ζ,2 (x ζ,2 ,y ζ,2 );
Step 17, backup binarization image P 'at 2 nd of the zeta group' ζ,2 At last, by the above step 16, 4 pixel points C ″ 'have been already existed' ζ,1 (x″ ζ,1 ,y″′ ζ,1 )、C″′ ζ,2 (x″′ ζ,2 ,y″′ ζ,2 )、C″′ ζ,3 (x″′ ζ,3 ,y″′ ζ,3 )、C″′ ζ,4 (x″′ ζ,4 ,y″′ ζ,4 ) Finding out the sub-pixel coordinate values of the characteristic corner points of the 2 nd coding region and the 3 rd coding region in the zeta-th parallelogram coding mark and respectively assigning the sub-pixel coordinate values to the C ζ,2 (x ζ,2 ,y ζ,2 ) And C ζ,3 (x ζ,3 ,y ζ,3 ) Respectively assigning the sub-pixel coordinate values of the rest 2 pixel points to a temporary coordinate value 1 of the zeta-th parallelogram coding mark, and recording as C' ζ,5 (x′ ζ,5 ,y′ ζ,5 ) And temporary coordinate value 2, marked as C' ζ,6 (x′ ζ,6 ,y′ ζ,6 );
Determining the 3 rd judgment vector in the ζ th parallelogram coding flag according to equations (7) and (8)
Figure GDA0003834588460000071
And 4 th judgment vector
Figure GDA0003834588460000072
Figure GDA0003834588460000073
Figure GDA0003834588460000074
Step 18, backup binarization image P 'at 2 nd of the zeta group' ζ,2 Root of Chinese Thalic acidAccording to the 3 rd judgment vector
Figure GDA0003834588460000075
And 4 th judgment vector
Figure GDA0003834588460000076
The 3 rd region division sine value sin omega is obtained by the formula (9) and the formula (10) ζ And 4 th area division sine value sin xi ζ
Figure GDA0003834588460000077
Figure GDA0003834588460000078
According to sin ω ζ And sin xi ζ C is' ζ,5 (x′ ζ,5 ,y′ ζ,5 ) Or C' ζ,6 (x′ ζ,6 ,y′ ζ,6 ) Is assigned to C ζ,4 (x ζ,4 ,y ζ,4 ) Or C ζ,1 (x ζ,1 ,y ζ,1 );
The execution is divided into the following two cases:
(1) Sin ω ζ ==0,sinξ ζ Not equal to 0, then C' ζ,5 (x′ ζ,5 ,y′ ζ,5 ) Namely C 'is the characteristic corner point of the 4 th coding area in the ζ th parallelogram coding mark' ζ,5 (x′ ζ,5 ,y′ ζ,5 ) Is assigned to C ζ,4 (x ζ,4 ,y ζ,4 );C′ ζ,6 (x′ ζ,6 ,y′ ζ,6 ) C 'is a characteristic corner point of a 1 st coding region in a zeta th parallelogram coding mark' ζ,6 (x′ ζ,6 ,y′ ζ,6 ) Is assigned to C ζ,1 (x ζ,1 ,y ζ,1 );
(2) Sin omega ζ ≠0,sinξ ζ =0, then C' ζ,6 (x′ ζ,6 ,y′ ζ,6 ) Namely C 'is the characteristic corner point of the 4 th coding area in the ζ th parallelogram coding mark' ζ,6 (x′ ζ,6 ,y′ ζ,6 ) Is assigned to C ζ,4 (x ζ,4 ,y ζ,4 );C′ ζ,5 (x′ ζ,5 ,y′ ζ,5 ) C 'is a characteristic corner point of a 1 st coding region in a zeta th parallelogram coding mark' ζ,5 (x′ ζ,5 ,y′ ζ,5 ) Is assigned to C ζ,1 (x ζ,1 ,y ζ,1 );
To this end, the binary image P 'is backed up at the 2 nd backup of the ζ group' ζ,2 The sub-pixel coordinate C of the characteristic corner point of the 1 st coding region in the ζ -th parallelogram coding mark is found ζ,1 (x ζ,1 ,y ζ,1 ) Sub-pixel coordinate C of characteristic corner point of No. 2 coding region ζ,2 (x ζ,2 ,y ζ,2 ) 3. Sub-pixel coordinate C of characteristic corner point of the 3 rd coding region ζ,3 (x ζ,3 ,y ζ,3 ) And the sub-pixel coordinate C of the characteristic corner of the 4 th coding region ζ,4 (x ζ,4 ,y ζ,4 );
Step 19, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 Will be composed of characteristic corner points C ζ,1 (x ζ,1 ,y ζ,1 ) Angular point C of orientation feature ζ,4 (x ζ,4 ,y ζ,4 ) Is recorded as a vector
Figure GDA0003834588460000081
And is derived from equation (11):
Figure GDA0003834588460000082
taking an integer variable i and assigning i =1;
step 20, backup binarization image P 'at 2 nd of the zeta group' ζ,2 According to the coding combination, the pattern centroid is oriented
Figure GDA0003834588460000083
(Vector)
Figure GDA0003834588460000084
And direction vector
Figure GDA0003834588460000085
The i-th code combination decision vector is calculated by the equations (12), (13) and (14)
Figure GDA0003834588460000086
Coding combination judgment cosine value
Figure GDA0003834588460000087
And
Figure GDA0003834588460000088
Figure GDA0003834588460000089
Figure GDA00038345884600000810
Figure GDA00038345884600000811
the following four cases are performed:
(1) If it is
Figure GDA00038345884600000812
And is provided with
Figure GDA00038345884600000813
Then
Figure GDA00038345884600000814
To orient the pattern centroids for the encoded combination of the 3 rd encoded region
Figure GDA00038345884600000815
Value to o' z ζ,3 (x′ z ζ,3 ,y′ z ζ,3 );
(2) If it is
Figure GDA00038345884600000816
And is provided with
Figure GDA00038345884600000817
Then
Figure GDA00038345884600000818
To orient the pattern centroids for the encoded combination of the 2 nd encoded region, will
Figure GDA00038345884600000819
Value to o' z ζ,2 (x′ z ζ,2 ,y′ z ζ,2 );
(3) If it is
Figure GDA00038345884600000820
And is provided with
Figure GDA00038345884600000821
Then the
Figure GDA00038345884600000822
To orient the pattern centroids for the code combinations of the 1 st code region
Figure GDA00038345884600000823
Assigned to o' z ζ,1 (x′ z ζ,1 ,y′ z ζ,1 );
(4) If it is
Figure GDA00038345884600000824
And is provided with
Figure GDA00038345884600000825
Then the
Figure GDA00038345884600000826
To orient the pattern centroids for the encoded combination of the 4 th encoded region
Figure GDA00038345884600000827
Assigned to o' z ζ,4 (x′ z ζ,4 ,y′ z ζ,4 );
Judging whether i meets the condition that i is less than 4, if i is less than 4, assigning i +1 to i, and returning to execute the step 20; otherwise, the code combined orientation pattern centroid o 'of the 1 st code area in the ζ th parallelogram code mark is obtained' z ζ,1 (x′ z ζ,1 ,y′ z ζ,1 ) Coded combined directional pattern centroid o 'of 2 nd coded region' z ζ,2 (x′ z ζ,2 ,y′ z ζ,2 ) And the center of mass o' of the code combined orientation pattern in the No. 3 code area z ζ,3 (x′ z ζ,3 ,y′ z ζ,3 ) And a coded combined directional pattern centroid o 'of a 4 th coded region' z ζ,4 (x′ z ζ,4 ,y′ z ζ,4 ) And continuing to execute step 21;
step 21, assigning the integer variable i with i =1 again;
step 22, defining 4 two-dimensional floating-point type numerical groups
Figure GDA00038345884600000828
Initializing all elements in the 4 two-dimensional arrays, and assigning a value of-1; taking 4 integer variables
Figure GDA00038345884600000829
Initialization
Figure GDA00038345884600000830
Step 23, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 Calculating the contour of the code combination code pattern mark circle in the Zeth parallelogram code mark
Figure GDA00038345884600000831
Centroid pixel coordinates of
Figure GDA00038345884600000832
And the positioning circle center o' l,ζ The ith difference vector of the formed zeta th group
Figure GDA0003834588460000091
Figure GDA0003834588460000092
Calculated by the following equations (16) and (17)
Figure GDA0003834588460000093
Figure GDA0003834588460000094
Figure GDA0003834588460000095
The method is executed in four cases:
(1) If it is
Figure GDA0003834588460000096
And is provided with
Figure GDA0003834588460000097
Then make it give
Figure GDA0003834588460000098
Will be provided with
Figure GDA0003834588460000099
Is assigned to
Figure GDA00038345884600000910
If i > k ζ 1, executing step 24, otherwise assigning i +1 to i, and returning to execute step 23;
(2) If it is
Figure GDA00038345884600000911
And is
Figure GDA00038345884600000912
Then order
Figure GDA00038345884600000913
Will be provided with
Figure GDA00038345884600000914
Is assigned to
Figure GDA00038345884600000915
If i > k ζ 1, executing step 24, otherwise, assigning i +1 to i, and returning to execute step 23;
(3) If it is
Figure GDA00038345884600000916
And is
Figure GDA00038345884600000917
Then order
Figure GDA00038345884600000918
Will be provided with
Figure GDA00038345884600000919
Is assigned to
Figure GDA00038345884600000920
If i > k ζ 1, executing step 24, otherwise, assigning i +1 to i, and returning to execute step 23;
(4) If it is
Figure GDA00038345884600000921
And is provided with
Figure GDA00038345884600000922
Then make it give
Figure GDA00038345884600000923
Will be provided with
Figure GDA00038345884600000924
Is assigned to
Figure GDA00038345884600000925
If i > k ζ 1, executing step 24, otherwise, assigning i +1 to i, and returning to execute step 23;
step 24.1, assigning the integer variable i with the value i =1 again;
step 24.2, according to
Figure GDA00038345884600000926
Taking integer variables
Figure GDA00038345884600000927
And
Figure GDA00038345884600000928
and assigning values;
the following cases are divided into execution:
(1) If it is
Figure GDA00038345884600000929
Then take the integer variable
Figure GDA00038345884600000930
And
Figure GDA00038345884600000931
and assign a value
Figure GDA00038345884600000932
(2) If it is
Figure GDA00038345884600000933
Will array
Figure GDA00038345884600000934
Elements in the same row which are not-1 are respectively marked as
Figure GDA00038345884600000935
And
Figure GDA00038345884600000936
and are respectively assigned to ζ,1 (x ζ,1 ,y ζ,1 ) And the abscissa and the ordinate of the computer, and calculating the sine value
Figure GDA00038345884600000937
Figure GDA00038345884600000938
And (4) judging:
1) If it is
Figure GDA00038345884600000939
Then get the integer variable
Figure GDA00038345884600000940
And
Figure GDA00038345884600000941
and assign values
Figure GDA00038345884600000942
2) If it is
Figure GDA00038345884600000943
Then take the integer variable
Figure GDA00038345884600000944
And
Figure GDA00038345884600000945
and assign a value
Figure GDA00038345884600000946
3) If it is
Figure GDA00038345884600000947
Then take the integer variable
Figure GDA00038345884600000948
And
Figure GDA00038345884600000949
and assign values
Figure GDA00038345884600000950
(3) If it is
Figure GDA00038345884600000951
Will array
Figure GDA00038345884600000952
Elements in the same row which are not-1 are respectively marked as
Figure GDA00038345884600000953
And
Figure GDA00038345884600000954
and
Figure GDA00038345884600000955
and are respectively assigned to ζ,1 (x ζ,1 ,y ζ,1 ) Abscissa and ordinate and o ζ,2 (x ζ,2 ,y ζ,2 ) The abscissa and the ordinate of the computer, while calculating the sine value
Figure GDA00038345884600000956
And
Figure GDA00038345884600000957
Figure GDA00038345884600000958
Figure GDA0003834588460000101
and judging:
1) If it is
Figure GDA0003834588460000102
Or
Figure GDA0003834588460000103
Then take the integer variable
Figure GDA0003834588460000104
And
Figure GDA0003834588460000105
and assign values
Figure GDA0003834588460000106
2) If it is
Figure GDA0003834588460000107
Or
Figure GDA0003834588460000108
Then get the integer variable
Figure GDA0003834588460000109
And
Figure GDA00038345884600001010
and assign values
Figure GDA00038345884600001011
3) If it is
Figure GDA00038345884600001012
Or
Figure GDA00038345884600001013
Then get the integer variable
Figure GDA00038345884600001014
And
Figure GDA00038345884600001015
and assign values
Figure GDA00038345884600001016
(4) If it is
Figure GDA00038345884600001017
Then get the integer variable
Figure GDA00038345884600001018
And
Figure GDA00038345884600001019
and assign values
Figure GDA00038345884600001020
If i is less than 4, assigning i +1 to i and returning to execute the step 24.2; otherwise, continuing to execute step 25;
step 25, obtaining the serial number W of the zeta th parallelogram coding mark through the formula (21) ζ
W ζ =V ζ T ·U (21)
Wherein, the column vector U = (2) 0 ,2 1 ,2 2 ,...2 11 ) T Column vector of
Figure GDA00038345884600001021
Step 26, recording the code number of the characteristic corner point belonging to the sigma-th coding region (wherein sigma =1,2,3, 4) in the zeta-th parallelogram coding mark as
Figure GDA00038345884600001022
Wherein W ζ For calibrating angular points
Figure GDA00038345884600001023
Coding of the coding squaresThe value of the number and the sigma represents a calibration angular point
Figure GDA00038345884600001024
The sigma-th coding region;
thus, the coding numbers and the corresponding sub-pixel coordinate values of the 4 feature corners in the ζ -th parallelogram coding mark are obtained:
coded number is
Figure GDA00038345884600001025
The sub-pixel coordinate value of the characteristic corner is (x) ζ,1 ,y ζ,1 );
The code number is
Figure GDA00038345884600001026
The sub-pixel coordinate value of the characteristic corner is (x) ζ,2 ,y ζ,2 );
Coded number is
Figure GDA00038345884600001027
The sub-pixel coordinate value of the characteristic corner is (x) ζ,3 ,y ζ,3 );
Coded number is
Figure GDA00038345884600001028
The sub-pixel coordinate value of the characteristic corner is (x) ζ,4 ,y ζ,4 );
Step 27, judging whether zeta is smaller than N, if yes, reassigning zeta +1 to zeta, and returning to step 6.1 for sequential execution; if not, the sub-pixel coordinate values and the corresponding coding numbers of the 4 characteristic angular points on each parallelogram coding mark are found.
Further, in step 6.1, obtaining a 1 st backup binary image P 'of the zeta th group' ζ,1 And the Zeth circular ring black connected domain centroid pixel coordinate value (x ″) in the circular ring black connected domain centroid set A d,ζ ,y″ d,ζ ) Removing the 1 st backup binary image P 'of the zeta-th group by using a complex background algorithm for removing the coding mark as an input condition' ζ,1 And finally obtaining the zeta th parallelogram binaryzation image P' without complex background ζ The steps are as follows:
step 6.1.1, taking an integer variable i and assigning i =1;
step 6.1.2, backup binary image P 'at the 1 st backup of the ζ th group' ζ,1 Find the distance pixel coordinate value (x ″) d,ζ ,y″ d,ζ ) The nearest white connected domain is recorded as the 1 st backup binary image P 'of the zeta th group' ζ,1 The ith circular ring white connected domain M' i And the ith circular ring white connected domain M' i All the gray values are assigned to be 0;
step 6.1.3, judging whether i is smaller than N, if i is smaller than N, assigning i +1 to i, and returning to the step 6.1.2 for sequential execution; otherwise, the 1 st backup binary image P 'of the ζ group is obtained' ζ,1 Setting the orientation circular rings in all the parallelogram coding marks to be black, and setting the 1 st backup binary image P 'of the zeta-th group' ζ,1 The image processed in this step is recorded as the zeta-th black background extraction image P' ζ,b And executing step 6.1.4;
step 6.1.4, extracting image P 'from the zeta-th black background' ζ,b In all the black connected domains, find the coordinate value (x ″) of the distance pixel d,ζ ,y″ d,ζ ) The nearest black connected domain is denoted as the ζ -th black background extraction image P' ζ,b The ζ th parallelogram background black connected domain Ω ζ
Step 6.1.5, extracting image P 'from the zeta-th black background' ζ,b Upper extraction of zeta-th parallelogram background black connected domain omega ζ Obtaining the zeta-th parallelogram background black connected domain omega ζ Inner and outer contour set V of ζ
Step 6.1.6, compare contour set V ζ The perimeter of the maximum perimeter is recorded as the zeta-th parallelogram background black connected domain omega ζ Outer contour E of ζ
Step 6.1.7, extract image P 'at the ζ th black background' ζ,b In the above, willOuter contour E ζ The gray value of all the pixels within is assigned to 255, and the outer contour E ζ Except for the gray values of all the pixel points, the gray values are assigned to be 0, and therefore the zeta th parallelogram binaryzation image P' without the complex background is obtained ζ (ii) a Leading the parallelogram to be a binary image P ″' without complex background at the zeta th ζ In (1), the pixel coordinate value (x ″) of the centroid is included d,ζ ,y″ d,ζ ) The gray value of all pixel points in the parallelogram coding mark is set to be 255 (namely white), and the gray value contains the coordinate value (x ″) of the centroid pixel d,ζ ,y″ d,ζ ) The gray values of all the pixel points outside the parallelogram coding mark are set to be 0 (namely black).
There is also provided a computer readable storage medium comprising a computer program for use in conjunction with an electronic device having image processing functionality, said computer program being executable by a processor to perform the decoding method.
Compared with the prior art, the invention has the following beneficial effects:
1. the coding pattern in the parallelogram coding mark provided by the invention is composed of a positioning pattern, an orientation pattern and a coding combination pattern, wherein the positioning pattern and the orientation pattern can automatically judge the relative rotation direction of a measured target and a video camera in the processes of camera calibration, three-dimensional data splicing and the like, so that the flexibility is improved;
2. the parallelogram coding mark provided by the invention comprises four coding combination patterns, and each coding combination pattern comprises three coding combination coding patterns, wherein 4096 different codes can be generated by the parallelogram coding mark provided by the invention, so that the capacity is expanded, and the three-dimensional data splicing can be completed aiming at a target with a larger size;
3. in the parallelogram coding mark provided by the invention, the positions of the orientation pattern, the positioning pattern and each coding combination pattern and the positions of each coding combination coding pattern are distinguished by a method of graphic geometric relationship and vector product, so that the parallelogram coding mark has stronger robustness and higher precision for affine transformation images;
4. the decoding method of the parallelogram coding mark based on the geometric relationship of the graph can effectively remove the interference of noise, and the method for removing the complex background greatly improves the accuracy of decoding;
5. the decoding method of the parallelogram coding mark based on the graph geometric relationship has high efficiency and high decoding speed, and can realize real-time decoding.
Drawings
FIG. 1 is a schematic diagram of a parallelogram encoding flag of the present invention;
FIG. 2 is a schematic diagram of arrangement of each vertex, each corner, and each coding pattern in each coding combination in the parallelogram coding flag according to the present invention;
FIG. 3 is a coded logo grayscale image P 1 A display diagram of;
FIG. 4 shows a binary image P of a coded mark 2 A display diagram of;
FIG. 5 shows a binary image P with a coded mark 2 Extracting a display diagram of a circular black connected domain centroid set A;
FIG. 6 is the No. 1 parallelogram binaryzation image P ″, without complex background 1,1 A display diagram of;
FIG. 7 is a diagram illustrating a method for extracting a 1 st parallelogram binaryzation image P ″, which has no complex background, by using Harris checkpoint detection algorithm 1,1 A sub-pixel coordinate result display diagram of the center corner point;
FIG. 8 is the No. 1 parallelogram binarized image P without complex background 1 "and 1 st backup grayscale image P 1 After image multiplication, the 1 st overlay result image T is obtained 1
FIG. 9 is a diagram of the 1 st overlay result image T extracted by Harris checkpoint detection algorithm 1 A sub-pixel coordinate result display diagram of the center corner point;
FIG. 10 is a 1 st binarized image P without complex background coding marks 1 "is shown;
FIG. 11 is a flowchart illustrating a decoding method according to the present invention.
Detailed Description
The following detailed description of the preferred embodiments of the present invention, taken in conjunction with the accompanying drawings, will make the advantages and features of the present invention more comprehensible to those skilled in the art, and will thus provide a clear and concise definition of the scope of the present invention.
Referring to fig. 1, a decoding method for a parallelogram coding mark based on a geometric graph relationship is disclosed, the coding mark is a square coding square, a parallelogram background pattern and a coding pattern are arranged on the surface of the coding square, the coding pattern is positioned inside the parallelogram background pattern, the coding pattern comprises a positioning pattern, an orientation pattern and a coding combination pattern, the orientation pattern and the positioning pattern are used for judging the direction of the parallelogram coding mark, the coding combination pattern is used for coding 4 angular points of the parallelogram coding mark, and each coding combination pattern is composed of a coding combination orientation pattern and three coding combination coding patterns.
The positioning pattern, the orientation pattern, all the code combination orientation patterns and all the code combination code patterns in the parallelogram code sign are all non-overlapping and non-communicating.
Marking one characteristic corner of any parallelogram coding mark as a vector to determine a first vertex o ″) 1 Intersecting each other to form a vector defining a first vertex o ″' on the parallelogram-shaped coded symbol 1 Determining a first edge N by recording any one edge of the first edge as a vector v1 Determining a first edge N in the vector v1 Marking the vertex of the upper parallelogram coding mark as a vector to determine a second point o ″) 2 Wherein the vector determines the second point o ″) 2 Determining the first vertex o ″' with the vector 1 Are 2 points which are not coincident with each other, and the vector is recorded
Figure GDA0003834588460000131
To specify a vector
Figure GDA0003834588460000132
The positional relationship of the positioning pattern and the orientation pattern within the parallelogram-shaped coded marker is as follows: oriented pattern within parallelogram-encoded symbolsThe center points to the direction and the specified vector of the center of mass of the positioning pattern
Figure GDA0003834588460000133
In the same direction.
Marking the plane marked by the parallelogram coding as a mark plane P t Determining the first vertex o' by the vector 1 Making a prescribed vector for the starting point
Figure GDA0003834588460000134
The unit vector in the same direction is denoted as the 1 st predetermined unit vector
Figure GDA0003834588460000135
When the person looks at the parallelogram coding mark, the first vertex o' is determined by the vector 1 At the mark plane P as the center of rotation t Defining the 1 st unit vector
Figure GDA0003834588460000136
Counterclockwise rotation by an angle beta '(0 DEG < beta' < 90 DEG) to obtain a 2 nd prescribed unit vector
Figure GDA0003834588460000137
The first vertex o' is determined in space as a vector 1 As a starting point, an
Figure GDA0003834588460000138
The unit vectors with the same direction are recorded as positive vectors
Figure GDA0003834588460000139
Respectively marking two characteristic angular points which are closest to an orientation pattern in the parallelogram coding mark as 1 st temporary vertex o ″ 3 And the 2 nd temporary vertex o ″ 4 (ii) a If vector
Figure GDA00038345884600001310
Cross-product specified vector
Figure GDA00038345884600001311
Direction of the resulting vector and the forward vector
Figure GDA00038345884600001312
Are in the same direction, they will be recorded as vectors
Figure GDA00038345884600001313
Auxiliary vector
Figure GDA00038345884600001314
If vector
Figure GDA00038345884600001315
Cross product specified vector
Figure GDA00038345884600001316
Direction of the obtained vector and forward vector
Figure GDA00038345884600001317
Are in the same direction, then vector is set
Figure GDA00038345884600001318
Is recorded as an auxiliary vector
Figure GDA00038345884600001319
The color of a parallelogram background pattern in the parallelogram coding mark is recorded as color 1, and the colors of an orientation pattern, a positioning pattern, all coding combination orientation patterns and all coding combination coding patterns in the parallelogram coding mark are color 2, wherein the color 1 is obviously different from the color 2. In this embodiment, the color of the parallelogram background pattern in the parallelogram coding mark is black (color 1), and the colors of the orientation pattern, the positioning pattern, all the coding combination orientation patterns and all the coding combination coding patterns in the parallelogram coding mark are white (color 2).
In the parallelogram coding mark, the minimum area in the areas of all the coding combination coding patterns is recorded as the minimum area of the coding combination coding patterns, and the sizes of the areas of the orientation patterns, all the coding combination orientation patterns and all the coding combination coding patterns in the parallelogram coding mark satisfy the following relations: the areas of all the coding combination coding patterns inside the parallelogram coding mark are smaller than the area of the orientation patterns inside the parallelogram coding mark, and the areas of all the coding combination orientation patterns inside the parallelogram coding mark are smaller than the minimum area of the coding combination coding patterns. In this embodiment, the orientation pattern is a circular connected domain with a diameter of 12 mm, the encoding combination orientation pattern is a circular connected domain with a diameter of 3 mm, the encoding combination encoding pattern is a circular connected domain with a diameter of 6 mm, and the positioning pattern is a circular connected domain with an outer circle diameter of 12 mm and an inner circle diameter of 5 mm, as shown in fig. 1.
The positions of the orientation pattern and the positioning pattern need to meet the following requirements: let the line segment connecting the geometric center of the orientation pattern and the geometric center of the orientation pattern be l 1 Then line segment l 1 Must be parallel to any one of the sides of the parallelogram lattice and line segment l 1 Midpoint p of 1 Near the geometric center point of the parallelogram lattice. The positions of the four code combinations need to satisfy the following requirements: segment l 1 Midpoint p of 1 The four line segments are respectively connected with the middle points of the four sides of the parallelogram grid to form four line segments, and the obtained four line segments divide the whole parallelogram grid into four areas. Then, the four encoded combined orientation patterns are located inside the four regions, respectively, and the geometric center of each encoded combined orientation pattern is located near the geometric center point of the respective region. And, among the four vertexes of the parallelogram grid, each vertex has and only has one coding combination orientation pattern closest to the vertex, namely, among the straight line distances between each vertex and the geometric centers of the four coding combination orientation patterns, there is and only one coding combination orientation pattern with the shortest straight line distance.
Meanwhile, of the four encoded combined orientation patterns, two encoded combined orientation patterns are significantly closer to the orientation pattern than to the positioning pattern. Likewise, the other two coded combined orientation patterns are significantly more distant from the positioning pattern than from the orientation patternAnd (4) approaching. As shown in FIG. 2, the positions of the coding patterns of 3 coding combinations in each coding combination should satisfy the following requirements: marking the orientation pattern as A 1 With a geometric center of a 1 The positioning pattern is A 2 With a geometric center of a 2 From a to a 1 Starting from lead to a 2 The directed line segment of (2) is called the normal vector α. In four code combinations, the Y code combination orientation pattern is marked as C Y With a geometric center of c Y Within the Yth coding combination, the 1 st coding pattern of the Yth coding combination is D Y1 With a geometric center of d Y1 The Y-th code is combined with the 2 nd code pattern to be D Y2 With a geometric center of d Y2 The Yth code combines the 3 rd code pattern into D Y3 With a geometric center of d Y3 . Combining orientation patterns C by the Yth code Y Geometric center c of Y Starting from the first code pattern D, the first code pattern D is respectively directed to the Y-th code pattern Y1 Geometric center d of Y1 The Y code combines the 2 nd coding pattern D Y2 Geometric center d of Y2 The Yth code combines the 3 rd coding pattern D Y3 Geometric center d of Y3 Are called vectors y Y1 Vector gamma Y2 Vector gamma Y3 . Simultaneous vector gamma Y1 Vector gamma Y2 Vector gamma Y3 The vector products gamma of the respective standard vectors alpha Y1 ×α、γ Y2 ×α、γ Y3 The result of x α is η Y1 、η Y2 、η Y3 As shown in the following formula:
Figure GDA0003834588460000151
then η Y1 、η Y2 、η Y3 There is a need for significant differences in die length or direction; wherein Y =1,2,3,4.
As shown in fig. 11, the digital image processing method is used to obtain the coding sequence number and the sub-pixel coordinates of each feature corner point in the image containing N (in this embodiment, N is 10) parallelogram coding marks captured by the camera, and further complete the decoding of the parallelogram coding marks as follows:
step 1.1, utilizing 10 parallelogram coding marks placed in a camera shooting space to obtain a coding mark image, wherein the coding mark image comprises 10 parallelogram coding marks;
step 1.2, establishing a pixel coordinate system of an angular point: in the shot image containing 10 parallelogram coding marks, taking the upper left corner of the image as the origin o of an angular point pixel coordinate system, taking the upper left corner of the image as the x-axis direction of the angular point pixel coordinate system from left to right, and taking the upper left corner of the image as the y-axis direction of the angular point pixel coordinate system from top to bottom, thereby establishing an angular point pixel coordinate system o-xy;
step 2.1, carrying out gray level processing on the coding mark image to obtain a coding mark gray level image P 1 (ii) a Wherein the code marks a grayscale image P 1 An 8-bit gray scale map, as shown in FIG. 3;
step 2.2, the grey image P of the coding mark 1 Copying and backing up to obtain a grey level backup image P of the coding mark 1 ′;
Step 2.3, the grey level backup image P of the coding mark 1 Performing binarization processing to make the background color of each parallelogram coding mark be black (namely the gray value is 0), the orientation pattern and the positioning pattern in each parallelogram coding mark be white (namely the gray value is 255), the color of the coding unit pattern can be white or black according to the coding rule of the parallelogram coding mark, and further obtaining a coding mark binary image P 2 As shown in fig. 3;
step 3, setting a roundness threshold lambda '=1 of the black connected domain and a pixel point number threshold lambda' =30;
step 4.1, calculating a binary image P of the coding mark 2 The circularity value of all black connected components in the black matrix n And the number of pixel points c n Wherein the circularity value of each black connected domain can be obtained by equation (1),
Figure GDA0003834588460000152
wherein,l n Perimeter, s, representing the contour of the corresponding black connected component n Represents the area corresponding to the black connected domain, n =1,2.., 10;
step 4.2, the black connected domain roundness threshold λ' =1 and the pixel number threshold λ =30 selected in this embodiment may be implemented on the coding mark binary image P 2 Obtaining black connected domains of the centers of 10 directional circular rings corresponding to the 10 parallelogram coding marks respectively; respectively recording black connected domains at the centers of 10 directional circular rings as a binary image P of a coding mark 2 Middle ring black connected domain M 1 Ring black connected domain M 2 Ring black connected domain M 3 823060, circular black connected domain M 10 And connecting the ring black connected region M 1 Ring black connected domain M 2 Circular ring black connected domain M 3 823060, circular black connected domain M 10 Sequentially putting into a ring black connected domain set A', namely a ring black connected domain M 1 Circular ring black connected domain M 2 Circular ring black connected domain M 3 823060, circular black connected domain M 10 Respectively being the 1 st element in the ring black connected domain set A' element No. 2, \ 8230, element No. 10; thereby obtaining a coded mark binarized image P 2 The black connected domain inside the orientation circle in each parallelogram encoding sign in (1); wherein, the coded mark binarizes the image P 2 Middle ring black connected domain M 1 Circular ring black connected domain M 2 Circular ring black connected domain M 3 823060, circular black connected domain M 10 Are all less than 1, and the black connected domain M of the ring 1 Ring black connected domain M 2 Circular ring black connected domain M 3 823060, circular black connected domain M 10 The number of the pixel points is more than 30;
step 4.3, taking an integer variable i and assigning i =1;
step 4.4, calculating the ith ring black connected domain M in the ring black connected domain set A i The coordinates of the centroid pixel are marked as o ″ d,i (x″ d,i ,y″ d,i ) The obtained black connected domain of the ith ringM i Centroid pixel coordinate o ″) d,i (x″ d,i ,y″ d,i ) Putting the circular ring black connected domain centroid set A as the ith element of the circular ring black connected domain centroid set A;
step 4.5, judging whether i is smaller than N, if i is smaller than 10, assigning i +1 to i, and returning to the step 4.4 for sequential execution; otherwise, obtaining the binary image P of the coding mark 2 Middle ring black connected domain M 1 Ring black connected domain M 2 Circular ring black connected domain M 3 823060, circular black connected domain M 10 Centroid pixel coordinate o ″) d,1 (775,135)、o″ d,2 (x″ d,2 ,y″ d,2 )、…、o″ d,10 (x″ d,10 ,y″ d,10 ) And sequentially putting the circular ring black connected domain centroid sets A into a circular ring black connected domain centroid set A, as shown in FIG. 5;
step 5, an integer variable zeta is taken and assigned zeta =1;
step 6.1, binarization image P of coding mark 2 Performing copy backup twice to obtain a 1 st backup binary image P 'of a 1 st group' 1,1 And a 1 st group of 2 nd backup binary image P' 1,2
Step 6.2, utilizing a complex background algorithm for removing coding marks to carry out binarization on the 1 st backup binary image P 'of the 1 st group' 1,1 Digital image processing is carried out, and then a 1 st parallelogram binaryzation image P ″, which has no complex background, is obtained 1,1 (ii) a The 1 st parallelogram binaryzation image P ″, which has no complex background 1 In 1, the gray values of all the pixels inside the parallelogram coding mark containing the centroid pixel coordinate values (775, 135) are set to be 255 (i.e. white), and the gray values of all the pixels outside the parallelogram coding mark containing the centroid pixel coordinate values (775, 135) are set to be 0 (i.e. black);
step 7.1, coding the mark gray level image P 1 Performing copy backup to obtain the 1 st backup grayscale image P 1 ″′;
Step 7.2, utilizing Harris corner detection algorithm to binarize an image P' on the 1 st parallelogram without complex background 1,1 Extract 4 corner pointsAnd is marked as the 1 st parallelogram binaryzation image P ″, which has no complex background 1,1 Upper 4 alternative corner points C ″) 1,1 (0.6904×10 3 ,0.1910×10 3 )、C″ 1,2 (0.6899×10 3 ,0.0238×10 3 )、C″ 1,3 (0.8575×10 3 ,0.0237×10 3 )、C″ 1,4 (0.8573×10 3 ,0.1908×10 3 );
Step 7.3, in the No. 1 complex background-free parallelogram binaryzation image P ″ 1,1 The first parallelogram binaryzation image P ″, which has no complex background and is made of black connected domain corrosion 1,1 The white connected domain in the image is enlarged, so that when image multiplication operation is carried out subsequently, the complete gray pattern of the parallelogram coding mark containing the coordinate values (775, 135) of the centroid pixel can be extracted from the operation result image, and 4 characteristic angular points of the gray pattern are completely stored; and the first parallelogram binaryzation image P' without complex background 1,1 The image obtained after the processing in this step is recorded as the 1 st operation binary image P ″ 1,2
Step 7.4, calculating the 1 st binary image P ″ 1,2 Setting the value of the part with the middle gray scale value of 255 as 1, and calculating the 1 st binary image P ″ 1,2 Setting the value of the part with the middle gray scale value of 0 as 0, and then utilizing the 1 st operation to binarize the image P ″) 1,2 And 1 st backup grayscale image P 1 ' multiply, and record the result image as the 1 st overlay result image T 1 As shown in fig. 8; the 1 st overlay result image T 1 Only contains the image information of the parallelogram coding mark containing the coordinate value (775, 135) of the centroid pixel, and removes the image information of other parallelogram coding marks;
step 7.5, covering the result image T at the 1 st by using Harris corner detection algorithm 1 Extracting sub-pixel coordinates of all corner points and storing the sub-pixel coordinates into a 1 st initially selected corner point sub-pixel coordinate set B 1 Performing the following steps; wherein, the 1 st initially selected corner sub-pixel coordinate set B 1 Storing the 1 st overlay result image T 1 Contains the parallel of the centroid pixel coordinate values (775, 135)Sub-pixel coordinate values of 4 characteristic angular points of the quadrilateral coding mark and sub-pixel coordinate values of interference angular points, wherein the interference angular points are interference angular points except the characteristic angular points;
step 7.6, taking an integer variable i and assigning i =1;
7.7, performing sub-pixel coordinate set B on the 1 st initially selected corner point 1 Finding the coordinate value (x ″) of the distance sub-pixel 1,i ,y″ 1,i ) Nearest corner sub-pixel coordinate is recorded as C' 1,i (x′ 1,i ,y′ 1,i );
7.8, judging whether i is smaller than 4, if i is smaller than 4, assigning i +1 to i and returning to execute the step 7.7; otherwise, the 1 st overlay result image T is already obtained at this time 1 Sub-pixel coordinates C 'of the 4 characteristic corner points of the parallelogram-coded logo comprising centroid pixel coordinate values (775, 135) thereon' 1,1 (0.6927×10 3 ,0.1889×10 3 )、C′ 1,2 (0.6926×10 3 ,0.0256×10 3 )、C′ 1,3 (0.8559×10 3 ,0.0257×10 3 )、C′ 1,4 (0.8558×10 3 ,0.1890×10 3 ) As shown in fig. 9, and step 8.1 is performed;
step 8.1, backing up the binary image P 'at the 2 nd backup of the 1 st group' 1,2 Marking the parallelogram coding mark containing the centroid pixel coordinate values (775, 135) as a 1 st parallelogram coding mark;
step 8.2, in the 2 nd backup binary image P 'of the 1 st group' 1,2 The sub-pixel coordinate values are (0.6904 × 10) 3 ,0.1910×10 3 )、(0.6899×10 3 ,0.0238×10 3 )、(0.8575×10 3 ,0.0237×10 3 )、(0.8573×10 3 ,0.1908×10 3 ) 4 pixel points as corner quadrangle S of the 1 st parallelogram coding mark 1 4 vertices of the parallelogram, and connecting the 4 vertices to obtain the corner point quadrangle S of the 1 st parallelogram coding mark 1
Step 9, in the 2 nd backup binarization image P 'of the 1 st group' 1,2 In the upper step, the centroid set of the black connected domain of the circular ring is searchedA, a white connected domain with the nearest 1 st orientation circular ring centroid pixel coordinate value (775, 135) is assigned with the gray value of the white connected domain as 0;
step 10, backing up binary image P 'in the 2 nd backup of the 1 st group' 1,2 Upper, the corner point quadrangle S of the 1 st parallelogram code mark is kept 1 The gray values of all the internal pixel points are unchanged, and the corner point quadrangle S of the 1 st parallelogram coding mark is coded 1 The gray values of all other pixel points are assigned to be 255;
step 11.1, backing up the binary image P 'at the 2 nd backup of the 1 st group' 1,2 Extracting the corner point parallelogram S of the first parallelogram code mark 1 All the inner and outer contours in (1) are marked as the contour set D of the 1 st parallelogram coding mark 1
Step 11.2 statistics of the contour set D in the 1 st parallelogram encoding flag 1 The number of pixel points contained in each contour is recorded as the positioning circle contour G in the 1 st parallelogram coding mark 1 Calculating the coordinates of the centroid pixel of the binary image and recording the coordinates as a No. 1 set of No. 2 backup binary image P' 1,2 Localizer circle centroid pixel coordinate o 'within the top 1 st parallelogram encoding landmark' l,1 (775,81);
Step 12, counting the outline set D in the 1 st parallelogram coding mark 1 The number of pixel points contained in each contour is recorded as the 2 nd backup binary image P 'of the 1 st group by 4 contours containing the minimum number of pixel points' 1,2 Coded combined orientation pattern profile Z in the upper 1 st parallelogram-coded logo 1,1 Coded composite directional pattern profile Z 1,2 Coded composite directional pattern profile Z 1,3 Coded composite directional pattern profile Z 1,4 And respectively calculate the coordinates of the centroid pixel
Figure GDA0003834588460000181
Step 13.1 encoding the set D of contours in the landmark from the 1 st parallelogram 1 Removing two contours with the largest number of pixel pointsAnd 4 contours with the least number of pixel points, the number of remaining contours k 1 =1; due to kappa 1 Not equal to 0, the 1 contour is the contour of the coded combined coded pattern in the 1 st parallelogram coded mark and is marked as the coded combined pattern
Figure GDA0003834588460000182
Step 14.1, giving an integer variable i and an initial value i =1;
step 14.2, backing up the binary image P 'at the 2 nd backup of the 1 st group' 1,2 Up-computing coded composite pattern
Figure GDA0003834588460000183
Of centroid pixel coordinate o' 1 i (x′ 1 i ,y′ 1 i ) Assigning i +1 to i again and continuing to execute the step until i > 1; whereby a corresponding coded combination pattern can be obtained
Figure GDA0003834588460000191
Coded composite pattern
Figure GDA0003834588460000192
8230code combined pattern
Figure GDA0003834588460000193
Centroid pixel coordinates of
Figure GDA0003834588460000194
In this embodiment, the code pattern can be obtained
Figure GDA0003834588460000195
Of is o' 1 1 (728,45);
Step 15.1, backup binarization image P 'at No. 1 group No. 2' 1,2 In the above, the characteristic corner points of the 1 st parallelogram coding mark located in the 1 st coding region, the 2 nd coding region, the 3 rd coding region and the 4 th coding region are recordedRespectively has a sub-pixel coordinate of C 1,1 (x 1,1 ,y 1,1 )、C 1,2 (x 1,2 ,y 1,2 )、C 1,3 (x 1,3 ,y 1,3 )、C 1,4 (x 1,4 ,y 1,4 ) (ii) a And the binary image P 'is copied at the 2 nd backup of the 1 st group' 1,2 In the above, the pixel points with pixel coordinate values of (775, 135) are recorded as the 1 st set of 2 nd backup binary image P' 1,2 Locating ring centroid o 'of upper 1 parallelogram coding mark' d,1 (775, 135), the sub-pixel coordinate value is (0.6927 × 10) 3 ,0.1889×10 3 )、(0.6926×10 3 ,0.0256×10 3 )、(0.8559×10 3 ,0.0257×10 3 )、(0.8558×10 3 ,0.1890×10 3 ) The 4 pixel points are respectively marked as C 1,1 (0.6927×10 3 ,0.1889×10 3 )、C″′ 1,2 (0.6926×10 3 ,0.0256×10 3 )、C″′ 1,3 (0.8559×10 3 ,0.0257×10 3 )、C″′ 1,4 (0.8558×10 3 ,0.1890×10 3 );
Step 15.2, in the 1 st group, the 2 nd backup binary image P' 1,2 Direction vector in the 1 st parallelogram code flag
Figure GDA0003834588460000196
As can be derived from the equation (2),
Figure GDA0003834588460000197
step 16, backing up binary image P 'in the 2 nd backup of the 1 st group' 1,2 In the above, 4 pixel points C' 1,1 (0.6927×10 3 ,0.1889×10 3 )、C″′ 1,2 (0.6926×10 3 ,0.0256×10 3 )、C″′ 1,3 (0.8559×10 3 ,0.0257×10 3 )、C″′ 1,4 (0.8558×10 3 ,0.1890×10 3 ) Pixel coordinate o 'of middle distance positioning circle centroid' l,1 (775, 81) the nearest 2 pixels, and respectively marked as C 1,1min (x 1,1min ,y 1,1min ) And C 1,2min (x 1,2min ,y 1,2min ) In this embodiment, it is C 1,1min (0.6926×10 3 ,0.0256×10 3 ) And C 1,2min (0.8559×10 3 ,0.0257×10 3 )。
Calculating the 1 st judgment vector in the 1 st parallelogram coding flag by the formulas (3) and (4)
Figure GDA0003834588460000198
And 2 nd decision vector
Figure GDA0003834588460000199
And calculating the area judgment sine value 1sin alpha by the formula (5) and the formula (6) 1 Sum area judgment sine value 2sin beta 1
Figure GDA00038345884600001910
Figure GDA00038345884600001911
Figure GDA00038345884600001912
Figure GDA00038345884600001913
In this embodiment:
sinα 1 >0,sinβ 1 if < 0, then C 1,2min (0.8559×10 3 ,0.0257×10 3 ) For the characteristic corner point of the 3 rd coding region in the 1 st parallelogram coding mark, C 1,2min (0.8559×10 3 ,0.0257×10 3 ) Is assigned to C 1,3 (x 1,3 ,y 1,3 );C 1,1min (0.6926×10 3 ,0.0256×10 3 ) Is composed ofFeature corner of the 2 nd coding region in the 1 st parallelogram coding index, C 1,1min (0.6926×10 3 ,0.0256×10 3 ) Is assigned to C 1,2 (x 1,2 ,y 1,2 );
Step 17, 1 st group of 2 nd backup binary image P' 1,2 Through the above step 16, at 4 pixel points C ″' 1,1 (0.6927×10 3 ,0.1889×10 3 )、C″′ 1,2 (0.6926×10 3 ,0.0256×10 3 )、C″′ 1,3 (0.8559×10 3 ,0.0257×10 3 )、C″′ 1,4 (0.8558×10 3 ,0.1890×10 3 ) Finding out the sub-pixel coordinate values of the characteristic angular points of the 2 nd coding region and the 3 rd coding region in the 1 st parallelogram coding mark and respectively assigning the sub-pixel coordinate values to the C 1,2 (x 1,2 ,y 1,2 ) And C 1,3 (x 1,3 ,y 1,3 ) (ii) a Respectively assigning the sub-pixel coordinate values of the rest 2 pixel points to the 1 st temporary coordinate value of the 1 st parallelogram coding mark, and recording as C' 1,5 (0.6927×10 3 ,0.1889×10 3 ) And 2 nd temporary coordinate value of C' 1,6 (0.8558×10 3 ,0.1890×10 3 ) (ii) a Determining the 3 rd judgment vector in the 1 st parallelogram coding flag according to the formulas (7) and (8)
Figure GDA0003834588460000201
And 4 th judgment vector
Figure GDA0003834588460000202
Figure GDA0003834588460000203
Figure GDA0003834588460000204
Step 18, in the 2 nd backup binary image P 'of the 1 st group' 1,2 According to step 17The 3 rd judgment vector calculated in the step
Figure GDA0003834588460000205
And 4 th judgment vector
Figure GDA0003834588460000206
The 3 rd region judgment sine value sin omega can be obtained through the formula (9) and the formula (10) 1 And 4. Area judgment sine value sin xi 1
Figure GDA0003834588460000207
Figure GDA0003834588460000208
In the present embodiment, a parallel vector sine threshold g =0.01,sin ξ is set in advance 1 If < g, the judgment is regarded as the 4 th judgment vector
Figure GDA0003834588460000209
And direction vector
Figure GDA00038345884600002010
Parallel: namely sin omega 1 ≠0,sinξ 1 0 is added, then C' 1,6 (0.8558×10 3 ,0.1890×10 3 ) Namely the characteristic corner point of the 4 th coding region in the 1 st parallelogram coding mark, and C' 1,6 (0.8558×10 3 ,0.1890×10 3 ) Is assigned to C 1,4 (x 1,4 ,y 1,4 );C′ 1,5 (0.6927×10 3 ,0.1889×10 3 ) C 'is a characteristic corner point of a 1 st coding region in a 1 st parallelogram coding mark' 1,5 (0.6927×10 3 ,0.1889×10 3 ) Is assigned to C 1,1 (x 1,1 ,y 1,1 );;
Step 19, backing up binary image P 'in the 2 nd backup of the 1 st group' 1,2 Will be defined by the characteristic corner point C 1,1 (0.6927×10 3 ,0.1889×10 3 ) Angular point C of orientation feature 1,4 (0.8558×10 3 ,0.1890×10 3 ) Is recorded as a vector
Figure GDA00038345884600002011
And is derived from equation (11):
Figure GDA00038345884600002012
taking an integer variable i and assigning i =1;
step 20, backing up binary image P 'in the 2 nd backup of the 1 st group' 1,2 According to the coding combination, the pattern centroid is oriented
Figure GDA0003834588460000211
(Vector)
Figure GDA0003834588460000212
And direction vector
Figure GDA0003834588460000213
The i-th code combination decision vector is calculated by the equations (12), (13) and (14)
Figure GDA0003834588460000214
Determining cosine values in combination with coding
Figure GDA0003834588460000215
And
Figure GDA0003834588460000216
Figure GDA0003834588460000217
Figure GDA0003834588460000218
Figure GDA0003834588460000219
in this embodiment, according to the above formula, the specific calculation result is:
Figure GDA00038345884600002110
Figure GDA00038345884600002111
Figure GDA00038345884600002112
Figure GDA00038345884600002113
Figure GDA00038345884600002114
due to the fact that
Figure GDA00038345884600002115
And is
Figure GDA00038345884600002116
Then
Figure GDA00038345884600002117
To orient the pattern centroid for the code combination of code region 1, will
Figure GDA00038345884600002118
Value to o' z 1,1 (x′ z 1,1 ,y′ z 1,1 );
Due to the fact that
Figure GDA00038345884600002119
And is provided with
Figure GDA00038345884600002120
Then
Figure GDA00038345884600002121
To orient the pattern centroids for the encoded combination of the 2 nd encoded region, will
Figure GDA00038345884600002122
Value to o' z 1,2 (x′ z 1,2 ,y′ z 1,2 );
Due to the fact that
Figure GDA00038345884600002123
And is
Figure GDA00038345884600002124
Then the
Figure GDA00038345884600002125
To orient the pattern centroids for the encoded combination of the 3 rd encoded region
Figure GDA00038345884600002126
Value to o' z 1,3 (x′ z 1,3 ,y′ z 1,3 );
Due to the fact that
Figure GDA00038345884600002127
And is provided with
Figure GDA00038345884600002128
Then
Figure GDA00038345884600002129
To orient the pattern centroids for the encoded combination of the 4 th encoded region
Figure GDA00038345884600002130
Assigned to o' z 1,4 (x′ z 1,4 ,y′ z 1,4 );
Step 21, assigning the integer variable i with i =1 again;
step 22, defining 4 two-dimensional floating-point type arrays Cr 1 1 [3][2]、Cr 1 2 [3][2]、Cr 1 3 [3][2]、Cr 1 4 [3][2]Initializing all elements in the 4 two-dimensional arrays to be assigned as-1; taking 4 integer variables b 1 1 ,b 1 2 ,b 1 3 ,b 1 4 Initialization of b 1 1 =0,b 1 2 =0,b 1 3 =0,b 1 4 =0;
Step 23, in the 1 st group of 2 nd backup binary image P' 1,2 Calculating the circular contour S of the coded and combined coded pattern mark in the 1 st parallelogram code mark 1 1 Centroid pixel coordinate o' 1 1 (728, 45) respectively locate the center of mass o 'of the circle' l,1 Formed 1 st group 1 st discrimination vector
Figure GDA0003834588460000221
Figure GDA0003834588460000222
Calculated by the following equations (16) and (17)
Figure GDA0003834588460000223
Figure GDA0003834588460000224
Figure GDA0003834588460000225
Due to the fact that
Figure GDA0003834588460000226
And is
Figure GDA0003834588460000227
Figure GDA0003834588460000228
Reassign value to b 1 2 =1, and i > 0, step 24.1 is performed directly;
step 24.1, assigning the integer variable i with the value i =1 again;
step 24.2, the results obtained in this example are as follows:
(1)
Figure GDA0003834588460000229
get integer variable
Figure GDA00038345884600002210
And
Figure GDA00038345884600002211
and assign values
Figure GDA00038345884600002212
(2)
Figure GDA00038345884600002213
Get the set Cr 1 2 [3][2]The elements in the same row are not Cr of-1 1 2 [0][0]And Cr 1 2 [0][1]And respectively assigned to 1,1 (x 1,1 ,y 1,1 ) And the abscissa and the ordinate of the sine value sin phi are calculated 1 2
Figure GDA00038345884600002214
Due to sin phi 1 2 =0, take the integer variable
Figure GDA00038345884600002215
And
Figure GDA00038345884600002216
and assign values
Figure GDA00038345884600002217
(3)
Figure GDA00038345884600002218
Get integer variable
Figure GDA00038345884600002219
And
Figure GDA00038345884600002220
and assign values
Figure GDA00038345884600002221
(4)
Figure GDA00038345884600002222
Get integer variable
Figure GDA00038345884600002223
And
Figure GDA00038345884600002224
and assign values
Figure GDA00038345884600002225
Step 25, obtaining the number W of the 1 st parallelogram coding mark through the formula (21) 1
W 1 =V 1 T ·U=8 (21)
Wherein, the column vector U = (2) 0 ,2 1 ,2 2 ,...2 11 ) T Column vector V 1 =(0,0,0,1,0,0,0,0,0,0,0,0) T
Step 26, marking the 1 st parallelogram coding mark belonging to the sigma-th coding region (wherein sigma)Code number L of the calibration corner points of =1,2,3,4) 8 σ Wherein the lower subscript 8 is the calibration corner point L 8 σ The value of the upper corner mark sigma represents the calibrated corner point L 8 σ The sigma-th coding region;
in this embodiment, the sub-pixel coordinate values of 4 characteristic corners and the corresponding corner coding numbers on the found parallelogram coding sign with the coding number of 8 are as follows:
the code number is L 8 1 The sub-pixel coordinate value of the characteristic corner is C 1,1 (0.6927×10 3 ,0.1889×10 3 );
The code number is L 8 2 The sub-pixel coordinate value of the characteristic corner is C 1,2 (0.6926×10 3 ,0.0256×10 3 );
The code number is L 8 3 The sub-pixel coordinate value of the characteristic corner is C 1,3 (0.8559×10 3 ,0.0257×10 3 );
The code number is L 8 4 The sub-pixel coordinate value of the characteristic corner is C 1,4 (0.8558×10 3 ,0.1890×10 3 );
Step 27, judging whether zeta is smaller than 8, if zeta +1 is smaller than 8, reassigning zeta +1 to zeta, and returning to step 6.1 to execute in sequence; if not, finding the sub-pixel coordinate values and the corresponding coding numbers of the 4 characteristic angular points on each parallelogram coding mark.
The 1 st backup binary image P 'of the 1 st group obtained in the step 6.1 is processed' 1,1 And taking the 1 st circular ring black connected domain centroid pixel coordinate value (775, 135) in the circular ring black connected domain centroid set A as an input condition, and removing the 1 st group 1 st backup binary image P 'by using a coding mark removing complex background algorithm' 1,1 And finally obtaining a 1 st parallelogram binaryzation image P without the complex background 1 "the steps are as follows:
step 6.1.1, taking an integer variable i and assigning i =1;
step 6.1.2, backup binary image P 'at the No. 1 st group' 1,1 Searching a white connected domain nearest to the pixel coordinate values (775, 135) and marking as a 1 st backup binary image P 'of the 1 st group' 1,1 The ith circular ring white connected domain M' i And the ith circular ring white connected domain M' i All the pixel values of (a) are assigned to 0;
step 6.1.3, judging whether i is smaller than 10, if i is smaller than 10, assigning i +1 to i, and returning to the step 6.1.2 for sequential execution; otherwise, the 1 st backup binary image P 'of the 1 st group has been obtained' 1,1 The directional rings in all the parallelogram coding marks are black; and 1 st backup binary image P 'of the 1 st group' 1,1 The image obtained after the processing of the present step 6.1.3 was designated as the 1 st black background extracted image P' 1,b And performing step 6.1.4;
step 6.1.4, extracting image P 'from the 1 st black background' 1,b Of all the black connected components on the image plane, the black connected component closest to the pixel coordinate values (775, 135) is found and is marked as the 1 st black background extraction image P' 1,b The 1 st parallelogram background black connected domain omega 1
Step 6.1.5, extracting image P 'from the 1 st black background' 1,b Extracting the 1 st parallelogram background black connected domain omega 1 All the inner and outer contours of the first parallelogram to obtain the 1 st black connected domain omega of the parallelogram background 1 Inner and outer contour set V of 1
Step 6.1.6, compare contour set V 1 The perimeter of all the contours in the graph is recorded as the 1 st parallelogram background black connected domain omega 1 Outer contour E of 1
Step 6.1.7, extracting image P 'from the 1 st black background' 1,b Method for distinguishing black connected domain omega of parallelogram background by ray method 1 Outer contour E of 1 All other pixels and the outline E 1 All the inner pixel points and the outer contour E 1 The gray value of all the pixels within is assigned to 255, and the outer contour E 1 Except that the gray values of all the pixel points are assigned to be 0, and then a 1 st parallelogram binary image without complex background is obtainedLike P 1 "; binary image P of No. 1 parallelogram without complex background 1 "in this case, all pixel values inside the parallelogram-shaped code flag containing the centroid pixel coordinate values (775, 135) are set to 255, and all pixel values outside the parallelogram-shaped code flag containing the centroid pixel coordinate values (775, 135) are set to 0, as shown in fig. 10.
The decoding method of parallelogram coding mark based on graph geometry relation provided by the invention needs to compile corresponding computer program and execute the program on the computer to realize the corresponding operation processing and logic control function, therefore, the invention also provides a computer readable storage medium, comprising the computer program used in combination with the electronic device with image processing function, the computer program can be executed by the processor to realize the decoding method.
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 performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A decoding method of a parallelogram coding mark based on a graph geometric relationship is characterized in that the coding mark is a square coding square, a parallelogram background pattern and a coding pattern are arranged on the surface of the coding square, the coding pattern is positioned inside the parallelogram background pattern, the coding pattern comprises a positioning pattern, an orientation pattern and a coding combination pattern, the orientation pattern and the positioning pattern are used for judging the direction of the parallelogram coding mark, the coding combination pattern is used for coding each corner point of the parallelogram coding mark, and each coding combination pattern is composed of one coding combination orientation pattern and three coding combination coding patterns, and the decoding method is characterized in that: the method for processing the digital image is used for obtaining the coding sequence number and the sub-pixel coordinates of each characteristic corner point in the image which is shot by the camera and contains N parallelogram coding marks, and further the steps for decoding the parallelogram coding marks are as follows:
step 1.1, acquiring a coding mark image by utilizing N parallelogram coding marks arranged in a camera shooting space, wherein the coding mark image comprises N parallelogram coding marks;
step 1.2, establishing a pixel coordinate system of an angular point;
step 2.1, carrying out gray level processing on the coding mark image to obtain a coding mark gray level image P 1
Step 2.2, 8 bits of gray level image P of coding mark 1 Copying and backing up to obtain a grey level backup image P of the coding mark 1 ′;
Step 2.3, the grey level backup image P of the coding mark 1 ' carry on the binarization processing to get the binary image P of the coding mark 2
Step 3, setting a roundness threshold lambda 'of the black connected domain and a pixel number threshold lambda';
step 4.1, calculating a binary image P of the coding mark 2 Circularity value λ of all black connected components in the image n And the number of pixel points c n Wherein the circularity value of each black connected domain is given by equation (1),
Figure FDA0003834588450000011
wherein l n Perimeter, s, representing the contour of the corresponding black connected component n Represents the area corresponding to the black connected domains, n =1,2,3,4;
step 4.2, selecting proper black connected domain roundness threshold lambda 'and pixel point number threshold lambda' to encode the mark binary image P 2 Black connected domains of the centers of N directional circular rings corresponding to the N parallelogram coding marks are obtained and are placed into a circular ring black connected domain set A';
wherein, the coded mark binarizes the image P 2 The circularity value of each circular ring black connected domain is smaller than the circularity threshold lambda', and the number of pixel points of each circular ring black connected domain is largeA threshold value lambda' of the number of pixels is set;
step 4.3, taking an integer variable i and assigning i =1;
step 4.4, calculating the ith ring black connected domain M in the ring black connected domain set A i The coordinates of the centroid pixel are marked as o ″ d,i (x″ d,i ,y″ d,i ) Obtaining the ith ring black connected domain M i Centroid pixel coordinate o ″) d,i (x″ d,i ,y″ d,i ) The ith element is taken as a circular black connected domain centroid set A;
step 4.5, judging whether i is smaller than N, if i is smaller than N, assigning i +1 to i, and returning to the step 4.4 to execute in sequence; otherwise, obtaining the binary image P of the coding mark 2 The center of mass pixel coordinate o' of each ring black connected domain d,1 (x″ d,1 ,y″ d,1 )、o″ d,2 (x″ d,2 ,y″ d,2 )、…、o″ d,N (x″ d,N ,y″ d,N ) Sequentially putting the circular black connected domain mass center sets into a circular black connected domain mass center set A;
step 5, taking an integer variable zeta and assigning zeta =1;
step 6.1, binarizing the image P with the coding mark 2 Performing copy backup twice to respectively obtain a 1 st backup binary image P 'of the zeta group' ζ,1 And the 2 nd backup binary image P 'of the zeta th group' ζ,2
Step 6.2, carrying out binarization on the 1 st backup binary image P 'of the zeta th group by using a complex background algorithm for removing coding marks' ζ,1 Digital image processing is carried out to obtain the zeta th parallelogram binaryzation image P ″, without complex background ζ,1
Step 7.1, coding the mark gray level image P 1 Copying and backing up again to obtain a zeta-th backup gray level image P' ζ
Step 7.2, utilizing a corner detection algorithm to perform binarization on the zeta th parallelogram binary image P' without complex background ζ,1 Extracting sub-pixel coordinates of 4 corner points, and marking as the zeta-th complex background-free parallelogram binaryzation image P ″ ζ,1 Upper 4 alternative corner points C ″) ζ,1 (x″ ζ,1 ,y″ ζ,1 )、C″ ζ,2 (x″ ζ,2 ,y″ ζ,2 )、C″ ζ,3 (x″ ζ,3 ,y″ ζ,3 )、C″ ζ,4 (x″ ζ,4 ,y″ ζ,4 );
Step 7.3, obtaining a parallelogram binaryzation image P ″' without a complex background at the zeta th ζ,1 Black connected domain corrosion is performed in the process, so that the zeta-th parallelogram binaryzation image P' without complex background ζ,1 White connected domain in (1) is enlarged; and recording the processed image as the zeta-th operation binary image P ″ ζ,2
Step 7.4, the zeta-th operation binaryzation image P ″ ζ,2 Setting the value of the part with the middle gray scale value of 255 as 1, and calculating the zeta-th binary image P ″ ζ,2 Setting the value of the part with the middle gray value of 0 as 0, and then utilizing the zeta-th operation to binarize the image P ″) ζ,2 And the ζ th backup grayscale image P' ζ Performing multiplication, and recording the obtained result image as the Zeta-th coverage result image T ζ
Step 7.5, covering the result image T at the zeta th by utilizing a corner point detection algorithm ζ Extracting sub-pixel coordinates of all corner points and storing the sub-pixel coordinates into a zeta-th primary corner point sub-pixel coordinate set B ζ Performing the following steps;
step 7.6, taking an integer variable i and assigning value i =1;
step 7.7, in the zeta th primary corner point sub-pixel coordinate set B ζ Finding the coordinate value (x ″) of the distance sub-pixel ζ,i ,y″ ζ,i ) Nearest corner sub-pixel coordinate is recorded as C' ζ,i (x′ ζ,i ,y′ ζ,i );
7.8, judging whether i is smaller than 4, if i is smaller than 4, assigning i +1 to i and returning to execute the step 7.7; otherwise, the ζ -th overlay result image T has been obtained at this time ζ Contains the coordinate value (x ″) of centroid pixel d,ζ ,y″ d,ζ ) Of 4 characteristic corner points of the parallelogram-coded logo C' ζ,1 (x′ ζ,1 ,y′ ζ,1 )、C′ ζ,2 (x′ ζ,2 ,y′ ζ,2 )、C′ ζ,3 (x′ ζ,3 ,y′ ζ,3 )、C′ ζ,4 (x′ ζ,4 ,y′ ζ,4 ) And step 8.1 is executed;
step 8.1, backup binarization image P 'at the 2 nd of the zeta group' ζ,2 Above, will contain the centroid pixel coordinate value (x ″) d,ζ ,y″ d,ζ ) The parallelogram coding mark is marked as the zeta th parallelogram coding mark;
step 8.2, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 Wherein the sub-pixel coordinate values are (x' ζ,1 ,y′ ζ,1 )、(x′ ζ,2 ,y′ ζ,2 )、(x′ ζ,3 ,y′ ζ,3 )、(x′ ζ,4 ,y′ ζ,4 ) The 4 pixel points are used as the corner quadrangle S of the zeta-th parallelogram coding mark ζ 4 vertices of (a), connecting the 4 vertices to obtain a corner quadrangle S of the zeta-th parallelogram coding mark ζ
Step 9, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 In the above, the pixel coordinate value (x ″) from the centroid is found d,ζ ,y″ d,ζ ) The nearest white connected domain, and the gray value of the white connected domain is assigned to be 0;
step 10, backing up a binary image P 'at the 2 nd backup of the zeta group' ζ,2 Corner quadrilateral S of upper Zeta parallelogram coding sign ζ Keeping the gray values of all internal pixel points unchanged, and making the corner quadrangle S of the zeta-th parallelogram coding mark ζ The gray values of all other pixel points are assigned to be 255;
step 11.1, backup binarization image P 'at 2 nd of zeta group' ζ,2 In the above, the corner quadrangle S of the ζ -th parallelogram coding mark is extracted ζ The inner and outer contours in (1) are marked as a contour set D in the zeta-th parallelogram coding mark ζ
Step 11.2, counting the outline set D in the zeta-th parallelogram coding mark ζ The number of pixel points included in each contour is recorded as the zeta-th groupNo. 2 backup binary image P' ζ,2 Positioning circle contour G in upper Zeth parallelogram coding mark ζ Calculating the coordinates of the centroid pixel of the binary image and recording the coordinates as the 2 nd backup binary image P 'of the zeta group' ζ,2 Locating circle centroid pixel coordinates o 'within the upper zeta parallelogram encoding logo' l,ζ (x′ l,ζ ,y′ l,ζ );
Step 12, collecting the outline D in the zeta-th parallelogram coding mark ζ The 4 contours with the least number of pixel points are recorded as the contour Z of the coding combination orientation pattern ζ,1 Coded composite directional pattern profile Z ζ,2 Coded composite directional pattern profile Z ζ,3 Coded combined orientation pattern profile Z ζ,4 And respectively calculate the centroid thereof
Figure FDA0003834588450000031
Figure FDA0003834588450000032
Step 13.1, according to the outline set D in the zeta th parallelogram coding mark ζ In the method, two contours with the largest number of pixel points and 4 contours with the smallest number of pixel points are removed, and the number of remaining contours kappa is determined ζ Is divided into the following cases: if κ ζ =0, then step 14.1 is executed; otherwise this κ ζ The profiles are the profiles of the coded combined coding patterns in the zeta-th parallelogram coding mark and are respectively marked as the coded combined patterns
Figure FDA0003834588450000033
Coded composite pattern
Figure FDA0003834588450000034
823060A combined coding pattern
Figure FDA0003834588450000041
Step 14.1, giving an integer variable i and an initial value i =1;
step 14.2, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 Calculating the code pattern
Figure FDA0003834588450000042
Center of mass of
Figure FDA0003834588450000043
This step continues after i +1 is reassigned to i until i > κ ζ Ending; whereby a corresponding coded composite pattern can be obtained
Figure FDA0003834588450000044
Coded composite pattern
Figure FDA0003834588450000045
823060A combined coding pattern
Figure FDA0003834588450000046
Centroid pixel coordinates of
Figure FDA0003834588450000047
Step 15.1, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 In the above, the sub-pixel coordinates of the characteristic corner points of the ζ -th parallelogram coding mark located in the 1 st coding region, the 2 nd coding region, the 3 rd coding region and the 4 th coding region are respectively C ζ,1 (x ζ,1 ,y ζ,1 )、C ζ,2 (x ζ,2 ,y ζ,2 )、C ζ,3 (x ζ,3 ,y ζ,3 )、C ζ,4 (x ζ,4 ,y ζ,4 ) (ii) a And backup binary image P 'at 2 nd of the zeta group' ζ,2 The pixel coordinate value is (x ″) d,ζ ,y″ d,ζ ) The pixel point of (1) is recorded as a zeta-group 2 nd backup binary image P' ζ,2 Directional ring centroid o 'of upper zeta-th parallelogram coding mark' d,ζ (x′ d,ζ ,y′ d,ζ ) And seating the sub-pixelsThe standard value is (x' ζ,1 ,y′ ζ,1 )、(x′ ζ,2 ,y′ ζ,2 )、(x′ ζ,3 ,y′ ζ,3 )、(x′ ζ,4 ,y′ ζ,4 ) The 4 pixel points are respectively marked as C' ζ,1 (x″′ ζ,1 ,y″′ ζ,1 )、C″′ ζ,2 (x″′ ζ,2 ,y″′ ζ,2 )、C″′ ζ,3 (x″′ ζ,3 ,y″′ ζ,3 )、C″′ ζ,4 (x″′ ζ,4 ,y″′ ζ,4 );
Step 15.2, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 The direction vector in the above, ζ th parallelogram code flag
Figure FDA0003834588450000048
As is derived from the formula (2),
Figure FDA0003834588450000049
step 16, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 On top, find 4 pixels C' ζ,1 (x″′ ζ,1 ,y″′ ζ,1 )、C″′ ζ,2 (x″′ ζ,2 ,y″′ ζ,2 )、C″′ ζ,3 (x″′ ζ,3 ,y″′ ζ,3 )、C″′ ζ,4 (x″′ ζ,4 ,y″′ ζ,4 ) Pixel coordinate o 'of middle-distance positioning circle centroid' l,ζ (x′ l,ζ ,y′ l,ζ ) The nearest 2 pixels are respectively marked as C ζ,1min (x ζ,1min ,y ζ,1min ) And C ζ,2min (x ζ,2min ,y ζ,2min );
Finding out the sub-pixel coordinate values of the characteristic corner points of the 2 nd coding region and the 3 rd coding region in the zeta-th parallelogram coding mark in 4 pixel points and respectively assigning the sub-pixel coordinate values to C ζ,2 (x ζ,2 ,y ζ,2 ) And C ζ,3 (x ζ,3 ,y ζ,3 );
By the formula (3) And (4) calculating the 1 st judgment vector in the ζ th parallelogram coding mark
Figure FDA00038345884500000410
And 2 nd decision vector
Figure FDA00038345884500000411
And calculating the 1 st area dividing sine value sin alpha according to the formulas (5) and (6) ζ And 2 nd area division sine value sin beta ζ
Figure FDA00038345884500000412
Figure FDA00038345884500000413
Figure FDA00038345884500000414
Figure FDA00038345884500000415
Step 17, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 And respectively assigning the sub-pixel coordinate values of the rest 2 pixel points to the temporary coordinate value 1 of the zeta-th parallelogram coding mark, and recording the temporary coordinate value as C' ζ,5 (x′ ζ,5 ,y′ ζ,5 ) And temporary coordinate value 2, marked as C' ζ,6 (x′ ζ,6 ,y′ ζ,6 );
Determining the 3 rd judgment vector in the ζ th parallelogram coding flag according to equations (7) and (8)
Figure FDA0003834588450000051
And 4 th judgment vector
Figure FDA0003834588450000052
Figure FDA0003834588450000053
Figure FDA0003834588450000054
Step 18, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 According to the 3 rd judgment vector
Figure FDA0003834588450000055
And 4 th judgment vector
Figure FDA0003834588450000056
The 3 rd region division sine value sin omega is obtained through the formula (9) and the formula (10) ζ And 4 th area dividing sine value sin xi ζ
Figure FDA0003834588450000057
Figure FDA0003834588450000058
According to sin ω ζ And sin xi ζ C is' ζ,5 (x′ ζ,5 ,y′ ζ,5 ) Or C' ζ,6 (x′ ζ,6 ,y′ ζ,6 ) Is assigned to C ζ,4 (x ζ,4 ,y ζ,4 ) Or C ζ,1 (x ζ,1 ,y ζ,1 );
Step 19, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 Will be composed of characteristic corner points C ζ,1 (x ζ,1 ,y ζ,1 ) Directing deviceSymbolized corner point C ζ,4 (x ζ,4 ,y ζ,4 ) Is recorded as a vector
Figure FDA0003834588450000059
And is derived from equation (11):
Figure FDA00038345884500000510
taking an integer variable i and assigning i =1;
step 20, backing up the binary image P 'at the 2 nd backup of the zeta group' ζ,2 According to the coding combination, the pattern centroid is oriented
Figure FDA00038345884500000511
(Vector)
Figure FDA00038345884500000512
And direction vector
Figure FDA00038345884500000513
The i-th code combination decision vector is calculated by the equations (12), (13) and (14)
Figure FDA00038345884500000514
Coding combination judgment cosine value
Figure FDA00038345884500000515
And
Figure FDA00038345884500000516
the value taking condition of (1):
Figure FDA00038345884500000517
Figure FDA00038345884500000518
Figure FDA00038345884500000519
judging whether i meets the condition that i is less than 4, if i is less than 4, assigning i +1 to i, and returning to execute the step 20; otherwise, the center of mass of the coded combined orientation pattern of the 1 st coding region in the ζ th parallelogram coding mark is obtained
Figure FDA00038345884500000520
Coded combined orientation pattern centroid for coding region 2
Figure FDA00038345884500000521
Coded combined orientation pattern centroid for 3 rd coded region
Figure FDA00038345884500000522
And the coded combined orientation pattern centroid of the 4 th coded region
Figure FDA00038345884500000523
And proceeds to step 21;
step 21, assigning the integer variable i with i =1 again;
step 22, defining 4 two-dimensional floating-point type numerical groups
Figure FDA0003834588450000061
Initializing all elements in the 4 two-dimensional arrays, and assigning a value of-1; taking 4 integer variables
Figure FDA0003834588450000062
Initialization
Figure FDA0003834588450000063
Step 23, backup binarization image P 'at 2 nd of the zeta group' ζ,2 In the above-mentioned manner,calculating the circular outline of the coded combined coded pattern mark in the Zeth parallelogram coded mark
Figure FDA0003834588450000064
Centroid pixel coordinates of
Figure FDA0003834588450000065
And the center o of the positioning circle' l,ζ The ith difference vector of the formed ζ -th group
Figure FDA0003834588450000066
Figure FDA0003834588450000067
Calculated by the following equations (16) and (17)
Figure FDA0003834588450000068
Figure FDA0003834588450000069
Figure FDA00038345884500000610
Step 24.1, assigning the integer variable i with the value i =1 again;
step 24.2, according to
Figure FDA00038345884500000611
Taking integer variables
Figure FDA00038345884500000612
And
Figure FDA00038345884500000613
and assigning values;
if i is less than 4, assigning i +1 to i and returning to execute the step 24.2; otherwise, continuing to execute the step 25;
step 25, obtaining the serial number W of the zeta th parallelogram coding mark through the formula (21) ζ
W ζ =V ζ T ·U (21)
Wherein, the column vector U = (2) 0 ,2 1 ,2 2 ,...2 11 ) T Column vector
Figure FDA00038345884500000614
Step 26, marking the code number of the characteristic corner point belonging to the sigma-th coding region in the zeta-th parallelogram coding mark as
Figure FDA00038345884500000615
Wherein W ζ For calibrating angular points
Figure FDA00038345884500000616
The number of the coding square grid, the value of sigma represents the calibration angular point
Figure FDA00038345884500000617
(ii) a σ -encoding region to which σ =1,2,3,4;
thus, the coding numbers of the 4 feature corners in the ζ -th parallelogram coding mark and the corresponding sub-pixel coordinate values thereof are obtained:
coded number is
Figure FDA00038345884500000618
The sub-pixel coordinate value of the characteristic corner is (x) ζ,1 ,y ζ,1 );
Coded number is
Figure FDA00038345884500000619
The sub-pixel coordinate value of the characteristic corner is (x) ζ,2 ,y ζ,2 );
The code number is
Figure FDA00038345884500000620
The sub-pixel coordinate value of the characteristic corner is (x) ζ,3 ,y ζ,3 );
Coded number is
Figure FDA00038345884500000621
The sub-pixel coordinate value of the characteristic corner is (x) ζ,4 ,y ζ,4 );
Step 27, judging whether zeta is smaller than N, if yes, reassigning zeta +1 to zeta, and returning to step 6.1 to execute in sequence; if not, the sub-pixel coordinate values and the corresponding coding numbers of the 4 characteristic angular points on each parallelogram coding mark are found.
2. The decoding method according to claim 1, wherein: in step 6.1, obtaining a 1 st backup binary image P 'of the zeta th group' ζ,1 And the Zeth circular ring black connected domain centroid pixel coordinate value (x ″) in the circular ring black connected domain centroid set A d,ζ ,y″ d,ζ ) Removing the 1 st backup binary image P 'of the zeta th group by using a complex background algorithm for removing a coding mark as an input condition' ζ,1 And finally obtaining the zeta th parallelogram binaryzation image P' without complex background ζ The steps are as follows:
step 6.1.1, taking an integer variable i and assigning i =1;
step 6.1.2, backup binary image P 'at the 1 st backup of the ζ th group' ζ,1 Upper search distance pixel coordinate value (x ″) d,ζ ,y″ d,ζ ) The nearest white connected domain is recorded as the 1 st backup binary image P 'of the ζ th group' ζ,1 The ith circular ring white connected domain M' i And the ith circular ring white connected domain M' i All the gray values are assigned to 0;
step 6.1.3, judging whether i is smaller than N, if i is smaller than N, assigning i +1 to i, and returning to the step 6.1.2 for sequential execution; if not, then,the zeta th group 1 st backup binary image P' ζ,1 Setting the orientation circular rings in all the parallelogram coding marks to be black, and setting the 1 st backup binary image P 'of the zeta-th group' ζ,1 The image processed in this step was recorded as the ζ -th black background extraction image P' ζ,b And performing step 6.1.4;
step 6.1.4, extracting image P 'from the zeta-th black background' ζ,b In all the black connected domains, find the coordinate value (x ″) of the distance pixel d,ζ ,y″ d,ζ ) The nearest black connected domain is denoted as the ζ -th black background extraction image P' ζ,b The ζ th parallelogram background black connected domain Ω ζ
Step 6.1.5, extracting image P 'from the ζ -th black background' ζ,b Upper extraction of zeta-th parallelogram background black connected domain omega ζ The zeta th parallelogram background black connected domain omega is obtained ζ Inner and outer contour set V of ζ
Step 6.1.6, compare contour set V ζ The perimeter of the longest perimeter of all the contours in the drawing is recorded as the zeta-th parallelogram background black connected domain omega ζ Outer contour E of ζ
Step 6.1.7, extracting image P 'from the zeta-th black background' ζ,b Upper, the outer contour E ζ The gray value of all the pixels within is assigned to 255, and the outer contour E ζ Except for the gray values of all the pixel points, the gray values are assigned to be 0, and therefore the zeta th parallelogram binaryzation image P' without the complex background is obtained ζ (ii) a Leading the parallelogram to be a binary image P ″' without complex background at the zeta th ζ In (1), the pixel coordinate value (x ″) of the centroid is included d,ζ ,y″ d,ζ ) The gray value of all pixel points in the parallelogram coding mark is set to be 255, and the gray value contains the coordinate value (x ″) of the centroid pixel d,ζ ,y″ d,ζ ) The gray values of all the pixel points outside the parallelogram coding mark are set to be 0.
3. The decoding method according to claim 1, wherein: in step 16, execution is performed in two cases:
(1) Sin alpha ζ <0,sinβ ζ If greater than 0, then C ζ,1min (x ζ,1min ,y ζ,1min ) For the characteristic corner point of the 3 rd coding region in the ζ th parallelogram coding mark, C ζ,1min (x ζ,1min ,y ζ,1min ) Is assigned to C ζ,3 (x ζ,3 ,y ζ,3 );C ζ,2min (x ζ,2min ,y ζ,2min ) For the characteristic corner of the 2 nd coding region in the ζ th parallelogram coding index, C ζ,2min (x ζ,2min ,y ζ,2min ) Is assigned to C ζ,2 (x ζ,2 ,y ζ,2 );
(2) If sin alpha ζ >0,sinβ ζ If < 0, then C ζ,2min (x ζ,2min ,y ζ,2min ) For the characteristic corner of the 3 rd coding region in the ζ -th parallelogram coding index, C ζ,2min (x ζ,2min ,y ζ,2min ) Is assigned to C ζ,3 (x ζ,3 ,y ζ,3 );C ζ,1min (x ζ,1min ,y ζ,1min ) For the characteristic corner of the 2 nd coding region in the ζ th parallelogram coding index, C ζ,1min (x ζ,1min ,y ζ,1min ) Is assigned to C ζ,2 (x ζ,2 ,y ζ,2 )。
4. The decoding method according to claim 1, wherein: in step 18, it is performed in two cases:
(1) Sin omega ζ ==0,sinξ ζ Not equal to 0, then C' ζ,5 (x′ ζ,5 ,y′ ζ,5 ) Namely C 'is the characteristic corner point of the 4 th coding area in the ζ th parallelogram coding mark' ζ,5 (x′ ζ,5 ,y′ ζ,5 ) Is assigned to C ζ,4 (x ζ,4 ,y ζ,4 );C′ ζ,6 (x′ ζ,6 ,y′ ζ,6 ) For the characteristic corner of the 1 st coding region in the ζ -th parallelogram coding indexC's' ζ,6 (x′ ζ,6 ,y′ ζ,6 ) Is assigned to C ζ,1 (x ζ,1 ,y ζ,1 );
(2) Sin ω ζ ≠0,sinξ ζ =0, then C' ζ,6 (x′ ζ,6 ,y′ ζ,6 ) Namely C 'is the characteristic corner point of the 4 th coding area in the ζ th parallelogram coding mark' ζ,6 (x′ ζ,6 ,y′ ζ,6 ) Is assigned to C ζ,4 (x ζ,4 ,y ζ,4 );C′ ζ,5 (x′ ζ,5 ,y′ ζ,5 ) C 'is a characteristic corner point of a 1 st coding region in a zeta th parallelogram coding mark' ζ,5 (x′ ζ,5 ,y′ ζ,5 ) Is assigned to C ζ,1 (x ζ,1 ,y ζ,1 )。
5. The decoding method according to claim 1, wherein: in step 20, the execution is divided into four cases:
(1) If it is
Figure FDA0003834588450000081
And is
Figure FDA0003834588450000082
Then
Figure FDA0003834588450000083
To orient the pattern centroids for the encoded combination of the 3 rd encoded region
Figure FDA0003834588450000084
Assign to
Figure FDA0003834588450000085
(2) If it is
Figure FDA0003834588450000086
And is
Figure FDA0003834588450000087
Then
Figure FDA0003834588450000088
To orient the pattern centroids for the coded combinations of the 2 nd coded region, will
Figure FDA0003834588450000089
Is assigned to
Figure FDA00038345884500000810
(3) If it is
Figure FDA00038345884500000811
And is
Figure FDA00038345884500000812
Then
Figure FDA00038345884500000813
To orient the pattern centroids for the encoded combination of the 1 st encoded region
Figure FDA00038345884500000814
Is assigned to
Figure FDA00038345884500000815
(4) If it is
Figure FDA00038345884500000816
And is provided with
Figure FDA00038345884500000817
Then the
Figure FDA00038345884500000818
To orient the pattern centroids for the encoded combination of the 4 th encoded region
Figure FDA00038345884500000819
Is assigned to
Figure FDA00038345884500000820
6. The decoding method according to claim 1, wherein: in step 23, the execution is divided into four cases:
(1) If it is
Figure FDA00038345884500000821
And is
Figure FDA00038345884500000822
Then make it give
Figure FDA00038345884500000823
Will be provided with
Figure FDA00038345884500000824
Is assigned to
Figure FDA00038345884500000825
If i > k ζ 1, executing step 24, otherwise, assigning i +1 to i, and returning to execute step 23;
(2) If it is
Figure FDA00038345884500000826
And is provided with
Figure FDA00038345884500000827
Then order
Figure FDA00038345884500000828
Will be provided with
Figure FDA00038345884500000829
Is assigned to
Figure FDA00038345884500000830
If i > k ζ 1, executing step 24, otherwise, assigning i +1 to i, and returning to execute step 23;
(3) If it is
Figure FDA0003834588450000091
And is
Figure FDA0003834588450000092
Then make it give
Figure FDA0003834588450000093
Will be provided with
Figure FDA0003834588450000094
Is assigned to
Figure FDA0003834588450000095
If i > k ζ 1, executing step 24, otherwise, assigning i +1 to i, and returning to execute step 23;
(4) If it is
Figure FDA0003834588450000096
And is
Figure FDA0003834588450000097
Then order
Figure FDA0003834588450000098
Will be provided with
Figure FDA0003834588450000099
Is assigned to
Figure FDA00038345884500000910
If i > k ζ 1, then step 24 is executed, otherwise i +1 is assigned to i, and the step 23 is returned to.
7. The decoding method according to claim 1, wherein: in step 24.2, execution is divided into the following cases:
(1) If it is
Figure FDA00038345884500000911
Then take the integer variable
Figure FDA00038345884500000912
And
Figure FDA00038345884500000913
and assign values
Figure FDA00038345884500000914
(2) If it is
Figure FDA00038345884500000915
Will array
Figure FDA00038345884500000916
Elements in the same row which are not-1 are respectively marked as
Figure FDA00038345884500000917
And
Figure FDA00038345884500000918
and respectively assigned to ζ,1 (x ζ,1 ,y ζ,1 ) And the abscissa and the ordinate of the computer, and calculating the sine value
Figure FDA00038345884500000919
Figure FDA00038345884500000920
And (4) judging:
1) If it is
Figure FDA00038345884500000921
Then get the integer variable
Figure FDA00038345884500000922
And
Figure FDA00038345884500000923
and assign values
Figure FDA00038345884500000924
2) If it is
Figure FDA00038345884500000925
Then take the integer variable
Figure FDA00038345884500000926
And
Figure FDA00038345884500000927
and assign values
Figure FDA00038345884500000928
3) If it is
Figure FDA00038345884500000929
Then take the integer variable
Figure FDA00038345884500000930
And
Figure FDA00038345884500000931
and assign values
Figure FDA00038345884500000932
(3) If it is
Figure FDA00038345884500000933
Will array
Figure FDA00038345884500000934
Elements in the same row which are not-1 are respectively marked as
Figure FDA00038345884500000935
And
Figure FDA00038345884500000936
and
Figure FDA00038345884500000937
and respectively assigned to ζ,1 (x ζ,1 ,y ζ,1 ) Abscissa and ordinate of and o ζ,2 (x ζ,2 ,y ζ,2 ) The abscissa and the ordinate of the computer, while calculating the sine value
Figure FDA00038345884500000938
And
Figure FDA00038345884500000939
Figure FDA00038345884500000940
Figure FDA00038345884500000941
and judging:
(1) If it is
Figure FDA00038345884500000942
Or
Figure FDA00038345884500000943
Then take the integer variable
Figure FDA00038345884500000944
And
Figure FDA00038345884500000945
and assign values
Figure FDA00038345884500000946
(2) If it is
Figure FDA00038345884500000947
Or
Figure FDA00038345884500000948
Then take the integer variable
Figure FDA00038345884500000949
And
Figure FDA00038345884500000950
and assign values
Figure FDA00038345884500000951
(3) If it is
Figure FDA00038345884500000952
Or
Figure FDA00038345884500000953
Then take the integer variable
Figure FDA00038345884500000954
And
Figure FDA00038345884500000955
and assign values
Figure FDA00038345884500000956
(4) If it is
Figure FDA0003834588450000101
Then take the integer variable
Figure FDA0003834588450000102
And
Figure FDA0003834588450000103
and assign values
Figure FDA0003834588450000104
8. A computer-readable storage medium comprising a computer program for use in conjunction with an electronic device having image processing functionality, the computer program being executable by a processor to perform the decoding method of claim 1.
CN202110392348.XA 2020-12-23 2021-04-13 Decoding method of parallelogram coding mark based on graphic geometric relation Active CN113129397B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2020115409242 2020-12-23
CN202011540924 2020-12-23

Publications (2)

Publication Number Publication Date
CN113129397A CN113129397A (en) 2021-07-16
CN113129397B true CN113129397B (en) 2022-10-14

Family

ID=76775881

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110392348.XA Active CN113129397B (en) 2020-12-23 2021-04-13 Decoding method of parallelogram coding mark based on graphic geometric relation

Country Status (1)

Country Link
CN (1) CN113129397B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114222143B (en) * 2021-12-04 2024-02-06 东南大学 Encoding and decoding method based on tiny image
CN115731312B (en) * 2022-11-03 2023-07-11 中国地质大学(武汉) Annular coding mark point extraction and identification method based on multi-feature relaxation constraint

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102163336A (en) * 2011-03-25 2011-08-24 重庆酷贝科技发展有限公司 Method for coding and decoding image identification codes
CN103530889A (en) * 2013-11-04 2014-01-22 天津工业大学 Method for decoding coding mark points of measuring stick based on skeleton extraction

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7580620B2 (en) * 2006-05-08 2009-08-25 Mitsubishi Electric Research Laboratories, Inc. Method for deblurring images using optimized temporal coding patterns

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102163336A (en) * 2011-03-25 2011-08-24 重庆酷贝科技发展有限公司 Method for coding and decoding image identification codes
CN103530889A (en) * 2013-11-04 2014-01-22 天津工业大学 Method for decoding coding mark points of measuring stick based on skeleton extraction

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Supervised segmentation at low bit rates for region representation and color image compression;D. Olivier等;《IEEE Xplore》;20021130;全文 *
一种环状编码标记点的设计及解码算法;金滔等;《计算机应用研究》;20180314(第04期);全文 *

Also Published As

Publication number Publication date
CN113129397A (en) 2021-07-16

Similar Documents

Publication Publication Date Title
CN108369650B (en) Method for identifying possible characteristic points of calibration pattern
CN109215016B (en) Identification and positioning method for coding mark
CN109859226B (en) Detection method of checkerboard corner sub-pixels for graph segmentation
CN113129397B (en) Decoding method of parallelogram coding mark based on graphic geometric relation
CN110246168A (en) A kind of feature matching method of mobile crusing robot binocular image splicing
CN107945221B (en) Three-dimensional scene feature expression and high-precision matching method based on RGB-D image
CN108573511B (en) Point-distributed cooperative coding mark and identification and positioning method thereof
CN110738273B (en) Image feature point matching method, device, equipment and storage medium
CN113096191B (en) Intelligent calibration method for monocular camera based on coding plane target
CN109191562B (en) Three-dimensional reconstruction method based on color pseudo-random coding structured light
CN113129385B (en) Binocular camera internal and external parameter calibration method based on multi-coding plane target in space
CN113129396B (en) Decoding method of parallelogram coding mark based on region segmentation
CN110942076B (en) Method and system for generating anti-counterfeiting mark of ceramic product
KR101753360B1 (en) A feature matching method which is robust to the viewpoint change
CN110490924A (en) A kind of light field image feature point detecting method based on multiple dimensioned Harris
CN117576219A (en) Camera calibration equipment and calibration method for single shot image of large wide-angle fish-eye lens
CN113160329B (en) Coding plane target for camera calibration and decoding method thereof
CN110929782B (en) River channel abnormity detection method based on orthophoto map comparison
CN110570354B (en) Strip chessboard calibration plate-based close-range image splicing method
CN115272459A (en) Four-corner two-dimensional code directional plane target device and calibration method thereof
CN113129386B (en) Intelligent calibration method for internal and external parameters of binocular camera based on coding plane target
CN115222828A (en) Regular hexagon coding mark decoding method for visual positioning
Kim et al. Fast computation of a visual hull
CN113112550B (en) Coding plane target for calibrating internal and external parameters of camera and coding method thereof
CN113112549B (en) Monocular camera rapid calibration method based on coding stereo target

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