Detection alignment method, detection alignment apparatus, computer device, and storage medium
By identifying the feature points of the target object and adjusting the spatial plane, the problem of accurate alignment at height in the prior art is solved, and three-dimensional high-precision alignment and detection alignment accuracy are achieved.
Patent Information
- Application Number
- PCT/CN2024/088856
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-10-17
- Filing Date
- 2024-04-19
- Publication Date
- 2025-06-19
AI Technical Summary
The existing detection and alignment technology cannot be accurately aligned at a height, which affects the accuracy of the test results.
The target camera recognizes the feature points of the target object, obtains its three-dimensional information, adjusts the spatial plane to be perpendicular to the preset plane, and aligns the image center point of the target camera with the optical center point of the target object by identifying the three-dimensional information of the third feature point.
Three-dimensional high-precision alignment is achieved, and the accuracy of detection and alignment is improved.
Smart Images

Figure CN2024088856_19062025_PF_FP_ABST
Abstract
Description
Detection alignment method, detection alignment device, computer equipment and storage medium
[0001] This application claims priority to Chinese patent application number 2023113383311, filed on October 17, 2023, entitled “Detection alignment method, device, computer equipment and storage medium,” the entire text of which is incorporated herein by reference. Technical Field
[0002] The present application relates to the field of visual detection technology, and in particular to a detection and alignment method for a spatial target point, a detection and alignment device, a computer device, a storage medium, and a computer program product. Background Art
[0003] With the advancement of visual inspection technology, detection and alignment based on spatial target points has also developed from two-dimensional high precision to three-dimensional high precision. However, the current detection and alignment technology for spatial target points cannot accurately align in height.
[0004] For example, taking the optical performance testing of AR (Augment Reality) devices as an example, it is usually necessary to align the camera image center with the optical center point of the AR device in advance, and the height difference between the camera image center and the optical center of the AR device needs to be kept within a very small range. However, current technology cannot accurately align the height, which affects the accuracy of the test results.
[0005] Summary of the Invention
[0006] According to various embodiments of the present application, a detection and alignment method, a detection and alignment apparatus, a computer device, a computer-readable storage medium, and a computer program product are provided.
[0007] In a first aspect, the present application provides a method for detecting alignment, the method comprising:
[0008] Identifying first feature points of a target object by a target camera and acquiring first three-dimensional information of the first feature points, where the first feature points include three;
[0009] determining a first spatial plane according to the first three-dimensional information, and adjusting the first spatial plane so that the first spatial plane is perpendicular to a preset first plane;
[0010] Identifying second feature points of a target object by the target camera and acquiring second three-dimensional information of the second feature points, where the second feature points include three;
[0011] determining a second spatial plane according to the second three-dimensional information, and adjusting the second spatial plane so that the second spatial plane is perpendicular to a preset second plane;
[0012] recognizing a third feature point of the target object by the target camera, and acquiring third three-dimensional information of the third feature point;
[0013] The height of the target feature point is adjusted to a preset height according to the third three-dimensional information to align the image center point of the target camera with the optical center point of the target object.
[0014] In one embodiment, determining a first spatial plane according to the first three-dimensional information, and adjusting the first spatial plane so that the first spatial plane is perpendicular to a preset first plane includes:
[0015] determining a first spatial plane according to the first three-dimensional information, obtaining a first angle between the first spatial plane and the first plane, and obtaining a first offset direction of the first angle;
[0016] According to the first angle and the first offset direction, the angle of the first spatial plane is adjusted so that the first spatial plane is perpendicular to the first plane.
[0017] In one embodiment, obtaining a first angle between the first spatial plane and the first plane includes:
[0018] determining a first normal vector to the first spatial plane, and determining a second normal vector to the first plane;
[0019] A first angle between the first space plane and the first plane is determined according to the first normal vector and the second normal vector.
[0020] In one embodiment, obtaining the first offset direction of the first angle includes:
[0021] determining an intersection line between the first spatial plane and the first plane;
[0022] Acquire a first target point on the first spatial plane that is perpendicular to the intersection line; and acquire a second target point on the first plane that is perpendicular to the intersection line;
[0023] A first offset direction of the first angle is determined according to the first target point and the second target point.
[0024] In one embodiment, determining a second spatial plane according to the second three-dimensional information, and adjusting the second spatial plane so that the second spatial plane is perpendicular to a preset second plane includes:
[0025] determining a second spatial plane according to the second three-dimensional information, obtaining a second angle between the second spatial plane and the second plane, and obtaining a second offset direction of the second angle;
[0026] According to the second included angle and the second offset direction, the angle of the second spatial plane is adjusted so that the second spatial plane is perpendicular to the second plane.
[0027] In one embodiment, the third feature points include three, and the three third feature points include a target feature point; and adjusting the height of the target feature point to a preset height according to the third three-dimensional information to align the image center point of the target camera with the optical center point of the target object includes:
[0028] determining a tilt angle according to the third three-dimensional information of the target feature point and the third three-dimensional information of another third feature point;
[0029] The tilt angle is corrected, and the height of the target feature point is adjusted to a preset height to align the image center point of the target camera with the optical center point of the target object.
[0030] In one embodiment, the target camera is a camera capable of acquiring depth information.
[0031] In one embodiment, the target object has an optical center point, and the target object includes but is not limited to an AR device and a VR device.
[0032] In a second aspect, the present application provides a detection alignment device, the device comprising:
[0033] A first acquisition module is configured to identify first feature points of a target object through a target camera and acquire first three-dimensional information of the first feature points, where the first feature points include three;
[0034] a first adjustment module, configured to determine a first spatial plane according to the first three-dimensional information, and adjust the first spatial plane so that the first spatial plane is perpendicular to a preset first plane;
[0035] A second acquisition module is configured to identify second feature points of the target object through the target camera and acquire second three-dimensional information of the second feature points, where the second feature points include three;
[0036] a second adjustment module, configured to determine a second spatial plane according to the second three-dimensional information, and adjust the second spatial plane so that the second spatial plane is perpendicular to a preset second plane;
[0037] a third acquisition module, configured to identify a third feature point of the target object by using the target camera, and acquire third three-dimensional information of the third feature point;
[0038] A third adjustment module is configured to adjust the height of the target feature point to a preset height according to the third three-dimensional information, so as to align the image center point of the target camera with the optical center point of the target object.
[0039] In one embodiment, the first adjustment module is further configured to:
[0040] determining a first spatial plane according to the first three-dimensional information, obtaining a first angle between the first spatial plane and the first plane, and obtaining a first offset direction of the first angle;
[0041] According to the first angle and the first offset direction, the angle of the first spatial plane is adjusted so that the first spatial plane is perpendicular to the first plane.
[0042] In one embodiment, the second adjustment module is further configured to:
[0043] determining a second spatial plane according to the second three-dimensional information, obtaining a second angle between the second spatial plane and the second plane, and obtaining a second offset direction of the second angle;
[0044] According to the second included angle and the second offset direction, the angle of the second spatial plane is adjusted so that the second spatial plane is perpendicular to the second plane.
[0045] In a third aspect, the present application provides a detection alignment system, the system comprising:
[0046] A target camera and a target object having an optical center point, wherein the image center point of the target camera and the optical center point of the target object are aligned using the method described above.
[0047] In a fourth aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0048] In a fifth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.
[0049] In a sixth aspect, the present application also provides a computer program product, comprising a computer program, which implements the steps of the above method when executed by a processor.
[0050] The details of one or more embodiments of the present application are set forth in the following drawings and description. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0052] FIG1 is a schematic flow chart of a detection alignment method according to an embodiment;
[0053] FIG2 is a schematic diagram of a process of adjusting the first spatial plane in one embodiment;
[0054] FIG3 is a schematic diagram of a spatial plane in one embodiment;
[0055] FIG4 is a simplified spatial diagram of FIG3 ;
[0056] FIG5 is a schematic flow chart of the step of obtaining a first offset direction in one embodiment;
[0057] FIG6 is a schematic flow chart of a height adjustment step in one embodiment;
[0058] FIG7 is a structural block diagram of a detection and alignment device in one embodiment;
[0059] FIG8 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0061] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0062] In an exemplary embodiment, as shown in FIG1 , a method for detecting alignment is provided, which may specifically include the following steps:
[0063] Step 102: Identify a first feature point of a target object through a target camera and obtain first three-dimensional information of the first feature point.
[0064] The target camera may be a camera capable of acquiring depth information, such as a binocular camera or a 3D camera. The target object may be any device having an optical center point, such as, but not limited to, an AR device or a VR (Virtual Reality) device.
[0065] The first feature point may specifically include three feature points, one of which is the test center alignment point of the target camera. The first three-dimensional information may be three-dimensional coordinate information of the first feature point, which may specifically include three-dimensional coordinate information of three feature points in the first feature point.
[0066] In this embodiment, the target camera identifies three feature points of the target object, also known as the first feature points, and calculates the two-dimensional information of these three feature points. After obtaining the position of the two-dimensional information, the target camera then calculates the height information of the corresponding two-dimensional points to obtain the three-dimensional coordinate information of each feature point. For example, if the first feature points include O1, P1, and Q1, the corresponding first three-dimensional information includes O1 (x11, y11, z11), P1 (x12, y12, z12), and Q1 (x13, y13, z13).
[0067] Step 104: determine a first spatial plane according to the first three-dimensional information, and adjust the first spatial plane.
[0068] The first spatial plane can be obtained by fitting the three-dimensional coordinate information of three feature points among the first feature points. In this embodiment, the first spatial plane can be determined by fitting the first three-dimensional information of the three feature points among the first feature points obtained in the above steps, and the first spatial plane can then be adjusted so that it is perpendicular to the preset first plane. Specifically, the preset first plane can be a plane in space where Y is 0, that is, a plane in space formed by the X-axis and the Z-axis.
[0069] Step 106 : Identify second feature points of the target object using the target camera, and obtain second three-dimensional information of the second feature points.
[0070] The second feature point may also include three feature points, one of which is the test center alignment point of the target camera. The second three-dimensional information may be the three-dimensional coordinate information of the second feature point, which may specifically include the three-dimensional coordinate information of three feature points in the second feature point.
[0071] In this embodiment, the target camera again identifies the target object's three feature points, also known as the second feature points, and calculates the two-dimensional information of these three feature points. After obtaining the position of the two-dimensional information, the target camera then calculates the height information of the corresponding two-dimensional points to obtain the three-dimensional coordinate information of each feature point. For example, if the second feature points include O2, P2, and Q2, the corresponding second three-dimensional information includes O2 (x21, y21, z21), P2 (x22, y22, z22), and Q2 (x23, y23, z23).
[0072] It should be noted that since the first spatial plane has been adjusted in the above steps, the positions of the three feature points (second feature points) obtained by the target camera when recognizing the target object again may be different from the three feature points (first feature points) recognized in the above step 102.
[0073] Step 108: Determine a second spatial plane according to the second three-dimensional information, and adjust the second spatial plane.
[0074] Similarly, the second spatial plane can be obtained by fitting the three-dimensional coordinate information of the three feature points in the second feature points. In this embodiment, the second spatial plane can be determined by fitting the second three-dimensional information of the three feature points in the second feature points obtained in the above steps. The second spatial plane can then be adjusted so that the second spatial plane is perpendicular to the preset second plane. At this time, the horizontal plane of the target camera is consistent with the horizontal plane of the target object. Specifically, the preset second plane can be the plane in space where X is 0, that is, the plane in space formed by the Y axis and the Z axis.
[0075] Step 110 : identifying a third feature point of the target object by using the target camera, and acquiring third three-dimensional information of the third feature point.
[0076] The third feature point may also include three feature points, one of which is the test center alignment point of the target camera. The third three-dimensional information may be the three-dimensional coordinate information of the third feature point, which may specifically include the three-dimensional coordinate information of three feature points in the third feature point.
[0077] In this embodiment, the target camera again identifies the three feature points of the target object, also known as the third feature points, and calculates the two-dimensional information of these three feature points. After obtaining the position of the two-dimensional information, the target camera then calculates the height information of the corresponding two-dimensional points to obtain the three-dimensional coordinate information of each feature point. For example, if the third feature points include O3, P3, and Q3, the corresponding third three-dimensional information includes O3 (x31, y31, z31), P3 (x32, y32, z32), and Q3 (x33, y33, z33).
[0078] Step 112: Adjust the height of the target feature point to a preset height according to the third three-dimensional information.
[0079] The target feature point may be the test center alignment point in the third feature point, and the height of the target feature point refers to the height information in the three-dimensional coordinate information corresponding to the feature point, i.e., the Z value. The preset height may be a pre-set standard height of the target object, which may be a parameter manually adjusted in advance. Specifically, the height of the target feature point may be adjusted to the preset height based on the third three-dimensional information to align the image center point of the target camera with the optical center point of the target object, thereby ensuring that the height difference between the camera image center and the target object optical center is within a small range.
[0080] In the above detection and alignment method, the first feature point of the target object is identified by the target camera, the first three-dimensional information of the first feature point is obtained, the first spatial plane is determined according to the first three-dimensional information, the first spatial plane is adjusted so that the first spatial plane is perpendicular to the preset first plane, the second feature point of the target object is identified by the target camera, the second three-dimensional information of the second feature point is obtained, the second spatial plane is determined according to the second three-dimensional information, the second spatial plane is adjusted so that the second spatial plane is perpendicular to the preset second plane, the third feature point of the target object is identified by the target camera, the third three-dimensional information of the third feature point is obtained, and finally the height of the target feature point is adjusted to a preset height according to the third three-dimensional information to align the image center point of the target camera with the optical center point of the target object, thereby ensuring that the height difference between the two points of the camera image center and the optical center of the target object is within a very small range, thereby achieving three-dimensional high-precision alignment.
[0081] In an exemplary embodiment, as shown in FIG2 , in step 104 , determining a first spatial plane according to the first three-dimensional information and adjusting the first spatial plane may specifically include:
[0082] Step 202: determine a first spatial plane according to the first three-dimensional information, obtain a first angle between the first spatial plane and the first plane, and obtain a first offset direction of the first angle.
[0083] Since the corresponding spatial plane can be fitted when three points are known, in this embodiment, the first spatial plane can be fitted using the three-dimensional coordinate information of the three feature points among the first feature points. Furthermore, a first normal vector of the first spatial plane and a second normal vector of the first plane are determined. Then, based on the first normal vector and the second normal vector, a first angle between the first spatial plane and the first plane is determined.
[0084] Specifically, if the spatial plane plane1 (i.e., the first spatial plane) fitted by three points is a1*x+b1*y+c1*z+d1=0, and if the preset first plane plane2 is a2*x+b2*y+c2*z+d2=0, then the normal vector n1 (i.e., the first normal vector of the first spatial plane) = (a1, b1, c1), and the normal vector n2 (i.e., the second normal vector of the first plane) = (a2, b2, c2). It should be noted that a, b, and c correspond to the components in the X, Y, and Z directions, respectively. As shown in Figures 3 and 4, Figure 3 is a schematic diagram of two spatial planes, namely the first spatial plane plane1 and the first plane plane2, which also includes the spatial normal vectors n1 and n2 of the two planes. Figure 4 is a simplified spatial diagram of Figure 3, where θ is the angle between the spatial vectors n1 and n2, which is the first angle between the first spatial plane and the first plane. Then:
[0085] Among them, n1.x represents the X-direction component corresponding to the first normal vector n1, that is, a1. Similarly, n2.x represents the X-direction component corresponding to the second normal vector n2, that is, a2. n1.y represents the Y-direction component corresponding to the first normal vector n1, that is, b1. n2.y represents the Y-direction component corresponding to the second normal vector n2, that is, b2. n1.z represents the Z-direction component corresponding to the first normal vector n1, that is, c1. n2.z represents the Z-direction component corresponding to the second normal vector n2, that is, c2.
[0086] The first angle θ between the first spatial plane and the first plane can be obtained by the above formula, where θ=acos(cosθ).
[0087] Since this embodiment needs to adjust the angle of the first spatial plane so that the first spatial plane is perpendicular to the first plane, and the above method can only obtain the angle between the first spatial plane and the first plane, but does not know in which direction the angle is offset relative to the x-axis and the y-axis. Therefore, it is necessary to further obtain the first offset direction of the first angle between the first spatial plane and the first plane, that is, to obtain the offset direction of the above-mentioned first angle θ, so as to accurately adjust the first spatial plane.
[0088] Step 204: Adjust the angle of the first spatial plane according to the first included angle and the first offset direction.
[0089] Specifically, after obtaining the first angle between the first spatial plane and the first plane, and the first offset direction of the first angle through the above steps, the angle of the first spatial plane can be adjusted according to the first angle and the first offset direction so that the first spatial plane is perpendicular to the first plane.
[0090] In an exemplary embodiment, as shown in FIG5 , in step 202 , obtaining a first offset direction of a first angle may specifically include:
[0091] Step 502: Determine the intersection line between the first spatial plane and the first plane.
[0092] Here, an intersection line refers to a straight line or curve on two two-dimensional geometric figures. For example, the intersection line between two planes or two curved surfaces, the intersection line between a plane and a curved surface, etc. The intersection line of two intersecting planes is a straight line. In other cases, the intersection line is generally a curve. In this embodiment, since the first spatial plane and the first plane can be fitted using a plane equation, the first spatial plane and the first plane can be determined, and then the corresponding intersection line can be determined based on the two planes.
[0093] Step 504 , obtaining a first target point on the first spatial plane perpendicular to the intersection line; and obtaining a second target point on the first plane perpendicular to the intersection line.
[0094] The first target point may be a point on the intersection line perpendicular to the first spatial plane, and the second target point may be a point on the intersection line perpendicular to the first plane. Specifically, based on the intersection line between the first spatial plane and the first plane determined in the above steps, the first target point on the first spatial plane perpendicular to the intersection line and the second target point on the first plane perpendicular to the intersection line can be obtained.
[0095] Step 506: Determine a first offset direction of a first angle according to the first target point and the second target point.
[0096] Specifically, the coordinates of the first target point and the second target point can be obtained, and then the first offset direction of the first angle can be determined by comparing the coordinates. For example, if you need to determine the direction in which the x-axis direction deviates, you can set x = 0, take the y value of that position, and use the y value to calculate the z value. Then, you can compare the z values. If the z axis of the first target point is larger than the z axis of the second target point, then multiply the first angle by -1 to obtain the compensation angle. If the z axis of the first target point is smaller than the z axis of the second target point, then the first angle can be determined as the compensation angle. That is, the first offset direction of the first angle can be determined, and then the angle of the first spatial plane can be adjusted, which can improve adjustment efficiency.
[0097] In an exemplary embodiment, the specific implementation principle of obtaining the first angle between the first spatial plane and the first plane, and obtaining the first offset direction of the first angle in the above step 202 is further described below.
[0098] In this embodiment, it is assumed that the equations of the two spatial planes are expressed as follows: the first spatial plane plane1 is a1*x+b1*y+c1*z+d1=0, and the first spatial plane plane2 is a2*x+b2*y+c2*z+d2=0. Then, the spatial vector of the intersecting line can be obtained by cross product, specifically:
[0099] Let A = {a1, b1, c1}, B = {a2, b2, c2}, then:
[0100] Then, we can find any point on the intersecting lines. Specifically, we can take the intersection of the intersecting lines and the XOY plane, set Z to 0, and solve the two equations simultaneously: a1*x+b1*y+d1=0, a2*x+b2*y+d2=0. The solution is: x=(b1d2-b2d1) / (a1b2-a2b1), y=(a1d2-a2d1) / (a2b1-a1b2).
[0101] That is, a point on the intersecting line is:
[0102] ((b1d2-b2d1) / (a1b2-a2b1), (a1d2-a2d1) / (a2b1-a1b2), 0)
[0103] Let it be (M, N, 0). Then the equation of the line passing through (M, N, 0) with direction vector (E, F, G) is:
[0104] (xM) / E=(yN) / F=z / G. Substitute the values of M, N, E, F and G into the formula and calculate.
[0105] Then, we can determine the spatial line perpendicular to the intersection line on the two planes. Assume that the coordinates of a point O in space are (Xo, Yo, Zo), and the coordinates of two points L1 and L2 on a line in space are: L1 (X1, Y1, Z1) and L2 (X2, Y2, Z2). Let the foot of the perpendicular to point O on line L1L2 be point L3, with coordinates (X3, Y3, Z3). The coordinate solution of point L3 is as follows:
[0106] First find the following vectors:
[0107] According to the perpendicular relationship between vectors, if two vectors are perpendicular, then the dot product (dot product, vector product) of the two vectors is 0, and we can get formula 1:
[0108] Since point L3 is on the line L1L2, according to the vector collinearity theorem:
[0109] and Collinear, then we have formula 2:
[0110] K can be understood as the distance ratio of the perpendicular foot point to the starting point, that is, a proportional coefficient. Then, from formula 2, we can get the following formula 3:
[0111] X3=k(X2-X1)+X1
[0112] Y3=k(Y2-Y1)+Y1
[0113] Z3=k(Z2-Z1)+Z1
[0114] Substituting Equation 3 into Equation 1 above, where there is only one unknown variable, k, we can simplify it to obtain Equation 4 below, which can be used to solve for k:
[0115] Then, substitute Equation 4 into Equation 3 to obtain the coordinates of the foot of the perpendicular L3.
[0116] Finding two points can find two lines in space, similar to this:
[0117] After finding the two points, the intersection of the target point on the two planes can be determined. For example, if you want to determine the direction of the X-axis offset, you can set X = 0, take the Y value of that position, and use the Y value to calculate the Z value. Then, by comparing the Z values, you can determine the angle of the offset in this direction. For example, for the first spatial plane and the first plane, if the Z axis of the first spatial plane is larger than the Z axis of the first plane, you can multiply the angle obtained above by -1 and make adjustments. If the Z axis of the first spatial plane is smaller than the Z axis of the first plane, you can directly make adjustments based on the angle obtained above, thereby ensuring the directionality of the adjustment.
[0118] In an exemplary embodiment, in step 108, determining a second spatial plane based on the second three-dimensional information and adjusting the second spatial plane may specifically include: determining the second spatial plane based on the second three-dimensional information, obtaining a second angle between the second spatial plane and the second plane, and obtaining a second offset direction for the second angle; and adjusting the angle of the second spatial plane based on the second angle and the second offset direction so that the second spatial plane is perpendicular to the second plane. It will be appreciated that the process for determining and adjusting the second spatial plane in this embodiment is similar to the process for determining and adjusting the first spatial plane described above. For details, reference may be made to the process for determining and adjusting the first spatial plane described above, and this embodiment will not be further elaborated upon.
[0119] In an exemplary embodiment, as shown in FIG6 , in step 112 , adjusting the height of the target feature point to a preset height according to the third three-dimensional information may specifically include the following steps:
[0120] Step 602 : determining a tilt angle according to the third three-dimensional information of the target feature point and the third three-dimensional information of another third feature point.
[0121] Since the third feature point includes three feature points, and one of the feature points is the test center alignment point of the target camera, that is, the target feature point, in this embodiment, the tilt angle can be determined based on the third 3D information of the target feature point and the third 3D information of another third feature point.
[0122] For example, if the third three-dimensional information of the target feature point O3 is (x31, y31, z31), and the third three-dimensional information of another third feature point P3 is (x32, y32, z32), assuming that the inclination angle between O3 and P3 is φ, then according to the trigonometric function law, tanφ = (y32-y31) / (x32-x31), then the inclination angle φ = arc[(y32-y31) / (x32-x31)].
[0123] Step 604 , correcting the tilt angle and adjusting the height of the target feature point to a preset height.
[0124] Specifically, the tilt angle can be corrected by adjusting the rotation axis of the target object. For example, the tilt angle can be eliminated by adjusting the rotation axis of the target object, thereby achieving tilt correction. Furthermore, the height of the target feature point can be adjusted to a preset height, that is, the Z coordinate z31 of the target feature point O3 is adjusted to a standard height, thereby aligning the image center point of the target camera with the optical center point of the target object, achieving high-precision three-dimensional alignment.
[0125] In one embodiment, taking the alignment scenario in the optical performance detection of an AR device as an example, where the target camera is a binocular camera and the target object is the AR device, the above-mentioned detection alignment method is further explained, which specifically may include the following steps:
[0126] Step 1: Use the binocular camera to identify three points on the AR device screen (i.e., first feature points) and obtain the three-dimensional information of the three points (i.e., first three-dimensional information), such as point o1 (xo1, yo1, zo1), point o2 (xo2, yo2, zo2), and point o3 (xo3, yo3, zo3), one of which is the test center alignment point of the camera.
[0127] Step 2: Fit the spatial equation through the three points o1, o2 and o3 to determine the corresponding first spatial plane R1.
[0128] Step 3: Obtain the angle (ie, the first angle) between the R1 plane and the y-axis plane (ie, the preset first plane), and adjust the first spatial plane R1 according to the angle so that the first spatial plane R1 is perpendicular to the y-axis plane.
[0129] The specific implementation of the above steps can refer to the embodiments of Figures 2 to 5, and will not be described in detail in this embodiment.
[0130] Step 4: Use the binocular camera to identify three points on the AR device screen (i.e., the second feature points) again and obtain the three-dimensional information of the three points (i.e., the second three-dimensional information), such as point p1 (xp1, yp1, zp1), point p2 (xp2, yp2, zp2), and point p3 (xp3, yp3, zp3).
[0131] Step 5: Fit the spatial equation through the three points p1, p2 and p3 to determine the corresponding second spatial plane R2.
[0132] Step 6: Obtain the angle (i.e., the second angle) between the R2 plane and the x-axis plane (i.e., the preset second plane), and adjust the second spatial plane R2 according to the angle so that the second spatial plane R2 is perpendicular to the x-axis plane.
[0133] It can be understood that the determination process and adjustment process of the second spatial plane in this embodiment are similar to the determination process and adjustment process of the above-mentioned first spatial plane. For details, please refer to the determination process and adjustment process of the above-mentioned first spatial plane (such as the embodiments shown in Figures 2 to 5), and this embodiment will not elaborate on this.
[0134] Step 7: At this point, the horizontal plane of the AR device is consistent with the horizontal plane of the camera.
[0135] Step 8: Then use the binocular camera to identify the three points on the AR device screen again (i.e., the third feature points) and obtain the three-dimensional information of the three points (i.e., the third three-dimensional information), such as point q1 (xq1, yq1, zq1), point q2 (xq2, yq2, zq2), and point q3 (xq3, yq3, zq3).
[0136] Step 9: Calculate the horizontal angle between points q1 and q2 (i.e., the inclination angle of the planes between the two points) and correct it using a rotation mechanism. This involves adjusting the AR device to eliminate the angle and adjusting zq1 at point q1 to a preset height. This aligns the image center of the binocular camera with the optical center of the AR device, ensuring that they have consistent three-dimensional positions.
[0137] The specific implementation process of calculating the horizontal angle between point q1 and point q2, correcting the angle through the rotation mechanism, and adjusting zq1 of point q1 to a preset height can refer to the embodiment shown in FIG6 , which will not be described in detail in this embodiment.
[0138] In this embodiment, a first feature point on the AR screen is identified by a binocular camera, and first three-dimensional information of the first feature point is obtained. A first spatial plane is determined based on the first three-dimensional information, and the first spatial plane is adjusted so that the first spatial plane is perpendicular to the preset first plane. A second feature point on the AR screen is identified by the binocular camera, and second three-dimensional information of the second feature point is obtained. A second spatial plane is determined based on the second three-dimensional information, and the second spatial plane is adjusted so that the second spatial plane is perpendicular to the preset second plane, so that the horizontal plane of the AR device and the horizontal plane of the camera are kept consistent. Then, a third feature point on the AR screen is identified by the binocular camera, and third three-dimensional information of the third feature point is obtained. Finally, the height of the target feature point is adjusted to a preset height based on the third three-dimensional information to align the image center point of the binocular camera with the optical center point of the AR device, thereby ensuring that the height difference between the camera image center and the optical center point of the AR device is within a very small range, achieving three-dimensional high-precision alignment, and thus improving the accuracy of optical performance detection of the AR device.
[0139] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0140] Based on the same inventive concept, the present application also provides an embodiment of a detection and alignment device for implementing the aforementioned detection and alignment method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more detection and alignment device embodiments provided below can be found in the above-mentioned limitations of the detection and alignment method, and will not be repeated here.
[0141] In an exemplary embodiment, as shown in FIG7 , a detection and alignment device is provided, comprising: a first acquisition module 702 , a first adjustment module 704 , a second acquisition module 706 , a second adjustment module 708 , a third acquisition module 710 , and a third adjustment module 712 , wherein:
[0142] A first acquisition module 702 is configured to identify first feature points of a target object through a target camera and acquire first three-dimensional information of the first feature points, where the first feature points include three first feature points;
[0143] A first adjustment module 704 is configured to determine a first spatial plane according to the first three-dimensional information, and adjust the first spatial plane so that the first spatial plane is perpendicular to a preset first plane;
[0144] A second acquisition module 706 is configured to identify second feature points of the target object through the target camera and acquire second three-dimensional information of the second feature points, where the second feature points include three;
[0145] A second adjustment module 708 is configured to determine a second spatial plane according to the second three-dimensional information, and adjust the second spatial plane so that the second spatial plane is perpendicular to a preset second plane;
[0146] A third acquisition module 710 is configured to identify a third feature point of the target object through the target camera and acquire third three-dimensional information of the third feature point;
[0147] The third adjustment module 712 is configured to adjust the height of the target feature point to a preset height according to the third three-dimensional information, so as to align the image center point of the target camera with the optical center point of the target object.
[0148] In an exemplary embodiment, the first adjustment module is used to: determine a first spatial plane based on the first three-dimensional information, obtain a first angle between the first spatial plane and the first plane, and obtain a first offset direction of the first angle; adjust the angle of the first spatial plane based on the first angle and the first offset direction so that the first spatial plane is perpendicular to the first plane.
[0149] In an exemplary embodiment, the first adjustment module is further used to: determine a first normal vector of the first spatial plane, and determine a second normal vector of the first plane; and determine a first angle between the first spatial plane and the first plane based on the first normal vector and the second normal vector.
[0150] In an exemplary embodiment, the first adjustment module is also used to: determine the intersection line between the first spatial plane and the first plane; obtain a first target point of the first spatial plane perpendicular to the intersection line; and obtain a second target point of the first plane perpendicular to the intersection line; determine the first offset direction of the first angle based on the first target point and the second target point.
[0151] In an exemplary embodiment, the second adjustment module is used to: determine the second spatial plane based on the second three-dimensional information, obtain the second angle between the second spatial plane and the second plane, and obtain the second offset direction of the second angle; adjust the angle of the second spatial plane based on the second angle and the second offset direction so that the second spatial plane is perpendicular to the second plane.
[0152] In an exemplary embodiment, the third feature points include three, and the three third feature points include a target feature point; the third adjustment module is used to: determine the tilt angle based on the third three-dimensional information of the target feature point and the third three-dimensional information of another third feature point; correct the tilt angle and adjust the height of the target feature point to a preset height to align the image center point of the target camera with the optical center point of the target object.
[0153] Each module in the above-mentioned detection and alignment device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0154] In an exemplary embodiment, a detection and alignment system is also provided. The system includes a target camera and a target object having an optical center point. The image center point of the target camera and the optical center point of the target object are aligned using the method described above. The solution provided by this system is similar to the solution described in the above method and is not further described here.
[0155] As used in this application, the terms "component," "module," and "system" are intended to refer to a computer-related entity, which can be hardware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable code, a thread of execution, a program, and / or a computer. As an illustration, an application running on a server and a server can both be components. One or more components can reside in a process and / or thread of execution, and a component can be located within a computer and / or distributed between two or more computers.
[0156] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in Figure 8. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via wired or wireless means, and the wireless means may be implemented via WiFi, a mobile cellular network, NFC (near field communication), or other technologies. When the computer program is executed by the processor, a detection alignment method is implemented. The display unit of the computer device is used to form a visually visible image, and may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.
[0157] Those skilled in the art will understand that the structure shown in FIG8 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0158] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0159] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.
[0160] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps of the above method when executed by a processor.
[0161] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0162] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0163] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A detection alignment method, characterized in that: The method comprises: Identify first feature points of a target object by using a target camera, and obtain first three-dimensional information of the first feature points, where the first feature points include three; Determine a first spatial plane according to the first three-dimensional information, and adjust the first spatial plane so that the first spatial plane is perpendicular to a preset first plane; Identifying second feature points of the target object by the target camera, and acquiring second three-dimensional information of the second feature points, where the second feature points include three; Determine a second spatial plane according to the second three-dimensional information, and adjust the second spatial plane so that the second spatial plane is perpendicular to a preset second plane; recognizing a third feature point of the target object by using the target camera, and acquiring third three-dimensional information of the third feature point; The height of the target feature point is adjusted to a preset height according to the third three-dimensional information to align the image center point of the target camera with the optical center point of the target object.
2. The method according to claim 1, characterized in that The determining a first spatial plane according to the first three-dimensional information, and adjusting the first spatial plane so that the first spatial plane is perpendicular to a preset first plane, includes: Determine a first spatial plane according to the first three-dimensional information, obtain a first angle between the first spatial plane and the first plane, and obtain a first offset direction of the first angle; According to the first angle and the first offset direction, the angle of the first spatial plane is adjusted so that the first spatial plane is perpendicular to the first plane.
3. The method according to claim 2, characterized in that The obtaining a first angle between the first spatial plane and the first plane includes: determining a first normal vector to the first spatial plane, and determining a second normal vector to the first plane; A first angle between the first space plane and the first plane is determined according to the first normal vector and the second normal vector.
4. The method according to claim 2, characterized in that: The obtaining of the first offset direction of the first angle includes: determining an intersection line between the first spatial plane and the first plane; Acquire a first target point where the first spatial plane is perpendicular to the intersection line; and acquire a second target point where the first plane is perpendicular to the intersection line; A first offset direction of the first angle is determined according to the first target point and the second target point.
5. The method according to any one of claims 1 to 4, characterized in that: The determining a second spatial plane according to the second three-dimensional information, and adjusting the second spatial plane so that the second spatial plane is perpendicular to a preset second plane, includes: Determine a second spatial plane according to the second three-dimensional information, obtain a second angle between the second spatial plane and the second plane, and obtain a second offset direction of the second angle; According to the second angle and the second offset direction, the angle of the second spatial plane is adjusted so that the second spatial plane is perpendicular to the second plane.
6. The method according to any one of claims 1 to 4, characterized in that: The third feature points include three, and the three third feature points include a target feature point; and adjusting the height of the target feature point to a preset height according to the third three-dimensional information to align the image center point of the target camera with the optical center point of the target object, including: Determine the tilt angle according to the third three-dimensional information of the target feature point and the third three-dimensional information of another third feature point; The tilt angle is corrected and the height of the target feature point is adjusted to a preset height to align the The image center point of the target camera and the optical center point of the target object.
7. The method according to any one of claims 1 to 4, characterized in that: The target camera is a camera that can collect depth information.
8. The method according to any one of claims 1 to 4, characterized in that: The target object has an optical center point, and the target object includes but is not limited to an AR device and a VR device.
9. A detection and alignment device, characterized in that: The device comprises: A first acquisition module, configured to identify first feature points of a target object through a target camera, and acquire first three-dimensional information of the first feature points, wherein the first feature points include three; A first adjustment module, configured to determine a first spatial plane according to the first three-dimensional information, and adjust the first spatial plane so that the first spatial plane is perpendicular to a preset first plane; A second acquisition module, configured to identify second feature points of the target object through the target camera and acquire second three-dimensional information of the second feature points, wherein the second feature points include three; A second adjustment module, configured to determine a second spatial plane according to the second three-dimensional information, and adjust the second spatial plane so that the second spatial plane is perpendicular to a preset second plane; A third acquisition module, used for identifying a third feature point of the target object through the target camera, and acquiring third three-dimensional information of the third feature point; The third adjustment module is used to adjust the height of the target feature point to a preset height according to the third three-dimensional information, so as to align the image center point of the target camera with the optical center point of the target object.
10. The device according to claim 9, characterized in that The first adjustment module is also used for: Determine a first spatial plane according to the first three-dimensional information, obtain a first angle between the first spatial plane and the first plane, and obtain a first offset direction of the first angle; According to the first angle and the first offset direction, the angle of the first spatial plane is adjusted so that the first spatial plane is perpendicular to the first plane.
11. The device according to claim 9, characterized in that The second adjustment module is also used for: Determine a second spatial plane according to the second three-dimensional information, obtain a second angle between the second spatial plane and the second plane, and obtain a second offset direction of the second angle; According to the second angle and the second offset direction, the angle of the second spatial plane is adjusted so that the second spatial plane is perpendicular to the second plane.
12. A detection alignment system, characterized in that: The system comprises: A target camera and a target object having an optical center point, wherein the image center point of the target camera and the optical center point of the target object are aligned using the method according to any one of claims 1 to 8.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.