Chessboard target-based position measurement method, system and electronic device
By setting up prisms around the checkerboard target and calculating the rotation and translation matrix, the problem of reduced measurement accuracy of the checkerboard target in low-light conditions was solved, and high-precision spatial measurement under low-light conditions was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FUJIAN HUICHUAN DIGITAL TECH
- Filing Date
- 2025-05-14
- Publication Date
- 2026-07-21
AI Technical Summary
In low-light environments, the accuracy of corner point recognition of checkerboard targets decreases, leading to reduced measurement precision. Adding reflective materials to ordinary checkerboard targets affects spatial measurement accuracy, while adding reflective materials to prism checkerboard targets disrupts image features and makes spatial measurement and positioning impossible.
By setting up prisms around a checkerboard target and using a ranging device to acquire images of the checkerboard target, the coordinate array of corner points is determined, the coordinates of the prism center are obtained, the rotation and translation matrix is calculated, a laser signal is emitted to obtain the laser distance, and the spatial coordinates are calculated in combination with the device angle.
It improves the measurement accuracy of checkerboard targets in low-light environments, solves the problems of reduced measurement accuracy and inability to locate targets, and ensures accurate measurement of spatial coordinates under low-light conditions.
Smart Images

Figure CN120765721B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of ranging technology, specifically to a position measurement method, system, and electronic device based on a checkerboard target. Background Technology
[0002] Checkerboard targets are commonly used features in machine vision. The position measurement method based on checkerboard targets is a method to locate the spatial coordinates of the measurement position in an engineering measurement environment by using checkerboard targets. Its positioning accuracy is the key to engineering measurement.
[0003] However, in low-light environments, poor illumination reduces the accuracy of corner point identification for checkerboard targets, thus decreasing measurement precision. To address this, a common practice is to add reflective materials (such as reflective stickers or coatings) to the surface of the checkerboard target to enhance the image features of the checkerboard pattern under additional light sources, thereby improving measurement accuracy.
[0004] However, the above methods still have the following drawbacks: For ordinary checkerboard targets, adding reflective material to the checkerboard targets will cause changes in reflectivity, which will affect the accuracy of spatial measurement; For prism checkerboard targets, after adding reflective material to prism checkerboard targets, the light reflectivity of the central prism is greater than that of the reflective material, which destroys the image characteristics of the checkerboard and makes it impossible to perform spatial measurement and positioning. Summary of the Invention
[0005] To address the aforementioned issues, this application provides a position measurement method, system, and electronic device based on a checkerboard target, which can improve the measurement accuracy of the checkerboard target in low-light environments.
[0006] According to a first aspect of this disclosure, a position measurement method based on a checkerboard target is provided. The method includes: acquiring a checkerboard target image using a ranging device and determining a first corner point coordinate array of the checkerboard target in an image coordinate system; wherein the ranging device includes a pan-tilt unit, an image acquisition device, and a laser rangefinder; the checkerboard target comprises multiple squares of the same size; and a prism is arranged around the checkerboard target; acquiring a second corner point coordinate array of the checkerboard target in a checkerboard model coordinate system based on the characteristic parameters of the checkerboard target; acquiring the coordinates of the prism center in the checkerboard model coordinate system; and determining the coordinates of the first corner point coordinate array, the second corner point coordinate array, and the second corner point coordinate array. Using the intrinsic parameters and distortion correction parameters of the image acquisition device, the rotation and translation matrices of the first and second corner point coordinate arrays are obtained. Based on the coordinates of the prism center, the rotation and translation matrices, the intrinsic parameters and distortion correction parameters of the image acquisition device, the estimated pixel coordinates of the prism center in the image coordinate system are obtained. In response to the laser rangefinder emitting a laser signal to the estimated pixel coordinates of the prism center, the echo signal is obtained and the laser distance from the rangefinder to the prism center is determined. Based on the laser distance, the current horizontal angle of the device's pan-tilt unit, and the current vertical angle of the device's pan-tilt unit, the spatial coordinates of the checkerboard target are obtained.
[0007] In one implementation of the first aspect, obtaining the second corner point coordinate array of the chessboard target in the chessboard model coordinate system based on the characteristic parameters of the chessboard target includes: obtaining the horizontal chessboard corner point coordinate array in the horizontal direction and the vertical chessboard corner point coordinate array in the vertical direction based on the side length of the squares and the number of rows and columns of the chessboard in the chessboard target, respectively, wherein the characteristic parameters of the chessboard target include the side length of the squares and the number of rows and columns of the chessboard; and obtaining the second corner point coordinate array based on the horizontal chessboard corner point coordinate array and the vertical chessboard corner point coordinate array.
[0008] In one implementation of the first aspect, based on the side length of the square and the number of rows and columns of the chessboard in the chessboard target, the horizontal chessboard corner coordinate array and the vertical chessboard corner coordinate array are obtained respectively. This includes: establishing a rectangular coordinate system with the top left corner of the chessboard as the origin, the horizontal direction to the right of the chessboard as the x-axis, and the vertical direction downward of the chessboard as the y-axis, and calculating the horizontal chessboard corner coordinate array and the vertical chessboard corner coordinate array respectively.
[0009] In one implementation of the first aspect, obtaining a second corner coordinate array based on the horizontal and vertical checkerboard corner coordinate arrays includes the following steps: Step 1: Obtain the value of the first element of the horizontal checkerboard corner coordinate array; Step 2: Obtain the value of the first element of the vertical checkerboard corner coordinate array; Step 3: Use the value of the first element of the horizontal checkerboard corner coordinate array as the x-axis coordinate value of the first element of the second corner coordinate array, and use the value of the first element of the vertical checkerboard corner coordinate array as the y-axis coordinate value of the first element of the second corner coordinate array, to obtain the first element of the second corner coordinate array; Step 4: Repeat steps 2 to 3 until the last value of the vertical checkerboard corner coordinate array is obtained; Step 5: Repeat steps 1 to 4 until the last value of the horizontal checkerboard corner coordinate array is obtained; Step 6: Add all the corner coordinates obtained in steps 1 to 5 to the second corner coordinate array in order to obtain the second corner coordinate array.
[0010] In one implementation of the first aspect, the straight line connecting the center of the prism and the center of the checkerboard target is parallel to either the x or y axis and perpendicular to the other axis. The origin of the coordinate system is the top left corner of the checkerboard, the x-axis is the horizontal direction to the right along the checkerboard, and the y-axis is the vertical direction downward along the checkerboard.
[0011] In one implementation of the first aspect, the characteristic parameters of the checkerboard target also include the vertical length from the edge of the checkerboard grid to the edge of the checkerboard target; obtaining the coordinates of the prism center in the checkerboard model coordinate system includes: determining the coordinate index of the reference corner point of the prism center according to the installation position of the prism; determining the coordinate value of the reference corner point according to the coordinate index of the reference corner point of the prism center, the horizontal checkerboard corner point coordinate array, and the vertical checkerboard corner point coordinate array; and determining the coordinates of the prism center according to the coordinate value of the reference corner point, the vertical length from the edge of the checkerboard grid to the edge of the checkerboard target, and the minimum vertical distance from the prism center to the edge of the checkerboard target.
[0012] According to a second aspect of this disclosure, a position measurement system based on a checkerboard target is provided. The system includes: a first corner point coordinate array determination module, used to acquire a checkerboard target image via a ranging device and determine the first corner point coordinate array of the checkerboard target in an image coordinate system, wherein the ranging device includes a gimbal, an image acquisition device, and a laser rangefinder; the checkerboard target includes multiple squares of the same size, and a prism is arranged around the checkerboard target; a second corner point coordinate array determination module, used to acquire the second corner point coordinate array of the checkerboard target in a checkerboard model coordinate system based on the characteristic parameters of the checkerboard target; a prism center coordinate determination module, used to acquire the coordinates of the prism center in the checkerboard model coordinate system; and a rotation and translation matrix determination module, used to determine the first corner point coordinate array and the second corner point coordinate array based on the characteristic parameters of the checkerboard target; a prism center coordinate determination module, used to acquire the coordinates of the prism center in the checkerboard model coordinate system; and a rotation and translation matrix determination module, used to determine the first corner point coordinate array and the second corner point coordinate array based on the characteristic parameters of the checkerboard target; The system comprises several modules: a corner coordinate array, an image acquisition device intrinsic parameters, and an image acquisition device distortion correction parameter; a prism center pre-estimated pixel coordinate acquisition module; a laser distance determination module; and a spatial coordinate determination module. The prism center pre-estimated pixel coordinate acquisition module is used to obtain the pre-estimated pixel coordinates of the prism center in the image coordinate system based on the prism center coordinates, the rotation and translation matrix, the image acquisition device intrinsic parameters, and the image acquisition device distortion correction parameter. The prism center pre-estimated pixel coordinate acquisition module is used to obtain the echo signal and determine the laser distance from the ranging device to the prism center in response to the laser rangefinder emitting a laser signal to the pre-estimated pixel coordinates of the prism center.
[0013] According to a third aspect of this application, an electronic device is provided, the electronic device including a memory and a processor, the memory for storing a computer program, the processor running the computer program to cause the electronic device to perform the position measurement method based on a checkerboard target as provided in the first aspect of this application.
[0014] According to a fourth aspect of this application, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the position measurement method based on a checkerboard target as provided in the first aspect of this application.
[0015] According to a fifth aspect of this application, a computer program product is provided, the computer program product including instructions that, when executed by a processor of an electronic device provided in a third aspect of this application, enable the electronic device to implement the position measurement method based on a checkerboard target as provided in the first aspect of this application.
[0016] This application provides a position measurement method, system, and electronic device based on a checkerboard target, which can overcome the problem of reduced measurement accuracy or inability to perform spatial measurement and positioning of checkerboard targets in low-light environments, thereby improving the measurement accuracy of checkerboard targets in low-light environments. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 The diagram shown is a schematic diagram of a checkerboard target provided in one embodiment of this application.
[0019] Figure 2 The diagram shown is a schematic flowchart of a position measurement method based on a checkerboard target provided in an embodiment of this application.
[0020] Figure 3 The diagram shown is a flowchart illustrating a method for obtaining the coordinate array of the second corner point of a chessboard target according to an embodiment of this application.
[0021] Figure 4 The diagram shown is a flowchart illustrating a method for obtaining the coordinates of a prism center according to an embodiment of this application.
[0022] Figure 5 The diagram shown is a schematic diagram of a position measurement system based on a checkerboard target according to an embodiment of this application.
[0023] Figure 6 The diagram shown is a block diagram of an exemplary electronic device provided in an embodiment of this application. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0025] When using checkerboard targets for position measurement, the primary method for spatial measurement in low-light environments is typically to add reflective materials (such as reflective stickers or coatings) to the surface of the target to enhance the image features of the checkerboard under additional light sources, combined with a ranging device (e.g., a coaxial photoelectric rangefinder). In practical applications, the measurement process is roughly as follows: An additional light source is added to make the reflective checkerboard have distinct feature points; the ranging device is adjusted to align with the direction of the distinct feature points, and the center pixel coordinates of these feature points are obtained by calling the `opencv-minAreaRect` and `opencv-boxPoints` methods through feature point matching; the laser center of the laser rangefinder in the ranging device is aligned with the center pixel coordinates of the aforementioned feature points to obtain the laser distance; and the spatial coordinates are calculated by combining the laser distance, the angle of the ranging device, and device parameters (such as the installation angle of the laser rangefinder).
[0026] However, the above methods still have the following drawbacks: For ordinary checkerboard targets, adding reflective material to the checkerboard targets will cause changes in reflectivity, which will affect the accuracy of spatial measurement; For prism checkerboard targets, after adding reflective material to prism checkerboard targets, the light reflectivity of the central prism is greater than that of the reflective material, which destroys the image characteristics of the checkerboard and makes it impossible to perform spatial measurement and positioning.
[0027] In view of this, this application provides a position measurement method, system and electronic device based on a checkerboard target, which can overcome the problem of reduced measurement accuracy of checkerboard targets or inability to perform spatial measurement and positioning in low light environments.
[0028] Figure 1 The diagram shown is a schematic diagram of a checkerboard target provided in one embodiment of this application.
[0029] Typically, a checkerboard target consists of alternating black and white squares, all of uniform size and arranged regularly. The corner points are the intersections of the black and white squares, and these corner points are crucial for position measurement based on the checkerboard target.
[0030] The number of rows and columns in the checkerboard target is a positive integer. In this embodiment, the number of intersection points of two pairs of adjacent black and white squares is the value of the number of rows and columns of the checkerboard target. The number of rows and columns of the checkerboard target can be the same or different. This embodiment does not limit this. Preferably, the number of rows and columns of the checkerboard target is the same and is a positive odd number, denoted as N.
[0031] like Figure 1As shown, the number of rows and columns N of the checkerboard target is 5; the side length of each square in the checkerboard target is denoted as size, preferably size = 40mm; the vertical length from the edge of the checkerboard square to the edge of the checkerboard target is denoted as border, preferably border = 20mm, wherein the edges of the checkerboard squares and the edges of the checkerboard target are as follows: Figure 1 As shown.
[0032] In this embodiment of the application, a prism is provided around the checkerboard target, preferably a total internal reflection prism.
[0033] In some embodiments, the prism can be cylindrical; in other embodiments, the prism can be any polygonal prism, such as a rectangular prism, a pentagonal prism, or an irregular polygonal prism. This application does not impose any limitations on this. Preferably, in this application embodiment, the prism is cylindrical, i.e., as shown... Figure 1 As shown, the prism has a circular cross-sectional shape.
[0034] It should be noted that the center of the prism is the center of the prism's cross-sectional shape, such as... Figure 1 As shown, when the cross-sectional shape of the prism is circular, the center of the circle is the center of the prism.
[0035] The prism can be directly fixed to the edge of the checkerboard target, or it can be fixed to the edge of the checkerboard target using a bracket; this application does not impose any limitations on this. Figure 1 As shown, the checkerboard target provided in this embodiment has a prism bracket, and the prism is fixed on the prism bracket to be fixed to the edge of the checkerboard target; the shape of the prism bracket can be customized, preferably, as shown in the figure. Figure 1 As shown, the bracket is L-shaped; Figure 1 In this case, the length from the center of the prism to the edge of the prism support near the checkerboard is denoted as l1, preferably l1 = 60mm.
[0036] When the prism is installed on the checkerboard target, the installation position can be customized. In this embodiment, a rectangular coordinate system is established with the upper left corner of the checkerboard as the origin, the horizontal direction to the right along the checkerboard as the x-axis, and the vertical direction downward along the checkerboard as the y-axis. Optionally, the straight line connecting the center of the prism and the center of the checkerboard target is parallel to either the x or y axis and perpendicular to the other axis. Preferably, as shown below... Figure 1 As shown, the center of the prism is located directly above the center of the checkerboard target.
[0037] It should be noted that, in the embodiments of this application, the surface of the checkerboard target has a reflective material (such as reflective stickers or reflective coatings) to enhance the image features of the checkerboard pattern in low-light environments.
[0038] Figure 2 The diagram shown is a flowchart illustrating a position measurement method based on a checkerboard target according to an embodiment of this application. Figure 2 As shown, the method may include the following steps S210 to S270.
[0039] Step S210: Acquire a checkerboard target image using a ranging device and determine the coordinate array of the first corner point of the checkerboard target in the image coordinate system. The ranging device includes a device pan-tilt unit, an image acquisition device, and a laser rangefinder. The checkerboard target includes multiple squares of the same size, and a prism is set around the checkerboard target.
[0040] In some embodiments, the checkerboard target image can be obtained directly by a ranging device; in other embodiments, the checkerboard target image can also be extracted from video footage acquired by the ranging device; the embodiments of this application do not limit the method of obtaining the checkerboard target image.
[0041] In some embodiments, the image acquisition device and the laser rangefinder of the ranging device are arranged in parallel on the device's pan-tilt head. The device's pan-tilt head can be adjusted manually or automatically to flexibly adjust the viewing angle of the ranging device.
[0042] In this embodiment of the application, the first corner point coordinate array includes the pixel coordinates of all corner points in the checkerboard target image under the image coordinate system of the image acquisition device.
[0043] In some embodiments, the pixel coordinates of the corner points in the checkerboard target image can be determined by using the corner recognition function (opencv-findChessboardCorners) to identify all corner points; in other embodiments, the pixel coordinates of all corner points can also be determined by using the method provided in Chinese Invention Patent (CN111798422A) entitled "Checkerboard Corner Recognition Method, Apparatus, Device and Storage Medium"; this application does not limit the method of obtaining the pixel coordinates of the corner points.
[0044] Specifically, in step S210, when acquiring the checkerboard target image, in response to the checkerboard target being placed at the measurement location, the viewing angle of the ranging device is adjusted so that the checkerboard target is within the image acquisition range of the image acquisition device of the ranging device. Subsequently, corner point recognition is performed on the acquired checkerboard target image to determine the pixel coordinates of all corner points in the checkerboard target image under the image coordinate system of the image acquisition device.
[0045] Step S220: Obtain the coordinate array of the second corner point of the chessboard target in the chessboard model coordinate system based on the characteristic parameters of the chessboard target.
[0046] In this embodiment of the application, the second corner point coordinate array is the coordinates of all corner points in the chessboard target under the chessboard model coordinate system.
[0047] Specifically, the method for obtaining the second corner point coordinate array in step S220 can be derived from... Figure 3 The method shown is used to achieve this. Figure 3 The diagram shown is a flowchart illustrating a method for obtaining the coordinate array of the second corner point of a chessboard target according to an embodiment of this application.
[0048] like Figure 3 As shown, step S220 includes the following steps S310 to S320:
[0049] Step S310: Based on the side length of the square and the number of rows and columns of the chessboard in the chessboard target, obtain the horizontal chessboard corner coordinate array in the horizontal direction and the vertical chessboard corner coordinate array in the vertical direction, respectively. The feature parameters of the chessboard target include the side length of the square and the number of rows and columns of the chessboard.
[0050] Specifically, a rectangular coordinate system is established with the top left corner of the chessboard as the origin, the horizontal direction to the right of the chessboard as the x-axis, and the vertical direction downwards of the chessboard as the y-axis. The coordinate arrays of the horizontal chessboard corner points and the vertical chessboard corner points are calculated respectively.
[0051] It should be noted that the above-mentioned horizontal chessboard corner coordinate array refers to the array consisting of the straight-line distances from each corner point on the x-axis of the chessboard to the origin of the chessboard, and the values in this array are arranged in ascending order; the above-mentioned vertical chessboard corner coordinate array refers to the array consisting of the straight-line distances from each corner point on the y-axis of the chessboard to the origin of the chessboard, and the values in this array are arranged in ascending order.
[0052] The specific calculation steps for the horizontal and vertical chessboard corner coordinate arrays are as follows:
[0053] Step 1: Obtain the maximum horizontal and vertical lengths of the default chessboard grid, denoted as xma and yma respectively. The specific formulas for calculating xma and yma are as follows:
[0054] xma = N * size,
[0055] yma = N * size
[0056] Where N is the number of rows and columns of the chessboard as defined above, and size is the side length of the square in the chessboard target.
[0057] Step 2: Since both the maximum horizontal length xma and the maximum vertical length yma are equally divided using the side length of the squares in the chessboard as the unit length, we can obtain the horizontal chessboard corner coordinate array and the vertical chessboard corner coordinate array based on the maximum horizontal length xma, the maximum vertical length yma, and the side length of the squares in the chessboard, as shown below:
[0058] The coordinate array of the corner points of the horizontal chessboard is p_x = [0, size, 2*size, ..., (N-1)*size].
[0059] The coordinate array of the corner points of the vertical chessboard grid is p_y = [0, size, 2*size, ..., (N-1)*size].
[0060] Where p_x is the array of coordinates of the corner points of the horizontal chessboard, p_y is the array of coordinates of the corner points of the vertical chessboard, N is the number of rows and columns of the chessboard, and size is the side length of the square.
[0061] Step S320: Obtain the second corner point coordinate array based on the horizontal chessboard corner point coordinate array and the vertical chessboard corner point coordinate array.
[0062] Specifically, step S320 includes the following steps:
[0063] Step 1: Get the value of the first element of the horizontal chessboard corner coordinate array.
[0064] Specifically, the value of the first element of the horizontal chessboard corner point coordinate array obtained in the above steps is denoted as x0. Combined with step S310, x0 is the value of the first element of the horizontal chessboard corner point coordinate array p_x. Therefore, the value of x0 is 0.
[0065] Step 2: Get the value of the first element of the vertical chessboard corner coordinate array.
[0066] Specifically, the value of the first element of the vertical chessboard corner point coordinate array obtained in the above steps is denoted as y0. Combined with step S310, y0 is the value of the first element of the vertical chessboard corner point coordinate array p_y. Therefore, the value of y0 is 0.
[0067] Step 3: Use the value of the first element of the horizontal checkerboard corner point coordinate array as the x-axis coordinate value of the first element of the second corner point coordinate array, and use the value of the first element of the vertical checkerboard corner point coordinate array as the y-axis coordinate value of the first element of the second corner point coordinate array, so as to obtain the first element of the second corner point coordinate array.
[0068] Specifically, in the above steps, the first element of the second corner point coordinate array is obtained and denoted as p00. The coordinates of the first element of the second corner point coordinate array can be represented as p00(x0,y0). Combining steps 1 and 2 above, we know that the coordinate value of the first element of the second corner point coordinate array is p00(0,0).
[0069] Step 4: Repeat steps 2 to 3 until the last value of the vertical chessboard corner coordinate array is obtained.
[0070] After step 4, the coordinates of the first element to the (N-1)th element in the second corner point coordinate array can be obtained sequentially, that is, the coordinates of all corner points in the first column of the chessboard. Figure 1 Taking the checkerboard target shown as an example (N=5), for this checkerboard, along the x-axis, the coordinate array of its horizontal checkerboard corner points is p_x=[0,size,2*size,3*size,4*size], and along the y-axis, the coordinate array of its vertical checkerboard corner points is p_y=[0,size,2*size,3*size,4*size]. After step 4, the coordinates of all corner points located on the y-axis can be obtained in sequence, namely: p00(0,0), p01(0,1*size), p02(0,2*size), p03(0,3*size), p04(0,4*size).
[0071] Step 5: Repeat steps 1 to 4 until the last value of the horizontal checkerboard corner coordinate array is obtained.
[0072] After step 5, the coordinates of all corner points in the checkerboard model coordinate system can be obtained sequentially. (Continuing with...) Figure 1 Taking the chessboard target shown as an example (N=5), for this chessboard, after step 5, the coordinates of all corner points in the chessboard can be obtained sequentially, as follows:
[0073] p00(0,0), p01(0,1*size), p02(0,2*size), p03(0,3*size), p04(0,4*size), p10(1*size,0), p11(1*size,1*size), p12(1*si ze,2*size), p13(1*size,3*size), p14(1*size,4*size), p20(2*size,0), p21(2*size,1*size), p22(2*size,2*size), p23(2 *size,3*size), p24(2*size,4*size), p30(3*size,0), p31(3*size,1*size), p32(3*size,2*size), p33(3*size,3*size), p3 4(3*size,4*size), p40(4*size,0), p41(4*size,1*size), p42(4*size,2*size), p43(4*size,3*size), p44(4*size,4*size).
[0074] Step 6: Add all the corner coordinates obtained in Steps 1 to 5 to the second corner coordinate array in order to obtain the second corner coordinate array.
[0075] In step 6, adding the coordinates of all corner points to the second corner point coordinate array in sequence means that after all the corner point coordinates obtained through steps 1 to 5 are added to the second corner point coordinate array, the order of all corner points in the second corner point coordinate array is consistent with the order of all corner points in the aforementioned first corner point coordinate array.
[0076] Step S230: Obtain the coordinates of the prism center in the checkerboard model coordinate system.
[0077] Figure 4 The diagram shown is a flowchart illustrating a method for obtaining the coordinates of a prism center according to an embodiment of this application.
[0078] like Figure 4 As shown, specifically, step S230 includes the following steps S410 to S430:
[0079] Step S410: Determine the coordinate index of the reference corner point of the prism center according to the installation position of the prism.
[0080] Specifically, a rectangular coordinate system is established with the top left corner of the chessboard as the origin, the horizontal direction to the right along the chessboard as the x-axis, and the vertical direction downward along the chessboard as the y-axis. The coordinate index of the reference corner point on the x-axis is denoted as ix, and the coordinate index of the reference corner point on the y-axis is denoted as iy.
[0081] by Figure 1 Taking the example where the prism center is directly above the center of the checkerboard (i.e., the straight line connecting the prism center and the center of the checkerboard target is parallel to the y-axis and perpendicular to the x-axis), when the prism center is directly above the center of the checkerboard, iy is 0, and the value of ix is the center value c of the checkerboard along the x-axis (i.e., ix = c). The specific formula for calculating c is as follows:
[0082] c = ceil(N / 2),
[0083] Here, ceil() is the floor function, and N is the number of rows and columns of the chessboard.
[0084] Step S420: Determine the coordinate value of the reference corner point based on the coordinate index of the reference corner point at the center of the prism, as well as the coordinate arrays of the horizontal and vertical checkerboard corner points.
[0085] Specifically, the coordinates of the reference corner points are denoted as vx and vy, respectively. Combining step S410, the horizontal checkerboard corner point coordinate array p_x, and the vertical checkerboard corner point coordinate array p_y, the value of vx can be obtained as p_x[ix], and the value of vy as p_y[iy]. Figure 1 For example, in Figure 1 In the case of N=5, vx=2*size, vy=0, that is, the coordinates of the reference corner point are (2*size,0).
[0086] Step S430: Determine the coordinates of the prism center based on the coordinates of the reference corner point, the vertical length from the edge of the checkerboard grid to the edge of the checkerboard grid target, and the minimum vertical distance from the prism center to the edge of the checkerboard grid target.
[0087] Let the coordinates of the prism center be denoted as prism2(nvx,nvy), specifically, as follows: Figure 1 As shown, taking an example where the prism center is located directly above the center of the checkerboard and has a prism support, the specific calculation formulas for nvx and nvy are as follows:
[0088] nvx=vx,nvy=vy-size-border-l1,
[0089] Where size is the side length of the square in the checkerboard target, border is the vertical length from the edge of the checkerboard to the edge of the checkerboard target, and l1 is the length from the center of the prism to the edge of the prism support near the checkerboard (i.e., the minimum vertical distance from the center of the prism to the edge of the checkerboard target).
[0090] Refer again Figure 2 After obtaining the coordinate arrays of the first and second corner points, the rotation and translation matrices of the first and second corner point coordinate arrays can be calculated. The method for obtaining the rotation and translation matrices is as follows: step S240:
[0091] Step S240: Based on the first corner point coordinate array, the second corner point coordinate array, the intrinsic parameters of the image acquisition device, and the distortion correction parameters of the image acquisition device, obtain the rotation and translation matrices of the first corner point coordinate array and the second corner point coordinate array.
[0092] The intrinsic parameters and distortion correction parameters of the image acquisition device can use calibrated values or default values, and this application embodiment does not impose any restrictions on this. The default value of the intrinsic parameters of the image acquisition device is [1000,0,960,0,1000,540,0,0,1], and the default value of the distortion correction parameters of the image acquisition device is [0,0,0,0,0].
[0093] In one implementation, the first corner coordinate array, the second corner coordinate array, the intrinsic parameters of the image acquisition device, and the distortion correction parameters of the image acquisition device can be substituted into cv2.solvePnp to obtain the mapping relationship between the default chessboard grid and the image chessboard grid, that is, the rotation and translation matrix between the default chessboard grid and the image chessboard grid.
[0094] cv2.solvePnp is an OpenCV function used to solve the Perspective-n-Point (PnP) problem. The goal of the PnP problem is to calculate the camera pose (i.e., rotation and translation vectors) based on known 3D points (in world coordinates) and their 2D projections in the image.
[0095] In another implementation, a deep learning model can be used to obtain the mapping relationship between the default chessboard and the image chessboard, that is, the rotation and translation matrices of the default chessboard and the image chessboard.
[0096] Step S250: Based on the coordinates of the prism center, the rotation and translation matrix, the intrinsic parameters of the image acquisition device, and the distortion correction parameters of the image acquisition device, obtain the estimated pixel coordinates of the prism center in the image coordinate system.
[0097] In one implementation, the coordinates of the prism center, the rotation and translation matrix, the intrinsic parameters of the image acquisition device, and the distortion correction parameters of the image acquisition device can be substituted into cv2.projectPoints to obtain the pre-estimated pixel coordinates of the prism center in the checkerboard target image.
[0098] cv2.projectPoints is a function in OpenCV used to project 3D points onto a 2D image plane. It calculates the projected position of the 3D points in the image based on the camera's intrinsic parameters, distortion coefficients, and the camera's pose (rotation and translation vectors).
[0099] In another implementation, a deep learning model can be used to obtain the estimated pixel coordinates of the prism center in the checkerboard target image.
[0100] Step S260: In response to the laser rangefinder emitting a laser signal toward the pre-estimated pixel coordinates of the prism center, the echo signal is acquired and the laser distance from the ranging device to the prism center is determined.
[0101] Specifically, after determining the estimated pixel coordinates of the prism center in the checkerboard target image through step S250, the horizontal and vertical angles of the device's pan-tilt unit are adjusted to ensure that the laser rangefinder can emit laser signals to the estimated pixel coordinates of the prism center to avoid measurement deviations, and to obtain the laser echo signal fed back by the prism. Thus, the relative distance between the ranging device and the prism center, i.e., the laser distance, can be determined based on the echo feedback delay of the laser echo signal (i.e., the time difference between the laser signal emission time and the laser echo signal reception time).
[0102] Step S270: Obtain the spatial coordinates of the checkerboard target based on the laser distance, the current horizontal angle of the device gimbal, and the current vertical angle of the device gimbal.
[0103] Specifically, in step S270, the laser distance, the current horizontal angle of the device gimbal, and the current vertical angle of the device gimbal can be input into the spherical coordinate calculation formula to calculate the spatial coordinates of the prism center in the Cartesian coordinate system, i.e., the spatial coordinates of the checkerboard target.
[0104] The above is an introduction to a position measurement method based on a checkerboard target provided in the embodiments of this application. The above solution, by setting a total internal reflection prism around the reflective checkerboard target, can not only overcome the problem of reduced measurement accuracy caused by changes in reflectivity of ordinary reflective checkerboard targets in low light environments, but also solve the problem that ordinary prism checkerboard targets cannot be spatially measured and positioned in low light environments because the image features of the checkerboard are destroyed. Thus, the measurement accuracy of checkerboard targets in low light environments can be improved as a whole.
[0105] The above-mentioned position measurement method based on checkerboard target can be derived from... Figure 5 The position measurement system based on the checkerboard target shown is being implemented.
[0106] Figure 5 The diagram shown is a schematic diagram of a position measurement system based on a checkerboard target according to an embodiment of this application. Figure 5 As shown, the system 500 includes:
[0107] The first corner point coordinate array determination module 510 is used to acquire a chessboard target image through a ranging device and determine the first corner point coordinate array of the chessboard target in the image coordinate system. The ranging device includes a device pan-tilt unit, an image acquisition device and a laser rangefinder. The chessboard target includes multiple squares of the same size and a prism is set around the chessboard target.
[0108] The second corner point coordinate array determination module 520 is used to obtain the second corner point coordinate array of the chessboard target in the chessboard model coordinate system according to the characteristic parameters of the chessboard target.
[0109] Prism center coordinate determination module 530 is used to obtain the coordinates of the prism center in the checkerboard model coordinate system;
[0110] The rotation and translation matrix determination module 540 is used to obtain the rotation and translation matrix of the first corner point coordinate array and the second corner point coordinate array based on the first corner point coordinate array, the second corner point coordinate array, the intrinsic parameters of the image acquisition device and the distortion correction parameters of the image acquisition device;
[0111] The prism center pre-estimated pixel coordinate acquisition module 550 is used to obtain the pre-estimated pixel coordinates of the prism center in the image coordinate system based on the coordinates of the prism center, the rotation and translation matrix, the intrinsic parameters of the image acquisition device, and the distortion correction parameters of the image acquisition device.
[0112] The laser distance determination module 560 is used to respond to the laser rangefinder emitting a laser signal toward the pre-estimated pixel coordinates of the prism center, acquire the echo signal and determine the laser distance from the ranging device to the prism center.
[0113] The spatial coordinate determination module 570 is used to obtain the spatial coordinates of the checkerboard target based on the laser distance, the current horizontal angle of the device gimbal, and the current vertical angle of the device gimbal.
[0114] The position measurement system based on checkerboard targets provided in this application can overcome the problems of reduced measurement accuracy or inability to perform spatial measurement and positioning of checkerboard targets in low-light environments, thereby improving the measurement accuracy of checkerboard targets in low-light environments.
[0115] It should be understood that, for the sake of convenience and brevity, the specific working scenarios, processes, effects, and other details of each module in the above system 500 can be referred to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0116] This application also provides an electronic device. Figure 6 The diagram shown is a block diagram of an exemplary electronic device provided in an embodiment of this application. (Refer to...) Figure 6 The electronic device 600 includes a memory 610 and a processor 620. The memory 610 stores a computer program, and the processor 620 runs the computer program to enable the electronic device 600 to implement the position measurement method based on a checkerboard target provided in any of the foregoing embodiments.
[0117] Electronic device 600 may also include a power supply component configured to perform power management of electronic device 600, a wired or wireless network interface configured to connect electronic device 600 to a network, and an input / output (I / O) interface. Electronic device 600 may operate based on an operating system stored in memory 610, such as Windows Server™, Mac OSX™, Unix™, Linux™, FreeBSD™, or similar.
[0118] This application also provides a computer-readable storage medium storing a computer program thereon. When the computer program in the storage medium is executed by the processor 620 of the electronic device 600, the electronic device 600 is able to implement the position measurement method based on the checkerboard target provided in any of the foregoing embodiments.
[0119] This application also provides a computer program product, which includes instructions that, when executed by the processor 620 of the electronic device 600, enable the electronic device 600 to implement the position measurement method based on a checkerboard target provided in any of the foregoing embodiments.
[0120] The prompting method in this application can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions of this application are performed, in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, network equipment, user equipment, core network equipment, OAM, or other programmable device.
[0121] The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM (Operational Information Management) system, or other programmable devices.
[0122] The computer program or instructions may be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions may be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium may be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; an optical medium, such as a digital video optical disc; or a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0123] It is understood that the specific examples provided in this application are only intended to help those skilled in the art better understand the embodiments of this application, and are not intended to limit the scope of the invention.
[0124] It is understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0125] It is understood that the various embodiments described in this application can be implemented individually or in combination, and the embodiments of this application are not limited in this respect.
[0126] Unless otherwise stated, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this application includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0127] It is understood that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0128] It is understood that the memory in the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Specifically, non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0129] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0130] For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0131] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0132] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0133] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0134] The above are merely specific embodiments of this disclosure, but the scope of protection of this invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this invention should be determined by the scope of the claims.
Claims
1. A method for measuring the position of a target based on a checkerboard pattern, characterized in that, include: The range measuring device acquires the image of the checkerboard target and determines the coordinate array of the first corner point of the checkerboard target in the image coordinate system. The range measuring device includes a device pan-tilt unit, an image acquisition device and a laser rangefinder. The checkerboard target includes multiple squares of the same size and a prism is set around the checkerboard target. Based on the characteristic parameters of the chessboard target, obtain the coordinate array of the second corner point of the chessboard target in the coordinate system of the chessboard model; Obtain the coordinates of the prism center in the coordinate system of the chessboard model; Based on the first corner coordinate array, the second corner coordinate array, the intrinsic parameters of the image acquisition device, and the distortion correction parameters of the image acquisition device, obtain the rotation and translation matrices of the first corner coordinate array and the second corner coordinate array; Based on the coordinates of the prism center, the rotation and translation matrix, the intrinsic parameters of the image acquisition device, and the distortion correction parameters of the image acquisition device, the estimated pixel coordinates of the prism center in the image coordinate system are obtained; In response to the laser rangefinder emitting a laser signal toward the pre-estimated pixel coordinates of the prism center, the echo signal is acquired and the laser distance from the ranging device to the prism center is determined. The spatial coordinates of the checkerboard target are obtained based on the laser distance, the current horizontal angle of the device gimbal, and the current vertical angle of the device gimbal.
2. The method according to claim 1, characterized in that, The step of obtaining the coordinate array of the second corner point of the chessboard target in the chessboard model coordinate system based on the feature parameters of the chessboard target includes: Based on the side length of the square and the number of rows and columns of the chessboard in the chessboard target, obtain the horizontal chessboard corner coordinate array in the horizontal direction and the vertical chessboard corner coordinate array in the vertical direction, respectively. The feature parameters of the chessboard target include the side length of the square and the number of rows and columns of the chessboard. The second corner point coordinate array is obtained based on the horizontal chessboard corner point coordinate array and the vertical chessboard corner point coordinate array.
3. The method according to claim 2, characterized in that, The step of obtaining the horizontal corner coordinate array of the chessboard grid and the vertical corner coordinate array of the chessboard grid according to the side length of the square and the number of rows and columns of the chessboard grid in the chessboard grid target includes: A rectangular coordinate system is established with the top left corner of the chessboard as the origin, the horizontal direction to the right of the chessboard as the x-axis, and the vertical direction downward of the chessboard as the y-axis. The coordinate arrays of the horizontal chessboard corner points and the coordinate arrays of the vertical chessboard corner points are calculated respectively.
4. The method according to claim 3, characterized in that, The step of obtaining the second corner point coordinate array based on the horizontal chessboard corner point coordinate array and the vertical chessboard corner point coordinate array includes the following steps: Step 1: Obtain the value of the first element of the horizontal chessboard corner point coordinate array; Step 2: Obtain the value of the first element of the vertical chessboard corner point coordinate array; Step 3: Use the value of the first element of the horizontal checkerboard corner point coordinate array as the x-axis coordinate value of the first element of the second corner point coordinate array, and use the value of the first element of the vertical checkerboard corner point coordinate array as the y-axis coordinate value of the first element of the second corner point coordinate array, so as to obtain the first element of the second corner point coordinate array; Step 4: Repeat steps 2 to 3 until the last value of the vertical chessboard corner coordinate array is obtained; Step 5: Repeat steps 1 to 4 until the last value of the horizontal chessboard corner coordinate array is obtained; Step 6: Add all the corner coordinates obtained in steps 1 to 5 to the second corner coordinate array in order to obtain the second corner coordinate array.
5. The method according to claim 2, characterized in that, The straight line connecting the center of the prism and the center of the checkerboard target is parallel to either the x or y axis and perpendicular to the other axis. The upper left corner of the checkerboard is taken as the origin of the coordinate system, the horizontal direction to the right along the checkerboard is the x-axis, and the vertical direction downward along the checkerboard is the y-axis.
6. The method according to claim 5, characterized in that, The feature parameters of the checkerboard target also include the vertical length from the edge of the checkerboard grid to the edge of the checkerboard target; obtaining the coordinates of the prism center in the checkerboard model coordinate system includes: Based on the installation position of the prism, determine the coordinate index of the reference corner point at the center of the prism; The coordinate value of the reference corner point is determined based on the coordinate index of the reference corner point at the center of the prism, the coordinate array of the horizontal checkerboard corner points, and the coordinate array of the vertical checkerboard corner points. The coordinates of the prism center are determined based on the coordinates of the reference corner point, the vertical length from the edge of the checkerboard grid to the edge of the checkerboard target, and the minimum vertical distance from the prism center to the edge of the checkerboard target.
7. A position measurement system based on a checkerboard target, characterized in that, include: The first corner point coordinate array determination module is used to acquire the chessboard target image through a ranging device and determine the first corner point coordinate array of the chessboard target in the image coordinate system. The ranging device includes a device pan-tilt unit, an image acquisition device and a laser rangefinder. The chessboard target includes multiple squares of the same size and a prism is set around the chessboard target. The second corner point coordinate array determination module is used to obtain the second corner point coordinate array of the chessboard target in the chessboard model coordinate system according to the characteristic parameters of the chessboard target. The prism center coordinate determination module is used to obtain the coordinates of the prism center in the checkerboard model coordinate system; The rotation and translation matrix determination module is used to obtain the rotation and translation matrix of the first corner point coordinate array and the second corner point coordinate array based on the first corner point coordinate array, the second corner point coordinate array, the intrinsic parameters of the image acquisition device, and the distortion correction parameters of the image acquisition device. The module for obtaining the pre-estimated pixel coordinates of the prism center is used to obtain the pre-estimated pixel coordinates of the prism center in the image coordinate system based on the coordinates of the prism center, the rotation and translation matrix, the intrinsic parameters of the image acquisition device, and the distortion correction parameters of the image acquisition device. The laser distance determination module is used to respond to the laser rangefinder emitting a laser signal toward the pre-estimated pixel coordinates of the prism center, acquiring the echo signal and determining the laser distance from the ranging device to the prism center; The spatial coordinate determination module is used to obtain the spatial coordinates of the checkerboard target based on the laser distance, the current horizontal angle of the device gimbal, and the current vertical angle of the device gimbal.
8. An electronic device, characterized in that, include: Memory; A processor, the memory for storing a computer program, the processor running the computer program to cause the electronic device to perform the position measurement method based on a checkerboard target as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the position measurement method based on a checkerboard target as described in any one of claims 1 to 6.