Coded target and positioning and decoding method based on the encoded target

By designing a coding target with two concentric positioning circles and coding points, combined with high-precision visual measurement methods, the problems of low decoding error rate and low positioning accuracy of traditional coding targets are solved, and target positioning and decoding with higher accuracy are achieved.

CN116358448BActive Publication Date: 2025-06-06SHANGHAI SPACEFLIGHT ELECTRONICS & COMM EQUIP RES INST
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310358717.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-04
Publication Date
2025-06-06
Estimated Expiration
2043-04-04

AI Technical Summary

Technical Problem

The decoding methods of traditional encoding targets have low fault tolerance and insufficient positioning accuracy, resulting in insufficient target recognition and measurement in visual measurement.

Method used

A coding target consisting of two concentric positioning circles and coding points was designed, and the high-precision positioning and decoding of the target was achieved through camera photography, distortion correction, adaptive binarization and contour extraction.

Benefits of technology

The positioning accuracy of the target center is improved, and the optimized decoding algorithm is used to achieve higher target recognition and decoding robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116358448B_ABST
    Figure CN116358448B_ABST
Patent Text Reader

Abstract

The present invention provides a coding target and a positioning and decoding method based on the coding target. The coding target uses two inner and outer concentric circles as positioning circles, and black and white coding points are arranged at equal angles in the annular area between the concentric circles. By correcting and optimizing the target center through the two inner and outer concentric positioning circles, higher positioning accuracy can be obtained, the area of ​​the coding area can be reduced by using the annularly distributed coding points, and the decoding accuracy can be improved by calculating the similarity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a coding target and a positioning and decoding method based on the coding target. Background Art

[0002] In many applications of visual measurement, coded targets are usually arranged on the surface of the object to be measured, and then the targets are identified and the image coordinates of the target center are obtained. Finally, the visual measurement algorithm is used to complete the three-dimensional measurement task of the target. According to the different characteristics of the coding pattern, the coded targets are mainly divided into annular coded targets, square coded targets and distributed coded targets. The coding areas of these targets are large, resulting in a larger overall target size, occupying more area when arranging the targets, and the positioning circle area is small, resulting in insufficient positioning accuracy of the target center. The decoding method of traditional coded targets generally directly performs binary decoding on the detected coding points, and has a low tolerance for misidentification of coding points. Summary of the invention

[0003] The object of the present invention is to provide a coded target and a high-precision positioning and decoding method thereof, comprising:

[0004] The target consists of two concentric positioning circles and coding points. The concentric positioning circles are used for high-precision positioning of the target. The inner concentric circle area is white, the annular area between the outer and inner concentric circles is black, and the coding points are white and distributed in the annular area for target decoding and identification.

[0005] High-precision positioning and decoding method of the coded target:

[0006] Step S1, using a calibrated camera to take a picture of the target to obtain a target grayscale image Image0;

[0007] Step S2, performing distortion correction on the target image using the distortion coefficient calibrated by the camera to obtain a target image Image1 without distortion;

[0008] Step S3, performing adaptive binarization processing on Image1 to obtain a binary image Image2;

[0009] Step S4, extracting the contour in Image2;

[0010] Step S5, traverse each contour segment and perform the following operations on it:

[0011] Step S6, find the leftmost point and the rightmost point of the contour, and determine a straight line from these two points, traverse each point of the contour, and if the point is above the straight line, proceed to step S7, otherwise proceed to step S8;

[0012] Step S7, if the gray value of the upper point adjacent to the point is greater than the gray value of the lower point adjacent to the point, the point may be a contour point of the positioning circle outside the target, and the point is recorded as a valid contour point;

[0013] Step S8, if the gray value of the upper point adjacent to the point is less than the gray value of the lower point adjacent to the point, the point may be a contour point of the positioning circle outside the target, and the point is recorded as a valid contour point;

[0014] Step S9, if the ratio of the number of valid contour points to the total number of contour points on the contour is greater than a threshold value of 0.4, the contour may be a contour of a positioning circle outside the target, and an ellipse is fitted to the contour to obtain the major and minor axes, rotation angle, and center point coordinates of the ellipse;

[0015] Step S10, traversing all contour points of the contour, calculating the closest Euclidean distance between each contour point and the fitted ellipse, if the distance is less than a threshold, the point may be a point on the outer positioning circle contour;

[0016] Step S11, if the ratio of the number of valid contour points to the total number of contour points on the contour is greater than a threshold value of 0.7, the contour is a rough positioning contour of the target outer positioning circle, and the contour is recorded as Counter_out_pre;

[0017] Step S12, taking the circumscribed rectangle of the fitted ellipse of Counter_out_pre as the ROI area, extracting all contours in the corresponding ROI area in the Image1 image;

[0018] Step S13, traverse each contour of the ROI and perform the following operations on it:

[0019] Step S14, find the leftmost point and the rightmost point of the contour, and determine a straight line from these two points, traverse each point of the contour, and if the point is above the straight line, proceed to step S15, otherwise proceed to step S16;

[0020] Step S15, if the gray value of the upper point adjacent to the point is less than the gray value of the lower point adjacent to the point, the point may be a contour point of the positioning circle or code within the target, and the point is recorded as a valid contour point of the inner circle, otherwise the point is recorded as a valid contour point of the outer circle;

[0021] Step S16, if the gray value of the upper point adjacent to the point is greater than the gray value of the lower point adjacent to the point, the point may be a contour point of the positioning circle or code within the target, and the point is recorded as a valid contour point of the inner circle, otherwise the point is recorded as a valid contour point of the outer circle;

[0022] Step S17, if the ratio of the inner circle valid contour points to the total contour points corresponding to the contour is greater than the threshold value 0.4, the contour may be the target inner positioning circle or the encoded precise positioning contour, and the contour is recorded as Counter_in, and the collection of the contour is recorded as Counters_in_collection;

[0023] Step S18, if the ratio of the valid contour points of the outer circle to the total contour points corresponding to the contour is greater than the threshold value 0.4, the contour may be the precise positioning contour of the target outer positioning circle, and the contour is recorded as Counter_out, and the collection of the contour is recorded as Counters_out_collection;

[0024] Step S19, if the number of contours in Counters_in_collection is less than 2, or the number of contours in Counters_out_collection is not 1, the ROI area is not a target, skip the ROI and process the next ROI area, otherwise continue to execute subsequent steps;

[0025] Step S20, the only Counter_out in Counters_out_collection is the outer positioning circle contour of the target, and the major and minor axes of its fitted ellipse are respectively a and o With b o , the coordinates of the center of the ellipse are (x o ,y o );

[0026] Step S21, calculate the Euclidean distance between the center of each contour of Counters_in_collection and the center of Counter_out, the Counter_out with the smallest distance is the inner positioning circle contour of the target, and the major and minor axes of its fitted ellipse are respectively a and i With b i , the coordinates of the center of the ellipse are (x i ,y i );

[0027] Step S22, record Then the center of the inner and outer concentric circles is the target center coordinate (x c ,y c )for

[0028]

[0029] Step S23, obtaining the coordinates of the four vertices of the target ROI rectangular area, and recording the homogeneous coordinates of the pixel points in the area as P;

[0030] Step S24, setting a square area as the forward projection area of ​​the target ROI graphic after perspective transformation;

[0031] Step S25, calculating the homography matrix H between the two projections through the coordinates of the four vertices of the ROI rectangle and the coordinates of the four vertices of the square area;

[0032] Step S26: homogeneous coordinates P of the pixel points in the ROI area after perspective transformation ′ =HP, that is, the forward projection image of a single target image is obtained, and the target positioning circle has been forward projected into a circle;

[0033] Step S27, according to the proportional relationship between the design value of the target outer positioning circle size and the design value of the coding point size, as well as the pixel size of the outer positioning circle on the target orthographic projection image and the target center pixel position, determine the pixel position of the circle where the coding point center is located on the target orthographic projection image.

[0034] Step S28, take a point every 1° on the circle where the encoding point is located and traverse 360° to take 360 ​​points, and record the array composed of the grayscale values ​​of these 360 ​​points as signal;

[0035] Step S29, normalizing the signal;

[0036] Step S30, calculating the angle θ occupied by each code point on the circle where the code point is located according to the design values ​​of the target and code point sizes;

[0037] Step S31, CodeLib is recorded as all binary codes that can be constructed by the n-bit coding target;

[0038] Step S32, traverse each binary code in CodeLib, and generate a reference signal array signal_ref1 with the same length as the signal for each code. The rule is: traverse each bit of the code, if the code bit is 1, write the corresponding θ elements in signal_ref1 to 1, if the code bit is 0, write the corresponding θ elements in signal_ref1 to -1, write (360 / n-θ) -1s in signal_ref1 between two adjacent code bits, and write (360 / n-θ) -1s at the end of signal_ref1 for the last code bit;

[0039] Step S33, record that the length of the reference signal array signal_ref2 is twice the length of signal_ref1, and the array element is composed of two signal_ref1 connected end to end;

[0040] Step S34, calculating the correlation between the acquisition signal signal and each coded reference signal array signal_ref2, and the code corresponding to the maximum correlation is the two-dimensional code value of the target;

[0041] Step S35, cyclically shift the two-dimensional code to the left by 1 bit, and calculate the decimal code value corresponding to each left shift, and the minimum code value is the code value of the target.

[0042] The present invention proposes a novel coded target and a high-precision identification, positioning and decoding method thereof, optimizes the coded target pattern features and structural dimensions, can achieve high-precision positioning of the target center, and simultaneously realizes highly robust target identification and decoding through a target decoding algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a flow chart of a method for high-precision positioning and decoding of a target according to an embodiment of the present invention;

[0044] Figure 2 is a schematic diagram of a target according to an embodiment of the present invention;

[0045] Figure 3 is the target image grayscale image Image0;

[0046] Figure 4 is a binary image Image2;

[0047] Figure 5 is the outer positioning circle outline of all targets;

[0048] Figure 6 is the target ROI area;

[0049] Figure 7 It is the contour of the inner and outer positioning circles of the target and the center of the target;

[0050] Figure 8 It is the perspective transformation of a single target image into a forward projection image;

[0051] Fig. 9 It is the circle where the center of the target coding point is located;

[0052] Fig.10 is the angle θ occupied by each target point;

[0053] Fig.11 It is a schematic diagram of generating a reference signal signal_ref1. DETAILED DESCRIPTION

[0054] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0055] Figure 1 It is a flow chart of a method for high-precision target positioning and decoding according to an embodiment of the present invention.

[0056] like Figure 2 As shown, the target consists of two concentric positioning circles and coding points. The concentric positioning circles are used for high-precision positioning of the target. The inner concentric circle area is white, the annular area between the outer concentric circle and the inner concentric circle is black, and the coding points are white and distributed in the annular area for target decoding and identification.

[0057] High-precision positioning and decoding method of the coded target:

[0058] Step S1, use a calibrated camera to take a picture of the target to obtain a target grayscale image Image0, such as Figure 3 As shown;

[0059] Step S2, performing distortion correction on the target image using the distortion coefficient calibrated by the camera to obtain a target image Image1 without distortion;

[0060] Step S3, perform adaptive binarization processing on Image1 to obtain a binary image Image2, such as Figure 4 As shown;

[0061] Step S4, extracting the contour in Image2;

[0062] Step S5, traverse each contour segment and perform the following operations on it:

[0063] Step S6, find the leftmost point and the rightmost point of the contour, and determine a straight line from these two points, traverse each point of the contour, and if the point is above the straight line, proceed to step S7, otherwise proceed to step S8;

[0064] Step S7, if the gray value of the upper point adjacent to the point is greater than the gray value of the lower point adjacent to the point, the point may be a contour point of the positioning circle outside the target, and the point is recorded as a valid contour point;

[0065] Step S8, if the gray value of the upper point adjacent to the point is less than the gray value of the lower point adjacent to the point, the point may be a contour point of the positioning circle outside the target, and the point is recorded as a valid contour point;

[0066] Step S9, if the ratio of the number of valid contour points to the total number of contour points on the contour is greater than a threshold value of 0.4, the contour may be a contour of a positioning circle outside the target, and an ellipse is fitted to the contour to obtain the major and minor axes, rotation angle, and center point coordinates of the ellipse;

[0067] Step S10, traversing all contour points of the contour, calculating the closest Euclidean distance between each contour point and the fitted ellipse, if the distance is less than a threshold, the point may be a point on the outer positioning circle contour;

[0068] Step S11, if the ratio of the number of valid contour points to the total number of contour points on the contour is greater than a threshold value of 0.7, then the contour is a target outer positioning circle contour, such as Figure 5 As shown, the profile is recorded as Counter_out_pre;

[0069] Step S12, taking the circumscribed rectangle of the fitted ellipse of Counter_out_pre as the ROI area, such as Figure 6 As shown, all sub-pixel contours in the corresponding ROI area in the Image1 image are accurately extracted;

[0070] Step S13, traverse each contour of the ROI and perform the following operations on it:

[0071] Step S14, find the leftmost point and the rightmost point of the contour, and determine a straight line from these two points, traverse each point of the contour, and if the point is above the straight line, proceed to step S15, otherwise proceed to step S16;

[0072] Step S15, if the gray value of the upper point adjacent to the point is less than the gray value of the lower point adjacent to the point, the point may be a contour point of the positioning circle or code within the target, and the point is recorded as a valid contour point of the inner circle, otherwise the point is recorded as a valid contour point of the outer circle;

[0073] Step S16, if the gray value of the upper point adjacent to the point is greater than the gray value of the lower point adjacent to the point, the point may be a contour point of the positioning circle or code within the target, and the point is recorded as a valid contour point of the inner circle, otherwise the point is recorded as a valid contour point of the outer circle;

[0074] Step S17, if the ratio of the inner circle valid contour points to the total contour points corresponding to the contour is greater than the threshold value 0.4, the contour may be the target inner positioning circle or the encoded precise positioning contour, and the contour is recorded as Counter_in, and the collection of the contour is recorded as Counters_in_collection;

[0075] Step S18, if the ratio of the valid contour points of the outer circle to the total contour points corresponding to the contour is greater than the threshold value 0.4, the contour may be the precise positioning contour of the target outer positioning circle, and the contour is recorded as Counter_out, and the collection of the contour is recorded as Counters_out_collection;

[0076] Step S19, if the number of contours in Counters_in_collection is less than 2, or the number of contours in Counters_out_collection is not 1, the ROI area is not a target, skip the ROI and process the next ROI area, otherwise continue to execute subsequent steps;

[0077] Step S20, the only Counter_out in Counters_out_collection is the outer positioning circle contour of the target, such as Figure 7 As shown, the major and minor axes of the fitted ellipse are respectively a o With b o , the coordinates of the center of the ellipse are (x o ,y o );

[0078] Step S21, calculate the Euclidean distance between the center of each contour of Counters_in_collection and the center of Counter_out, and the Counter_out with the smallest distance is the inner positioning circle contour of the target, such as Figure 7 As shown, the major and minor axes of the fitted ellipse are a and i With b i , the coordinates of the center of the ellipse are (x i ,y i );

[0079] Step S22, record Then the center of the inner and outer concentric circles is the target center coordinate (x c ,y c ) is calculated by the following formula, and the target center positioning result is as follows Figure 7 shown.

[0080]

[0081] Step S23, obtaining the coordinates of the four vertices of the target ROI rectangular area, and recording the homogeneous coordinates of the pixel points in the area as P;

[0082] Step S24, setting a square area as the forward projection area of ​​the target ROI graphic after perspective transformation;

[0083] Step S25, calculating the homography matrix H between the two projections through the coordinates of the four vertices of the ROI rectangle and the coordinates of the four vertices of the square area;

[0084] Step S26: homogeneous coordinates P of the pixel points in the ROI area after perspective transformation ′ =HP, that is, the forward projection image of a single target image is obtained, such as Figure 8As shown, the target positioning circle has been forward projected into a circle;

[0085] Step S27, according to the proportional relationship between the design value of the target outer positioning circle size and the design value of the coding point size, as well as the pixel size of the outer positioning circle on the target orthographic projection image and the target center pixel position, the pixel position of the circle where the coding point center is located is determined on the target orthographic projection image, such as Fig. 9 shown.

[0086] Step S28, take a point every 1° on the circle where the encoding point is located and traverse 360° to take 360 ​​points, and record the array composed of the grayscale values ​​of these 360 ​​points as signal;

[0087] Step S29, normalizing the signal;

[0088] Step S30, as Fig.10 As shown, according to the design values ​​of the target and the coding point sizes, the angle θ occupied by each coding point on the circle where the coding point is located is calculated;

[0089] Step S31, CodeLib is recorded as all binary codes that can be constructed by the n-bit coding target;

[0090] Step S32, as Fig.11 As shown, traverse each binary code in CodeLib, and generate a reference signal array signal_ref1 with the same length as the signal for each code. The rule is: traverse each bit of the code, if the code bit is 1, write the corresponding θ elements in signal_ref1 to 1, if the code bit is 0, write the corresponding θ elements in signal_ref1 to -1, write (360 / n-θ) -1s in signal_ref1 between two adjacent code bits, and write (360 / n-θ) -1s at the end of signal_ref1 for the last code bit;

[0091] Step S33, record that the length of the reference signal array signal_ref2 is twice the length of signal_ref1, and the array element is composed of two signal_ref1 connected end to end;

[0092] Step S34, calculating the correlation between the acquisition signal signal and each coded reference signal array signal_ref2, and the code corresponding to the maximum correlation is the two-dimensional code value of the target;

[0093] Step S35, cyclically shift the two-dimensional code to the left by 1 bit, and calculate the decimal code value corresponding to each left shift, and the minimum code value is the code value of the target.

Claims

1. A positioning and decoding method based on coded targets, It is characterized in that The coded target used is composed of two concentric positioning circles and coding points. The concentric positioning circles are used for target positioning. The inner concentric circle area is white, and the annular area between the outer and inner concentric circles is black. The code is white and distributed in the annular area for target decoding and identification. The number of codes is not limited to 10. The method comprises: a process of detecting the inner and outer positioning circles of the coding target; The process of detecting the inner and outer positioning circles of the coded target includes: Step S14, find the leftmost point and the rightmost point of the coding target, and determine a straight line from these two points, traverse each point of the coding target, and determine whether a point is above the straight line. If so, proceed to step S15; if not, proceed to step S16; Step S15, if the gray value of the upper point adjacent to the point is less than the gray value of the lower point adjacent to the point, the point may be a contour point of the positioning circle or code within the target, and the point is recorded as a valid contour point of the inner circle, otherwise the point is recorded as a valid contour point of the outer circle; Step S16, if the gray value of the upper point adjacent to the point is greater than the gray value of the lower point adjacent to the point, the point may be a contour point of the positioning circle or code within the target, and the point is recorded as a valid contour point of the inner circle, otherwise the point is recorded as a valid contour point of the outer circle; Step S17, if the ratio of the inner circle valid contour points to the total contour points corresponding to the contour is greater than the threshold value 0.4, the contour may be the target inner positioning circle or the encoded precise positioning contour, and the contour is recorded as Counter_in, and the collection of the contour is recorded as Counters_in_collection; Step S18, if the ratio of the valid contour points of the outer circle to the total contour points corresponding to the contour is greater than the threshold value 0.4, the contour may be the precise positioning contour of the target outer positioning circle, and the contour is recorded as Counter_out, and the collection of the contour is recorded as Counters_out_collection; Step S19, if the number of contours in Counters_in_collection is less than 2, or the number of contours in Counters_out_collection is not 1, the ROI area is not a target, skip the ROI and process the next ROI area, otherwise continue to execute subsequent steps; Step S20, the only Counter_out in Counters_out_collection is the outer positioning circle contour of the target, and the major and minor axes of its fitted ellipse are respectively and , the coordinates of the center of the ellipse are ( , ); Step S21, calculate the Euclidean distance between the center of each contour of Counters_in_collection and the center of Counter_out, the Counters_in with the smallest distance is the inner positioning circle contour of the target, and the major and minor axes of its fitting ellipse are respectively and , the coordinates of the center of the ellipse are ( , ); Also includes: The perspective transformation process when decoding the coded target; The perspective transformation process when decoding the coded target includes: Step S23, obtaining the coordinates of the four vertices of the rectangular area of ​​the encoding target ROI, and recording the homogeneous coordinates of the pixel points in the area as P; Step S24, setting a square area as the forward projection area of ​​the target ROI graphic after perspective transformation; Step S25, calculating the homography matrix H between the two projections through the coordinates of the four vertices of the ROI rectangle and the coordinates of the four vertices of the square area; Step S26: homogeneous coordinates of the pixels in the ROI area after perspective transformation , that is, the forward projection image of a single target image is obtained, and the target positioning circle has been forward projected into a circle; It also includes: the code value signal acquisition process when decoding the target; The code value signal acquisition process during target decoding includes: Step S28, take a point every 1° on the circle where the encoding point is located and traverse 360° to take 360 ​​points, and record the array composed of the grayscale values ​​of these 360 ​​points as signal; Step S29, normalizing the signal; Also includes: reference signal generation and decoding process; Generate reference signal and decode process, including: Step S30, calculating the angle θ occupied by each code point on the circle where the code point is located according to the design values ​​of the target and code point sizes; Step S31, CodeLib is recorded as all binary codes that can be constructed by the n-bit coding target; Step S32, as shown in FIG11, traverses each binary code in CodeLib, and generates a reference signal array signal_ref1 of the same length as the signal for each code, and the rule is: traverse each bit of the code, if the code bit is 1, write the corresponding θ elements in signal_ref1 to 1, if the code bit is 0, write the corresponding θ elements in signal_ref1 to -1, write (360 / n-θ) -1s in signal_ref1 between two adjacent code bits, and write (360 / n-θ) -1s at the end of signal_ref1 for the last code bit; Step S33, record that the length of the reference signal array signal_ref2 is twice the length of signal_ref1, and the array elements are composed of two signal_ref1 connected end to end; Step S34, calculate the correlation between the collected signal signal and each encoded reference signal array signal_ref2, and the code corresponding to the maximum correlation is the two-dimensional code value of the target.

Citation Information

Patent Citations

  • Looseness screw and method for supporting automatic assembly of Looseness screw

    CN115546290A