CN108801226B  Plane inclination testing method and equipment  Google Patents
Plane inclination testing method and equipment Download PDFInfo
 Publication number
 CN108801226B CN108801226B CN201811003383.2A CN201811003383A CN108801226B CN 108801226 B CN108801226 B CN 108801226B CN 201811003383 A CN201811003383 A CN 201811003383A CN 108801226 B CN108801226 B CN 108801226B
 Authority
 CN
 China
 Prior art keywords
 plane
 sampling
 depth
 sampling point
 points
 Prior art date
 Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
 Active
Links
 238000005070 sampling Methods 0.000 claims abstract description 450
 230000000875 corresponding Effects 0.000 claims abstract description 136
 238000004590 computer program Methods 0.000 claims description 6
 238000001514 detection method Methods 0.000 abstract description 5
 238000010586 diagram Methods 0.000 description 12
 238000004364 calculation method Methods 0.000 description 8
 238000000034 method Methods 0.000 description 3
 230000001960 triggered Effects 0.000 description 3
 235000020127 ayran Nutrition 0.000 description 2
 230000003287 optical Effects 0.000 description 2
 230000001131 transforming Effects 0.000 description 2
 240000004282 Grewia occidentalis Species 0.000 description 1
 238000004519 manufacturing process Methods 0.000 description 1
 230000004048 modification Effects 0.000 description 1
 238000006011 modification reaction Methods 0.000 description 1
 230000002093 peripheral Effects 0.000 description 1
 230000003068 static Effects 0.000 description 1
 238000006467 substitution reaction Methods 0.000 description 1
Classifications

 G—PHYSICS
 G01—MEASURING; TESTING
 G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
 G01C11/00—Photogrammetry or videogrammetry, e.g. stereogrammetry; Photographic surveying
 G01C11/04—Interpretation of pictures
 G01C11/06—Interpretation of pictures by comparison of two or more pictures of the same area
 G01C11/12—Interpretation of pictures by comparison of two or more pictures of the same area the pictures being supported in the same relative position as when they were taken
 G01C11/14—Interpretation of pictures by comparison of two or more pictures of the same area the pictures being supported in the same relative position as when they were taken with optical projection
Abstract
The embodiment of the application provides a plane inclination testing method and equipment, wherein the method comprises the following steps: and acquiring a depthoffield image of the test target at the test position. And determining pixel points of the depth image, which comprise the depth information of the preset sampling position of the test target, as sampling points. And establishing a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determining the sampling coordinate value of the sampling point. And determining the projection coordinate value of the sampling point projected to the first plane where the test position is located under the threedimensional coordinate system. And calculating a plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value. According to the scheme, the accuracy of the detection result can be greatly improved, and the position relation between the plane where the test module is located and the plane where the test target is located is obtained based on the obtained plane included angle.
Description
Technical Field
The embodiment of the application relates to the technical field of image processing, in particular to a plane inclination testing method and testing equipment.
Background
In the production of the mobile phone camera module, the test camera module needs to be tested. The resolution parameter is used as an important index for evaluating the image quality of the camera module, and when the parameter is tested, the testing environment is required to be ensured to meet the condition that a first plane where the camera module is located is parallel to a second plane where the testing target is located as far as possible. Therefore, in order to ensure the accuracy of the test result, it is necessary to detect whether the first plane and the second plane are parallel in the test environment before testing the resolution parameters of the camera module.
In the prior art, when a test environment is detected to meet a test condition that a first plane is parallel to a second plane, a laser range finder is generally used to detect distances between four opposite corners of the first plane and the second plane respectively. If the difference between the detection distance and the testing distance between the four corners is within an error range, such as within plus or minus 2CM (centimeter), the testing environment is considered to meet the testing requirement.
However, the testing method can only obtain the position relationship between the testing points on the two planes, has low accuracy, cannot accurately reflect the position relationship between the two planes, and is easy to be interfered by human factors in the testing process, so that the accuracy of the testing result is low.
Disclosure of Invention
The embodiment of the application provides a plane inclination testing method and testing equipment, which can detect and obtain the position relation between a plane where a testing module is located and a plane where a testing target is located, and further improve the accuracy of a detection result.
The application provides a plane inclination testing method, which comprises the following steps:
collecting a depthoffield image of a test target at a test position;
determining pixel points of the depth image, which comprise depth information of the preset sampling position of the test target, as sampling points;
establishing a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determining the sampling coordinate value of the sampling point;
determining a projection coordinate value of the sampling point projected to a first plane where the test position is located under the threedimensional coordinate system;
and calculating a plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value.
Preferably, the depth of field module has high edge definition;
the determining that the pixel point of the depth image, which includes the depth information of the preset sampling position of the test target, is a sampling point comprises:
and determining pixel points, which comprise the depth information, of the depth image and are located in the center of the depth image and pixel points located in the edge area of the depth image as sampling points.
Preferably, the depth of field module edge is distorted;
the determining that the pixel point of the depth image, which includes the depth information of the preset sampling position of the test target, is a sampling point comprises:
and determining pixel points, which comprise the depth information, of the depthoffield image and are located in the center of the depthoffield image, and determining the pixel points located in the center area of the depthoffield image as sampling points.
Preferably, the calculating a plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value includes:
determining at least one group of sampling points which are positioned on the same straight line and are parallel to any edge of the depth image in the sampling points;
respectively calculating a first linear equation of a first straight line corresponding to each group of grouping sampling points on the first plane based on the projection coordinate values corresponding to each group of grouping sampling points;
respectively calculating a second line equation of a second line corresponding to each group of grouping sampling points on the second plane based on the sampling coordinate values corresponding to each group of grouping sampling points;
calculating an included angle between the corresponding first straight line and second straight line of each group of grouping sampling points based on the first straight line equation and the second straight line equation to obtain at least one plane included angle;
and summing and averaging the included angles of each plane to obtain the plane included angle between the first plane and the second plane.
Preferably, the establishing a threedimensional coordinate system based on the depth information corresponding to the sampling point, and the determining a sampling coordinate value of the sampling point includes:
establishing a threedimensional coordinate system taking the sampling point corresponding to the central position in the depth image as a coordinate origin based on the depth information corresponding to the sampling point;
and determining sampling coordinate values of the sampling points in the threedimensional coordinate system.
Preferably, the determining, in the threedimensional coordinate system, a projection coordinate value of the sampling point projected to the first plane where the test position is located includes:
translating the first plane under the threedimensional coordinate system such that a center of the second plane intersects a center of the first plane at the origin of coordinates;
and determining projection coordinate values of the sampling points projected to the first plane under the threedimensional coordinate system.
Preferably, the sampling points include at least one center line sampling point located on an intersection line of the first plane and the second plane, and a first edge sampling point and a second edge sampling point which are symmetrical about each center line sampling point and located on two sides of the second plane respectively; each central line sampling point and the corresponding first edge sampling point and the first projection sampling point of the first edge sampling point projected to the first plane form a plane subincluded angle corresponding to each central line sampling point;
the calculating the plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value comprises:
respectively subtracting the sampling coordinate value of each first edge sampling point from the corresponding projection coordinate value to obtain a first distance corresponding to each first edge sampling point;
respectively subtracting the sampling coordinate values of the second edge sampling points from the corresponding projection coordinate values to obtain a second distance corresponding to each second edge sampling point;
respectively subtracting the sampling coordinate value of each central line sampling point from the projection coordinate value of the corresponding first edge sampling point to obtain a third distance corresponding to each central line sampling point;
respectively subtracting the sampling coordinate value of each central line sampling point from the projection coordinate value of the corresponding second edge sampling point to obtain a fourth distance corresponding to each central line sampling point;
calculating and obtaining plane subincluded angles corresponding to each central sampling point based on the first distance, the second distance, the third distance and the fourth distance;
and summing and averaging the plane included angles respectively corresponding to the central line sampling points to obtain the plane included angle between the first plane and the second plane.
Preferably, the calculating a plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value includes:
fitting to obtain a first plane equation of the first plane based on the projection coordinate values corresponding to the sampling points;
fitting to obtain a second plane equation of the second plane based on the sampling coordinate value corresponding to the sampling point;
and calculating the plane included angle of the first plane and the second plane according to a plane included angle formula based on the first plane equation and the second plane equation.
Preferably, after calculating a plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value, the method further includes:
judging whether the first plane and the second plane are parallel or not based on the plane included angle;
if the depth information of the depth image is parallel to the preset sampling positions of the test target, judging whether the depth information of the depth image corresponding to the preset sampling positions of the test target meets a leveling condition or not;
if yes, determining that the surface of the test target is flat;
if not, determining that the surface of the test target is uneven;
and if not, adjusting the angle between the depth of field module and the test target and then continuing to execute the step of judging whether the first plane and the second plane are parallel or not.
The application provides plane inclination testing equipment, which comprises a processing component and a storage component; the storage component stores one or more computer program instructions; the processing component is configured to invoke and execute the one or more computer program instructions to implement:
collecting a depthoffield image of a test target at a test position;
determining pixel points of the depthoffield image, which comprise preset sampling position depth information of the test target, as sampling points;
establishing a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determining the sampling coordinate value of the sampling point;
determining a projection coordinate value of the sampling point projected to a first plane where the test position is located under the threedimensional coordinate system;
and calculating a plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value.
The embodiment of the application provides a plane inclination testing method and device, wherein a depth image of a testing target is collected at a testing position. And determining pixel points of the depth image, which comprise the depth information of the preset sampling position of the test target, as sampling points. And establishing a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determining the sampling coordinate value of the sampling point. And determining the projection coordinate value of the sampling point projected to the first plane where the test position is located under the threedimensional coordinate system. And calculating a plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value. According to the scheme, the accuracy of the detection result can be greatly improved, and the position relation between the plane where the test module is located and the plane where the test target is located is obtained based on the obtained plane included angle.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic structural diagram illustrating an embodiment of a plane tilt testing method provided by the present application;
FIG. 2 is a schematic structural diagram illustrating a plane tilt testing method according to yet another embodiment of the present application;
FIG. 3 is a schematic diagram illustrating one embodiment of a planar subangle provided herein;
FIG. 4 is a schematic structural diagram illustrating another embodiment of a plane tilt testing method provided by the present application;
FIG. 5 is a schematic structural diagram illustrating an embodiment of a flat tilt testing apparatus provided herein; (ii) a
FIG. 6 is a schematic structural diagram illustrating a further embodiment of a flat tilt test apparatus provided herein;
FIG. 7 is a schematic structural diagram illustrating another embodiment of a flat tilt test apparatus provided herein;
FIG. 8 is a schematic structural diagram of an embodiment of a plane tilt testing apparatus provided in the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
In some of the flows described in the specification and claims of this application and in the abovedescribed figures, a number of operations are included that occur in a particular order, but it should be clearly understood that these operations may be performed out of order or in parallel as they occur herein, the number of operations, e.g., 101, 102, etc., merely being used to distinguish between various operations, and the number itself does not represent any order of performance. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
The embodiment of the application is suitable for but not limited to detection of test conditions of the mobile phone camera module, can be used for testing the relative inclination angle of any two planes, the flatness or the plane of the planes and the like, can be applied to the technical field of engineering in multiple fields, and is not particularly limited.
The technical solution of the present application will be described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart of an embodiment of a plane tilt testing method according to an embodiment of the present disclosure. The method can comprise the following steps:
101: and acquiring a depthoffield image of the test target at the test position.
The test position can be the position of the test module or a preset calibration position, and the test target is arranged at a position with a preset calibrated distance. In the embodiment of the application, a TOF (time of flight) depth of field module may be adopted, and a depth of field image obtained by image acquisition of the test target through the TOF depth of field module includes depth information from the test position to the test target.
102: and determining pixel points of the depth image, which comprise the depth information of the preset sampling position of the test target, as sampling points.
According to the different accuracy of the depth of field module, the depth of field module can be divided into one with high edge accuracy and one with edge distortion. Therefore, when the preset sampling position of the test target is selected, the selection can be accurately carried out according to the depth of field module. For example, if the edge accuracy of the depthoffield module is high, the position of the edge area of the selected test target can be set as a preset sampling position, and the depth information of the edge area of the test target can be acquired; the edge distortion of the depthoffield module can cause the accuracy of the depth information obtained by the edge to be lower, so that the central area of the test target can be set and selected as a preset sampling position to obtain the depthoffield information of the central area of the test target.
In practical application, all areas of the test target can be used as preset sampling positions, the depthoffield module acquires depthoffield information of all the areas of the test target, and then pixel points with small depth information distortion and high accuracy are selected as sampling points based on accuracy of the depthoffield module.
The above manners can all be used to select the sampling point, and are not specifically limited herein.
103: and establishing a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determining the sampling coordinate value of the sampling point.
Therefore, the sampling points are pixel points containing depth information, so that the pixel coordinates in the depth image can be respectively used as an X axis and a Y axis, the depth information is used as a Z axis, a threedimensional coordinate system is established, and the sampling coordinate value of each sampling point is determined according to the established threedimensional coordinate system.
104: and determining the projection coordinate value of the sampling point projected to the first plane where the test position is located under the threedimensional coordinate system.
In practical application, the first plane where the test position is located and the second plane where the test target is located may be regarded as the second plane where the depth image is located in the threedimensional coordinate system, and the depth image is projected onto the plane where Z is 0 to obtain the first plane where the test position is located. Therefore, in the threedimensional coordinate system, the sampling point is projected to the plane where Z is 0, and the obtained projected coordinate values have the same abscissa and ordinate as the sampling coordinate values, but Z is 0. I.e. if the sampling coordinate value of the sampling point is (x)_{i},y_{i},z_{i}) Then the corresponding projected coordinate value may be (x)_{i},y_{i},0)。
105: and calculating a plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value.
In practice, the second plane where the test target is located may be represented by the sampling coordinate values of the sampling points, and the first plane where the test target is located may be represented by the projection coordinate values of the sampling points. Therefore, the plane included angle between the first plane and the second plane can be obtained through various operation modes with the sampled sampling coordinate value and the projection coordinate value, and is not limited specifically herein.
According to the embodiment of the application, a plurality of sampling points containing depth information of a test target are obtained through a depth image, a threedimensional coordinate system is established based on the sampling points, a sampling coordinate value capable of representing a first plane and a projection coordinate value capable of representing a second plane in the threedimensional coordinate system are determined, a plane included angle between the first plane and the second plane can be calculated and obtained more accurately based on the projection coordinate value and the sampling coordinate value, and then a position relation between the two planes is obtained according to the plane included angle.
Further, the embodiment of the present application may also be configured to detect the flatness of the surface of the test target, and in another implementable embodiment, after calculating the plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value, the method may further include:
judging whether the first plane and the second plane are parallel or not based on the plane included angle;
if the depth information of the depth image is parallel to the preset sampling positions of the test target, judging whether the depth information of the depth image corresponding to the preset sampling positions of the test target meets a leveling condition or not;
if yes, determining that the surface of the test target is flat;
if not, determining that the surface of the test target is uneven;
and if not, adjusting the angle between the depth of field module and the test target and then continuing to execute the step of judging whether the first plane and the second plane are parallel or not.
The implementation can be used for testing the flatness of any plane or surface of a test target, and based on the embodiment, when the first plane where the test position is located is parallel to the second plane where the test target is located, whether the second plane obtained by the surface of the test target is flat or not can be determined according to whether the depth information of the preset sampling position of the test target acquired by the depthoffield image meets the flatness threshold value or not. The leveling condition and whether the difference value of the depth information contained in at least two sampling points is within a preset error range or not are determined, and if the difference value is within the error range, the leveling condition is considered to be met; if the error range is exceeded, it is considered that the leveling condition is not satisfied.
Fig. 2 is a flowchart of a plane tilt testing method according to another embodiment of the present application. The method can comprise the following steps:
201: and acquiring a depthoffield image of the test target at the test position.
202: and determining pixel points, which comprise the depth information, of the depth image and are located in the center of the depth image and pixel points located in the edge area of the depth image as sampling points.
The embodiment of the application provides an implementation method suitable for higher edge precision of a depth of field module. At this time, the preset sampling position of the test target can be arranged in the edge area, so that the pixel point at the central position and the pixel point at the edge area of the depth image are correspondingly selected as sampling points.
203: and establishing a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determining the sampling coordinate value of the sampling point.
204: and determining the projection coordinate value of the sampling point projected to the first plane where the test position is located under the threedimensional coordinate system.
205: and determining at least one group of sampling points which are positioned on the same straight line and are parallel to any edge of the depth image.
206: and respectively calculating a first linear equation of a first straight line corresponding to each group of grouped sampling points on the first plane based on the projection coordinate values corresponding to each group of grouped sampling points.
207: and respectively calculating a second line equation of a second line corresponding to each group of grouping sampling points on the second plane based on the sampling coordinate values corresponding to each group of grouping sampling points.
In order to more accurately represent the positional relationship between the first plane and the second plane, the sampling points may be divided into a plurality of grouped sampling points, the sampling coordinate values of each group of the grouped sampling points may be fitted to a first straight line on the second plane, and the projection coordinate values of each group of the grouped sampling points may be fitted to a second straight line on the first plane. And describing the position relation between the first plane and the second plane through the position relation of the first straight line and the second straight line respectively corresponding to each group of grouped sampling points.
And fitting to obtain a first straight line equation of a first straight line and a second straight line equation of a second straight line respectively corresponding to each group of grouped sampling points based on the sampling coordinate values and the projection coordinate values of each group of grouped sampling points.
Based on the space linear equation:wherein (x)_{0},y_{0},z_{0}) Is the space coordinate of any point on the straight line, and (m, n, p) represents the direction vector of the straight line.
By the sampling coordinate value P (x) of the sampling point_{i},y_{i},z_{i}) (ii) a Projection coordinate value P' (x)_{i},y_{i},z_{i}') to a host; will be provided withThe sampling coordinate values and the projection coordinate values corresponding to each group of the sampling points are solved according to the space linear equation formula, and each group of the sampling points respectively corresponds to a first linear equation:
and each group of grouping sampling points respectively correspond to a second linear equation:
208: and calculating the included angle between the corresponding first straight line and second straight line of each group of grouping sampling points based on the first straight line equation and the second straight line equation to obtain at least one plane included angle.
The direction vector (m) of the first line can be obtained based on the first line equation and the second line equation_{1i},n_{1i},p_{1i}) And the direction vector (m) of the second straight line_{2i},n_{2i},p_{2i}) (ii) a Based on the direction vector (m) of the first line_{1i},n_{1i},p_{1i}) And the direction vector (m) of the second straight line_{2i},n_{2i},p_{2i}) The cosine value of the included angle of the plane corresponding to each group of sampling points can be calculated and obtained:
further, calculating and obtaining plane included angles of the first straight line and the second straight line respectively corresponding to each group of grouping sampling pointsCan be expressed as:
209: and summing and averaging the included angles of each plane to obtain the plane included angle between the first plane and the second plane.
By grouping the sampling points, the position relation of a plurality of plane included subangles representing different positions of the first plane and the second plane can be obtained, and the precision of the plane included angle obtained by averaging the plurality of plane included subangles is further improved.
To further simplify the calculation method, optionally, in some embodiments, the establishing a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determining the sampling coordinate value of the sampling point may include:
establishing a threedimensional coordinate system taking the sampling point corresponding to the central position in the depth image as a coordinate origin based on the depth information corresponding to the sampling point;
and determining sampling coordinate values of the sampling points in the threedimensional coordinate system.
Further, in the threedimensional coordinate system established based on the above, determining a projection coordinate value of the sampling point projected to the first plane where the test position is located in the threedimensional coordinate system may include:
translating the first plane under the threedimensional coordinate system such that a center of the second plane intersects a center of the first plane at the origin of coordinates;
and determining projection coordinate values of the sampling points projected to the first plane under the threedimensional coordinate system.
By translating the first plane to intersect with the second plane under the established threedimensional coordinate system, the plane intersection line can be obtained by translating the second plane to intersect with the first plane.
Optionally, as an implementation manner, the sampling points include at least one center line sampling point located on an intersection line of the first plane and the second plane, and a first edge sampling point and a second edge sampling point which are symmetric with respect to each center line sampling point and located on two sides of the second plane respectively; and each central line sampling point and the corresponding first edge sampling point and the first projection sampling point projected to the first plane from the first edge sampling point form a plane subincluded angle corresponding to each central line sampling point.
The calculating a plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value may include:
and respectively subtracting the sampling coordinate value of each first edge sampling point from the corresponding projection coordinate value to obtain a first distance corresponding to each first edge sampling point.
And respectively carrying out difference on the sampling coordinate values of the second edge sampling points and the corresponding projection coordinate values to obtain a second distance corresponding to each second edge sampling point.
And respectively subtracting the sampling coordinate value of each central line sampling point from the projection coordinate value of the corresponding first edge sampling point to obtain a third distance corresponding to each central line sampling point.
And respectively subtracting the sampling coordinate value of each central line sampling point from the corresponding projection coordinate value of the second edge sampling point to obtain a fourth distance corresponding to each central line sampling point.
And calculating and obtaining the plane subincluded angle corresponding to each central sampling point based on the first distance, the second distance, the third distance and the fourth distance.
And summing and averaging the plane included angles respectively corresponding to the central line sampling points to obtain the plane included angle between the first plane and the second plane.
According to the scheme of the embodiment of the application, the first plane and the second plane are intersected under the threedimensional coordinate system, and 9 sampling points are taken as an example, wherein the 3 central sampling points are located on the intersection line of the planes and are respectively P2, P5 and P8. Wherein the first edge sampling point P1 and the second edge sampling point P3 are symmetrically arranged on both sides of the center line sampling point P2 with respect to the center line sampling point symmetry P2; the first edge sampling point P4 and the second edge sampling point P6 are symmetrically arranged on both sides of the center line sampling point P5 with respect to the center line sampling point P5; the first edge sampling point P7 and the second edge sampling point P9 are symmetrically disposed on both sides of the center line sampling point P8 with respect to the center line sampling point P8.
Wherein, the sampling coordinate values corresponding to the above 9 sampling points can be respectively expressed as:
P1(x1,y1,z1)，P2(x2,y2,z2)，P3(x3,y3,z3)
P4(x4,y4,z4)，P5(x5,y5,z5)，P6(x6,y6,z6)
P7(x7,y7,z7)，P8(x8,y8,z8)，P9(x9,y9,z9)；
the projection coordinate values corresponding to the above 9 sampling points may be expressed by substandard as:
P1’(x1,y1,z1’)，P2’(x2,y2,z2’)，P3’(x3,y3,z3’)
P4’(x4,y4,z4’)，P5(x5,y5,z5’)，P6’(x6,y6,z6’)
P7’(x7,y7,z7’)，P8’(x8,y8,z8’)，P9’(x9,y9,z9’)。
since P1 and P3 are symmetric with respect to P2, a triangular relationship as shown in fig. 3 can be established with P1 ', P2 ' and P3 ', corresponding to the subincluded angles of the planes.
Wherein, the first distance corresponding to the first edge sampling point P1 can be represented as:
P1P1’＝z1z1’；
the second distance corresponding to the second edge sampling point P3 can be expressed as:
P3P3’＝z3z3’；
the third distance and the fourth distance corresponding to the centerline sampling point P2 can be expressed as:
p1 'P2  ═ x2x 1'  P2P3 ' ═ x2x 3'; wherein, x1 ═ x 1; x3 ═ x 3.
Based on the first distance, the second distance, the third distance and the fourth distance, the plane included angle corresponding to the center line sampling point P1 calculated and obtained according to the following formula can be expressed as:
tan∠P1P2P1’＝P1P1’/P1’P2
∠P1P2P1’＝arctanP1P1’/P1’P2。
similarly, by adopting the above calculation mode, the subincluded angle of plane P4P5P4 'corresponding to the center line sampling point P5 and the angle P7P8P 7' corresponding to the center line sampling point P8 are respectively calculated and obtained, which is not described herein again.
And then, based on the subincluded angles of the three planes, adding the subincluded angles and then calculating three average values to obtain the plane included angle between the first plane and the second plane.
Fig. 4 is a flowchart of another embodiment of a plane tilt testing method according to an embodiment of the present disclosure. The method can comprise the following steps:
401: and acquiring a depthoffield image of the test target at the test position.
402: and determining pixel points, including the depth information, of the depthoffield image, which are positioned in the center position of the depthoffield image, and determining the pixel points positioned in the center area of the depthoffield image as sampling points.
The embodiment of the application provides an implementation method suitable for edge distortion of a depth of field module. At this time, the preset sampling position of the test target can be arranged in the central area, so that the pixel point at the central position and the pixel point in the central area of the depth image are correspondingly selected as sampling points.
403: and establishing a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determining the sampling coordinate value of the sampling point.
404: and determining the projection coordinate value of the sampling point projected to the first plane where the test position is located under the threedimensional coordinate system.
405: and fitting to obtain a first plane equation of the first plane based on the projection coordinate values corresponding to the sampling points.
406: and fitting to obtain a second plane equation of the second plane based on the sampling coordinate values corresponding to the sampling points.
According to the embodiment of the application, the first plane equation of the first plane and the second plane equation of the second plane are obtained by respectively fitting the sampling coordinate values and the projection coordinate values based on the sampling points, and the position relation between the first plane and the second plane can be calculated more intuitively based on the plane equations.
The general expression according to the plane equation is:
ax + By + Cz + D ═ 0, (c ≠ 0); wherein A, B and C are planar coefficients, and D is a planar constant.
After transformation, the following are obtained:
note the bookThe plane equation can be expressed as: and Z is ax + by + c.
And (3) performing plane equation fitting by adopting a least square method:
by the sampling coordinate value P (x) of the sampling point_{i},y_{i},z_{i}) For example, fitting a second plane equation, let the second plane:
at a minimum, should satisfyk＝0,1,2。
Namely obtain
Further yielding a system of equations:
or a linear system of equations is obtained:where n represents the number of sample points.
Obtaining the plane coefficient a of the second plane equation by solving the linear equation set_{2},b_{2},c_{2}；
That is, the second plane equation can be expressed as: z_{2}＝a_{2}x+b_{2}y+c_{2}。
Similarly, according to the above plane equation fitting formula, fitting and obtaining the first plane equation based on the projection coordinate value corresponding to each sampling point may be expressed as: z_{1}＝a_{1}x+b_{1}y+c_{1}。
407: and calculating the plane included angle of the first plane and the second plane according to a plane included angle formula based on the first plane equation and the second plane equation.
The plane angle θ calculated according to the angle calculation formula can be expressed as:
in the embodiment of the application, the first plane and the second plane are subjected to plane fitting through the sampling coordinate values and the projection coordinate values of the sampling points, and a first plane equation of the first plane and a second plane equation of the second plane are obtained through calculation. And calculating to obtain the plane angle according to a plane angle formula based on the first plane equation and the second plane equation, so that the position relation between the first plane and the second plane can be quickly and accurately obtained.
Fig. 5 is a schematic structural diagram of an embodiment of a plane inclination testing apparatus according to an embodiment of the present application. The apparatus may include:
the collecting module 501 is configured to collect a depthoffield image of the test target at the test position.
A sampling point determining module 502, configured to determine, as a sampling point, a pixel point of the depth image that includes the depth information of the preset sampling position of the test target.
According to the different accuracy of the depth of field module, the depth of field module can be divided into one with high edge accuracy and one with edge distortion. Therefore, when the preset sampling position of the test target is selected, the selection can be accurately carried out according to the depth of field module. For example, if the edge accuracy of the depthoffield module is high, the position of the edge area of the selected test target can be set as a preset sampling position, and the depth information of the edge area of the test target can be acquired; the edge distortion of the depthoffield module can cause the accuracy of the depth information obtained by the edge to be lower, so that the central area of the test target can be set and selected as a preset sampling position to obtain the depthoffield information of the central area of the test target.
In practical application, all areas of the test target can be used as preset sampling positions, the depthoffield module acquires depthoffield information of all the areas of the test target, and then pixel points with small depth information distortion and high accuracy are selected as sampling points based on accuracy of the depthoffield module.
The above manners can all be used to select the sampling point, and are not specifically limited herein.
And a sampling coordinate value determining module 503, configured to establish a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determine a sampling coordinate value of the sampling point.
And a projection coordinate value determining module 504, configured to determine, in the threedimensional coordinate system, a projection coordinate value of the sampling point projected to the first plane where the test position is located.
And a plane included angle obtaining module 505, configured to calculate a plane included angle between the first plane and the second plane where the test target is located, based on the sampling coordinate value and the projection coordinate value.
In practice, the second plane where the test target is located may be represented by the sampling coordinate values of the sampling points, and the first plane where the test target is located may be represented by the projection coordinate values of the sampling points. Therefore, the plane included angle between the first plane and the second plane can be obtained through various operation modes with the sampled sampling coordinate value and the projection coordinate value, and is not limited specifically herein.
According to the embodiment of the application, a plurality of sampling points containing depth information of a test target are obtained through a depth image, a threedimensional coordinate system is established based on the sampling points, a sampling coordinate value capable of representing a first plane and a projection coordinate value capable of representing a second plane in the threedimensional coordinate system are determined, a plane included angle between the first plane and the second plane can be calculated and obtained more accurately based on the projection coordinate value and the sampling coordinate value, and then a position relation between the two planes is obtained according to the plane included angle.
Further, the embodiment of the present application may also be used to detect the flatness of the surface of the test target, and in another implementable embodiment, after the plane included angle obtaining module 505, the method may further include:
the first judging module is used for judging whether the first plane and the second plane are parallel or not based on the plane included angle, and if so, the second judging module is triggered in parallel; if not, the adjusting module is triggered.
The second judgment module is used for judging whether the depth information of at least two preset sampling positions corresponding to the test target in the depthoffield image meets a leveling condition or not; if yes, triggering a first determination module; if not, the second determination module is triggered.
The first determination module is used for determining the surface flatness of the test target;
the second determining module is used for determining the surface unevenness of the test target;
and the adjusting module is used for continuing returning to the first judging module after adjusting the angle between the depth of field module and the test target.
The implementation can be used for testing the flatness of any plane or surface of a test target, and based on the embodiment, when the first plane where the test position is located is parallel to the second plane where the test target is located, whether the second plane obtained by the surface of the test target is flat or not can be determined according to whether the depth information of the preset sampling position of the test target acquired by the depthoffield image meets the flatness threshold value or not. The leveling condition and whether the difference value of the depth information contained in at least two sampling points is within a preset error range or not are determined, and if the difference value is within the error range, the leveling condition is considered to be met; if the error range is exceeded, it is considered that the leveling condition is not satisfied.
Fig. 6 is a schematic structural diagram of another embodiment of a plane inclination testing apparatus according to an embodiment of the present application. The apparatus may include:
the acquisition module 601 is configured to acquire a depthoffield image of the test target at the test position.
A sampling point determining module 602, configured to determine, as a sampling point, a pixel point in the depth image that includes the depth information of the preset sampling position of the test target.
The sampling point determining module 602 may be specifically configured to:
and determining pixel points, which comprise the depth information, of the depth image and are located in the center of the depth image and pixel points located in the edge area of the depth image as sampling points.
The embodiment of the application provides an implementation method suitable for higher edge precision of a depth of field module. At this time, the preset sampling position of the test target can be arranged in the edge area, so that the pixel point at the central position and the pixel point at the edge area of the depth image are correspondingly selected as sampling points.
And a sampling coordinate value determining module 603, configured to establish a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determine a sampling coordinate value of the sampling point.
And a projection coordinate value determining module 604, configured to determine, in the threedimensional coordinate system, a projection coordinate value of the sampling point projected to the first plane where the test position is located.
And a plane included angle obtaining module 605, configured to calculate a plane included angle between the first plane and the second plane where the test target is located, based on the sampling coordinate value and the projection coordinate value.
The plane included angle obtaining module 605 may include:
the grouped sampling point determining unit 611 is configured to determine at least one group of grouped sampling points that are located on the same straight line and are parallel to any edge of the depth image.
And a first linear equation calculating unit 612, configured to calculate, based on the projection coordinate values corresponding to each group of grouped sampling points, first linear equations of first straight lines corresponding to each group of grouped sampling points on the first plane, respectively.
A second linear equation calculating unit 613, configured to calculate, based on the sampling coordinate values corresponding to each group of grouped sampling points, second linear equations of second straight lines corresponding to each group of grouped sampling points on the second plane, respectively.
In order to more accurately represent the positional relationship between the first plane and the second plane, the sampling points may be divided into a plurality of grouped sampling points, the sampling coordinate values of each group of the grouped sampling points may be fitted to a first straight line on the second plane, and the projection coordinate values of each group of the grouped sampling points may be fitted to a second straight line on the first plane. And describing the position relation between the first plane and the second plane through the position relation of the first straight line and the second straight line respectively corresponding to each group of grouped sampling points.
And fitting to obtain a first straight line equation of a first straight line and a second straight line equation of a second straight line respectively corresponding to each group of grouped sampling points based on the sampling coordinate values and the projection coordinate values of each group of grouped sampling points.
Based on the space linear equation:wherein (x)_{0},y_{0},z_{0}) Is the space coordinate of any point on the straight line, and (m, n, p) represents the direction vector of the straight line.
By the sampling coordinate value P (x) of the sampling point_{i},y_{i},z_{i}) (ii) a Projection coordinate value P' (x)_{i},y_{i},z_{i}') to a host; solving the sampling coordinate values and the projection coordinate values corresponding to each group of the grouped sampling points according to the space linear equation formula, wherein each group of the grouped sampling points respectively correspond to a first linear equation:
and each group of grouping sampling points respectively correspond to a second linear equation:
and a plane subincluded angle obtaining unit 614, configured to calculate, based on the first linear equation and the second linear equation, an included angle between the corresponding first straight line and second straight line for each group of grouped sampling points, respectively, to obtain at least one plane subincluded angle.
The direction vector (m) of the first line can be obtained based on the first line equation and the second line equation_{1i},n_{1i},p_{1i}) And the direction vector (m) of the second straight line_{2i},n_{2i},p_{2i}) (ii) a Based on the first straight lineDirection vector (m)_{1i},n_{1i},p_{1i}) And the direction vector (m) of the second straight line_{2i},n_{2i},p_{2i}) The cosine value of the included angle of the plane corresponding to each group of sampling points can be calculated and obtained:
further, calculating and obtaining plane included angles of the first straight line and the second straight line respectively corresponding to each group of grouping sampling pointsCan be expressed as:
a first plane included angle obtaining unit 615, configured to sum and average each plane included subangle to obtain a plane included angle between the first plane and the second plane.
By grouping the sampling points, the position relation of a plurality of plane included subangles representing different positions of the first plane and the second plane can be obtained, and the precision of the plane included angle obtained by averaging the plurality of plane included subangles is further improved.
In order to further simplify the calculation method, optionally, in some embodiments, the sampling coordinate value determining module 603 may be specifically configured to:
establishing a threedimensional coordinate system taking the sampling point corresponding to the central position in the depth image as a coordinate origin based on the depth information corresponding to the sampling point;
and determining sampling coordinate values of the sampling points in the threedimensional coordinate system.
Further, based on the threedimensional coordinate system established above, the projection coordinate value determining module 604 may be specifically configured to:
translating the first plane under the threedimensional coordinate system such that a center of the second plane intersects a center of the first plane at the origin of coordinates;
and determining projection coordinate values of the sampling points projected to the first plane under the threedimensional coordinate system.
By translating the first plane to intersect with the second plane under the established threedimensional coordinate system, the plane intersection line can be obtained by translating the second plane to intersect with the first plane.
Optionally, as an implementation manner, the sampling points include at least one center line sampling point located on an intersection line of the first plane and the second plane, and a first edge sampling point and a second edge sampling point which are symmetric with respect to each center line sampling point and located on two sides of the second plane respectively; and each central line sampling point and the corresponding first edge sampling point and the first projection sampling point projected to the first plane from the first edge sampling point form a plane subincluded angle corresponding to each central line sampling point.
The plane angle obtaining module 605 may specifically be configured to:
and respectively subtracting the sampling coordinate value of each first edge sampling point from the corresponding projection coordinate value to obtain a first distance corresponding to each first edge sampling point.
And respectively carrying out difference on the sampling coordinate values of the second edge sampling points and the corresponding projection coordinate values to obtain a second distance corresponding to each second edge sampling point.
And respectively subtracting the sampling coordinate value of each central line sampling point from the projection coordinate value of the corresponding first edge sampling point to obtain a third distance corresponding to each central line sampling point.
And respectively subtracting the sampling coordinate value of each central line sampling point from the corresponding projection coordinate value of the second edge sampling point to obtain a fourth distance corresponding to each central line sampling point.
And calculating and obtaining the plane subincluded angle corresponding to each central sampling point based on the first distance, the second distance, the third distance and the fourth distance.
And summing and averaging the plane included angles respectively corresponding to the central line sampling points to obtain the plane included angle between the first plane and the second plane.
According to the scheme of the embodiment of the application, the first plane and the second plane are intersected under the threedimensional coordinate system, and 9 sampling points are taken as an example, wherein the 3 central sampling points are located on the intersection line of the planes and are respectively P2, P5 and P8. Wherein the first edge sampling point P1 and the second edge sampling point P3 are symmetrically arranged on both sides of the center line sampling point P2 with respect to the center line sampling point symmetry P2; the first edge sampling point P4 and the second edge sampling point P6 are symmetrically arranged on both sides of the center line sampling point P5 with respect to the center line sampling point P5; the first edge sampling point P7 and the second edge sampling point P9 are symmetrically disposed on both sides of the center line sampling point P8 with respect to the center line sampling point P8.
Wherein, the sampling coordinate values corresponding to the above 9 sampling points can be respectively expressed as:
P1(x1,y1,z1)，P2(x2,y2,z2)，P3(x3,y3,z3)
P4(x4,y4,z4)，P5(x5,y5,z5)，P6(x6,y6,z6)
P7(x7,y7,z7)，P8(x8,y8,z8)，P9(x9,y9,z9)；
the projection coordinate values corresponding to the above 9 sampling points may be expressed by substandard as:
P1’(x1,y1,z1’)，P2’(x2,y2,z2’)，P3’(x3,y3,z3’)
P4’(x4,y4,z4’)，P5(x5,y5,z5’)，P6’(x6,y6,z6’)
P7’(x7,y7,z7’)，P8’(x8,y8,z8’)，P9’(x9,y9,z9’)。
since P1, P3 is symmetric about P2, a triangular relationship as shown in fig. 3 can be established with P1 ', P2 ', P3 '.
Wherein, the first distance corresponding to the first edge sampling point P1 can be represented as:
P1P1’＝z1z1’；
the second distance corresponding to the second edge sampling point P3 can be expressed as:
P3P3’＝z3z3’；
the third distance and the fourth distance corresponding to the centerline sampling point P2 can be expressed as:
p1 'P2  ═ x2x 1'  P2P3 ' ═ x2x 3'; wherein, x1 ═ x 1; x3 ═ x 3.
Based on the first distance, the second distance, the third distance and the fourth distance, the plane included angle corresponding to the center line sampling point P1 calculated and obtained according to the following formula can be expressed as:
tan∠P1P2P1’＝P1P1’/P1’P2
∠P1P2P1’＝arctanP1P1’/P1’P2。
similarly, by adopting the above calculation mode, the subincluded angle of plane P4P5P4 'corresponding to the center line sampling point P5 and the angle P7P8P 7' corresponding to the center line sampling point P8 are respectively calculated and obtained, which is not described herein again.
And then, based on the subincluded angles of the three planes, adding the subincluded angles and then calculating three average values to obtain the plane included angle between the first plane and the second plane.
Fig. 7 is a schematic structural diagram of another embodiment of a plane inclination testing apparatus according to an embodiment of the present application. The apparatus may include:
the acquisition module 701 is configured to acquire a depth of field image of the test target at the test position.
A sampling point determining module 702, configured to determine, as a sampling point, a pixel point in the depth image that includes the depth information of the preset sampling position of the test target.
The sampling point determining module 702 may specifically be configured to:
and determining pixel points, including the depth information, of the depthoffield image, which are positioned in the center position of the depthoffield image, and determining the pixel points positioned in the center area of the depthoffield image as sampling points.
The embodiment of the application provides an implementation method suitable for edge distortion of a depth of field module. At this time, the preset sampling position of the test target can be arranged in the central area, so that the pixel point at the central position and the pixel point in the central area of the depth image are correspondingly selected as sampling points.
And the sampling coordinate value determining module 703 is configured to establish a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determine a sampling coordinate value of the sampling point.
And a projection coordinate value determining module 704, configured to determine, in the threedimensional coordinate system, a projection coordinate value of the sampling point projected to the first plane where the test position is located.
And a plane included angle obtaining module 705, configured to calculate a plane included angle between the first plane and the second plane where the test target is located, based on the sampling coordinate value and the projection coordinate value.
The plane included angle obtaining module 705 may include:
and a first plane equation calculating unit 711, configured to fit to obtain a first plane equation of the first plane based on the projection coordinate values corresponding to the sampling points.
And a second plane equation calculating unit 712, configured to fit to obtain a second plane equation of the second plane based on the sampling coordinate values corresponding to the sampling points.
According to the embodiment of the application, the first plane equation of the first plane and the second plane equation of the second plane are obtained by respectively fitting the sampling coordinate values and the projection coordinate values based on the sampling points, and the position relation between the first plane and the second plane can be calculated more intuitively based on the plane equations.
The general expression according to the plane equation is:
ax + By + Cz + D ═ 0, (c ≠ 0); wherein A, B and C are planar coefficients, and D is a planar constant.
After transformation, the following are obtained:
note the bookThe plane equation can be expressed as: and Z is ax + by + c.
And (3) performing plane equation fitting by adopting a least square method:
by the sampling coordinate value P (x) of the sampling point_{i},y_{i},z_{i}) As an example, fit the secondThe plane equation, then, makes the second plane:
at a minimum, should satisfyk＝0,1,2。
Namely obtain
Further yielding a system of equations:
or a linear system of equations is obtained:where n represents the number of sample points.
Obtaining the plane coefficient a of the second plane equation by solving the linear equation set_{2},b_{2},c_{2}；
That is, the second plane equation can be expressed as: z_{2}＝a_{2}x+b_{2}y+c_{2}。
Similarly, according to the above plane equation fitting formula, fitting and obtaining the first plane equation based on the projection coordinate value corresponding to each sampling point may be expressed as: z_{1}＝a_{1}x+b_{1}y+c_{1}。
A second plane included angle obtaining unit 713, configured to calculate a plane included angle between the first plane and the second plane according to a plane included angle formula based on the first plane equation and the second plane equation.
The plane angle θ calculated according to the angle calculation formula can be expressed as:
in the embodiment of the application, the first plane and the second plane are subjected to plane fitting through the sampling coordinate values and the projection coordinate values of the sampling points, and a first plane equation of the first plane and a second plane equation of the second plane are obtained through calculation. And calculating to obtain the plane angle according to a plane angle formula based on the first plane equation and the second plane equation, so that the position relation between the first plane and the second plane can be quickly and accurately obtained.
Fig. 8 is a schematic structural diagram of an embodiment of a planar tilt testing apparatus according to an embodiment of the present disclosure. The apparatus may include a processing component 801 and a storage component 802; the storage component 802 stores one or more computer program instructions.
The processing component 801 is configured to invoke and execute the one or more computer program instructions to implement:
collecting a depthoffield image of a test target at a test position; determining pixel points of the depthoffield image, which comprise preset sampling position depth information of the test target, as sampling points; establishing a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determining the sampling coordinate value of the sampling point; determining a projection coordinate value of the sampling point projected to a first plane where the test position is located under the threedimensional coordinate system; and calculating a plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value.
Optionally, the processing component 801 is further configured to perform all or some of the method steps described above.
The processing component 801 may include one or more processors to execute computer instructions, among other things. Of course, the processing component 801 may also be implemented as one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components configured to perform the abovedescribed methods.
The memory component 802 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable readonly memory (EEPROM), erasable programmable readonly memory (EPROM), programmable readonly memory (PROM), readonly memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Of course, the electronic device may also comprise other components, such as input/output interfaces, communication components, etc. The input/output interface provides an interface between the processing components and peripheral interface modules, which may be output devices, input devices, etc.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the abovedescribed systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The abovedescribed embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the abovedescribed technical solutions may be embodied in the form of a software product, which can be stored in a computerreadable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.
Claims (10)
1. A method for testing a plane tilt, comprising:
collecting a depthoffield image of a test target at a test position;
determining pixel points of the depth image, which comprise depth information of the preset sampling position of the test target, as sampling points;
establishing a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determining the sampling coordinate value of the sampling point;
determining a projection coordinate value of the sampling point projected to a first plane where the test position is located under the threedimensional coordinate system;
and calculating a plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value.
2. The method of claim 1, wherein the depth of field module edge definition is high;
the determining that the pixel point of the depth image, which includes the depth information of the preset sampling position of the test target, is a sampling point comprises:
and determining pixel points, which comprise the depth information, of the depth image and are located in the center of the depth image and pixel points located in the edge area of the depth image as sampling points.
3. The method of claim 1, wherein the depth of field module edge is distorted;
the determining that the pixel point of the depth image, which includes the depth information of the preset sampling position of the test target, is a sampling point comprises:
and determining pixel points, which comprise the depth information, of the depthoffield image and are located in the center of the depthoffield image, and determining the pixel points located in the center area of the depthoffield image as sampling points.
4. The method of claim 2, wherein the calculating a plane angle between the first plane and a second plane where the test target is located based on the sampling coordinate values and the projection coordinate values comprises:
determining at least one group of sampling points which are positioned on the same straight line and are parallel to any edge of the depth image in the sampling points;
respectively calculating a first linear equation of a first straight line corresponding to each group of grouping sampling points on the first plane based on the projection coordinate values corresponding to each group of grouping sampling points;
respectively calculating a second line equation of a second line corresponding to each group of grouping sampling points on the second plane based on the sampling coordinate values corresponding to each group of grouping sampling points;
calculating an included angle between the corresponding first straight line and second straight line of each group of grouping sampling points based on the first straight line equation and the second straight line equation to obtain at least one plane included angle;
and summing and averaging the included angles of each plane to obtain the plane included angle between the first plane and the second plane.
5. The method of claim 2, wherein the establishing a threedimensional coordinate system based on the depth information corresponding to the sampling points, and the determining sampling coordinate values of the sampling points comprises:
establishing a threedimensional coordinate system taking the sampling point corresponding to the central position in the depth image as a coordinate origin based on the depth information corresponding to the sampling point;
and determining sampling coordinate values of the sampling points in the threedimensional coordinate system.
6. The method of claim 5, wherein determining the projection coordinate values of the sampling points projected to the first plane of the test position under the threedimensional coordinate system comprises:
translating the first plane under the threedimensional coordinate system such that a center of the second plane intersects a center of the first plane at the origin of coordinates;
and determining projection coordinate values of the sampling points projected to the first plane under the threedimensional coordinate system.
7. The method of claim 6, wherein the sampling points comprise at least one centerline sampling point located on an intersection of the first plane and the second plane, and first and second edge sampling points that are symmetric about each centerline sampling point and located on both sides of the second plane, respectively; each central line sampling point and the corresponding first edge sampling point and the first projection sampling point of the first edge sampling point projected to the first plane form a plane subincluded angle corresponding to each central line sampling point;
the calculating the plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value comprises:
respectively subtracting the sampling coordinate value of each first edge sampling point from the corresponding projection coordinate value to obtain a first distance corresponding to each first edge sampling point;
respectively subtracting the sampling coordinate values of the second edge sampling points from the corresponding projection coordinate values to obtain a second distance corresponding to each second edge sampling point;
respectively subtracting the sampling coordinate value of each central line sampling point from the projection coordinate value of the corresponding first edge sampling point to obtain a third distance corresponding to each central line sampling point;
respectively subtracting the sampling coordinate value of each central line sampling point from the projection coordinate value of the corresponding second edge sampling point to obtain a fourth distance corresponding to each central line sampling point;
calculating and obtaining plane subincluded angles corresponding to each central sampling point based on the first distance, the second distance, the third distance and the fourth distance;
and summing and averaging the plane included angles respectively corresponding to the central line sampling points to obtain the plane included angle between the first plane and the second plane.
8. The method of claim 3, wherein the calculating a plane angle between the first plane and a second plane where the test target is located based on the sampling coordinate values and the projection coordinate values comprises:
fitting to obtain a first plane equation of the first plane based on the projection coordinate values corresponding to the sampling points;
fitting to obtain a second plane equation of the second plane based on the sampling coordinate value corresponding to the sampling point;
and calculating the plane included angle of the first plane and the second plane according to a plane included angle formula based on the first plane equation and the second plane equation.
9. The method according to claim 1, wherein after calculating a plane angle between the first plane and a second plane where the test target is located based on the sampling coordinate value and the projection coordinate value, the method further comprises:
judging whether the first plane and the second plane are parallel or not based on the plane included angle;
if the depth information of the depth image is parallel to the preset sampling positions of the test target, judging whether the depth information of the depth image corresponding to the preset sampling positions of the test target meets a leveling condition or not;
if yes, determining that the surface of the test target is flat;
if not, determining that the surface of the test target is uneven;
and if not, adjusting the angle between the depth of field module and the test target and then continuing to execute the step of judging whether the first plane and the second plane are parallel or not.
10. A planar tilt testing apparatus comprising a processing component and a storage component; the storage component stores one or more computer program instructions; the processing component is configured to invoke and execute the one or more computer program instructions to implement:
collecting a depthoffield image of a test target at a test position;
determining pixel points of the depthoffield image, which comprise preset sampling position depth information of the test target, as sampling points;
establishing a threedimensional coordinate system based on the depth information corresponding to the sampling point, and determining the sampling coordinate value of the sampling point;
determining a projection coordinate value of the sampling point projected to a first plane where the test position is located under the threedimensional coordinate system;
and calculating a plane included angle between the second plane where the test target is located and the first plane based on the sampling coordinate value and the projection coordinate value.
Priority Applications (1)
Application Number  Priority Date  Filing Date  Title 

CN201811003383.2A CN108801226B (en)  20180830  20180830  Plane inclination testing method and equipment 
Applications Claiming Priority (1)
Application Number  Priority Date  Filing Date  Title 

CN201811003383.2A CN108801226B (en)  20180830  20180830  Plane inclination testing method and equipment 
Publications (2)
Publication Number  Publication Date 

CN108801226A CN108801226A (en)  20181113 
CN108801226B true CN108801226B (en)  20210302 
Family
ID=64081242
Family Applications (1)
Application Number  Title  Priority Date  Filing Date 

CN201811003383.2A Active CN108801226B (en)  20180830  20180830  Plane inclination testing method and equipment 
Country Status (1)
Country  Link 

CN (1)  CN108801226B (en) 
Citations (6)
Publication number  Priority date  Publication date  Assignee  Title 

CN101501445A (en) *  20060801  20090805  特里伯耶拿有限公司  Electronic leveling apparatus and method 
CN102252653A (en) *  20110627  20111123  合肥工业大学  Position and attitude measurement method based on time of flight (TOF) scanningfree threedimensional imaging 
CN105091858A (en) *  20150802  20151125  上海砺晟光电技术有限公司  Twodimension inclination angle noncontact measurement method and system based on absolute distance measurement 
CN105953777A (en) *  20160427  20160921  武汉讯图科技有限公司  Largeplottingscale tilt image measuring method based on depth image 
JP2017044663A (en) *  20150828  20170302  シャープ株式会社  Optical sensor 
CN106773514A (en) *  20161221  20170531  信利光电股份有限公司  A kind of parallel adjusting method of camera module optical axis and system 

2018
 20180830 CN CN201811003383.2A patent/CN108801226B/en active Active
Patent Citations (6)
Publication number  Priority date  Publication date  Assignee  Title 

CN101501445A (en) *  20060801  20090805  特里伯耶拿有限公司  Electronic leveling apparatus and method 
CN102252653A (en) *  20110627  20111123  合肥工业大学  Position and attitude measurement method based on time of flight (TOF) scanningfree threedimensional imaging 
CN105091858A (en) *  20150802  20151125  上海砺晟光电技术有限公司  Twodimension inclination angle noncontact measurement method and system based on absolute distance measurement 
JP2017044663A (en) *  20150828  20170302  シャープ株式会社  Optical sensor 
CN105953777A (en) *  20160427  20160921  武汉讯图科技有限公司  Largeplottingscale tilt image measuring method based on depth image 
CN106773514A (en) *  20161221  20170531  信利光电股份有限公司  A kind of parallel adjusting method of camera module optical axis and system 
Also Published As
Publication number  Publication date 

CN108801226A (en)  20181113 
Similar Documents
Publication  Publication Date  Title 

EP3392837B1 (en)  Camera calibration method, recording medium, and camera calibration apparatus  
Yin et al.  Calibration of fringe projection profilometry with bundle adjustment strategy  
RicolfeViala et al.  Lens distortion models evaluation  
US9443297B2 (en)  System and method for selective determination of point clouds  
US9390202B2 (en)  Coordinate measuring system data reduction  
CN102980556B (en)  A kind of distancefinding method and device  
US8254723B2 (en)  System and method for extracting boundary elements of an object  
Huang et al.  Camera calibration with active phase target: improvement on feature detection and optimization  
CN103399015B (en)  Pathological section scanner and slide glass platform positioning precision measuring method thereof and device  
US9135710B2 (en)  Depth map stereo correspondence techniques  
US20180140182A1 (en)  Apparatus, system and method of determining one or more optical parameters of a lens  
JP6807639B2 (en)  How to calibrate the depth camera  
CN104613930B (en)  Method and device for measuring distance as well as mobile terminal  
US8526705B2 (en)  Driven scanning alignment for complex shapes  
US10455219B2 (en)  Stereo correspondence and depth sensors  
US20190392609A1 (en)  3 dimensional coordinates calculating apparatus, 3 dimensional coordinates calculating method, 3 dimensional distance measuring apparatus and 3 dimensional distance measuring method using images  
Krüger et al.  Accurate chequerboard corner localisation for camera calibration  
JP6319329B2 (en)  Surface attribute estimation using plenoptic camera  
Park et al.  Active calibration of cameraprojector systems based on planar homography  
EP2396769A1 (en)  Registration of 3d point cloud data to 2d electrooptical image data  
US20110228052A1 (en)  Threedimensional measurement apparatus and method  
US10451403B2 (en)  Structurebased camera pose estimation system  
US9747680B2 (en)  Inspection apparatus, method, and computer program product for machine vision inspection  
US8249304B2 (en)  System and method for measuring gaps between object parts  
CN106949848A (en)  A kind of highprecision laser 3D profiles phone structural detection method 
Legal Events
Date  Code  Title  Description 

PB01  Publication  
PB01  Publication  
SE01  Entry into force of request for substantive examination  
SE01  Entry into force of request for substantive examination  
TA01  Transfer of patent application right 
Effective date of registration: 20201028 Address after: 261061 north of Yuqing East Street, east of Dongming Road, Weifang High tech Zone, Weifang City, Shandong Province (Room 502, Geer electronic office building) Applicant after: GoerTek Optical Technology Co.,Ltd. Address before: 261031 No. 268 Dongfang Road, Weifang hi tech Industrial Development Zone, Shandong, Weifang Applicant before: GOERTEK Inc. 

TA01  Transfer of patent application right  
GR01  Patent grant 