A method for measuring one-dimensional position parameters of a target based on DSP
By using the DSP-based fast mark detection algorithm and system calibration algorithm in the monocular visual measurement system, the problems of redundancy and complexity of one-dimensional position parameter measurement calculations in the existing technology are solved, and efficient real-time measurement and precise positioning are achieved. Parameter calculation.
Patent Information
- Application Number
- CN202210259208.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-16
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-03-16
AI Technical Summary
Existing monocular vision measurement systems have computational redundancy and complexity when measuring one-dimensional position parameters, making it difficult to implement real-time processing based on DSP.
A DSP-based target one-dimensional position parameter measurement method is designed, which uses manually marked red circular patterns for rapid detection. The fast mark detection algorithm and system calibration algorithm are used to reduce the amount of calculation and improve the extraction speed and accuracy.
Real-time one-dimensional position parameter measurement based on DSP is realized, which reduces the difficulty of feature extraction, speeds up the speed, improves accuracy, and eliminates noise points through clustering algorithm to improve detection accuracy.
Smart Images

Figure CN114693786B
Abstract
Description
Technical Field
[0001] The invention relates to the field of computer image processing, and in particular to a target one-dimensional position parameter measurement method based on DSP. Background Art
[0002] The visual measurement system based on monocular camera has been maturely applied to the position parameter measurement of targets in the fields of aviation, aerospace, national defense, etc. Compared with inertial measurement, radar measurement and multi-camera measurement, monocular vision measurement of posture has the advantages of non-contact, strong intuitiveness, high measurement accuracy, strong anti-electromagnetic interference ability, simple structure and low measurement cost.
[0003] The existing monocular vision position parameter measurement systems include vision measurement systems based on cooperative targets and vision measurement systems based on non-cooperative targets. The difference between the two lies mainly in whether the target features used for position parameter solution are artificially marked features. If they are artificially marked features, they are cooperative targets; otherwise, they are non-cooperative targets. Compared with non-cooperative targets, vision measurement systems based on cooperative targets have higher feature extraction accuracy and faster extraction speed. Artificially marked features mainly include straight line features, circle features, etc. Generally speaking, there are two methods for extracting cooperative features:
[0004] (1) Analytical method: The mark is a straight line, and the straight line image is still a straight line. The intersection of the straight lines is used to determine the feature points. The advantage of this method is that the correspondence between the extracted imaging points and the marking points is accurate and there is no systematic error. The disadvantage is that the calculation is complicated;
[0005] (2) Statistical method: The marker is a geometric feature such as a circle or rectangle. The centroid of the marker point is obtained by using the statistical method of the imaging point coordinates. The centroid is used to approximate the imaging point at the center of the marker. The feature point extraction algorithm of this method is simple and easy to implement. The disadvantage is that the correspondence between the extracted feature points and the marker points is inaccurate, and there is a systematic error. However, compared with the measurement error caused by other factors, the systematic error is small and can meet the measurement accuracy requirements.
[0006] The position parameter calculation algorithm of the measurement system needs to be designed according to the target features, such as PnP (point feature), PnL (line feature) algorithm and the calculation algorithm based on monocular circle feature. However, the existing position parameter calculation algorithm has the following disadvantages: 1) The existing typical posture parameter measurement algorithm realizes the measurement of three-dimensional position parameters. When the measurement system only requires one-dimensional position parameters of the target, the measurement results are redundant; 2) The existing feature extraction algorithm and position parameter calculation algorithm are complex and computationally intensive, making it difficult to achieve real-time processing based on DSP. Summary of the invention
[0007] In order to solve the defects of redundant parameter calculation and high calculation amount in the prior art, the purpose of the present invention is to provide a method for measuring target one-dimensional position parameters based on DSP.
[0008] In order to achieve the above object, the technical solution provided by the present invention is:
[0009] A method for measuring target one-dimensional position parameters based on DSP includes the following steps:
[0010] Step 1, the marking radius of the artificial mark (red circular pattern) on the target surface is designed;
[0011] Step 2, using a fast marker detection algorithm to obtain the initial value of the marker center and perform a secondary search for the marker point;
[0012] Step 3: Use the system calibration algorithm to calibrate the relative position between the camera and the guide rail to establish an accurate parameter correspondence relationship;
[0013] Step 4: Use the DSP-based fast marker detection algorithm to quickly detect artificial markers.
[0014] The mark is designed as a red circular pattern for the following reasons:
[0015] Since there is an angle between the guide rail and the imaging plane, the midpoint p of the line segment L0 on plane α (the imaging is parallel to the camera X-axis direction and its own length is 2R) C The imaging point p c ′ does not coincide with the midpoint x0 of its imaging line segment l0. The error is quantitatively analyzed as follows:
[0016] Let L0 endpoint p L ,p R The coordinates are (X L ,Y o ,Z L )、(X R ,Y o ,Z R ), the relationship between the coordinate values is:
[0017] X R =X L +2Rcosθ,Z R =Z L +2Rsinθ (1)
[0018] Where θ is the inclination angle of the guide rail. Center p C Coordinate (X C ,Y o ,Z C )for:
[0019] X C =XL +Rcosθ,Z C =Z L +Rsinθ (2)
[0020] From formula (2), the horizontal coordinate of the imaging point can be obtained as:
[0021]
[0022] The horizontal coordinate of the l0 center calculated using the imaging point is:
[0023]
[0024] The center point extraction error Δs is expressed as:
[0025]
[0026] Here, Δn represents the pixel difference.
[0027] When the guide rail inclination angle θ = 45°, equation (5) can be simplified to:
[0028]
[0029] According to the system parameters, Z C The minimum value is generally 100mm, and the marking radius is generally less than 10mm, so Right now Formula (6) can be simplified as:
[0030]
[0031] That is, the difference between the horizontal coordinates of the imaging point at the center of the line segment and the midpoint of the imaging line segment is proportional to the square of the length of the line segment, and inversely proportional to the cube of the distance between the center of the line segment and the optical center in the Z direction.
[0032] According to the center coordinate difference function of the line segment (Equation (7)), the error size of different markers can be compared:
[0033] (1) When the mark is a circle with a radius of R, the integral diagram is as follows Figure 6 As shown: The coordinate difference between the mean of all marked points and the center imaging point is as follows:
[0034]
[0035] (2) When the mark is a rectangle with a width of 2R, the integral diagram is as follows Figure 7 As shown:
[0036]
[0037] (3) For other axisymmetric shapes, the calculation method is the same as above.
[0038] The center difference is proportional to the square of R, and when the horizontal width of the rectangular mark is equal to the diameter of the circular mark, the center difference is twice that of the circular mark. Therefore, the present invention selects a circular feature as the shape of the mark.
[0039] Furthermore, the specific implementation of step 1 is as follows:
[0040] Step 1.1: According to the measurement system parameters, the maximum number of horizontal imaging pixels (horizontal diameter imaging) of a circle with a radius of R is n max ,but:
[0041]
[0042] Among them, dx is the pixel size in the horizontal direction.
[0043] In order to ensure the detection accuracy of the marking center, the present invention sets n max The minimum value of is set to 40 pixels; in order to ensure the speed of mark detection, the present invention sets n max The maximum value of is set to 100 pixels. The geometric radius of the marker circle is:
[0044]
[0045] According to n max The value range of R can be obtained by the value range of and the parameters of the measurement system.
[0046] Step 1.2: Set the center coordinates of the marked circle (camera coordinate system, the camera is located at the bottom center, such as Figure 4 (X i ,Y0,Z i ), the center coordinate of the imaging ellipse is (x i ,y i ), where X i With Z i The geometric constraints are as follows:
[0047]
[0048] According to the pinhole imaging model, the horizontal coordinate x of the imaging point i It can be expressed as:
[0049]
[0050] The position parameters of the slider can be obtained by combining equations (12) and (13):
[0051]
[0052] Furthermore, the specific implementation of step 2 is as follows:
[0053] The image collected by the DSP in the present invention is a YUV422 (UYVY) two-field image with an image size of 720×576. In order to realize fast marker detection based on DSP, the present invention designs the following detection algorithm:
[0054] Step 2.1: Get the initial value of the marker center. To reduce the amount of calculation, this step only scans the top field (every other column, relative to scanning 1 / 4 of the full image). The method for extracting the red marker point is as follows:
[0055] Step 2.2: First, use the V component (chrominance component, which largely reflects whether the pixel is red) of the YUV image for screening (greatly reducing the amount of calculation), and retain the pixels with V component greater than 12; then convert the YUV component to RGB component for screening, the conversion method is as follows:
[0056]
[0057] Pixels that meet the following conditions are marked points:
[0058] (R>50)&(R>2.5·G||RG>40)&(R>2.5·B||RB>40) (16)
[0059] Step 2.3: Take the average of the X and Y coordinate values of the marked point, which is the initial value of the marked center Center0 (r0, c0).
[0060] Step 2.4: Secondary search of the marking point. To reduce the amount of calculation and eliminate possible interference points, the search area of the top field and bottom field is determined according to the initial value of the marking center, and scanned point by point. The marking point extraction method is the same as above:
[0061] (1) The search area of the top field: a circular area with a radius of 50 pixels and a center at (r0, c0);
[0062] (2) Search area of the bottom field: a circular area with a radius of 50 pixels and a center at (r0+576 / 2, c0);
[0063] Step 2.5: Process the coordinates of the marked points:
[0064] (1) Top field: Let the coordinates of the marking point be (r i ,c i )(row, column), converted to (2·r i -1,c i );
[0065] (2) Bottom field: Let the coordinates of the marking point be (r i ,ci )(row, column), converted to (2·(r i -576 / 2),c i );
[0066] Step 2.6: Perform distortion correction on the marker point coordinates (column coordinates) and take the mean value X0 of the corrected column coordinates.
[0067] In order to improve the processing speed of the algorithm, the distortion correction matrix is loaded onto the DSP in advance. When performing correction, the corresponding coordinate correction value can be called without the need for real-time distortion correction calculation.
[0068] Furthermore, the specific implementation method of step 3 is as follows:
[0069] Calibrate the relative position between the camera and the rail (rail inclination, distance between the camera and the rail) to establish an accurate parameter correspondence. The calibration method is as follows:
[0070] Step 3.1: Use a high-precision control system to control the movement of the slider along the guide rail, save the image (calibration image) and record the real position parameters of the slider, which can be given by the control system;
[0071] Step 3.2: Calculate the X coordinate of the marker center of all images according to the marker detection algorithm;
[0072] Step 3.3: According to the set of {mark center coordinates, true value of position parameters} and the position parameter solving function, the system parameters (distance, guide rail inclination) are fitted based on the least squares method;
[0073] Step 3.4: Based on the fitting parameters, obtain the expression for solving the position parameter.
[0074] Due to the adoption of the above-mentioned technical scheme, the beneficial effects of the present invention are as follows: the target one-dimensional position parameter measurement system implemented based on DSP solves the position parameters of the target through artificial marking, and the use of marking reduces the difficulty of feature extraction and speeds up the feature extraction; a position parameter solving algorithm is designed to realize the function mapping of marking and position parameter; a measurement system parameter calibration algorithm is designed to improve the accuracy of position parameter solving; a fast marker detection algorithm based on DSP is designed to extract marker points by step and color channel, thereby reducing the number of pixels to be processed and improving the speed of marker point extraction. At the same time, noise points are eliminated through a clustering algorithm to improve the detection accuracy of marker points. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 It is a schematic diagram of the measurement system of the present invention.
[0076] Figure 2This is a flow chart of a target one-dimensional position parameter solving algorithm based on DSP of the present invention.
[0077] Figure 3 It is a schematic diagram of a red circular mark of the present invention.
[0078] Figure 4 It is a schematic diagram of measurement system parameters.
[0079] Figure 5 It is a schematic diagram of imaging at the center of a line segment.
[0080] Figure 6 It is a schematic diagram of circular marks and integration.
[0081] Figure 7 Rectangular marking and integral diagram
[0082] In the figure: 1-target, 2-rail, 3-camera. DETAILED DESCRIPTION
[0083] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0084] A method for measuring target one-dimensional position parameters based on DSP includes the following steps:
[0085] Step 1, the marking radius of the artificial mark (red circular pattern) on the target surface is designed;
[0086] Step 2, using a fast marker detection algorithm to obtain the initial value of the marker center and perform a secondary search for the marker point;
[0087] Step 3: Use the system calibration algorithm to calibrate the relative position between the camera and the guide rail to establish an accurate parameter correspondence; Step 4: Use the DSP-based fast marker detection algorithm to quickly detect artificial markers.
[0088] The mark is designed as a red circular pattern for the following reasons:
[0089] Since there is an angle between the guide rail and the imaging plane, the midpoint p of the line segment L0 on plane α (parallel to the X-axis direction, with a length of 2R) C The imaging point p c ′ does not coincide with the midpoint x0 of its imaging line segment l0. The error is quantitatively analyzed as follows:
[0090] Let L0 endpoint p L ,p R The coordinates are (X L ,Y o ,Z L )、(X R ,Y o ,ZR ), the relationship between the coordinate values is:
[0091] X R =X L +2Rcosθ,Z R =Z L +2Rsinθ (1)
[0092] Center C Coordinate (X C ,Y o ,Z C )for:
[0093] X C =X L +Rcosθ,Z C =Z L +Rsinθ (2)
[0094] From formula (2), the horizontal coordinate of the imaging point can be obtained as:
[0095]
[0096] The horizontal coordinate of the l0 center calculated using the imaging point is:
[0097]
[0098] The center point extraction error is expressed as:
[0099]
[0100] Here, Δn represents the pixel difference.
[0101] When the guide rail inclination angle θ = 45°, equation (5) can be simplified to:
[0102]
[0103] According to the system parameters, Z C The minimum value is generally 100mm, and the marking radius is generally less than 10mm, so Right now Formula (6) can be simplified as:
[0104]
[0105] That is, the difference between the horizontal coordinates of the imaging point at the center of the line segment and the midpoint of the imaging line segment is proportional to the square of the length of the line segment, and inversely proportional to the cube of the distance between the center of the line segment and the optical center in the Z direction.
[0106] According to the center coordinate difference function of the line segment (Equation (7)), the error size of different markers can be compared:
[0107] (1) When the mark is a circle with a radius of R, the integral diagram is as follows Figure 6 As shown: The coordinate difference between the mean of all marked points and the center imaging point is as follows:
[0108]
[0109] (2) When the mark is a rectangle with a width of 2R, the integral diagram is as follows Figure 7 As shown:
[0110]
[0111] (3) For other axisymmetric shapes, the calculation method is the same as above.
[0112] The center difference is proportional to the square of R, and when the horizontal width of the rectangular mark is equal to the diameter of the circular mark, the center difference is twice that of the circular mark. Therefore, the present invention selects a circular feature as the shape of the mark.
[0113] Furthermore, the specific implementation of step 1 is as follows:
[0114] Step 1.1: According to the measurement system parameters, the maximum number of horizontal imaging pixels (horizontal diameter imaging) of a circle with a radius of R is n max ,but:
[0115]
[0116] Among them, dx is the pixel size in the horizontal direction.
[0117] In order to ensure the detection accuracy of the marking center, the present invention sets n max The minimum value of is set to 40 pixels; in order to ensure the speed of mark detection, the present invention sets n max The maximum value of is set to 100 pixels. The geometric radius of the marker circle is:
[0118]
[0119] According to n max The value range of R can be obtained by the value range of and the parameters of the measurement system.
[0120] Step 1.2: Set the center coordinates of the marked circle (camera coordinate system, the camera is located at the bottom center, such as Figure 4 (X i ,Y0,Z i ), the center coordinate of the imaging ellipse is (x i ,y i ), where X i With Z i The geometric constraints are as follows:
[0121]
[0122] According to the pinhole imaging model, the horizontal coordinate x of the imaging point i It can be expressed as:
[0123]
[0124] The position parameters of the slider can be obtained by combining equations (12) and (13):
[0125]
[0126] Furthermore, the specific implementation of step 2 is as follows:
[0127] The image collected by the DSP in the present invention is a YUV422 (UYVY) two-field image with an image size of 720×576. In order to realize fast marker detection based on DSP, the present invention designs the following detection algorithm:
[0128] Step 2.1: Get the initial value of the marker center. To reduce the amount of calculation, this step only scans the top field (every other column, relative to scanning 1 / 4 of the full image). The method for extracting the red marker point is as follows:
[0129] Step 2.2: First, use the V component (chrominance component, which largely reflects whether the pixel is red) of the YUV image for screening (greatly reducing the amount of calculation), and retain the pixels with V component greater than 12; then convert the YUV component to RGB component for screening, the conversion method is as follows:
[0130]
[0131] Pixels that meet the following conditions are marked points:
[0132] (R>50)&(R>2.5·G||RG>40)&(R>2.5·B||RB>40) (16)
[0133] Step 2.3: Take the average of the X and Y coordinate values of the marked point, which is the initial value of the marked center Center0 (r0, c0).
[0134] Step 2.4: Secondary search of the marking point. To reduce the amount of calculation and eliminate possible interference points, the search area of the top field and bottom field is determined according to the initial value of the marking center, and scanned point by point. The marking point extraction method is the same as above:
[0135] (1) The search area of the top field: a circular area with a radius of 50 pixels and a center at (r0, c0);
[0136] (2) Search area of the bottom field: a circular area with a radius of 50 pixels and a center at (r0+576 / 2, c0);
[0137] Step 2.5: Process the coordinates of the marked points:
[0138] (1) Top field: Let the coordinates of the marking point be (r i ,c i )(row, column), converted to (2·r i -1,c i );
[0139] (2) Bottom field: Let the coordinates of the marking point be (r i ,c i )(row, column), converted to (2·(r i -576 / 2),c i );
[0140] Step 2.6: Perform distortion correction on the marker point coordinates (column coordinates) and take the mean value X0 of the corrected column coordinates.
[0141] In order to improve the processing speed of the algorithm, the distortion correction matrix is loaded onto the DSP in advance. When performing correction, the corresponding coordinate correction value can be called without the need for real-time distortion correction calculation.
[0142] Furthermore, the specific implementation method of step 3 is as follows:
[0143] Calibrate the relative position between the camera and the rail (rail inclination, distance between the camera and the rail) to establish an accurate parameter correspondence. The calibration method is as follows:
[0144] Step 3.1: Use a high-precision control system to control the movement of the slider along the guide rail, save the image (calibration image) and record the real position parameters of the slider, which can be given by the control system;
[0145] Step 3.2: Calculate the X coordinate of the marker center of all images according to the marker detection algorithm;
[0146] Step 3.3: According to the set of {mark center coordinates, true value of position parameters} and the position parameter solving function, the system parameters (distance, guide rail inclination) are fitted based on the least squares method;
[0147] Step 3.4: Based on the fitting parameters, obtain the expression for solving the position parameter.
[0148] Due to the adoption of the above-mentioned technical scheme, the beneficial effects of the present invention are as follows: the target one-dimensional position parameter measurement system implemented based on DSP solves the position parameters of the target through artificial marking, and the use of marking reduces the difficulty of feature extraction and speeds up the feature extraction; a position parameter solving algorithm is designed to realize the function mapping of marking and position parameter; a measurement system parameter calibration algorithm is designed to improve the accuracy of position parameter solving; a fast marker detection algorithm based on DSP is designed to extract marker points by step and color channel, thereby reducing the number of pixels to be processed and improving the speed of marker point extraction. At the same time, noise points are eliminated through a clustering algorithm to improve the detection accuracy of marker points.
[0149] It should be recognized that the above description is only a specific embodiment of the present invention, and the present invention is not limited to the specific structure shown or described above. The claims will cover all changes within the spirit and scope of the present invention.
Claims
1. A method for measuring target one-dimensional position parameters based on DSP. It is characterized in that The steps include: Step 1: Design the marking radius of the artificial marking on the target surface. The specific implementation method is as follows: Step 1.1: According to the measurement system parameters, the maximum number of imaging pixels in the horizontal direction of a circle with a radius of R is n max ,but: Among them, dx is the pixel size in the horizontal direction, and θ is the inclination angle of the guide rail; The geometric radius of the marker circle is: According to n max The value range of R can be obtained by the value range of and the parameters of the measurement system; Step 1.2: Set the center coordinates of the marked circle to (X i ,Y 0 ,Z i ), the center coordinate of the imaging ellipse is (x i ,y i ), where X i With Z i The geometric constraints are as follows: According to the pinhole imaging model, the horizontal coordinate x of the imaging point i It can be expressed as: The position parameters of the slider (X i ,Z i ) can be obtained by combining equations (3) and (4): Step 2: Use the fast marker detection algorithm to obtain the initial value of the marker center and perform a secondary search for the marker point. The specific implementation method is as follows: Step 2.1: Scan the top field in alternate columns to obtain the initial value of the marking center; Step 2.2: Extract the red markers, use the V component of the YUV image to filter, and retain the pixels with a V component greater than 12; then convert the YUV component to RGB component for filtering, the conversion method is as follows: Pixels that meet the following conditions are marked points: (R>50)&(R>2.5·G||RG>40)&(R>2.5·B||RB>40) (7) Step 2.3: Take the average of the X and Y coordinates of the marked point, which is the center of the mark. 0 Initial value (r 0 ,c 0 ); Step 2.4: Determine the search area of the top field and bottom field according to the initial value of the marker center, scan point by point, and perform a secondary search for the marker point: (1) Top field search area: (r 0 ,c 0 ) as the center and a circular area with a radius of 50 pixels; (2) Search area of the bottom field: (r 0 +576 / 2,c 0 ) as the center and a circular area with a radius of 50 pixels; Step 2.5: Process the coordinates of the marked points: (1) Top field: Let the coordinates of the marking point be (r i ,c i )(row, column), converted to (2·r i -1,c i ); (2) Bottom field: Let the coordinates of the marking point be (r i ,c i )(row, column), converted to (2·(r i -576 / 2),c i ); Step 2.6: Perform distortion correction on the column coordinates of the marker points and take the mean value X of the corrected column coordinates 0 ; Step 3: Use the system calibration algorithm to calibrate the relative position between the camera and the guide rail to establish an accurate parameter correspondence. The specific implementation method is as follows: Step 3.1: Use a high-precision control system to control the movement of the slider along the guide rail, save the calibration image and record the real position parameters of the slider, which can be given by the control system; Step 3.2: Calculate the X coordinate of the marker center of all images according to the marker detection algorithm; Step 3.3: According to the set of {mark center coordinates, true value of position parameters} and the position parameters, solve the function formula and fit the distance and guide rail inclination based on the least squares method; Step 3.4: Based on the fitting parameters, obtain the expression for solving the position parameters; Step 4: Use the DSP-based fast marker detection algorithm to quickly detect artificial markers.
Citation Information
Patent Citations
Automatic detecting and positioning method for artificial circular mark in X-ray image
CN106097362A
A method for a high precision solution of pose parameters based on minimization of reconstruction errors
CN109102567A
Image marking method and device
CN111105431A
Rotating rigid body spacecraft attitude estimation method based on monocular vision
CN113295171A
Method and system for recognizing three-dimensional position and attitude on the basis of sense of sight
JP1995098208A
