Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
The first embodiment of the invention relates to a pupil distance adaptability test system, which is used for testing the pupil distance adaptability of a device to be tested, wherein the device to be tested is a Virtual Reality (VR) device or an Augmented Reality (AR) device. Referring to fig. 1 and fig. 2, the pupil distance adaptability testing system includes a first camera 1, a second camera 2 and a testing host 3. The test host 3 is in communication connection with the first camera 1, the second camera 2 and the equipment to be tested 4 respectively; the pupil distance adaptability test system further comprises an equipment support 5 and a camera support 6, the equipment to be tested 4 is placed on the equipment support 5, the first camera 1 and the second camera 2 are placed on the camera support 6, the positions and angles of the first camera 1 and the second camera 2 can be adjusted, and the first camera 1 and the second camera 2 are located at the observation position of the equipment to be tested 4 and used for simulating human eyes to observe images of the equipment to be tested 4. The communication connection between the test host 3 and the first camera 1, the second camera 2 and the device under test 4 may be through a data line (e.g., a USB data line), but is not limited thereto, and may also be through a wireless connection, such as WIFI, bluetooth, etc.
Preferably, the pupil distance adaptability test system further comprises a dark box 7, and when the test system is used for testing, the first camera 1, the second camera 2 and the equipment to be tested 4 are placed in the dark box 7, so that the test effect is not affected by ambient light.
The test host 3 is used for controlling the equipment to be tested 4 to display a preset test pattern, and capturing the test pattern through the first camera 1 and the second camera 2 respectively, specifically, the first camera 1 and the second camera 2 are located at the observation position of the equipment to be tested 4 and used for simulating human eyes to observe the test pattern displayed by the equipment to be tested 4. The test pattern may be a black and white checkerboard, but is not limited thereto, and may also be other types of checkerboards, such as a red and green checkerboard.
The test host 3 is further configured to obtain a translation vector T and a rotation matrix R between the first camera 1 and the second camera 2; the mode of the translation vector T is the current test interpupillary distance. Specifically, the test host 3 may capture a test pattern according to the first camera 1 and the second camera 2, and obtain a translation vector T and a rotation matrix R between the first camera 1 and the second camera 2 by using a binocular camera calibration method; however, if the camera support 6 is an optical positioning support, the translation vector T and the rotation matrix R can be obtained by reading the scale on the optical positioning support. The model of the translation vector T is the distance between the first camera 1 and the second camera 2, and is the current testing pupil distance d.
The test host 3 is further configured to select at least four test points on the test pattern, obtain two-dimensional coordinates of each test point from the test patterns captured by the first camera 1 and the second camera 2, specifically, obtain two-dimensional coordinates of each test point on the test pattern captured by the first camera 1 according to the test pattern captured by the first camera 1, and obtain two-dimensional coordinates of each test point on the test pattern captured by the second camera 2 according to the test pattern captured by the second camera 2; wherein, the test point can test any point on the pattern; preferably, when the test pattern is a black-and-white checkerboard, the intersection point of the black lattice and the white lattice on the black-and-white checkerboard can be selected as the test point, please refer to fig. 3, and the point a, the point B, the point C, and the point D on the black-and-white checkerboard are selected as four test points (for example, four test points), so that the two-dimensional coordinate of each test point is easier to obtain, and the obtained two-dimensional coordinate is more accurate.
The test host 3 is also used for calculating the three-dimensional coordinates of the test points according to the two-dimensional coordinates, the translation vectors and the rotation matrix of the test points; specifically, the test host 3 calculates three-dimensional coordinates of the test points corresponding to the first camera 1 and the second camera 2 according to two-dimensional coordinates of the test points corresponding to the first camera 1 and the second camera 2, and a translation vector T and a rotation matrix R between the first camera 1 and the second camera 2.
The test host 3 is further configured to determine whether the position relationship of each test point satisfies a preset condition according to the two-dimensional coordinates and the three-dimensional coordinates of each test point, and when it is determined that the position relationship of each test point satisfies the preset condition, it is indicated that the device 4 to be tested is applicable to the current test interpupillary distance d; otherwise, it indicates that the device under test 4 is not suitable for the current testing interpupillary distance d.
In this embodiment, after the adaptability test of current test interpupillary distance d is accomplished, then can adjust the position and the angle of first camera 1 and second camera 2, promptly, adjust the test interpupillary distance, then test once more to can acquire the scope of the interpupillary distance that awaits measuring equipment 4 is suitable for.
Compared with the prior art, the method and the device for testing the pupil distance of the mobile terminal control the device to be tested to display the preset test pattern, simulate human eyes through the first camera and the second camera to capture the test pattern, obtain a translation vector and a rotation matrix between the first camera and the second camera, wherein the translation vector is a current test pupil distance, then select at least four test points on the test pattern, and obtain two-dimensional coordinates of each selected test point from the test pattern captured by the first camera and the second camera; and then, calculating the three-dimensional coordinates of each test point according to the two-dimensional coordinates, the translation vectors and the rotation matrixes of each test point, so that whether the position relation of each test point meets a preset condition or not can be judged according to the two-dimensional coordinates and the three-dimensional coordinates of each test point, if each test point meets the preset condition, the device to be tested is judged to adapt to the current test interpupillary distance, the adaptability of the interpupillary distance of the device to be tested can be quantitatively measured, the test result is objective, and the test efficiency is high.
A second embodiment of the present invention relates to a pupil distance adaptability test system. The second embodiment is a refinement on the basis of the first embodiment, and the main refinements are as follows: specific contents of the preset conditions are provided.
When the test host 3 judges whether the position relation of each test point meets a preset condition according to the two-dimensional coordinates and the three-dimensional coordinates of each test point, the preset condition includes: the test points on the test pattern captured by the first camera are positioned on the same plane, and the current distance between the adjacent test points is increased or reduced in an equal ratio relative to the previous distance between the adjacent test points; or, the test points on the test pattern captured by the second camera are positioned on the same plane, and the current distance between the adjacent test points is increased or reduced in an equal ratio relative to the previous distance between the adjacent test points; the current distance is calculated according to the three-dimensional coordinates, and the previous distance is calculated according to the two-dimensional coordinates.
Specifically, the
testing host 3 can determine whether the position relationship of the test points meets the preset condition according to the two-dimensional coordinates and the three-dimensional coordinates of the test points corresponding to the first camera 1 or the
second camera 2, which is described by taking the first camera 1 as an example, and calculate whether the test points are located on the same plane according to the three-dimensional coordinates of the test points corresponding to the first camera 1, and the number of the selected test points is n (n is an integer greater than or equal to 4),
representing the three-dimensional coordinates of the ith test point captured by the first camera, wherein i is a positive integer and is smaller than the number of the selected test points, i is more than or equal to 1 and less than or equal to n; the test points are located on the same plane, which means that n test points can be fitted to obtain a plane, i.e.,
less than a first preset threshold, wherein S is required to be less than the first preset threshold (set by the tester)
That is to say that the first and second electrodes,
solving to obtain a
0、a
1And a
2The value of (c).
When S is smaller than a first preset threshold value, the distance between the adjacent test points calculated according to the three-dimensional coordinates of each test point is increased or reduced in an equal proportion relative to the distance between the adjacent test points calculated according to the two-dimensional coordinates of each test point, and the fact that the preset condition is met is judged, which indicates that the device to be tested 4 is applicable to the current test interpupillary distance d; otherwise, it indicates that the device under test 4 is not suitable for the current testing interpupillary distance d.
The present embodiment provides specific contents of the preset conditions with respect to the first embodiment.
A third embodiment of the present invention relates to a pupil distance adaptability test method applied to the pupil distance adaptability test system according to the first or second embodiment.
Fig. 4 shows a specific flow of the pupil distance adaptability test method according to the present embodiment. In this embodiment, the pupil distance adaptability test system in the first embodiment is taken as an example for explanation, please refer to fig. 1 and fig. 2.
Step 101, controlling the device to be tested to display a preset test pattern.
Specifically, the test host 3 controls the device under test 4 to display a preset test pattern, specifically, the test host 3 sends the preset test pattern to the device under test 4, and the device under test 4 displays the preset test pattern.
Step 102, capturing a test pattern through a first camera and a second camera which are located at the observation positions of the equipment to be tested respectively.
Specifically, the first camera 1 and the second camera 2 are located at an observation position of the device under test 4, and are used for simulating human eyes to observe a test pattern displayed by the device under test 4. The test pattern may be a black and white checkerboard, but is not limited thereto, and may also be other types of checkerboards, such as a red and green checkerboard.
And 103, acquiring a translation vector and a rotation matrix between the first camera and the second camera.
Specifically, the test host 3 may capture a test pattern according to the first camera 1 and the second camera 2, and obtain a translation vector T and a rotation matrix R between the first camera 1 and the second camera 2 by using a binocular camera calibration method; however, if the camera support 6 is an optical positioning support, the translation vector T and the rotation matrix R can be obtained by reading the scale on the optical positioning support. The model of the translation vector T is the distance between the first camera 1 and the second camera 2, and is the current testing pupil distance d.
And 104, selecting at least four test points on the test pattern, and respectively acquiring two-dimensional coordinates of each test point from the test patterns captured by the first camera and the second camera.
Specifically, the test host 1 selects at least four test points on a test pattern in advance, then obtains two-dimensional coordinates of each test point on the test pattern captured by the first camera 1 according to the test pattern captured by the first camera 1, and obtains two-dimensional coordinates of each test point on the test pattern captured by the second camera 2 according to the test pattern captured by the second camera 2; when the test pattern is a black-and-white checkerboard, the intersection point of the black lattice and the white lattice on the black-and-white checkerboard can be selected as a test point, please refer to fig. 3, and point a, point B, point C, and point D on the black-and-white checkerboard are selected as four test points (four are taken as an example), so that the two-dimensional coordinate of each test point is easier to obtain, and the obtained two-dimensional coordinate is more accurate.
And 105, calculating the three-dimensional coordinates of the test points according to the two-dimensional coordinates, the translation vectors and the rotation matrix of the test points.
Specifically, the test host 3 calculates three-dimensional coordinates of the test points corresponding to the first camera 1 and the second camera 2 according to the two-dimensional coordinates of the test points corresponding to the first camera 1 and the second camera 2, and the translation vector T and the rotation matrix R between the first camera 1 and the second camera 2.
Step 106, judging whether the position relation of each test point meets a preset condition or not according to the two-dimensional coordinates and the three-dimensional coordinates of each test point; and when the preset condition is met, judging that the equipment to be tested is suitable for the current testing interpupillary distance.
Specifically, the test host 3 judges whether the position relationship of each test point meets a preset condition according to the two-dimensional coordinates and the three-dimensional coordinates of each test point, and when the position relationship of each test point meets the preset condition, it is indicated that the device 4 to be tested is suitable for the current test interpupillary distance d; otherwise, it indicates that the device under test 4 is not suitable for the current testing interpupillary distance d.
In this embodiment, after completing the adaptability test of the current testing interpupillary distance d, the positions and angles of the first camera 1 and the second camera 2 may be adjusted, that is, the testing interpupillary distance is adjusted, and then the above steps 101 to 106 are repeated, so that the range of the interpupillary distance applicable to the device to be tested 4 may be obtained.
It should be understood that this embodiment is a method example corresponding to the first embodiment, and may be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
Compared with the prior art, the method and the device for testing the pupil distance of the mobile terminal control the device to be tested to display the preset test pattern, simulate human eyes through the first camera and the second camera to capture the test pattern, obtain a translation vector and a rotation matrix between the first camera and the second camera, wherein the translation vector is a current test pupil distance, then select at least four test points on the test pattern, and obtain two-dimensional coordinates of each selected test point from the test pattern captured by the first camera and the second camera; and then, calculating the three-dimensional coordinates of each test point according to the two-dimensional coordinates, the translation vectors and the rotation matrixes of each test point, so that whether the position relation of each test point meets a preset condition or not can be judged according to the two-dimensional coordinates and the three-dimensional coordinates of each test point, if each test point meets the preset condition, the device to be tested is judged to adapt to the current test interpupillary distance, the adaptability of the interpupillary distance of the device to be tested can be quantitatively measured, the test result is objective, and the test efficiency is high.
It should be noted that each module referred to in this embodiment is a logical module, and in practical applications, one logical unit may be one physical unit, may be a part of one physical unit, and may be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, elements that are not so closely related to solving the technical problems proposed by the present invention are not introduced in the present embodiment, but this does not indicate that other elements are not present in the present embodiment.
The fourth embodiment of the invention relates to a pupil distance adaptability test method. The fourth embodiment is a refinement on the basis of the third embodiment, and the main refinements are as follows: specific contents of the preset conditions are provided.
Fig. 4 is a flowchart of a pupil distance adaptability test method in this embodiment.
In step 106 of this embodiment, the preset conditions include: the test points on the test pattern captured by the first camera are positioned on the same plane, and the current distance between the adjacent test points is increased or reduced in an equal ratio relative to the previous distance between the adjacent test points; or, the test points on the test pattern captured by the second camera are positioned on the same plane, and the current distance between the adjacent test points is increased or reduced in an equal ratio relative to the previous distance between the adjacent test points; the current distance is calculated according to the three-dimensional coordinates, and the previous distance is calculated according to the two-dimensional coordinates.
Specifically, the
testing host 3 can determine whether the position relationship of the test points meets the preset condition according to the two-dimensional coordinates and the three-dimensional coordinates of the test points corresponding to the first camera 1 or the
second camera 2, which is described by taking the first camera 1 as an example, and calculate whether the test points are located on the same plane according to the three-dimensional coordinates of the test points corresponding to the first camera 1, and the number of the selected test points is n (n is an integer greater than or equal to 4),
representing the three-dimensional coordinates of the ith test point captured by the first camera, wherein i is a positive integer and is smaller than the number of the selected test points, i is more than or equal to 1 and less than or equal to n; the test points are located on the same plane, which means that n test points can be fitted to obtain a plane, i.e.,
less than a first preset threshold, wherein s is less than the first preset threshold (set by the tester) and is satisfied
That is to say that the first and second electrodes,
solving to obtain a
0、a
1And a
2The value of (c).
When S is smaller than a first preset threshold value, the distance between the adjacent test points calculated according to the three-dimensional coordinates of each test point is increased or reduced in an equal proportion relative to the distance between the adjacent test points calculated according to the two-dimensional coordinates of each test point, and the fact that the preset condition is met is judged, which indicates that the device to be tested 4 is applicable to the current test interpupillary distance d; otherwise, it indicates that the device under test 4 is not suitable for the current testing interpupillary distance d.
Preferably, the distances between adjacent test points in the selected test points are equal, and when it is determined whether the current distance between adjacent test points is increased or decreased in equal proportion to the previous distance between adjacent test points, the difference between the current distances between adjacent test points can also be directly calculated, and the determination is performed by determining whether the difference is smaller than a second preset threshold (set by a tester), so that the determination mode is more concise.
Since the second embodiment corresponds to the present embodiment, the present embodiment can be implemented in cooperation with the second embodiment. The related technical details mentioned in the second embodiment are still valid in this embodiment, and the technical effects that can be achieved in the second embodiment can also be achieved in this embodiment, and are not described herein again in order to reduce the repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the second embodiment.
A fifth embodiment of the present invention relates to a pupil distance adaptability test method, which is a refinement of the third embodiment, and is mainly characterized in that: a specific way of calculating the three-dimensional coordinates of each test point is provided.
A specific flow of the pupil distance adaptability test method in this embodiment is shown in fig. 5.
The steps 201 to 204 are substantially the same as the steps 101 to 104, and the step 206 is substantially the same as the step 106, mainly different in that:
step 205, according to the formula
And
calculating the three-dimensional coordinates of each test point captured by the first camera
And the three-dimensional coordinates of each test point captured by the second camera
Wherein,
two-dimensional coordinates representing the ith test point captured by the first camera,
two-dimensional coordinates representing the ith test point captured by the second camera,
representing the three-dimensional coordinates of the ith test point captured by the first camera,
the three-dimensional coordinates of the ith test point captured by the second camera are represented, i is a positive integer and is smaller than the number of the selected test points, K represents built-in parameters of the first camera and the second camera, R represents a rotation matrix, and T represents a translation vector.
In the present embodiment, the first and second electrodes are,
the built-in parameters representing the first camera 1 and the
second camera 2 can be obtained by a binocular camera calibration method, f
xIs shown asFocal length of a camera and a second camera in X-axis direction, f
YShowing the focal lengths of the first camera and the second camera in the Y-axis direction, (C)
x,C
Y) And the optical center coordinates of the first camera and the second camera are represented.
In one example, when adjusting the positions of the first camera 1 and the
second camera 2, it is possible to position the two cameras on the same straight line without angle difference, and at this time, the translation vector between the first camera 1 and the
second camera 2
Rotation matrix between first camera 1 and
second camera 2
And d is the current testing interpupillary distance.
So that the above-mentioned formula can be reduced to,
and
calculating to obtain the three-dimensional coordinates of the test point captured by the first camera
And the three-dimensional coordinates of the test point captured by the second camera
The present embodiment provides a specific calculation method of the three-dimensional coordinates of each test point, compared to the third embodiment. In addition, the present embodiment can be refined as the fourth embodiment, and the same technical effects can be achieved.
A sixth embodiment of the present invention relates to a test host, including: at least one processor; and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the interpupillary distance adaptability test method of any one of the third to sixth embodiments.
Where the memory and processor are connected by a bus, the bus may comprise any number of interconnected buses and bridges, the buses connecting together one or more of the various circuits of the processor and the memory. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor.
The processor is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And the memory may be used to store data used by the processor in performing operations.
A seventh embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method according to the above embodiments may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps in the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.