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 PDFInfo
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 108091026890 Coding region Proteins 0.000 claims description 38
- 238000000605 extraction Methods 0.000 claims description 15
- 238000012545 processing Methods 0.000 claims description 15
- 238000004422 calculation algorithm Methods 0.000 claims description 14
- 238000001514 detection method Methods 0.000 claims description 8
- 238000004590 computer program Methods 0.000 claims description 7
- 238000003491 array Methods 0.000 claims description 5
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 claims description 3
- 108700026244 Open Reading Frames Proteins 0.000 claims description 3
- 239000002131 composite material Substances 0.000 claims 5
- 238000005260 corrosion Methods 0.000 claims 1
- 230000007797 corrosion Effects 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 7
- 238000005259 measurement Methods 0.000 description 4
- 230000000007 visual effect Effects 0.000 description 3
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003628 erosive effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000003550 marker Substances 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T9/00—Image coding
- G06T9/20—Contour coding, e.g. using detection of edges
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
- G06T5/30—Erosion or dilatation, e.g. thinning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/62—Analysis of geometric attributes of area, perimeter, diameter or volume
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/66—Analysis 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 Processing (AREA)
- Image Analysis (AREA)
Abstract
本发明公开了一种基于图形几何关系的平行四边形编码标志的解码方法,该平行四边形编码标志由平行四边形背景图案和编码图案构成,编码图案在平行四边形背景图案的内部,包括定位图案、定向图案和编码组合图案,定向图案和定位图案用于平行四边形编码标志方向的判断;编码组合图案用于编码标志四个顶点进行编码。本发明提出的平行四边形编码标志中的编码图案,能够在相机标定、三维数据拼接等过程中自动判断所测目标与摄像机相对旋转方向,提高了灵活性;各组成部分图案的位置均通过图形几何关系和矢量积的方法加以区分,具有较强的鲁棒性;该解码方法极大地提高了解码的准确性;具有高效性、解码速度快的优点,可实现实时解码。
The invention discloses a decoding method of a parallelogram coding mark based on a graphic geometric relationship. The parallelogram coding mark is composed of a parallelogram background pattern and a coding pattern, and the coding pattern is inside the parallelogram background pattern, including a positioning pattern and an orientation pattern. And the coding combination pattern, the orientation pattern and the positioning pattern are used for the judgment of the direction of the parallelogram coding mark; the coding combination pattern is used for coding the four vertices of the coding mark. The coding pattern in the parallelogram coding mark proposed by the present invention can automatically determine the relative rotation direction of the measured target and the camera in the process of camera calibration, three-dimensional data splicing, etc., thereby improving flexibility; the position of each component pattern is determined by graphic geometry. The method of relation and vector product is distinguished, and has strong robustness; this decoding method greatly improves the accuracy of decoding; it has the advantages of high efficiency and fast decoding speed, and can realize real-time decoding.
Description
技术领域technical field
本发明涉及计算机视觉中的视觉测量领域,具体为一种基于图形几何关系的平行四边形编码标志的解码方法,适用于相机标定、目标特征提取、立体匹配和三维数据拼接等领域。The invention relates to the field of visual measurement in computer vision, in particular to a method for decoding parallelogram coding marks based on graphic geometric relationships, which is suitable for the fields of camera calibration, target feature extraction, stereo matching and three-dimensional data splicing.
背景技术Background technique
在视觉测量中,对于被测物进行特征识别与匹配是该领域的研究热点之一。但是对于高分辨率的大视场或其他复杂背景的情况下,特征提取与匹配的准确度不能满足精度要求,而通过在被测物表面设置编码标志,可极大提高目前特征提取与匹配的速度与精度,同时也能解决多幅图像的匹配问题。因此,对编码标志的设计与识别是视觉测量中的关键环节。In visual measurement, feature recognition and matching of measured objects is one of the research hotspots in this field. However, in the case of a high-resolution large field of view or other complex backgrounds, the accuracy of feature extraction and matching cannot meet the accuracy requirements, and by setting coding marks on the surface of the measured object, the current feature extraction and matching can be greatly improved. Speed and accuracy, and can also solve the matching problem of multiple images. Therefore, the design and identification of coding marks is a key link in visual measurement.
1972年,Russo和Knockeart通过利用标记点的独有的特性实现了编译与识别,从那以后,编码标记点技术便飞速发展。为了满足工业测量的要求,出现的编码标志点类型有很多,但大多都为环形、圆形或扇形等,而这些编码标志点存在以下缺陷:拍摄角度发生变化时,部分编码产生变形,从而影响精度;编码的容量较小,面对尺寸较大的目标无能为力等。In 1972, Russo and Knockeart achieved compilation and recognition by exploiting the unique properties of markers, and coding marker technology has developed rapidly since then. In order to meet the requirements of industrial measurement, there are many types of coding marks, but most of them are annular, circular or fan-shaped, etc. These coding marks have the following defects: when the shooting angle changes, part of the coding is deformed, which affects the Accuracy; the encoding capacity is small, and it is powerless to face the target of large size.
发明内容SUMMARY OF THE INVENTION
本发明旨在克服现有编码标志的缺陷,提出了一种基于图形几何关系的平行四边形编码标志的解码方法,适用于大视场下的多目立体视觉标定,对仿射变换的图像具有很好的稳定性,编码容量大,针对尺寸较大的目标也能有较高的编码精度和准确性。The invention aims to overcome the defects of the existing coding marks, and proposes a decoding method of a parallelogram coding mark based on the geometric relationship of the figures, which is suitable for multi-eye stereo vision calibration under a large field of view, and has a great effect on affine transformed images. Good stability, large coding capacity, and high coding precision and accuracy for targets with larger sizes.
为实现上述效果,本发明采用的技术方案为:In order to realize the above-mentioned effect, the technical scheme adopted in the present invention is:
一种基于图形几何关系的平行四边形编码标志的解码方法,所述编码标志为正方形的编码方格,编码方格的表面设置有平行四边形背景图案和编码图案,所述编码图案位于平行四边形背景图案的内部,所述编码图案包括定位图案、定向图案和编码组合图案,所述定向图案和定位图案用于平行四边形编码标志方向的判断,所述编码组合图案用于平行四边形编码标志各个角点的编码,每个编码组合图案均由一个编码组合定向图案和三个编码组合编码图案组成。利用数字图像处理的方法获得摄像机拍摄的包含N个平行四边形编码标志的图像中每个特征角点的编码序号和亚像素坐标,进而完成平行四边形编码标志解码的步骤如下:A method for decoding a parallelogram coding mark based on a graphic geometric relationship, the coding mark is a square coding square, the surface of the coding square is provided with a parallelogram background pattern and a coding pattern, and the coding pattern is located in the parallelogram background pattern Inside, the coding pattern includes a positioning pattern, a directional pattern and a coding combination pattern, the directional pattern and the positioning pattern are used for the judgment of the direction of the parallelogram coding mark, and the coding combination pattern is used for each corner of the parallelogram coding mark. coding, each coding combination pattern consists of one coding combination orientation pattern and three coding combination coding patterns. Utilize the method of digital image processing to obtain the coding sequence number and sub-pixel coordinates of each feature corner in the image containing N parallelogram coding marks captured by the camera, and then complete the steps of decoding the parallelogram coding marks as follows:
步骤1.1、利用摄像机拍摄空间中放置的N个平行四边形编码标志,获得编码标志图像,所述编码标志图像当中包含N个平行四边形编码标志;Step 1.1, utilize the N parallelogram coding marks placed in the camera shooting space to obtain a coding mark image, which contains N parallelogram coding marks in the middle of the coding mark image;
步骤1.2、建立角点的像素坐标系:Step 1.2, establish the pixel coordinate system of the corner points:
在上述拍摄的包含N个平行四边形编码标志的图像中,取图像左上角作为角点像素坐标系的原点o,自左向右为角点像素坐标系的x轴方向,自上向下作为角点像素坐标系的y轴方向,由此建立角点像素坐标系o-xy;In the above-mentioned image containing N parallelogram coding marks, the upper left corner of the image is taken as the origin o of the corner pixel coordinate system, the x-axis direction of the corner pixel coordinate system is from left to right, and the corner is taken from top to bottom. The y-axis direction of the point pixel coordinate system, thereby establishing the corner pixel coordinate system o-xy;
步骤2.1、对编码标志图像进行8位灰度处理,得到编码标志灰度图像P1;其中,编码标志灰度图像P1为8位灰度图;Step 2.1, performing 8-bit grayscale processing on the encoded mark image to obtain the encoded mark grayscale image P 1 ; wherein, the encoded mark grayscale image P 1 is an 8-bit grayscale image;
步骤2.2、对编码标志灰度图像P1进行复制备份,得到编码标志灰度备份图像P1′;Step 2.2, duplicating and backing up the grayscale image P1 of the coding mark to obtain a grayscale backup image P1 ' of the coding mark;
步骤2.3、对编码标志灰度备份图像P1′进行二值化处理,使得每个平行四边形编码标志的背景颜色均为黑色(即灰度值为0),每个平行四边形编码标志内的定向图案和定位图案均为白色(即灰度值为255),编码单元图案的颜色根据平行四边形编码标志的编码规则可以为白色也可以为黑色,进而得到编码标志二值化图像P2;Step 2.3. Binarize the grayscale backup image P 1 ′ of the coding mark, so that the background color of each parallelogram coding mark is black (that is, the gray value is 0), and the orientation in each parallelogram coding mark is The pattern and the positioning pattern are both white (that is, the gray value is 255), and the color of the coding unit pattern can be white or black according to the coding rule of the parallelogram coding mark, and then obtain the coding mark binarization image P 2 ;
步骤3、设定黑色连通域圆度阈值λ′,像素点个数阈值λ″;Step 3. Set the black connected domain circularity threshold λ′ and the pixel number threshold λ″;
步骤4.1、计算编码标志二值化图像P2中所有黑色连通域的圆度值λn和像素点个数cn,其中每个黑色连通域的圆度值可由式(1)得出,Step 4.1. Calculate the circularity value λ n and the number of pixels c n of all black connected domains in the coded mark binarized image P 2 , wherein the circularity value of each black connected domain can be obtained from formula (1),
其中,ln代表对应黑色连通域轮廓的周长,sn代表对应黑色连通域的面积,n=1,2,3,4...;Among them, l n represents the perimeter of the corresponding black connected domain outline, s n represents the area of the corresponding black connected domain, n=1, 2, 3, 4...;
步骤4.2、选择合适的黑色连通域圆度阈值λ′和像素点个数阈值λ″可以在编码标志二值化图像P2中获得N个平行四边形编码标志中各自所对应的N个定向圆环中心的黑色连通域;将N个定向圆环中心的黑色连通域分别记为编码标志二值化图像P2中的圆环黑色连通域M1、圆环黑色连通域M2、圆环黑色连通域M3、…、圆环黑色连通域MN,并将圆环黑色连通域M1、圆环黑色连通域M2、圆环黑色连通域M3、…、圆环黑色连通域MN依次放入圆环黑色连通域集合A′中,即圆环黑色连通域M1、圆环黑色连通域M2、圆环黑色连通域M3、…、圆环黑色连通域MN分别为圆环黑色连通域集合A′中的第1个元素、第2个元素、…、第N个元素;由此获得编码标志二值化图像P2中的所有N个平行四边形编码标志中定向圆环内部的黑色连通域;其中,编码标志二值化图像P2中的圆环黑色连通域M1、圆环黑色连通域M2、圆环黑色连通域M3、…、圆环黑色连通域MN的圆度值均小于圆度阈值λ′,并且圆环黑色连通域M1、圆环黑色连通域M2、圆环黑色连通域M3、…、圆环黑色连通域MN的像素点个数均大于像素点个数阈值λ″;Step 4.2, select the appropriate black connected domain circularity threshold λ′ and pixel number threshold λ″ to obtain N directional rings corresponding to each of the N parallelogram coding marks in the coding mark binarization image P 2 The black connected domain in the center; the black connected domain at the center of the N directional rings are respectively recorded as the black connected domain M 1 of the ring, the black connected domain M 2 of the ring, and the black connected domain of the ring in the binarized image P 2 of the coding mark. The domain M 3 , ..., the ring black connected domain M N , and the ring black connected domain M 1 , the torus black connected domain M 2 , the torus black connected domain M 3 , ... , the ring black connected domain M N in turn Put it into the set of black connected domains A', namely the black connected domain M 1 , the black connected domain M 2 , the black connected domain M 3 , ... and the black connected domain M N are respectively torus The first element, the second element, . The black connected domain of ; wherein, the circular black connected domain M 1 , the circular black connected domain M 2 , the circular black connected domain M 3 , ..., the circular black connected domain M N in the binarized image P 2 of the coding mark The circularity values of , are all less than the circularity threshold λ′, and the black connected domain M 1 , the black connected domain M 2 , the black connected domain M 3 , ..., the black connected domain MN of the circular ring are pixel points The number is greater than the threshold λ″ of the number of pixels;
步骤4.3、取整数变量i并赋值i=1;Step 4.3, take the integer variable i and assign i=1;
步骤4.4、计算圆环黑色连通域集合A′中的第i个圆环黑色连通域Mi的质心像素坐标并记为o″d,i(x″d,i,y″d,i),将得到的第i个圆环黑色连通域Mi的质心像素坐标o″d,i(x″d,i,y″d,i)作为圆环黑色连通域质心集合A的第i元素;Step 4.4. Calculate the pixel coordinates of the centroid of the i -th ring black connected domain Mi in the black connected domain set A′ and denote it as o″ d,i (x″ d,i ,y″ d,i ), Take the obtained centroid pixel coordinate o″ d,i (x″ d,i ,y″ d,i ) of the i-th annular black connected domain Mi as the i -th element of the centroid set A of the annular black connected domain;
步骤4.5、判断i是否小于N,若i<N,则将i+1赋值给i,返回步骤4.4顺序执行;否则,即获得了编码标志二值化图像P2中各个圆环黑色连通域的质心像素坐标o″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),并依次放入圆环黑色连通域质心集合A中;Step 4.5, judge whether i is less than N, if i<N, assign i+ 1 to i, and return to step 4.4 to execute in sequence; Centroid pixel coordinates o″ 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 ), and put them into the set A of centroids of the black connected domain of the ring in turn;
步骤5、取整数变量ζ并赋值ζ=1;
步骤6.1、将编码标志二值化图像P2进行两次复制备份,分别得到第ζ组第1个备份二值化图像P′ζ,1和第ζ组第2个备份二值化图像P′ζ,2;Step 6.1. Make two copies of the coding mark binarized image P 2 to obtain the first backup binarized image P′ ζ,1 of the ζ group and the second backup binarized image P′ of the ζ group respectively. ζ,2 ;
步骤6.2、利用去除编码标志复杂背景算法对第ζ组第1个备份二值化图像P′ζ,1进行数字图像处理,得到第ζ个无复杂背景平行四边形二值化图像P″ζ,1;Step 6.2. Use the complex background removal algorithm to perform digital image processing on the first backup binarized image P′ ζ,1 of the ζth group to obtain the ζth parallelogram binarized image without complex background P″ ζ,1 ;
在所述第ζ个无复杂背景平行四边形二值化图像P″ζ,1中,包含质心像素坐标值(x″d,ζ,y″d,ζ)的平行四边形编码标志内部的所有像素点的灰度值被置为255(即白色),包含质心像素坐标值(x″d,ζ,y″d,ζ)的平行四边形编码标志外部的所有像素点的灰度值值被置为0(即黑色);In the ζth non-complex background parallelogram binarized image P″ ζ,1 , all the pixels inside the parallelogram coding mark containing the centroid pixel coordinate values (x″ d,ζ ,y″ d,ζ ) is set to 255 (that is, white), and the gray value of all pixels outside the parallelogram coding mark containing the centroid pixel coordinate value (x″ d, ζ , y″ d, ζ ) are set to 0. (i.e. black);
步骤7.1、对编码标志灰度图像P1再次进行复制备份,获得第ζ个备份灰度图像Pζ″′;Step 7.1, copy and backup the coding mark grayscale image P1 again to obtain the ζth backup grayscale image Pζ ″′;
步骤7.2、利用角点检测算法在第ζ个无复杂背景平行四边形二值化图像P″ζ,1中提取4个角点的亚像素坐标,并记为第ζ个无复杂背景平行四边形二值化图像P″ζ,1上的4个备选角点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.2. Use the corner detection algorithm to extract the sub-pixel coordinates of the 4 corner points in the ζth non-complex background parallelogram binarized image P″ ζ,1 , and record them as the ζth non-complex background parallelogram binary image Four candidate corner points C″ ζ,1 (x″ ζ,1 ,y″ ζ,1 ), C″ ζ,2 (x″ ζ,2 ,y″ ζ ,1 on the transformed image P″ ζ,1 , 2 ), C″ ζ,3 (x″ ζ,3 ,y″ ζ,3 ), C″ ζ,4 (x″ ζ,4 ,y″ ζ,4 );
步骤7.3、在第ζ个无复杂背景平行四边形二值化图像P″ζ,1中做黑色连通域腐蚀,使得第ζ个无复杂背景平行四边形二值化图像P″ζ,1中的白色连通域扩大,在后续进行图像乘法运算时,能够保证运算结果图像中提取出完整的包含质心像素坐标值(x″d,ζ,y″d,ζ)的平行四边形编码标志的灰度图案且其4个特征角点保存完整;并将第ζ个无复杂背景平行四边形二值化图像P″ζ,1经过本步骤处理所得的图像记为第ζ个运算二值化图像P″ζ,2;Step 7.3. Perform black connected domain erosion in the ζth non-complex background parallelogram binarized image P″ ζ,1 , so that the white connected in the ζth non-complex background parallelogram binarized image P″ ζ,1 Domain expansion, in the subsequent image multiplication operation, it can ensure that the complete grayscale pattern of the parallelogram coding mark including the centroid pixel coordinate values (x″ d, ζ , y″ d, ζ ) is extracted from the result image and its The 4 characteristic corners are preserved completely; and the ζth binarized image P″ ζ,1 of a parallelogram without a complex background is recorded as the ζth arithmetic binarized image P″ ζ,2 through the image processed in this step;
步骤7.4、将第ζ个运算二值化图像P″ζ,2中灰度值为255的部分的值置为1,将第ζ个运算二值化图像P″ζ,2中灰度值为0的部分的值置为0,而后利用第ζ个运算二值化图像P″ζ,2和第ζ个备份灰度图像Pζ″′进行乘法运算,将得到的结果图像记为第ζ个覆盖结果图像Tζ;所述第ζ个覆盖结果图像Tζ中只含有包含质心像素坐标值(x″d,ζ,y″d,ζ)的平行四边形编码标志的图像信息,去除了其它平行四边形编码标志的图像信息;Step 7.4. Set the value of the part with the gray value of 255 in the ζth operation binarized image P″ ζ, 2 to 1, and set the gray value in the ζth operation binarized image P″ ζ,2 to 1. The value of the 0 part is set to 0, and then the binarized image P″ ζ,2 and the ζth backup grayscale image P ζ ″′ are used for multiplication, and the resulting image is recorded as the ζth The overlay result image T ζ ; the ζth overlay result image T ζ only contains the image information of the parallelogram coded mark including the centroid pixel coordinate values (x″ d, ζ , y″ d, ζ ), and other parallelograms are removed. The image information of the quadrilateral coding logo;
步骤7.5、利用角点检测算法在第ζ个覆盖结果图像Tζ中提取所有角点的亚像素坐标并存入第ζ个初选角点亚像素坐标集合Bζ中;其中,第ζ个初选角点亚像素坐标集合Bζ中存放了第ζ个覆盖结果图像Tζ上包含质心像素坐标值(x″d,ζ,y″d,ζ)的平行四边形编码标志的4个特征角点亚像素坐标值和干扰角点的亚像素坐标值,所述干扰角点是除特征角点以外的干扰角点;Step 7.5, using the corner detection algorithm to extract the sub-pixel coordinates of all corners in the ζ-th coverage result image T ζ and store them in the ζ-th preliminary corner sub-pixel coordinate set B ζ ; The sub-pixel coordinate set B ζ of the corner selection point stores the four characteristic corner points of the parallelogram coding mark containing the centroid pixel coordinate values (x″ d, ζ , y″ d, ζ ) on the ζth overlay result image T ζ . sub-pixel coordinate values and sub-pixel coordinate values of interference corners, where the interference corners are interference corners other than characteristic corners;
步骤7.6、取整数变量i并赋值i=1;Step 7.6, take the integer variable i and assign i=1;
步骤7.7、在所述第ζ个初选角点亚像素坐标集合Bζ中寻找距离亚像素坐标值(x″ζ,i,y″ζ,i)最近的角点亚像素坐标并记为C′ζ,i(x′ζ,i,y′ζ,i);Step 7.7, find the corner sub-pixel coordinate closest to the sub-pixel coordinate value (x″ ζ, i , y″ ζ, i ) in the ζ-th primary corner sub-pixel coordinate set B ζ and denote it as C ′ ζ,i (x′ ζ,i ,y′ ζ,i );
步骤7.8、判断i是否小于4,若i<4,则将i+1赋值给i并返回执行步骤7.7;否则,此时已经获得了第ζ个覆盖结果图像Tζ上包含质心像素坐标值(x″d,ζ,y″d,ζ)的平行四边形编码标志的4个特征角点的亚像素坐标C′ζ,1(x′ζ,1,y′ζ,1)、C′ζ,2(x′ζ,2,y′ζ,2)、C′ζ,3(x′ζ,3,y′ζ,3)、C′ζ,4(x′ζ,4,y′ζ,4),且执行步骤8.1;Step 7.8, judge whether i is less than 4, if i<4, then assign i+1 to i and return to step 7.7; otherwise, the ζth coverage result image T ζ has been obtained at this time. The sub-pixel coordinates 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 perform step 8.1;
步骤8.1、在第ζ组第2个备份二值化图像P′ζ,2上,将包含质心像素坐标值(x″d,ζ,y″d,ζ)的平行四边形编码标志记为第ζ个平行四边形编码标志;Step 8.1. On the second backup binarized image P′ζ,2 of the ζth group, mark the parallelogram encoding mark containing the centroid pixel coordinate values (x″ d,ζ , y″ d,ζ ) as the ζth a parallelogram coding mark;
步骤8.2、在第ζ组第2个备份二值化图像P′ζ,2上,选取亚像素坐标值分别为(x′ζ,1,y′ζ,1)、(x′ζ,2,y′ζ,2)、(x′ζ,3,y′ζ,3)、(x′ζ,4,y′ζ,4)的4个像素点作为第ζ个平行四边形编码标志的角点四边形Sζ的4个顶点,将4个顶点相连进而获得第ζ个平行四边形编码标志的角点四边形Sζ;Step 8.2. On the second backup binarized image P' ζ,2 of the ζ group, select the sub-pixel coordinate values as (x' ζ,1 ,y' ζ,1 ), (x' ζ,2 , y′ ζ,2 ), (x′ ζ,3 ,y′ ζ,3 ), (x′ ζ,4 ,y′ ζ,4 ) 4 pixels as the corners of the ζth parallelogram coding mark 4 vertices of quadrilateral S ζ , connect 4 vertices and then obtain the corner quadrilateral S ζ of the ζth parallelogram coding mark;
步骤9、在第ζ组第2个备份二值化图像P′ζ,2上,寻找距离质心像素坐标值(x″d,ζ,y″d,ζ)最近的白色连通域,并将此白色连通域的灰度值赋值为0;Step 9. On the second backup binarized image P′ ζ,2 of the ζ group, find the white connected domain closest to the centroid pixel coordinate value (x″ d, ζ , y″ d, ζ ), and use this The gray value of the white connected domain is assigned as 0;
步骤10、在第ζ组第2个备份二值化图像P′ζ,2上,第ζ个平行四边形编码标志的角点四边形Sζ内部的所有像素点的灰度值保持不变,将第ζ个平行四边形编码标志的角点四边形Sζ以外的所有像素点的灰度值赋值为255;Step 10: On the second backup binarized image P′ ζ,2 of the ζth group, the gray values of all the pixels inside the corner quadrilateral S ζ of the ζth parallelogram coding mark remain unchanged, and the The gray value assignment of all pixel points other than the corner quadrilateral S ζ of the ζ parallelogram coding marks is 255;
步骤11.1、在第ζ组第2个备份二值化图像P′ζ,2上,提取第ζ个平行四边形编码标志的角点四边形Sζ中所有的内、外轮廓,记为第ζ个平行四边形编码标志内的轮廓集合Dζ;Step 11.1. On the second backup binarized image P'ζ,2 of the ζth group, extract all the inner and outer contours in the corner quadrilateral S ζ of the ζth parallelogram coding mark, and denote it as the ζth parallelogram. A set of contours D ζ within the quadrilateral coded sign;
步骤11.2、统计第ζ个平行四边形编码标志内的轮廓集合Dζ内每个轮廓包含的像素点数,将包含像素点数第二多的轮廓记为第ζ组第2个备份二值化图像P′ζ,2上第ζ个平行四边形编码标志内的定位圆轮廓Gζ,计算其质心像素坐标并记为第ζ组第2个备份二值化图像P′ζ,2上第ζ个平行四边形编码标志内的定位圆质心像素坐标o′l,ζ(x′l,ζ,y′l,ζ);Step 11.2. Count the number of pixels contained in each contour in the contour set Dζ in the ζth parallelogram coding mark, and record the contour containing the second largest number of pixels as the second backup binarized image P′ of the ζth group The positioning circle outline G ζ in the ζ-th parallelogram coding mark on ζ,2 is calculated and its centroid pixel coordinates are calculated and recorded as the ζ-th group of the second backup binarized image P′ ζ,2 on the ζ-th parallelogram coding Pixel coordinates of the centroid of the positioning circle in the sign o′ l,ζ (x′ l,ζ ,y′ l,ζ );
步骤12、将第ζ个平行四边形编码标志内的轮廓集合Dζ内4个包含像素点数最少的轮廓记为编码组合定向图案轮廓Zζ,1、编码组合定向图案轮廓Zζ,2、编码组合定向图案轮廓Zζ,3、编码组合定向图案轮廓Zζ,4,并分别计算其质心 Step 12, the 4 contours containing the least number of pixels in the contour set D ζ in the ζ-th parallelogram coding mark are marked as the coding combination directional pattern outline Z ζ,1 , the coding combination directional pattern outline Z ζ,2 , the coding combination The directional pattern profile Z ζ,3 and the encoded combined directional pattern profile Z ζ,4 and their centroids are calculated respectively
步骤13.1、根据第ζ个平行四边形编码标志内的轮廓集合Dζ中,除去包含像素点数最多的两个轮廓以及包含像素点数最少的4个轮廓,剩余轮廓个数κζ的大小分为如下情况:Step 13.1, according to the contour set D ζ in the ζth parallelogram coding mark, remove the two contours that contain the largest number of pixels and the 4 contours that contain the least number of pixels, and the size of the remaining contours κ ζ is divided into the following situations: :
(1)若κζ==0,则执行步骤14.1;(1) If κ ζ == 0, execute step 14.1;
(2)若κζ≠0,则这κζ个轮廓即为第ζ个平行四边形编码标志内编码组合编码图案的轮廓,分别记为编码组合图案编码组合图案…、编码组合图案 (2) If κ ζ ≠ 0, then these κ ζ contours are the contours of the coded combination coding pattern in the ζth parallelogram coding mark, which are respectively denoted as coding combination patterns Coded Combination Patterns ..., coding combination pattern
步骤14.1、给整数变量i并赋予初值i=1;Step 14.1, give integer variable i and initial value i=1;
步骤14.2、在第ζ组第2个备份二值化图像P′ζ,2上,计算编码组合图案的质心将i+1重新赋值给i后继续执行此步骤,直到i>κζ结束;由此可以得到对应编码组合图案编码组合图案…、编码组合图案的质心像素坐标 Step 14.2, on the second backup binarized image P′ ζ,2 of the ζ group, calculate the coding combination pattern centroid of Continue to perform this step after reassigning i+1 to i, until i> κζ ends; thus the corresponding coding combination pattern can be obtained Coded Combination Patterns ..., coding combination pattern The centroid pixel coordinates of
步骤15.1、在第ζ组第2个备份二值化图像P′ζ,2上,记在第ζ个平行四边形编码标志中位于第1编码区域、第2编码区域、第3编码区域和第4编码区域的特征角点的亚像素坐标分别为Cζ,1(xζ,1,yζ,1)、Cζ,2(xζ,2,yζ,2)、Cζ,3(xζ,3,yζ,3)、Cζ,4(xζ,4,yζ,4);并在第ζ组第2个备份二值化图像P′ζ,2上,将像素坐标值为的(x′d,ζ,y′d,ζ)的像素点记为第ζ组第2个备份二值化图像P′ζ,2上第ζ个平行四边形编码标志的定向圆环质心o′d,ζ(x′d,ζ,y′d,ζ),并将亚像素坐标值为(x′ζ,1,y′ζ,1)、(x′ζ,2,y′ζ,2)、(x′ζ,3,y′ζ,3)、(x′ζ,4,y′ζ,4)的4个像素点分别记为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.1. On the second backup binarized image P'ζ,2 of the ζth group, record the ζth parallelogram coding marks in the 1st coding area, the 2nd coding area, the 3rd coding area and the 4th coding area. The sub-pixel coordinates of the feature corners of the coding region are C ζ,1 (x ζ,1 ,y ζ,1 ), C ζ,2 (x ζ,2 ,y ζ,2 ), C ζ,3 (x ζ,2 ), respectively. ζ,3 ,y ζ,3 ), C ζ,4 (x ζ,4 ,y ζ,4 ); and on the second backup binarized image P′ ζ,2 of the ζth group, the pixel coordinate value The pixel point of (x′ d,ζ , y′ d,ζ ) is denoted as the centroid o ′ d,ζ (x′ d,ζ ,y′ d,ζ ), and set the sub-pixel coordinate values as (x′ ζ,1 ,y′ ζ,1 ), (x′ ζ,2 ,y′ ζ, 2 ), (x′ ζ,3 ,y′ ζ,3 ), (x′ ζ,4 ,y′ ζ,4 ) 4 pixels are denoted 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 );
步骤15.2在第ζ组第2个备份二值化图像P′ζ,2上,第ζ个平行四边形编码标志中的方向向量由公式(2)得出,Step 15.2 On the second backup binarized image P'ζ,2 of the ζth group, the direction vector in the ζth parallelogram coding mark According to formula (2),
步骤16、在第ζ组第2个备份二值化图像P′ζ,2上,找出4个像素点C″′ζ,1(x″′ζ,1,y″′ζ,1)、C″′ζ,2(x″′ζ,2,y″′ζ,2)、C″′ζ,3(x″′ζ,3,y″′ζ,3)、C″′ζ,4(x″′ζ,4,y″′ζ,4)中距离定位圆质心的像素坐标o′l,ζ(x′l,ζ,y′l,ζ)最近的2个像素点,分别记为Cζ,1min(xζ,1min,yζ,1min)和Cζ,2min(xζ,2min,yζ,2min);Step 16. On the second backup binarized image P′ ζ,2 of the ζ group, find 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 ) are the two nearest pixels to the pixel coordinates o′ l,ζ (x′ l,ζ ,y′ l,ζ ) of the centroid of the positioning circle, respectively record are C ζ,1min (x ζ,1min ,y ζ,1min ) and C ζ,2min (x ζ,2min ,y ζ,2min );
在4个像素点中找到第ζ个平行四边形编码标志中第2编码区域和第3编码区域的特征角点的亚像素坐标值并分别赋值给Cζ,2(xζ,2,yζ,2)和Cζ,3(xζ,3,yζ,3);Find the sub-pixel coordinate values of the characteristic corners of the second coding area and the third coding area in the ζth parallelogram coding mark in the 4 pixel points and assign them to C ζ,2 (x ζ,2 ,y ζ, 2 ) and C ζ,3 (x ζ,3 ,y ζ,3 );
通过公式(3)和(4)计算出在第ζ个平行四边形编码标志中的第1判断向量和第2判断向量并通过式(5)和式(6)计算出第1区域划分正弦值sinαζ和第2区域划分正弦值sinβζ;Calculate the first judgment vector in the ζth parallelogram coding mark by formulas (3) and (4) and the second judgment vector And by formula (5) and formula (6), calculate the 1st area division sine value sinα ζ and the 2nd area division sine value sinβ ζ ;
分以下两种情况执行:Execute in the following two cases:
(1)若sinαζ<0,sinβζ>0,则Cζ,1min(xζ,1min,yζ,1min)为第ζ个平行四边形编码标志中第3编码区域的特征角点,把Cζ,1min(xζ,1min,yζ,1min)的亚像素坐标值赋值给Cζ,3(xζ,3,yζ,3);Cζ,2min(xζ,2min,yζ,2min)为第ζ个平行四边形编码标志中第2编码区域的特征角点,把Cζ,2min(xζ,2min,yζ,2min)的亚像素坐标值赋值给Cζ,2(xζ,2,yζ,2);(1) If sinα ζ <0, sinβ ζ >0, then C ζ,1min (x ζ,1min ,y ζ,1min ) is the characteristic corner point of the third coding region in the ζth parallelogram coding mark. The sub-pixel coordinate value of ζ,1min (x ζ,1min ,y ζ,1min ) is assigned to C ζ,3 (x ζ,3 ,y ζ,3 ); C ζ,2min (x ζ,2min ,y ζ, 2min ) is the characteristic corner point of the second coding region in the ζth parallelogram coding mark, and assign the sub-pixel coordinate value of C ζ,2min (x ζ,2min ,y ζ,2min ) to C ζ,2 (x ζ ) ,2 ,y ζ,2 );
(2)若sinαζ>0,sinβζ<0,则Cζ,2min(xζ,2min,yζ,2min)为第ζ个平行四边形编码标志中第3编码区域的特征角点,把Cζ,2min(xζ,2min,yζ,2min)的亚像素坐标值赋值给Cζ,3(xζ,3,yζ,3);Cζ,1min(xζ,1min,yζ,1min)为第ζ个平行四边形编码标志中第2编码区域的特征角点,把Cζ,1min(xζ,1min,yζ,1min)的亚像素坐标值赋值给Cζ,2(xζ,2,yζ,2);(2) If sinα ζ >0, sinβ ζ <0, then C ζ,2min (x ζ,2min ,y ζ,2min ) is the characteristic corner point of the third coding region in the ζth parallelogram coding mark. The sub-pixel coordinate value of ζ,2min (x ζ,2min ,y ζ,2min ) is assigned to C ζ,3 (x ζ,3 ,y ζ,3 ); C ζ,1min (x ζ,1min ,y ζ, 1min ) is the characteristic corner point of the second coding region in the ζth parallelogram coding mark, assign the sub-pixel coordinate value of C ζ,1min (x ζ,1min ,y ζ,1min ) to C ζ,2 (x ζ ) ,2 ,y ζ,2 );
步骤17、在第ζ组第2个备份二值化图像P′ζ,2上,通过上述步骤16已经在4个像素点C″′ζ,1(x″ζ,1,y″′ζ,1)、C″′ζ,2(x″′ζ,2,y″′ζ,2)、C″′ζ,3(x″′ζ,3,y″′ζ,3)、C″′ζ,4(x″′ζ,4,y″′ζ,4)中找到第ζ个平行四边形编码标志中第2编码区域和第3编码区域的特征角点的亚像素坐标值并分别赋值给了Cζ,2(xζ,2,yζ,2)和Cζ,3(xζ,3,yζ,3),将余下的2个像素点的亚像素坐标值分别赋值给第ζ个平行四边形编码标志的临时坐标值1,记为C′ζ,5(x′ζ,5,y′ζ,5),以及临时坐标值2,记为C′ζ,6(x′ζ,6,y′ζ,6);Step 17: On the second backup binarized image P′ ζ,2 of the ζ group, through the above step 16, the 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 ) find the sub-pixel coordinate values of the characteristic corners of the second coding region and the third coding region in the ζth parallelogram coding mark and assign them to C ζ,2 (x ζ,2 ,y ζ,2 ) and C ζ,3 (x ζ,3 ,y ζ,3 ), assign the sub-pixel coordinate values of the remaining two pixels to the ζth The temporary coordinate value 1 of a parallelogram coding mark is denoted as C′ ζ,5 (x′ ζ,5 ,y′ ζ,5 ), and the temporary coordinate value 2 is denoted as C′ ζ,6 (x′ ζ, 6 ,y′ ζ,6 );
根据公式(7)和(8)求出在第ζ个平行四边形编码标志中的第3判断向量和第4判断向量 According to formulas (7) and (8), the third judgment vector in the ζth parallelogram coding mark is obtained and the fourth judgment vector
步骤18、在第ζ组第2个备份二值化图像P′ζ,2上,根据第3判断向量和第4判断向量通过式(9)和式(10)得出第3区域划分正弦值sinωζ和第4区域划分正弦值sinξζ;Step 18: On the second backup binarized image P′ ζ,2 of the ζ group, according to the third judgment vector and the fourth judgment vector By formula (9) and formula (10), the 3rd area division sine value sinω ζ and the 4th area division sine value sinξ ζ are obtained;
根据sinωζ和sinξζ的取值情况,将C′ζ,5(x′ζ,5,y′ζ,5)或C′ζ,6(x′ζ,6,y′ζ,6)的亚像素坐标值赋值给Cζ,4(xζ,4,yζ,4)或Cζ,1(xζ,1,yζ,1);According to the value of sinω ζ and sinξ ζ , the C′ ζ,5 (x′ ζ,5 ,y′ ζ,5 ) or C′ ζ,6 (x′ ζ,6 ,y′ ζ,6 ) The sub-pixel coordinate value is assigned to C ζ,4 (x ζ,4 ,y ζ,4 ) or C ζ,1 (x ζ,1 ,y ζ,1 );
分以下两种情况执行:Execute in the following two cases:
(1)若sinωζ==0,sinξζ≠0,则C′ζ,5(x′ζ,5,y′ζ,5)即为第ζ个平行四边形编码标志中第4编码区域的特征角点,把C′ζ,5(x′ζ,5,y′ζ,5)的亚像素坐标值赋值给Cζ,4(xζ,4,yζ,4);C′ζ,6(x′ζ,6,y′ζ,6)为第ζ个平行四边形编码标志中第1编码区域的特征角点,把C′ζ,6(x′ζ,6,y′ζ,6)的亚像素坐标值赋值给Cζ,1(xζ,1,yζ,1);(1) If sinω ζ ==0, sinξ ζ ≠0, then C' ζ,5 (x' ζ,5 ,y' ζ,5 ) is the feature of the fourth coding region in the ζ-th parallelogram coding mark Corner point, assign the sub-pixel coordinate value of C′ ζ,5 (x′ ζ,5 ,y′ ζ,5 ) to C ζ,4 (x ζ,4 ,y ζ,4 ); C′ ζ,6 (x' ζ,6 ,y' ζ,6 ) is the characteristic corner point of the first coding region in the ζth parallelogram coding mark, set C' ζ,6 (x' ζ,6 ,y' ζ,6 ) The sub-pixel coordinate value of is assigned to C ζ,1 (x ζ,1 ,y ζ,1 );
(2)若sinωζ≠0,sinξζ==0,则C′ζ,6(x′ζ,6,y′ζ,6)即为第ζ个平行四边形编码标志中第4编码区域的特征角点,把C′ζ,6(x′ζ,6,y′ζ,6)的亚像素坐标值赋值给Cζ,4(xζ,4,yζ,4);C′ζ,5(x′ζ,5,y′ζ,5)为第ζ个平行四边形编码标志中第1编码区域的特征角点,把C′ζ,5(x′ζ,5,y′ζ,5)的亚像素坐标值赋值给Cζ,1(xζ,1,yζ,1);(2) If sinω ζ ≠0, sinξ ζ ==0, then C' ζ,6 (x' ζ,6 ,y' ζ,6 ) is the feature of the fourth coding region in the ζ-th parallelogram coding mark Corner point, assign the sub-pixel coordinate value of C′ ζ,6 (x′ ζ,6 ,y′ ζ,6 ) to C ζ,4 (x ζ,4 ,y ζ,4 ); C′ ζ,5 (x′ ζ,5 ,y′ ζ,5 ) is the characteristic corner point of the first coding region in the ζth parallelogram coding mark, set C′ ζ,5 (x′ ζ,5 ,y′ ζ,5 ) The sub-pixel coordinate value of is assigned to C ζ,1 (x ζ,1 ,y ζ,1 );
至此,在第ζ组第2个备份二值化图像P′ζ,2上找到了第ζ个平行四边形编码标志中第1编码区域的特征角点的亚像素坐标Cζ,1(xζ,1,yζ,1)、第2编码区域的特征角点的亚像素坐标Cζ,2(xζ,2,yζ,2)、第3编码区域的特征角点的亚像素坐标Cζ,3(xζ,3,yζ,3)和第4编码区域的特征角点的亚像素坐标Cζ,4(xζ,4,yζ,4);So far, the sub-pixel coordinates C ζ , 1 (x ζ, 1 , y ζ,1 ), the sub-pixel coordinates C ζ,2 (x ζ,2 ,y ζ,2 ) of the feature corners of the second coding region, and the sub-pixel coordinates C ζ of the feature corners of the third coding region ,3 (x ζ,3 ,y ζ,3 ) and the sub-pixel coordinates C ζ,4 (x ζ,4 ,y ζ,4 ) of the feature corners of the fourth coding region;
步骤19、在第ζ组第2个备份二值化图像P′ζ,2上将由特征角点Cζ,1(xζ,1,yζ,1)指向特征角点Cζ,4(xζ,4,yζ,4)的向量记为向量且由公式(11)得出:Step 19. On the second backup binarized image P′ ζ,2 of the ζ group, the feature corner point C ζ,1 (x ζ,1 ,y ζ,1 ) will point to the feature corner point C ζ,4 (x ζ,4 (x ζ,1 ) ζ,4 ,y ζ,4 ) vector is denoted as vector And from formula (11) we get:
取整数变量i并赋值i=1;Take integer variable i and assign i=1;
步骤20、在第ζ组第2个备份二值化图像P′ζ,2上,根据编码组合定向图案质心向量和方向向量通过公式(12)、(13)和(14)计算出第i编码组合判断向量编码组合判断余弦值和 Step 20. On the second backup binarized image P'ζ,2 of the ζth group, combine the directional pattern centroids according to the code vector and the direction vector The ith code combination judgment vector is calculated by formulas (12), (13) and (14) Code Combination Judgment Cosine and
分为以下四种情况执行:Divided into the following four cases:
(1)若且则为第3编码区域的编码组合定向图案质心,将赋值给o′z ζ,3(x′z ζ,3,y′z ζ,3);(1) If and but To orient the pattern centroids for the encoded combination of the 3rd encoded region, set the Assign to o′ z ζ,3 (x′ z ζ,3 ,y′ z ζ,3 );
(2)若且则为第2编码区域的编码组合定向图案质心,将赋值给o′z ζ,2(x′z ζ,2,y′z ζ,2);(2) If and but To orient the pattern centroids for the coded combination of the 2nd coded region, set the Assign to o′ z ζ,2 (x′ z ζ,2 ,y′ z ζ,2 );
(3)若且则为第1编码区域的编码组合定向图案质心,将赋值给o′z ζ,1(x′z ζ,1,y′z ζ,1);(3) If and but To orient the pattern centroids for the encoded combination of the 1st encoded region, set the Assign to o′ z ζ,1 (x′ z ζ,1 ,y′ z ζ,1 );
(4)若且则为第4编码区域的编码组合定向图案质心,将赋值给o′z ζ,4(x′z ζ,4,y′z ζ,4);(4) If and but To orient the pattern centroids for the coded combination of the 4th coded region, set the Assign to o′ z ζ,4 (x′ z ζ,4 ,y′ z ζ,4 );
判断i是否满足i<4,若i<4,则将i+1赋值给i,返回执行步骤20;否则,即得到了第ζ个平行四边形编码标志中第1编码区域的编码组合定向图案质心o′z ζ,1(x′z ζ,1,y′z ζ,1)、第2编码区域的编码组合定向图案质心o′z ζ,2(x′z ζ,2,y′z ζ,2)、第3编码区域的编码组合定向图案质心o″z ζ,3(x′z ζ,3,y′z ζ,3)和第4编码区域的编码组合定向图案质心o′z ζ,4(x′z ζ,4,y′z ζ,4),并继续执行步骤21;Judging whether i satisfies i<4, if i<4, then assign i+1 to i, and return to execute step 20; otherwise, obtain the coding combination orientation pattern centroid of the first coding region in the ζth parallelogram coding mark o′ z ζ,1 (x′ z ζ,1 ,y′ z ζ,1 ), the centroid of the encoding combined orientation pattern of the second encoding region o′ z ζ,2 (x′ z ζ,2 ,y′ z ζ , 2 ), the encoded combined orientation pattern centroid o″ z ζ,3 (x′ z ζ,3 ,y′ z ζ,3 ) of the third encoding region and the encoded combined orientation pattern centroid o′ z ζ of the fourth encoding region ,4 (x′ z ζ,4 ,y′ z ζ,4 ), and proceed to step 21;
步骤21、重新给整数变量i赋值i=1;Step 21, re-assign i=1 to the integer variable i;
步骤22、定义4个二维浮点型数组并初始化这4个二维数组中的所有元素,且赋值为-1;另外取4个整数变量初始化 Step 22. Define 4 two-dimensional floating point arrays And initialize all elements in these 4 two-dimensional arrays, and assign the value to -1; additionally take 4 integer variables initialization
步骤23、在第ζ组第2个备份二值化图像P′ζ,2上,计算第ζ个平行四边形编码标志中编码组合编码图案标志圆轮廓的质心像素坐标与定位圆中心o′l,ζ所形成的第ζ组第i区别向量 Step 23, on the 2nd backup binarized image P′ ζ,2 of the ζth group, calculate the circular outline of the code combination code pattern mark in the ζth parallelogram code mark The centroid pixel coordinates of The ζth group i-th difference vector formed by the center o′ l,ζ of the positioning circle
通过式(16)、式(17)计算 Calculated by formula (16) and formula (17)
分为以下四种情况执行:Divided into the following four cases:
(1)若且则令将赋值给若i>κζ-1,则执行步骤24,否则将i+1赋值给i,返回执行步骤23;(1) If and order Will assign to If i>κ ζ -1, then execute step 24, otherwise assign i+1 to i, and return to execute step 23;
(2)若且则令将赋值给若i>κζ-1,则执行步骤24,否则将i+1赋值给i,返回执行步骤23;(2) If and order Will assign to If i>κ ζ -1, then execute step 24, otherwise assign i+1 to i, and return to execute step 23;
(3)若且则令将赋值给若i>κζ-1,则执行步骤24,否则将i+1赋值给i,返回执行步骤23;(3) If and order Will assign to If i>κ ζ -1, then execute step 24, otherwise assign i+1 to i, and return to execute step 23;
(4)若且则令将赋值给若i>κζ-1,则执行步骤24,否则将i+1赋值给i,返回执行步骤23;(4) If and order Will assign to If i>κ ζ -1, then execute step 24, otherwise assign i+1 to i, and return to execute step 23;
步骤24.1、重新给整数变量i赋值i=1;Step 24.1, re-assign i=1 to the integer variable i;
步骤24.2、根据的取值情况,取整数变量和并赋值;Step 24.2, according to The value of the case, take the integer variable and and assign;
分为以下情况执行:Execute in the following cases:
(1)若则取整数变量和并赋值 (1) If take an integer variable and and assign
(2)若将数组中同一行元素均不为-1的元素分别记为和并分别赋值给oζ,1(xζ,1,yζ,1)的横坐标和纵坐标,并计算正弦值 (2) If the array The elements in the same row whose elements are not -1 are recorded as and And assign it to the abscissa and ordinate of o ζ,1 (x ζ,1 ,y ζ,1 ) respectively, and calculate the sine value
进行判断:To judge:
1)若则取整数变量和并赋值 1) If take an integer variable and and assign
2)若则取整数变量和并赋值 2) If take an integer variable and and assign
3)若则取整数变量和并赋值 3) If take an integer variable and and assign
(3)若将数组中同一行元素均不为-1的元素分别记为和和并分别赋值给oζ,1(xζ,1,yζ,1)的横坐标和纵坐标以及oζ,2(xζ,2,yζ,2)的横坐标和纵坐标,同时计算正弦值和 (3) If the array The elements in the same row whose elements are not -1 are recorded as and and and assign them to the abscissa and ordinate of o ζ,1 (x ζ,1 ,y ζ,1 ) and the abscissa and ordinate of o ζ,2 (x ζ,2 ,y ζ,2 ), and calculate at the same time Sine and
并进行判断:and make a judgment:
1)若或则取整数变量和并赋值 1) If or take an integer variable and and assign
2)若或则取整数变量和并赋值 2) If or take an integer variable and and assign
3)若或则取整数变量和并赋值 3) If or take an integer variable and and assign
(4)若则取整数变量和并赋值 (4) If take an integer variable and and assign
若i<4,将i+1赋值给i并返回执行步骤24.2;否则继续执行步骤25;If i<4, assign i+1 to i and return to step 24.2; otherwise, continue to step 25;
步骤25、通过公式(21)得出第ζ个平行四边形编码标志的编号Wζ:Step 25, obtain the number W ζ of the ζth parallelogram coding mark by formula (21):
Wζ=Vζ T·U (21)W ζ =V ζ T ·U (21)
其中,列向量U=(20,21,22,...211)T,列向量 Among them, the column vector U=(2 0 ,2 1 ,2 2 ,...2 11 ) T , the column vector
步骤26、记第ζ个平行四边形编码标志中属于第σ编码区域(其中σ=1,2,3,4)的特征角点的编码号为其中Wζ为标定角点所属编码方格的编号,σ的取值代表标定角点所属的第σ编码区域;Step 26, mark the code number of the characteristic corner point that belongs to the σth coding region (wherein σ=1,2,3,4) in the ζth parallelogram coding mark as where W ζ is the calibration corner The number of the coding square to which it belongs, and the value of σ represents the calibration corner the σth coding region to which it belongs;
至此获得了第ζ个平行四边形编码标志中4个特征角点各自的编码号与其相应的亚像素坐标值:So far, the respective code numbers of the 4 characteristic corner points in the zth parallelogram coding mark and their corresponding sub-pixel coordinate values have been obtained:
编码号为的特征角点的亚像素坐标值为(xζ,1,yζ,1);Code number is The sub-pixel coordinate value of the feature corner of is (x ζ,1 ,y ζ,1 );
编码号为的特征角点的亚像素坐标值为(xζ,2,yζ,2);Code number is The sub-pixel coordinate value of the feature corner of is (x ζ,2 ,y ζ,2 );
编码号为的特征角点的亚像素坐标值为(xζ,3,yζ,3);Code number is The sub-pixel coordinate value of the feature corner of is (x ζ,3 ,y ζ,3 );
编码号为的特征角点的亚像素坐标值为(xζ,4,yζ,4);Code number is The sub-pixel coordinate value of the feature corner of is (x ζ,4 ,y ζ,4 );
步骤27、判断ζ是否小于N,若满足,则将ζ+1重新赋值给ζ,并返回步骤6.1顺序执行;若不满足,则已经找到每个平行四边形编码标志上4个特征角点的亚像素坐标值和对应的编码号。Step 27, judge whether ζ is less than N, if satisfied, then ζ+1 is reassigned to ζ, and returns to step 6.1 to execute sequentially; If not satisfied, have found the sub of 4 characteristic corners on each parallelogram coding mark. Pixel coordinate value and corresponding code number.
进一步的,步骤6.1中,以获得的第ζ组第1个备份二值化图像P′ζ,1以及圆环黑色连通域质心集合A中第ζ个圆环黑色连通域质心像素坐标值(x″d,ζ,y″d,ζ)作为输入条件,利用去除编码标志复杂背景算法去除第ζ组第1个备份二值化图像P′ζ,1的复杂背景,并最终获得第ζ个无复杂背景平行四边形二值化图像P″ζ的步骤如下:Further, in step 6.1, the obtained first backup binarized image P′ ζ,1 of the ζth group and the pixel coordinate value (x " d, ζ , y" d, ζ ) as the input condition, the complex background of the first backup binarized image P′ ζ,1 of the ζ group is removed by using the complex background removal algorithm of coding marks, and finally the ζ-th non-complex background is obtained. The steps of binarizing the image P″ ζ of a parallelogram with a complex background are as follows:
步骤6.1.1、取整数变量i并赋值i=1;Step 6.1.1, take integer variable i and assign i=1;
步骤6.1.2、在第ζ组第1个备份二值化图像P′ζ,1上寻找距离像素坐标值(x″d,ζ,y″d,ζ)最近的白色连通域并记为第ζ组第1个备份二值化图像P′ζ,1上的第i个圆环白色连通域M′i,并将第i个圆环白色连通域M′i的灰度值均赋值为0;Step 6.1.2. Find the white connected domain closest to the pixel coordinate value (x″ d, ζ , y″ d, ζ ) on the first backup binarized image P′ ζ,1 of the ζ group and record it as the first The ith ring white connected domain M' i on the first backup binarized image P' ζ,1 of the ζ group, and the gray value of the ith ring white connected domain M' i is assigned to 0 ;
步骤6.1.3、判断i是否小于N,若i<N,则将i+1赋值给i,返回步骤6.1.2顺序执行;否则,将第ζ组第1个备份二值化图像P′ζ,1中所有平行四边形编码标志中的定向圆环置为黑色,并将第ζ组第1个备份二值化图像P′ζ,1经过本步骤处理后的图像记为第ζ个黑色背景提取图像P′ζ,b,并执行步骤6.1.4;Step 6.1.3, judge whether i is less than N, if i<N, assign i+1 to i, and return to step 6.1.2 to execute in sequence; otherwise, set the first backup binarized image P′ ζ of the ζ group , The orientation circles in all parallelogram coding marks in 1 are set to black, and the first backup binarized image P' ζ,1 of the ζ group is recorded as the ζ-th black background extraction image after this step is processed. image P' ζ,b , and perform step 6.1.4;
步骤6.1.4、在第ζ个黑色背景提取图像P′ζ,b上的所有黑色连通域中,寻找距离像素坐标值(x″d,ζ,y″d,ζ)最近的黑色连通域记为第ζ个黑色背景提取图像P′ζ,b上的第ζ个平行四边形背景黑色连通域Ωζ;Step 6.1.4. In all the black connected domains on the ζth black background extraction image P′ ζ,b , find the black connected domain mark that is closest to the pixel coordinate value (x″ d, ζ , y″ d, ζ ). Extract the black connected domain Ω ζ of the ζth parallelogram background on the image P′ ζ,b for the ζth black background;
步骤6.1.5、在第ζ个黑色背景提取图像P′ζ,b上提取第ζ个平行四边形背景黑色连通域Ωζ的所有内、外轮廓,获得第ζ个平行四边形背景黑色连通域Ωζ的内、外轮廓集合Vζ;Step 6.1.5. Extract all the inner and outer contours of the ζth parallelogram background black connected domain Ω ζ on the ζth black background extraction image P′ ζ,b to obtain the ζth parallelogram background black connected domain Ω ζ The inner and outer contour set V ζ of ;
步骤6.1.6、比较轮廓集合Vζ中所有轮廓的周长,将周长最长的轮廓记为第ζ个平行四边形背景黑色连通域Ωζ的外轮廓Eζ;Step 6.1.6, compare the perimeters of all contours in the contour set V ζ , and record the contour with the longest perimeter as the outer contour E ζ of the ζth parallelogram background black connected domain Ω ζ ;
步骤6.1.7、在第ζ个黑色背景提取图像P′ζ,b上,将外轮廓Eζ以内的所有像素点的灰度值赋值为255,外轮廓Eζ以外的所有像素点的灰度值赋值为0,从而获得第ζ个无复杂背景平行四边形二值化图像P″ζ;使得在第ζ个无复杂背景平行四边形二值化图像P″ζ中,包含质心像素坐标值(x″d,ζ,y″d,ζ)的平行四边形编码标志内部的所有像素点灰度值被置为255(即为白色),包含质心像素坐标值(x″d,ζ,y″d,ζ)的平行四边形编码标志外部的所有像素点灰度值被置为0(即为黑色)。Step 6.1.7. On the ζth black background extraction image P′ ζ,b , assign the gray value of all pixels within the outer contour E ζ to 255, and the gray value of all pixels outside the outer contour E ζ . The value is assigned as 0, so as to obtain the ζth non-complex background parallelogram binarized image P″ ζ ; so that in the ζth non-complex background parallelogram binarized image P″ ζ , the centroid pixel coordinate value (x″ ζ is included d,ζ ,y″ d,ζ ) The gray value of all pixels inside the parallelogram coding mark is set to 255 (that is, white), including the centroid pixel coordinate value (x″ d,ζ ,y″ d,ζ ) of the parallelogram coding mark outside the gray value of all pixels are set to 0 (ie black).
还提供了一种计算机可读存储介质,包括与具有图像处理功能的电子设备结合使用的计算机程序,所述计算机程序可被处理器执行以所述的解码方法。Also provided is a computer-readable storage medium comprising a computer program for use in conjunction with an electronic device having an image processing function, the computer program being executable by a processor to perform the decoding method.
与现有技术相比较,本发明的有益效果如下:Compared with the prior art, the beneficial effects of the present invention are as follows:
1、本发明提出的平行四边形编码标志中的编码图案,由定位图案、定向图案和编码组合图案构成,其中,定位图案和定向图案能够实现在相机标定、三维数据拼接等过程中,自动判断所测目标与摄像机相对旋转方向,提高了灵活性;1. The coding pattern in the parallelogram coding mark proposed by the present invention is composed of a positioning pattern, an orientation pattern and a coding combination pattern, wherein the positioning pattern and the orientation pattern can be realized in the process of camera calibration, three-dimensional data splicing, etc. The relative rotation direction of the measuring target and the camera improves the flexibility;
2、本发明提出的平行四边形编码标志中,包含四个编码组合图案,每个编码组合图案中包含三个编码组合编码图案,本发明提出的平行四边形编码标志共可产生4096种不同的编码,容量得以扩充,因此,针对尺寸较大的目标也能完成三维数据拼接;2, in the parallelogram coding mark proposed by the present invention, comprise four coding combination patterns, comprise three coding combination coding patterns in each coding combination pattern, the parallelogram coding mark proposed by the present invention can produce 4096 kinds of different codes altogether, The capacity can be expanded, so 3D data stitching can also be completed for targets with larger sizes;
3、本发明提出的平行四边形编码标志中,定向图案、定位图案和各编码组合图案的位置,以及各编码组合编码图案的位置均通过图形几何关系和矢量积的方法加以区分,因此,具有较强的鲁棒性,针对仿射变换的图像也能有较高的精度;3. In the parallelogram coding mark proposed by the present invention, the position of orientation pattern, positioning pattern and each coding combination pattern, and the position of each coding combination coding pattern are distinguished by the method of graphic geometric relationship and vector product. Strong robustness, high accuracy for affine transformed images;
4、本发明提出的一种基于图形几何关系的平行四边形编码标志的解码方法,能够有效地去除噪声的干扰,提出的去除复杂背景的方法极大地提高了解码的准确性;4. A decoding method for a parallelogram coding mark based on a graphic geometric relationship proposed by the present invention can effectively remove the interference of noise, and the proposed method for removing complex background greatly improves the accuracy of decoding;
5、本发明提出的一种基于图形几何关系的平行四边形编码标志的解码方法具有高效性,解码速度快,且可以实现实时解码。5. The decoding method of the parallelogram coding mark based on the graphic geometric relationship proposed by the present invention has high efficiency, fast decoding speed, and can realize real-time decoding.
附图说明Description of drawings
图1为本发明的平行四边形编码标志的示意图;Fig. 1 is the schematic diagram of the parallelogram coding mark of the present invention;
图2为本发明的平行四边形编码标志中,各顶点、角点以及各编码组合中编码图案的排列示意图;Fig. 2 is in the parallelogram coding mark of the present invention, the arrangement schematic diagram of coding pattern in each vertex, corner point and each coding combination;
图3为编码标志灰度图像P1的展示图;FIG. 3 is a display diagram of the grayscale image P 1 of the coding mark;
图4为在编码标志二值化图像P2的展示图;FIG. 4 is a display diagram of the binarized image P 2 at the coding mark;
图5为在编码标志二值化图像P2上提取圆环黑色连通域质心集合A的展示图;Fig. 5 is a display diagram of extracting the set A of centroids of annular black connected domains on the coded mark binarization image P2;
图6为第1个无复杂背景平行四边形二值化图像P″1,1的展示图;FIG. 6 is a display diagram of the first parallelogram binarized image P″ 1,1 without complex background;
图7为利用Harris检点检测算法提取第1个无复杂背景平行四边形二值化图像P″1,1中角点的亚像素坐标结果展示图;7 is a graph showing the result of extracting the sub-pixel coordinates of the corners of the first parallelogram binarized image P″ 1,1 without complex background using the Harris point detection algorithm;
图8为第1个无复杂背景平行四边形二值化图像P1″和第1个备份灰度图像P1″′做图像乘法后,所得到的第1个覆盖结果图像T1;FIG. 8 is the first overlay result image T 1 obtained after performing image multiplication between the first parallelogram binarized image P 1 ″ without complex background and the first backup grayscale image P 1 ″′;
图9为利用Harris检点检测算法提取第1个覆盖结果图像T1中角点的亚像素坐标结果展示图;9 is a graph showing the result of extracting the sub-pixel coordinates of the corner points in the first coverage result image T 1 by utilizing the Harris point detection algorithm;
图10为第1个无复杂背景编码标志二值化图像P1″的展示图;FIG. 10 is a display diagram of the first binarized image P 1 ″ without a complex background coding mark;
图11为本发明所述解码方法的流程示意图。FIG. 11 is a schematic flowchart of the decoding method according to the present invention.
具体实施方式Detailed ways
下面结合附图对本发明的较佳实施例进行详细阐述,以使本发明的优点和特征能更易于被本领域技术人员理解,从而对本发明的保护范围做出更为清楚明确的界定。The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, and the protection scope of the present invention can be more clearly defined.
请参阅图1,一种基于图形几何关系的平行四边形编码标志的解码方法,所述编码标志为正方形的编码方格,编码方格的表面设置有平行四边形背景图案和编码图案,所述编码图案位于平行四边形背景图案的内部,所述编码图案包括定位图案、定向图案和编码组合图案,所述定向图案和定位图案用于平行四边形编码标志方向的判断,所述编码组合图案用于平行四边形编码标志4个角点的编码,每个编码组合图案均由一个编码组合定向图案和三个编码组合编码图案组成。Please refer to Fig. 1, a kind of decoding method of the parallelogram coding mark based on the graphic geometrical relationship, the coding mark is a square coding square, and the surface of the coding square is provided with a parallelogram background pattern and a coding pattern, and the coding pattern Located inside the parallelogram background pattern, the encoding pattern includes a positioning pattern, an orientation pattern and a combined encoding pattern, the orientation pattern and the positioning pattern are used for the judgment of the direction of the parallelogram encoding mark, and the encoding combined pattern is used for the parallelogram encoding Codes that mark four corners, each code combination pattern is composed of one code combination orientation pattern and three code combination code patterns.
平行四边形编码标志中的定位图案、定向图案、所有的编码组合定向图案和所有的编码组合编码图案均不重叠且不连通。The positioning patterns, the orientation patterns, all the encoding combination orientation patterns and all the encoding combination encoding patterns in the parallelogram coding mark are non-overlapping and non-connected.
任取平行四边形编码标志的一个特征角点记为向量确定第一顶点o″1,在平行四边形编码标志上将相交形成向量确定第一顶点o″1的任意一条边记为向量确定第一边Nv1,在向量确定第一边Nv1上取平行四边形编码标志的顶点记为向量确定第二点o″2,其中向量确定第二点o″2与向量确定第一顶点o″1是互不重合的2个点,记向量为规定向量则平行四边形编码标志内的定位图案和定向图案的位置关系如下:平行四边形编码标志内由定向图案质心指向定位图案质心的方向与规定向量的方向相同。Take any characteristic corner of the parallelogram coding mark and mark it as a vector to determine the first vertex o" 1 , and on the parallelogram coding mark, any side that intersects to form a vector to determine the first vertex o" 1 is marked as a vector to determine the first side N v1 , take the vertex of the parallelogram coding mark on the first side N v1 of the vector determination and record it as the vector determination second point o″ 2 , wherein the vector determination second point o″ 2 and the vector determination first vertex o″ 1 are mutually 2 points that do not coincide, denote a vector is the specified vector Then the positional relationship between the positioning pattern and the orientation pattern in the parallelogram coding mark is as follows: the direction from the centroid of the orientation pattern to the centroid of the positioning pattern in the parallelogram encoding mark is the same as the specified vector. in the same direction.
将平行四边形编码标志在的平面记为标志平面Pt,以向量确定第一顶点o″1为起点做一个与规定向量同向的单位向量记为第1个规定单位向量当人正视看向平行四边形编码标志时,以向量确定第一顶点o″1为旋转中心,在标志平面Pt内将第1个规定单位向量逆时针旋转β′角度(0°<β′<90°)得到第2个规定单位向量在空间中以向量确定第一顶点o″1为起点做一个与所得向量的方向相同的单位向量,并记为正向向量将距离平行四边形编码标志中定向图案最近的两个特征角点分别记为第1临时顶点o″3和第2临时顶点o″4;若向量叉乘规定向量所得向量的方向与正向向量的方向相同,则将记为向量辅助向量若向量叉乘规定向量所得向量的方向与正向向量的方向相同,则将向量记为辅助向量 Denote the plane on which the parallelogram coding mark is located as the mark plane P t , and take the first vertex o″ 1 determined by the vector as the starting point to make a vector with the specified vector The unit vector in the same direction is recorded as the first specified unit vector When a person looks directly at the parallelogram coding mark, the first vertex o″ 1 determined by the vector is used as the rotation center, and the first specified unit vector is set in the mark plane P t Rotate the angle β′ counterclockwise (0°<β′<90°) to obtain the second specified unit vector Make an and The resulting vector is a unit vector with the same direction as the forward vector The two characteristic corner points closest to the orientation pattern in the parallelogram coding mark are recorded as the first temporary vertex o″ 3 and the second temporary vertex o″ 4 ; if the vector cross product specified vector The direction and forward vector of the resulting vector in the same direction, it will be recorded as a vector auxiliary vector if vector cross product specified vector The direction and forward vector of the resulting vector in the same direction, the vector denoted as auxiliary vector
记平行四边形编码标志中的平行四边形背景图案的颜色为颜色1,平行四边形编码标志中的定向图案、定位图案、所有的编码组合定向图案和所有的编码组合编码图案的颜色均为颜色2,其中,颜色1与颜色2具有明显的差异。本实施例中,平行四边形编码标志中的平行四边形背景图案的颜色为黑色(颜色1),平行四边形编码标志中的定向图案、定位图案、所有的编码组合定向图案和所有的编码组合编码图案的颜色均为白色(颜色2)。Note that the color of the parallelogram background pattern in the parallelogram coding sign is color 1, and the colors of the orientation pattern, positioning pattern, all coding combination orientation patterns and all coding combination coding patterns in the parallelogram coding sign are color 2, wherein , Color 1 is significantly different from Color 2. In this embodiment, the color of the parallelogram background pattern in the parallelogram coding sign is black (color 1), and the orientation pattern, positioning pattern, all coding combination orientation patterns and all coding combination coding patterns in the parallelogram coding sign All colors are white (color 2).
在平行四边形编码标志内部,将所有编码组合编码图案的面积中的最小面积记为编码组合编码图案最小面积,平行四边形编码标志内部的定向图案、所有编码组合定向图案和所有编码组合编码图案的面积大小满足如下关系:平行四边形编码标志内部的所有编码组合编码图案的面积均小于平行四边形编码标志内部的定向图案的面积,并且平行四边形编码标志内部的所有编码组合定向图案的面积均小于编码组合编码图案最小面积。本实施例中,定向图案为直径12毫米的圆形连通域,编码组合定向图案为直径3毫米的圆形连通域,编码组合编码图案为直径6毫米的圆形连通域,定位图案为外圆直径12毫米内圆直径5毫米的圆环连通域,如图1所示。Inside the parallelogram coding mark, the smallest area among the areas of all coding combined coding patterns is recorded as the minimum area of the coding combined coding pattern, the area of the directional pattern, all coding combined directional patterns and all coding combined coding patterns inside the parallelogram coding mark The size satisfies the following relationship: the area of all the coding combination coding patterns inside the parallelogram coding mark is smaller than the area of the directional pattern inside the parallelogram coding mark, and the area of all coding combination directional patterns inside the parallelogram coding mark is smaller than the coding combination coding Pattern minimum area. In this embodiment, the directional pattern is a circular connected domain with a diameter of 12 mm, the coding combined directional pattern is a circular connected domain with a diameter of 3 mm, the coding combined coding pattern is a circular connected domain with a diameter of 6 mm, and the positioning pattern is an outer circle A circular connected domain with a diameter of 12 mm and an inner circle of 5 mm in diameter is shown in Figure 1.
定向图案与定位图案的位置需满足以下要求:记定向图案的几何中心与定位图案的几何中心连成的线段为l1,那么线段l1必需与平行四边形格任意一条边平行,并且线段l1的中点p1在平行四边形格的几何中心点附近处。四个编码组合的位置需满足以下要求:将线段l1的中点p1分别与平行四边形格四条边的中点连接,形成四条线段,得到的四条线段将整个平行四边形格分割成四个区域。那么,四个编码组合定向图案分别位于四个区域内部,并且每个编码组合定向图案的几何中心在各自所在区域的几何中心点附近处。并且,平行四边形格的四个顶点中,每个顶点有且仅有一个与之距离最近的编码组合定向图案,即每个顶点与四个编码组合定向图案几何中心的直线距离中,有且仅有一个直线距离最短的编码组合定向图案。The position of the orientation pattern and the positioning pattern must meet the following requirements: the line segment formed by the geometric center of the orientation pattern and the geometric center of the positioning pattern is l 1 , then the line segment l 1 must be parallel to any side of the parallelogram, and the line segment l 1 The midpoint p 1 of is near the geometric center point of the parallelogram lattice. The positions of the four code combinations need to meet the following requirements: connect the midpoint p 1 of the line segment l 1 to the midpoint of the four sides of the parallelogram lattice to form four line segments, and the obtained four line segments divide the entire parallelogram lattice into four regions . 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 near the geometric center point of the respective region. And, among the four vertices of the parallelogram lattice, each vertex has and only one coding combination orientation pattern with the closest distance to it, that is, in the straight-line distance between each vertex and the geometric center of the four coding combination orientation patterns, there are and only There is a coded combination directional pattern with the shortest straight-line distance.
同时,四个编码组合定向图案中,有两个编码组合定向图案与定向图案的距离明显比与定位图案的距离更近。同样的,另外两个编码组合定向图案与定位图案的距离明显比与定向图案的距离更近。如图2所示,每个编码组合内,3个编码组合编码图案的位置需满足以下要求:记定向图案为A1,其几何中心为a1,定位图案为A2,其几何中心为a2,由a1出发引向a2的有向线段,称为标准矢量α。在四个编码组合中,记第Y编码组合定向图案为CY,其几何中心为cY,在第Y编码组合内,第Y编码组合第1编码图案为DY1,其几何中心为dY1,第Y编码组合第2编码图案为DY2,其几何中心为dY2,第Y编码组合第3编码图案为DY3,其几何中心为dY3。由第Y编码组合定向图案CY的几何中心cY出发,分别引向第Y编码组合第1编码图案DY1的几何中心dY1、第Y编码组合第2编码图案DY2的几何中心dY2、第Y编码组合第3编码图案DY3的几何中心dY3的有向线段,分别称为矢量γY1、矢量γY2、矢量γY3。同时矢量γY1、矢量γY2、矢量γY3分别与标准矢量α的矢量积γY1×α、γY2×α、γY3×α的结果分别为ηY1、ηY2、ηY3,如下式所示:At the same time, among the four coded combined directional patterns, two of the coded combined directional patterns were significantly closer to the directional patterns than to the positioning patterns. Likewise, the other two encoded combined orientation patterns are significantly closer to the orientation pattern than to the orientation pattern. As shown in Figure 2, in each coding combination, the positions of the coding patterns of the three coding combinations must meet the following requirements: the orientation pattern is A 1 , and its geometric center is a 1 , and the positioning pattern is A 2 , and its geometric center is a 2 , the directed line segment from a 1 to a 2 is called the standard vector α. In the four coding combinations, the directional pattern of the Y-th coding combination is denoted as C Y , and its geometric center is c Y . In the Y-th coding combination, the first coding pattern of the Y-th coding combination is D Y1 , and its geometric center is d Y1 , the second encoding pattern of the Y-th encoding combination is D Y2 , and its geometric center is d Y2 , and the third encoding pattern of the Y-th encoding combination is D Y3 , and its geometric center is d Y3 . Starting from the geometric center c Y of the Y-th encoding combination directional pattern C Y , leading to the geometric center d Y1 of the Y-th encoding combination first encoding pattern D Y1 and the Y-th encoding combination The geometric center d Y2 of the second encoding pattern D Y2 The directional line segment of the geometric center d Y3 of the third coding pattern D Y3 of the Y-th coding combination is called a vector γ Y1 , a vector γ Y2 , and a vector γ Y3 , respectively. At the same time, the vector products γ Y1 ×α, γ Y2 ×α, and γ Y3 ×α of the vector γ Y1 , the vector γ Y2 , and the vector γ Y3 respectively and the standard vector α are η Y1 , η Y2 , η Y3 , respectively, as shown in the following equations Show:
则ηY1、ηY2、ηY3需在模长或方向上有明显的差异;其中,Y=1,2,3,4。Then η Y1 , η Y2 , η Y3 need to have obvious differences in the length or direction of the module; among them, Y=1, 2, 3, 4.
如图11,利用数字图像处理的方法获得摄像机拍摄的包含N(本实施例中N取10)个平行四边形编码标志的图像中每个特征角点的编码序号和亚像素坐标,进而完成平行四边形编码标志解码的步骤如下:As shown in Figure 11, the method of digital image processing is used to obtain the coding sequence number and sub-pixel coordinates of each feature corner point in the image containing N (N is taken as 10 in this embodiment) parallelogram coding marks captured by the camera, and then complete the parallelogram The steps for decoding the encoding flag are as follows:
步骤1.1、利用摄像机拍摄空间中放置的10个平行四边形编码标志,获得编码标志图像,所述编码标志图像当中包含10个平行四边形编码标志;Step 1.1, utilize 10 parallelogram coding marks placed in the camera shooting space to obtain a coding mark image, which includes 10 parallelogram coding marks in the said coding mark image;
步骤1.2、建立角点的像素坐标系:在上述拍摄的包含10个平行四边形编码标志的图像中,取图像左上角作为角点像素坐标系的原点o,自左向右为角点像素坐标系的x轴方向,自上向下作为角点像素坐标系的y轴方向,由此建立角点像素坐标系o-xy;Step 1.2, establish the pixel coordinate system of the corner point: in the above-mentioned image containing 10 parallelogram coding marks, take the upper left corner of the image as the origin o of the corner pixel coordinate system, and from left to right as the corner pixel coordinate system The x-axis direction of , is taken as the y-axis direction of the corner pixel coordinate system from top to bottom, thereby establishing the corner pixel coordinate system o-xy;
步骤2.1、对编码标志图像进行灰度处理,得到编码标志灰度图像P1;其中,编码标志灰度图像P1为8位灰度图,如图3所示;Step 2.1, performing grayscale processing on the encoded logo image to obtain the encoded logo grayscale image P 1 ; wherein, the encoded logo grayscale image P 1 is an 8-bit grayscale image, as shown in Figure 3;
步骤2.2、对编码标志灰度图像P1进行复制备份,得到编码标志灰度备份图像P1′;Step 2.2, duplicating and backing up the grayscale image P1 of the coding mark to obtain a grayscale backup image P1 ' of the coding mark;
步骤2.3、对编码标志灰度备份图像P1′进行二值化处理,使得每个平行四边形编码标志的背景颜色均为黑色(即灰度值为0),每个平行四边形编码标志内的定向图案和定位图案均为白色(即灰度值为255),编码单元图案的颜色根据平行四边形编码标志的编码规则可以为白色也可以为黑色,进而得到编码标志二值化图像P2,如图3所示;Step 2.3. Binarize the grayscale backup image P 1 ′ of the coding mark, so that the background color of each parallelogram coding mark is black (that is, the gray value is 0), and the orientation in each parallelogram coding mark is The pattern and the positioning pattern are both white (that is, the grayscale value is 255), and the color of the coding unit pattern can be white or black according to the coding rule of the parallelogram coding mark, and then obtain the coding mark binarization image P 2 , as shown in the figure 3 shown;
步骤3、设定黑色连通域圆度阈值λ′=1,像素点个数阈值λ″=30;Step 3. Set the black connected domain circularity threshold λ′=1, and the pixel number threshold λ″=30;
步骤4.1、计算编码标志二值化图像P2中所有黑色连通域的圆度值λn和像素点个数cn,其中每个黑色连通域的圆度值可由式(1)得出,Step 4.1. Calculate the circularity value λ n and the number of pixels c n of all black connected domains in the coded mark binarized image P 2 , wherein the circularity value of each black connected domain can be obtained from formula (1),
其中,ln代表对应黑色连通域轮廓的周长,sn代表对应黑色连通域的面积,n=1,2,...,10;Among them, l n represents the perimeter of the corresponding black connected domain outline, s n represents the area of the corresponding black connected domain, n=1, 2, ..., 10;
步骤4.2、本实施例中选择的黑色连通域圆度阈值λ′=1和像素点个数阈值λ″=30可以在编码标志二值化图像P2中获得10个平行四边形编码标志各自所对应的10个定向圆环中心的黑色连通域;将10个定向圆环中心的黑色连通域分别记为编码标志二值化图像P2中的圆环黑色连通域M1、圆环黑色连通域M2、圆环黑色连通域M3、…、圆环黑色连通域M10,并将圆环黑色连通域M1、圆环黑色连通域M2、圆环黑色连通域M3、…、圆环黑色连通域M10依次放入圆环黑色连通域集合A′中,即圆环黑色连通域M1、圆环黑色连通域M2、圆环黑色连通域M3、…、圆环黑色连通域M10分别为圆环黑色连通域集合A′中的第1个元素、第2个元素、…、第10个元素;由此获得编码标志二值化图像P2中的每个平行四边形编码标志中定向圆环内部的黑色连通域;其中,编码标志二值化图像P2中的圆环黑色连通域M1、圆环黑色连通域M2、圆环黑色连通域M3、…、圆环黑色连通域M10的圆度值均小于1,并且圆环黑色连通域M1、圆环黑色连通域M2、圆环黑色连通域M3、…、圆环黑色连通域M10的像素点个数均大于30;Step 4.2. The black connected domain circularity threshold λ′=1 and the pixel number threshold λ″=30 selected in this embodiment can obtain the corresponding corresponding 10 parallelogram coding marks in the coding mark binarization image P2. The black connected domains at the centers of the 10 directional rings; the black connected domains at the centers of the 10 directional rings are respectively recorded as the black connected domains M 1 of the rings and the black connected domains M of the rings in the binarized image P 2 of the coding mark 2. The torus black connected domain M 3 , ..., the torus black connected domain M 10 , and the torus black connected domain M 1 , the torus black connected domain M 2 , the torus black connected domain M 3 , ... , the torus The black connected domains M 10 are sequentially placed in the set A' of circular black connected domains, namely the circular black connected domain M 1 , the circular black connected domain M 2 , the circular black connected domain M 3 , . . . , the circular black connected domain M 10 are the 1st element, the 2nd element, . The black connected domain inside the oriented circular ring in the middle; wherein, the circular black connected domain M 1 , the circular black connected domain M 2 , the circular black connected domain M 3 , ..., the circular ring in the binarized image P 2 of the coding mark The circularity value of the black connected domain M 10 is all less than 1, and the pixel points of the circular black connected domain M 1 , the circular black connected domain M 2 , the circular black connected domain M 3 , ..., the circular black connected domain M 10 The number is greater than 30;
步骤4.3、取整数变量i并赋值i=1;Step 4.3, take the integer variable i and assign i=1;
步骤4.4、计算圆环黑色连通域集合A′中的第i个圆环黑色连通域Mi的质心像素坐标并记为o″d,i(x″d,i,y″d,i),将得到的第i个圆环黑色连通域Mi的质心像素坐标o″d,i(x″d,i,y″d,i)放入圆环黑色连通域质心集合A中,作为圆环黑色连通域质心集合A的第i元素;Step 4.4. Calculate the pixel coordinates of the centroid of the i -th ring black connected domain Mi in the black connected domain set A′ and denote it as o″ d,i (x″ d,i ,y″ d,i ), Put the obtained centroid pixel coordinates o″ d,i (x″ d,i ,y″ d,i ) of the black connected domain Mi of the i -th ring into the centroid set A of the black connected domain of the ring, as a ring The ith element of the black connected domain centroid set A;
步骤4.5、判断i是否小于N,若i<10,则将i+1赋值给i,返回步骤4.4顺序执行;否则,即获得了编码标志二值化图像P2中圆环黑色连通域M1、圆环黑色连通域M2、圆环黑色连通域M3、…、圆环黑色连通域M10的质心像素坐标o″d,1(775,135)、o″d,2(x″d,2,y″d,2)、…、o″d,10(x″d,10,y″d,10),并依次放入圆环黑色连通域质心集合A中,如图5所示;Step 4.5, judge whether i is less than N, if i < 10, assign i+1 to i, and return to step 4.4 to execute in sequence; otherwise, obtain the black connected domain M 1 of the ring in the binarized image P 2 of the coding mark , circular black connected domain M 2 , circular black connected domain M 3 , ..., the centroid pixel coordinates of circular black connected domain M 10 o″ d,1 (775,135), o″ d,2 (x″ d,2 , y″ d,2 ), …, o″ d,10 (x″ d,10 ,y″ d,10 ), and put them into the set A of the black connected domain centroids of the ring in turn, as shown in Figure 5;
步骤5、取整数变量ζ并赋值ζ=1;
步骤6.1、将编码标志二值化图像P2进行两次复制备份,分别得到第1组第1个备份二值化图像P′1,1和第1组第2个备份二值化图像P′1,2;Step 6.1. Make two copies of the coding flag binarized image P 2 to obtain the first backup binarized image P′ 1,1 of the first group and the second backup binarized image P′ of the first group 1,2 ;
步骤6.2、利用去除编码标志复杂背景算法对第1组第1个备份二值化图像P′1,1进行数字图像处理,进而得到第1个无复杂背景平行四边形二值化图像P″1,1;在所述第1个无复杂背景平行四边形二值化图像P″1,1中,包含质心像素坐标值(775,135)的平行四边形编码标志内部的所有像素点的灰度值被置为255(即白色),包含质心像素坐标值(775,135)的平行四边形编码标志外部的所有像素点的灰度值值被置为0(即黑色);Step 6.2, using the algorithm of removing the complex background of the coding mark to perform digital image processing on the first backup binarized image P′ 1,1 of the first group, and then obtain the first parallelogram binarized image P″ 1 without complex background, 1 ; in the first parallelogram binarized image P″ 1,1 without complex background, the grayscale values of all the pixels inside the parallelogram encoding mark including the centroid pixel coordinate value (775, 135) are set to 255 (ie white), the gray value of all pixels outside the parallelogram coding mark containing the centroid pixel coordinate value (775,135) are set to 0 (ie black);
步骤7.1、对编码标志灰度图像P1进行复制备份,获得第1个备份灰度图像P1″′;Step 7.1, copy and backup the grayscale image P 1 of the coding mark to obtain the first backup grayscale image P 1 ″′;
步骤7.2、利用Harris角点检测算法在第1个无复杂背景平行四边形二值化图像P″1,1中提取4个角点的亚像素坐标,并记为第1个无复杂背景平行四边形二值化图像P″1,1上的4个备选角点C″1,1(0.6904×103,0.1910×103)、C″1,2(0.6899×103,0.0238×103)、C″1,3(0.8575×103,0.0237×103)、C″1,4(0.8573×103,0.1908×103);Step 7.2. Use the Harris corner detection algorithm to extract the sub-pixel coordinates of the four corner points in the first parallelogram binarized image P″ 1,1 without complex background, and record it as the first parallelogram without complex background II Four candidate corner points C″ 1,1 (0.6904×10 3 , 0.1910×10 3 ), C″ 1,2 (0.6899×10 3 , 0.0238×10 3 ) on the valued image P″ 1,1 , C″ 1,3 (0.8575×10 3 , 0.0237×10 3 ), C″ 1,4 (0.8573×10 3 , 0.1908×10 3 );
步骤7.3、在第1个无复杂背景平行四边形二值化图像P″1,1中做黑色连通域腐蚀,使得第个无复杂背景平行四边形二值化图像P″1,1中的白色连通域扩大,在后续进行图像乘法运算时,能够保证运算结果图像中提取出完整的包含质心像素坐标值(775,135)的平行四边形编码标志的灰度图案且其4个特征角点保存完整;并将第个无复杂背景平行四边形二值化图像P″1,1经过本步骤处理所得的图像记为第1个运算二值化图像P″1,2;Step 7.3. Perform black connected domain erosion in the first parallelogram binarized image P″ 1,1 without complex background to make the white connected domain in the first parallelogram binarized image P″ 1,1 without complex background Expansion, in the subsequent image multiplication operation, it can ensure that the complete grayscale pattern of the parallelogram coding mark containing the centroid pixel coordinate value (775,135) is extracted from the operation result image, and its 4 characteristic corners are kept intact; The image obtained through the processing in this step of the two parallelogram binarized images P″ 1,1 without a complex background is denoted as the first arithmetic binarized image P″ 1,2 ;
步骤7.4、将第1个运算二值化图像P″1,2中灰度值为255的部分的值置为1,将第1个运算二值化图像P″1,2中灰度值为0的部分的值置为0,而后利用第1个运算二值化图像P″1,2和第1个备份灰度图像P1″′进行乘法运算,将得到的结果图像记为第1个覆盖结果图像T1,如图8所示;所述第1个覆盖结果图像T1中只含有包含质心像素坐标值(775,135)的平行四边形编码标志的图像信息,去除了其它平行四边形编码标志的图像信息;Step 7.4. Set the value of the part whose gray value is 255 in the first operation binarized image P″ 1,2 to 1, and set the gray value in the first operation binary image P″ 1,2 as 1 The value of the part of 0 is set to 0, and then the first operation binarized image P″ 1, 2 and the first backup grayscale image P 1 ″′ are used for multiplication, and the resultant image obtained is recorded as the first image The overlay result image T 1 , as shown in FIG. 8 ; the first overlay result image T 1 only contains the image information of the parallelogram encoding mark including the centroid pixel coordinate value (775, 135), and removes the image information of other parallelogram encoding marks. image information;
步骤7.5、利用Harris角点检测算法在第1个覆盖结果图像T1中提取所有角点的亚像素坐标并存入第1个初选角点亚像素坐标集合B1中;其中,第1个初选角点亚像素坐标集合B1存放着第1个覆盖结果图像T1上包含质心像素坐标值(775,135)的平行四边形编码标志的4个特征角点亚像素坐标值和干扰角点的亚像素坐标值,所述干扰角点是除特征角点以外的干扰角点;Step 7.5. Use the Harris corner detection algorithm to extract the sub-pixel coordinates of all corners in the first coverage result image T 1 and store them in the first primary corner sub-pixel coordinate set B 1 ; among them, the first The sub-pixel coordinate set B 1 of the primary selected corner points stores the sub-pixel coordinate values of the four characteristic corner points and the sub-pixel coordinate values of the interference corner points on the first overlay result image T 1 containing the pixel coordinate value of the centroid (775, 135) of the parallelogram coding mark. pixel coordinate value, the interference corners are interference corners other than characteristic corners;
步骤7.6、取整数变量i并赋值i=1;Step 7.6, take the integer variable i and assign i=1;
步骤7.7、在所述第1个初选角点亚像素坐标集合B1中寻找距离亚像素坐标值(x″1,i,y″1,i)最近的角点亚像素坐标并记为C′1,i(x′1,i,y′1,i);Step 7.7. Find the corner sub-pixel coordinate closest to the sub-pixel coordinate value (x″ 1, i , y″ 1, i ) in the first primary corner sub-pixel coordinate set B 1 and denote it as C ′ 1,i (x′ 1,i ,y′ 1,i );
步骤7.8、判断i是否小于4,若i<4,则将i+1赋值给i并返回执行步骤7.7;否则此时已经获得了第1个覆盖结果图像T1上包含质心像素坐标值(775,135)的平行四边形编码标志的4个特征角点的亚像素坐标C′1,1(0.6927×103,0.1889×103)、C′1,2(0.6926×103,0.0256×103)、C′1,3(0.8559×103,0.0257×103)、C′1,4(0.8558×103,0.1890×103),如图9所示,且执行步骤8.1;Step 7.8, judge whether i is less than 4, if i < 4, assign i+1 to i and return to step 7.7; otherwise, the first coverage result image T 1 contains the centroid pixel coordinate value (775,135 ), the sub-pixel coordinates 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 ), as shown in FIG. 9 , and step 8.1 is performed;
步骤8.1、在第1组第2个备份二值化图像P′1,2上,将包含质心像素坐标值(775,135)的平行四边形编码标志记为第1个平行四边形编码标志;Step 8.1, on the second backup binarized image P′ 1,2 of the first group, mark the parallelogram encoding mark containing the centroid pixel coordinate value (775,135) as the first parallelogram encoding mark;
步骤8.2、在第1组第2个备份二值化图像P′1,2上,选取亚像素坐标值分别为(0.6904×103,0.1910×103)、(0.6899×103,0.0238×103)、(0.8575×103,0.0237×103)、(0.8573×103,0.1908×103)的4个像素点作为第1个平行四边形编码标志的角点四边形S1的4个顶点,将4个顶点相连进而获得第1个平行四边形编码标志的角点四边形S1;Step 8.2. On the second backup binarized image P′ 1,2 of the first group, select sub-pixel coordinate values as (0.6904×10 3 , 0.1910×10 3 ), (0.6899×10 3 , 0.0238×10 respectively) 3 ), (0.8575×10 3 , 0.0237×10 3 ), (0.8573×10 3 , 0.1908×10 3 ) 4 pixels as the 4 vertices of the corner quadrilateral S 1 of the first parallelogram coding mark, Connect 4 vertices and then obtain the corner quadrilateral S 1 of the first parallelogram coding mark;
步骤9、在第1组第2个备份二值化图像P′1,2上,寻找距离上述圆环黑色连通域质心集合A中第1个定向圆环质心像素坐标值(775,135)最近的白色连通域,并将此白色连通域的灰度值赋值为0;Step 9. On the second backup binarized image P′ 1,2 of the first group, find the white color closest to the pixel coordinate value (775,135) of the centroid of the first directional ring in the black connected domain centroid set A of the above-mentioned ring. Connected domain, and assign the gray value of this white connected domain to 0;
步骤10、在第1组第2个备份二值化图像P′1,2上,保持第1个平行四边形编码标志的角点四边形S1内部的所有像素点的灰度值不变,将第1个平行四边形编码标志的角点四边形S1以外的所有像素点的灰度值赋值为255;Step 10: On the second backup binarized image P′ 1,2 of the first group, keep the grayscale values of all the pixels inside the corner quadrilateral S1 of the first parallelogram coding mark unchanged, and set the first The gray value of all pixel points other than the corner point quadrilateral S 1 of a parallelogram coding mark is assigned as 255;
步骤11.1、在第1组第2个备份二值化图像P′1,2上,提取第个平行四边形编码标志的角点平行四边形S1中所有的内、外轮廓,记为第1个平行四边形编码标志的轮廓集合D1;Step 11.1. On the second backup binarized image P′ 1,2 of the first group, extract all the inner and outer contours in the parallelogram S 1 at the corner point of the first parallelogram coding mark, and denote it as the first parallel a set of contours D 1 of quadrilateral coding signs;
步骤11.2统计第1个平行四边形编码标志内的轮廓集合D1内每个轮廓包含的像素点数,将包含像素点数第二多的轮廓记为第1个平行四边形编码标志内的定位圆轮廓G1,计算其质心像素坐标并记为第1组第2个备份二值化图像P′1,2上第1个平行四边形编码标志内的定位圆质心像素坐标o′l,1(775,81);Step 11.2 Count the number of pixels contained in each contour in the contour set D 1 in the first parallelogram coding mark, and mark the contour with the second largest number of pixels as the positioning circle contour G 1 in the first parallelogram coding mark , calculate its centroid pixel coordinate and record it as the centroid pixel coordinate o′ l,1 ( 775,81) ;
步骤12、统计第1个平行四边形编码标志内的轮廓集合D1内每个轮廓包含的像素点数,将4个包含像素点数最少的轮廓记为第1组第2个备份二值化图像P′1,2上第1个平行四边形编码标志内的编码组合定向图案轮廓Z1,1、编码组合定向图案轮廓Z1,2、编码组合定向图案轮廓Z1,3、编码组合定向图案轮廓Z1,4,并分别计算其质心像素坐标 Step 12: Count the number of pixels contained in each contour in the contour set D1 in the first parallelogram coding mark, and record the four contours with the least number of pixels as the second backup binarized image P′ of the first group The coded combination directional pattern outline Z 1,1 , the coded combination directional pattern outline Z 1,2 , the coded combination directional pattern outline Z 1,3 , the coded combination directional pattern outline Z 1 in the first parallelogram coding mark on 1,2 ,4 , and calculate their centroid pixel coordinates respectively
步骤13.1、根据第1个平行四边形编码标志内的轮廓集合D1,除去包含像素点数最多的两个轮廓以及包含像素点数最少的4个轮廓,剩余轮廓个数κ1==1;由于κ1≠0,则这1个轮廓即为第1个平行四边形编码标志内编码组合编码图案的轮廓,记为编码组合图案 Step 13.1. According to the contour set D 1 in the first parallelogram coding mark, remove the two contours containing the largest number of pixels and the four contours containing the least number of pixels, and the remaining contours κ 1 == 1; because κ 1 ≠0, then this 1 outline is the outline of the coded combination coding pattern in the first parallelogram coding mark, which is denoted as the coding combination pattern
步骤14.1、给整数变量i并赋予初值i=1;Step 14.1, give integer variable i and initial value i=1;
步骤14.2、在第1组第2个备份二值化图像P′1,2上计算编码组合图案的质心像素坐标o′1 i(x′1 i,y′1 i),将i+1重新赋值给i后继续执行此步骤,直到i>1结束;由此可以得到对应编码组合图案编码组合图案…、编码组合图案的质心像素坐标 Step 14.2: Calculate the coding combination pattern on the second backup binarized image P' 1,2 of the first group The centroid pixel coordinates o′ 1 i (x′ 1 i , y′ 1 i ) of , reassign i+1 to i and continue to perform this step until i>1 ends; thus the corresponding coding combination pattern can be obtained Coded Combination Patterns ..., coding combination pattern The centroid pixel coordinates of
本实施例中,可得到编码组合图案的质心像素坐标为o′1 1(728,45);In this embodiment, the coded combination pattern can be obtained The centroid pixel coordinate of is o′ 1 1 (728,45);
步骤15.1、在第1组第2个备份二值化图像P′1,2上,记在第1个平行四边形编码标志中位于第1编码区域、第2编码区域、第3编码区域和第4编码区域的特征角点的亚像素坐标分别为C1,1(x1,1,y1,1)、C1,2(x1,2,y1,2)、C1,3(x1,3,y1,3)、C1,4(x1,4,y1,4);并在第1组第2个备份二值化图像P′1,2上,将像素坐标值为的(775,135)的像素点记为第1组第2个备份二值化图像P′1,2上第1个平行四边形编码标志的定位圆环质心o′d,1(775,135),将亚像素坐标值为(0.6927×103,0.1889×103)、(0.6926×103,0.0256×103)、(0.8559×103,0.0257×103)、(0.8558×103,0.1890×103)的4个像素点分别记为C″1,1(0.6927×103,0.1889×103)、C″′1,2(0.6926×103,0.0256×103)、C″′1,3(0.8559×103,0.0257×103)、C″′1,4(0.8558×103,0.1890×103);Step 15.1. On the second backup binarized image P′ 1,2 of the first group, record the location in the first encoding area, the second encoding area, the third encoding area and the fourth encoding area in the first parallelogram encoding mark The sub-pixel coordinates of the feature corners of the coding region are 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 ); and on the second backup binarized image P′ 1,2 of the first group, the pixel coordinate value The pixel point of (775,135) is marked as the centroid o′ d,1 (775,135) of the positioning ring of the first parallelogram coding mark on the second backup binarized image P′ 1,2 of the first group. The pixel coordinate values are (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 four pixels are respectively denoted 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 );
步骤15.2在第1组第2个备份二值化图像P′1,2上,第1个平行四边形编码标志中的方向向量由公式(2)得出,Step 15.2 On the second backup binarized image P′ 1,2 of the first group, the direction vector in the first parallelogram encoding flag According to formula (2),
步骤16、在第1组第2个备份二值化图像P′1,2上,找出4个像素点C″′1,1(0.6927×103,0.1889×103)、C″′1,2(0.6926×103,0.0256×103)、C″′1,3(0.8559×103,0.0257×103)、C″′1,4(0.8558×103,0.1890×103)中距离定位圆质心的像素坐标o′l,1(775,81)最近的2个像素点,并分别记为C1,1min(x1,1min,y1,1min)和C1,2min(x1,2min,y1,2min),本实施例中即为C1,1min(0.6926×103,0.0256×103)以及C1,2min(0.8559×103,0.0257×103)。Step 16. On the second backup binarized image P' 1,2 of the first group, find 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 ) The two pixels closest to the pixel coordinates o′ l,1 (775,81) of the centroid of the positioning circle are recorded as C 1,1min (x 1,1min ,y 1,1min ) and C 1,2min (x 1,2min , y 1,2min ), which are C 1,1min (0.6926×10 3 , 0.0256×10 3 ) and C 1,2min (0.8559×10 3 , 0.0257×10 3 ) in this embodiment.
通过公式(3)和(4)计算出在第1个平行四边形编码标志中的第1判断向量和第2判断向量并通过式(5)和式(6)计算出区域判断正弦值1sinα1和区域判断正弦值2sinβ1;Calculate the first judgment vector in the first parallelogram coding mark by formulas (3) and (4) and the second judgment vector And calculate the regional judgment sine value 1sinα 1 and the regional judgment sine value 2sinβ 1 by formula (5) and formula (6);
本实施例中:In this example:
sinα1>0,sinβ1<0,则C1,2min(0.8559×103,0.0257×103)为第1个平行四边形编码标志中第3编码区域的特征角点,把C1,2min(0.8559×103,0.0257×103)的像素坐标值赋值给C1,3(x1,3,y1,3);C1,1min(0.6926×103,0.0256×103)为第1个平行四边形编码标志中第2编码区域的特征角点,把C1,1min(0.6926×103,0.0256×103)的像素坐标值赋值给C1,2(x1,2,y1,2);sinα 1 >0, sinβ 1 <0, then C 1,2min (0.8559×10 3 , 0.0257×10 3 ) is the characteristic corner point of the third coding region in the first parallelogram coding mark, and C 1,2min ( The pixel coordinate value of 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 the first The characteristic corner points of the second coding region in the parallelogram coding mark, assign the pixel coordinate value of C 1,1min (0.6926×10 3 ,0.0256×10 3 ) to C 1,2 (x 1,2 ,y 1, 2 );
步骤17、第1组第2个备份二值化图像P′1,2,通过上述步骤16在4个像素点C″′1,1(0.6927×103,0.1889×103)、C″′1,2(0.6926×103,0.0256×103)、C″′1,3(0.8559×103,0.0257×103)、C″′1,4(0.8558×103,0.1890×103)中找到了第1个平行四边形编码标志中第2编码区域和第3编码区域的特征角点的亚像素坐标值并分别赋值给了C1,2(x1,2,y1,2)和C1,3(x1,3,y1,3);将余下的2个像素点的亚像素坐标值分别赋值给第1个平行四边形编码标志的第1临时坐标值,记为C′1,5(0.6927×103,0.1889×103),以及第2临时坐标值,记为C′1,6(0.8558×103,0.1890×103);根据公式(7)和(8)求出在第1个平行四边形编码标志中的第3判断向量和第4判断向量 Step 17, the second backup binarized image P' 1,2 of the first group, through the above step 16, at the 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 ) The sub-pixel coordinate values of the characteristic corners of the second coding area and the third coding area in the first parallelogram coding mark are found and assigned to C 1,2 (x 1,2 ,y 1,2 ) and C 1,3 (x 1,3 ,y 1,3 ); assign the sub-pixel coordinate values of the remaining two pixels to the first temporary coordinate value of the first parallelogram coding mark, and denote it as C′ 1 , 5 (0.6927×10 3 , 0.1889×10 3 ), and the second temporary coordinate value, denoted as C′ 1,6 (0.8558×10 3 , 0.1890×10 3 ); calculate according to formulas (7) and (8) The third judgment vector in the first parallelogram coding flag and the fourth judgment vector
步骤18、在第1组第2个备份二值化图像P′1,2上,根据步骤17中计算出的第3判断向量和第4判断向量通过式(9)和式(10)可得出第3区域判断正弦值sinω1和第4区域判断正弦值sinξ1;Step 18: On the second backup binarized image P′ 1,2 of the first group, according to the third judgment vector calculated in step 17 and the fourth judgment vector Through formula (9) and formula (10), the judgment sine value sinω 1 of the third region and the judgment sine value sinξ 1 of the fourth region can be obtained;
在本实施例中,预先设定平行向量正弦阈值g=0.01,sinξ1<g,则判定认为第4判断向量和方向向量平行:即sinω1≠0,sinξ1≈0,则C′1,6(0.8558×103,0.1890×103)即为第1个平行四边形编码标志中第4编码区域的特征角点,把C′1,6(0.8558×103,0.1890×103)的坐标值赋值给C1,4(x1,4,y1,4);C′1,5(0.6927×103,0.1889×103)为第1个平行四边形编码标志中第1编码区域的特征角点,把C′1,5(0.6927×103,0.1889×103)的坐标值赋值给C1,1(x1,1,y1,1);;In this embodiment, the parallel vector sine threshold g=0.01 is preset, and sinξ 1 <g, then it is determined that the fourth determination vector and the direction vector Parallel: i.e. sinω 1 ≠0, sinξ 1 ≈0, then C′ 1,6 (0.8558×10 3 , 0.1890×10 3 ) is the characteristic corner of the fourth coding region in the first parallelogram coding mark. The coordinate value of 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 ) is the characteristic corner point of the first coding region in the first parallelogram coding mark, and assign the coordinate value of C′ 1,5 (0.6927×10 3 ,0.1889×10 3 ) to C 1,1 (x 1 ,1 ,y 1,1 );
步骤19、在第1组第2个备份二值化图像P′1,2上,将由特征角点C1,1(0.6927×103,0.1889×103)指向特征角点C1,4(0.8558×103,0.1890×103)的向量记为向量且由公式(11)得出:Step 19: On the second backup binarized image P′ 1,2 of the first group, point the feature corner C 1,1 (0.6927×10 3 , 0.1889×10 3 ) to the feature corner C 1,4 ( 0.8558×10 3 , 0.1890×10 3 ) vector is recorded as a vector And from formula (11) we get:
取整数变量i并赋值i=1;Take integer variable i and assign i=1;
步骤20、在第1组第2个备份二值化图像P′1,2上,根据编码组合定向图案质心向量和方向向量通过公式(12)、(13)和(14)计算出第i编码组合判断向量和编码组合判断余弦值和 Step 20: On the second backup binarized image P′ 1,2 of the first group, orient the pattern centroid according to the code combination vector and the direction vector The ith code combination judgment vector is calculated by formulas (12), (13) and (14) Combined with encoding to determine cosine value and
本实施例中,根据以上公式,具体计算结果为:In the present embodiment, according to the above formula, the specific calculation result is:
由于且则为第1编由于码区域的编码组合定向图案质心,将赋值给o′z 1,1(x′z 1,1,y′z 1,1);because and but For the 1st code, the code combination of the code region orients the pattern centroids, and sets the Assign to o′ z 1,1 (x′ z 1,1 ,y′ z 1,1 );
由于且则为第2编码区域的编码组合定向图案质心,将赋值给o′z 1,2(x′z 1,2,y′z 1,2);because and but To orient the pattern centroids for the coded combination of the 2nd coded region, set the Assign to o′ z 1,2 (x′ z 1,2 ,y′ z 1,2 );
由于且则为第3编码区域的编码组合定向图案质心,将赋值给o′z 1,3(x′z 1,3,y′z 1,3);because and but To orient the pattern centroids for the encoded combination of the 3rd encoded region, set the Assign to o′ z 1,3 (x′ z 1,3 ,y′ z 1,3 );
由于且则为第4编码区域的编码组合定向图案质心,将赋值给o′z 1,4(x′z 1,4,y′z 1,4);because and but To orient the pattern centroids for the coded combination of the 4th coded region, set the Assign to o′ z 1,4 (x′ z 1,4 ,y′ z 1,4 );
步骤21、重新给整数变量i赋值i=1;Step 21, re-assign i=1 to the integer variable i;
步骤22、定义4个二维浮点型数组Cr1 1[3][2]、Cr1 2[3][2]、Cr1 3[3][2]、Cr1 4[3][2],并初始化这4个二维数组中的所有元素赋值为-1;另外取4个整数变量b1 1,b1 2,b1 3,b1 4,初始化b1 1=0,b1 2=0,b1 3=0,b1 4=0;Step 22. Define 4 two-dimensional floating point arrays Cr 1 1 [3][2], Cr 1 2 [3][2], Cr 1 3 [3][2], Cr 1 4 [3][2 ], and initialize all elements in these 4 two-dimensional arrays to -1; in addition, take 4 integer variables b 1 1 , b 1 2 , b 1 3 , b 1 4 , and initialize b 1 1 = 0, b 1 2 = 0, b 1 3 =0, b 1 4 =0;
步骤23、在第1组第2个备份二值化图像P′1,2上,计算第1个平行四边形编码标志中编码组合编码图案标志圆轮廓S1 1的质心像素坐标o′1 1(728,45)分别与定位圆质心o′l,1所形成的第1组第1区别向量 Step 23: On the second backup binarized image P′ 1,2 of the first group, calculate the centroid pixel coordinate o ′ 1 1 ( 728,45) and the first group of the first difference vector formed by the positioning circle centroid o′ l,1 respectively
通过式(16)、式(17)计算 Calculated by formula (16) and formula (17)
由于且 重新赋值给b1 2=1,并且i>0,直接执行步骤24.1;because and Reassign to b 1 2 =1, and i>0, directly execute step 24.1;
步骤24.1、重新给整数变量i赋值i=1;Step 24.1, re-assign i=1 to the integer variable i;
步骤24.2、本实施例中所得结果如下:Step 24.2, the results obtained in this example are as follows:
(1)取整数变量和并赋值 (1) take integer variable and and assign
(2)取数组Cr1 2[3][2]中同一行元素均不为-1的元素Cr1 2[0][0]和Cr1 2[0][1]并分别赋值给o1,1(x1,1,y1,1)的横坐标和纵坐标,并计算正弦值sinφ1 2 (2) Take the elements Cr 1 2 [0][0] and Cr 1 2 [0][1] in the same row of the array Cr 1 2 [3][2] whose elements are not -1 and assign them to o 1,1 ( x 1,1 ,y 1,1 ) of the abscissa and ordinate, and calculate the sine value sinφ 1 2
由于sinφ1 2==0,取整数变量和并赋值 Since sinφ 1 2 == 0, take the integer variable and and assign
(3)取整数变量和并赋值 (3) take integer variable and and assign
(4)取整数变量和并赋值 (4) take integer variable and and assign
步骤25、通过公式(21)得出第1个平行四边形编码标志的编号W1:Step 25, obtain the number W 1 of the first parallelogram coding mark by formula (21):
W1=V1 T·U=8 (21)W 1 =V 1 T ·U=8 (21)
其中,列向量U=(20,21,22,...211)T,列向量V1=(0,0,0,1,0,0,0,0,0,0,0,0)T。Among them, 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 .
步骤26、记第1个平行四边形编码标志中属于第σ编码区域(其中σ=1,2,3,4)的标定角点的编码号为L8 σ,其中下脚标8为标定角点L8 σ所属编码方格的编码号,上角标σ的取值代表了标定角点L8 σ所属的第σ编码区域;Step 26, mark the code number of the calibration corner point belonging to the σth coding region (where σ=1, 2, 3, 4) in the first parallelogram coding mark as L 8 σ , wherein the subscript 8 is the calibration corner point L The code number of the coding square to which 8 σ belongs, and the value of the superscript σ represents the σ-th coding area to which the calibration corner L 8 σ belongs;
本实施例中,找到的编码号为8的平行四边形编码标志上4个特征角点的亚像素坐标值以及相对应的角点编码号:In the present embodiment, the found code number is the subpixel coordinate value of 4 characteristic corner points on the parallelogram code mark of 8 and the corresponding corner point code number:
编码号为L8 1的特征角点的亚像素坐标值为C1,1(0.6927×103,0.1889×103);The sub-pixel coordinate value of the feature corner whose code number is L 8 1 is C 1,1 (0.6927×10 3 , 0.1889×10 3 );
编码号为L8 2的特征角点的亚像素坐标值为C1,2(0.6926×103,0.0256×103);The sub-pixel coordinate value of the feature corner whose code number is L 8 2 is C 1,2 (0.6926×10 3 , 0.0256×10 3 );
编码号为L8 3的特征角点的亚像素坐标值为C1,3(0.8559×103,0.0257×103);The sub-pixel coordinate value of the feature corner whose code number is L 8 3 is C 1,3 (0.8559×10 3 , 0.0257×10 3 );
编码号为L8 4的特征角点的亚像素坐标值为C1,4(0.8558×103,0.1890×103);The sub-pixel coordinate value of the feature corner whose code number is L 8 4 is C 1,4 (0.8558×10 3 , 0.1890×10 3 );
步骤27、判断ζ是否小于8,若满足,则将ζ+1重新赋值给ζ,并返回步骤6.1顺序执行;若不满足,则已经找到每个平行四边形编码标志上4个特征角点的亚像素坐标值和对应的编码号。Step 27, judge whether ζ is less than 8, if satisfied, then ζ+1 is reassigned to ζ, and returns to step 6.1 and executes sequentially; Pixel coordinate value and corresponding code number.
将步骤6.1获得的第1组第1个备份二值化图像P′1,1以及圆环黑色连通域质心集合A中第1个圆环黑色连通域质心像素坐标值(775,135)作为输入条件,利用去除编码标志复杂背景算法去除第1组第1个备份二值化图像P′1,1的复杂背景,并最终获得第1个无复杂背景平行四边形二值化图像P1″的步骤如下:Take the first group of the first backup binarized image P′ 1,1 obtained in step 6.1 and the pixel coordinate value (775,135) of the centroid of the first annular black connected domain centroid in the annular black connected domain centroid set A as input conditions, The steps of removing the complex background of the first backup binarized image P′ 1,1 of the first group by using the algorithm of removing the complex background of the coding mark, and finally obtaining the first parallelogram binarized image P 1 ″ without complex background are as follows:
步骤6.1.1、取整数变量i并赋值i=1;Step 6.1.1, take integer variable i and assign i=1;
步骤6.1.2、在第1组第1个备份二值化图像P′1,1上寻找距离像素坐标值(775,135)最近的白色连通域并记为第1组第1个备份二值化图像P′1,1上的第i个圆环白色连通域M′i,并将第i个圆环白色连通域M′i的像素值均赋值为0;Step 6.1.2. Find the white connected domain closest to the pixel coordinate value (775,135) on the first backup binarized image P' 1,1 of the first group and record it as the first backup binarized image of the first group The i-th circular white connected domain M' i on P' 1,1 , and the pixel value of the i-th circular white connected domain M' i is assigned as 0;
步骤6.1.3、判断i是否小于10,若i<10,则将i+1赋值给i,返回步骤6.1.2顺序执行;否则,已将第1组第1个备份二值化图像P′1,1中所有平行四边形编码标志中的定向圆环置为黑色;并将第1组第1个备份二值化图像P′1,1经过本步骤6.1.3处理后所得的图像记为第1个黑色背景提取图像P′1,b,并执行步骤6.1.4;Step 6.1.3, judge whether i is less than 10, if i < 10, assign i+1 to i, and return to step 6.1.2 to execute sequentially; otherwise, the first backup binarized image P' of the first group has been The orientation circles in all parallelogram coding marks in 1,1 are set to black; and the first backup binarized image P′ 1,1 of the first group is processed in this step 6.1.3 The image obtained by the process is recorded as the first 1 black background extraction image P′ 1,b , and perform step 6.1.4;
步骤6.1.4、在第1个黑色背景提取图像P′1,b上的所有黑色连通域中,寻找距离像素坐标值(775,135)最近的黑色连通域记为第1个黑色背景提取图像P′1,b上的第1个平行四边形背景黑色连通域Ω1;Step 6.1.4. In all black connected domains on the first black background extraction image P' 1,b , find the black connected domain closest to the pixel coordinate value (775,135) and record it as the first black background extraction image P' The first parallelogram background black connected domain Ω 1 on 1,b ;
步骤6.1.5、在第1个黑色背景提取图像P′1,b中提取第1个平行四边形背景黑色连通域Ω1的所有内、外轮廓,获得第1个平行四边形背景黑色连通域Ω1的内、外轮廓集合V1;Step 6.1.5. Extract all the inner and outer contours of the first parallelogram background black connected domain Ω 1 in the first black background extraction image P′ 1,b to obtain the first parallelogram background black connected domain Ω 1 The inner and outer contour set V 1 of ;
步骤6.1.6、比较轮廓集合V1中所有轮廓的周长,将周长最长的轮廓记为第1个平行四边形背景黑色连通域Ω1的外轮廓E1;Step 6.1.6. Compare the perimeters of all contours in the contour set V 1 , and record the contour with the longest perimeter as the outer contour E 1 of the black connected domain Ω 1 of the first parallelogram background;
步骤6.1.7、在第1个黑色背景提取图像P′1,b上利用射线法区分平行四边形背景黑色连通域Ω1的外轮廓E1以外的所有像素点和外轮廓E1以内的所有像素点,并将外轮廓E1以内的所有像素点灰度值赋值为255,外轮廓E1以外的所有像素点灰度值赋值为0,进而获得第1个无复杂背景平行四边形二值化图像P1″;使得第1个无复杂背景平行四边形二值化图像P1″中,包含质心像素坐标值(775,135)的平行四边形编码标志内部的所有像素点像素值被置为255,包含质心像素坐标值(775,135)的平行四边形编码标志外部的所有像素点像素值被置为0,如图10所示。Step 6.1.7. Use the ray method on the first black background extraction image P′ 1,b to distinguish all pixels outside the outer contour E 1 of the black connected domain Ω 1 of the parallelogram background and all pixels within the outer contour E 1 point, and assign the gray value of all pixels within the outer contour E 1 to 255, and assign the gray value of all pixels outside the outer contour E 1 to 0, and then obtain the first parallelogram binarized image without complex background. P 1 ″; in the first parallelogram binarized image without complex background P 1 ″, the pixel values of all the pixels inside the parallelogram coding mark including the centroid pixel coordinate value (775,135) are set to 255, including the centroid pixel The pixel values of all pixels outside the parallelogram encoding mark of the coordinate value (775, 135) are set to 0, as shown in Figure 10.
本发明提供的基于图形几何关系的平行四边形编码标志的解码方法,需要编制相应的计算机程序,并在计算机上执行程序以实现相应的运算处理及逻辑控制功能,因而本发明也提供一种计算机可读存储介质,包括与具有图像处理功能的电子设备结合使用的计算机程序,所述计算机程序可被处理器执行以所述的解码方法。The decoding method of the parallelogram coding mark based on the graphic geometric relationship provided by the present invention needs to compile a corresponding computer program, and execute the program on the computer to realize the corresponding operation processing and logic control functions, so the present invention also provides a computer Reading a storage medium includes a computer program used in conjunction with an electronic device having an image processing function, the computer program being executable by a processor to perform the decoding method.
以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above descriptions are only the embodiments of the present invention, and are not intended to limit the scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied to other related technologies Fields are similarly included in the scope of patent protection of the present invention.
Claims (8)
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)
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)
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)
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 |
-
2021
- 2021-04-13 CN CN202110392348.XA patent/CN113129397B/en active Active
Patent Citations (2)
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)
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 |
---|---|---|
CN110047109B (en) | Camera calibration plate based on self-identification mark and identification detection method thereof | |
CN101398907B (en) | Two-dimension code structure and decoding method for movable robot | |
CN109859226B (en) | Detection method of checkerboard corner sub-pixels for graph segmentation | |
CN109215016B (en) | Identification and positioning method for coding mark | |
CN108573511B (en) | Point-distributed cooperative coding mark and identification and positioning method thereof | |
CN113129397B (en) | Decoding method of parallelogram coding mark based on graphic geometric relation | |
CN113096191B (en) | Intelligent calibration method for monocular camera based on coding plane target | |
CN113160329B (en) | Coding plane target for camera calibration and decoding method thereof | |
Tang et al. | Robust pattern decoding in shape-coded structured light | |
CN109191562B (en) | 3D reconstruction method based on color pseudorandom coding structured light | |
CN113129396B (en) | Decoding method of parallelogram coding mark based on region segmentation | |
CN111179360B (en) | High-precision automatic calibration plate and calibration method | |
CN113129385B (en) | Binocular camera internal and external parameter calibration method based on multi-coding plane target in space | |
CN111199163A (en) | Edge detection and positioning identification method of annular code | |
CN106407973A (en) | Robust recognition method for AR code marked on cylinder | |
CN114792104A (en) | A method for identifying and decoding ring-shaped code points | |
CN110570354B (en) | Strip chessboard calibration plate-based close-range image splicing method | |
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 | |
Ni et al. | A fully automatic registration approach based on contour and SIFT for HJ-1 images | |
CN111191759B (en) | Two-dimensional code generation method, positioning and decoding method based on GPU | |
CN115731312B (en) | Annular coding mark point extraction and identification method based on multi-feature relaxation constraint | |
CN113129394B (en) | A parallelogram coding mark based on region division coding and its coding method | |
CN113192143B (en) | Coding stereo target for camera quick calibration and decoding method thereof | |
CN113112549A (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 |