Testing method for near-eye display device and electronic device
The present application is applicable to a field of optical detection technology, and provides a testing method for a near-eye display device and an electronic device. The method acquires first captured images of a test point displayed by the near-eye display device, according to a plurality of preset virtual image distances. According to a sharpness of each of the first captured images, the second captured image is determined from the first captured images. According to a preset virtual image distance corresponding to the second captured image, the standard position corresponding to the test point in the second captured image is determined. According to a measured position and the standard position corresponding to the test point in the second captured image, the detection result of the near-eye display device is determined. The above method can improve the detection efficiency and the detection accuracy of the near-eye display device.
1 . A testing method for a near-eye display device, the method comprising:
acquiring first captured images of a test point displayed by the near-eye display device, according to a plurality of preset virtual image distances;
determining a second captured image from the first captured images, according to a sharpness of each of the first captured images;
determining a standard position corresponding to the test point in the second captured image, according to a preset virtual image distance corresponding to the second captured image; and
determining a detection result of the near-eye display device, according to a measured position and the standard position corresponding to the test point in the second captured image.
2 . The testing method for the near-eye display device of claim 1 , further comprising:
determining an interpolated virtual image distance according to the plurality of preset virtual image distances and a preset distance;
determining target virtual image distances adjacent to the interpolated virtual image distance from the plurality of preset virtual image distances; and
generating enhanced images according to a first captured image corresponding to the target virtual image distances and the interpolated virtual image distance.
3 . The testing method for the near-eye display device of claim 1 , wherein determining the second captured image from the first captured images, according to the sharpness of each of the first captured images comprises:
calculating the sharpness of each of the first captured images through a Modulation Transfer Function; and
determining a first captured image with the highest sharpness as the second captured image.
4 . The testing method for the near-eye display device of claim 1 , wherein the detection result comprises a first offset angle, and determining the detection result of the near-eye display device, according to the measured position and the standard position corresponding to the test point in the second captured image comprises:
determining a first offset distance in a first preset direction and a second offset distance in a second preset direction for the test point, according to the measured position and the standard position; and
calculating the first offset angle based on the first offset distance and the second offset distance.
5 . The testing method for the near-eye display device of claim 1 , further comprising:
calibrating the near-eye display device by rotating a display screen of the near-eye display device, based on a first offset angle in the detection result.
6 . The testing method for the near-eye display device of claim 5 , wherein the method further comprises:
determining a virtual image distance of a calibrated near-eye display device;
in response that the virtual image distance of the calibrated near-eye display device satisfies a preset requirement, generating a prompt message, which indicates that the calibrated near-eye display device satisfies assembly specifications.
7 . The testing method for the near-eye display device of claim 1 , wherein the near-eye display device comprises a lens and a display screen, and the method further comprises:
acquiring third captured images of a test point displayed by the near-eye display device with different preset object distances using a camera device, wherein the preset object distances indicate distances between the lens and the display screen;
determining a fourth captured image from the third captured images, according to a sharpness of each of the third captured images;
determining a second offset angle of the near-eye display device with a target object distance, according to the target object distance corresponding to the fourth captured image and a field of view angle of the camera device during capturing the fourth captured image.
8 . The testing method for the near-eye display device of claim 7 , wherein determining the second offset angle of the near-eye display device with the target object distance, according to the target object distance corresponding to the fourth captured image and the field of view angle of the camera device during capturing the fourth captured image comprises:
performing a weighted fitting on the target object distance according to the field of view angle, and obtaining a fitting plane;
determining a plane vector of the fitting plane; and
calculating the second offset angle according to the plane vector.
9 . The testing method for the near-eye display device of claim 7 , wherein the method further comprises:
calibrating the near-eye display device based on the second offset angle and the target object distance.
10 . An electronic device comprising:
a processor; and
a storage device storing a plurality of instructions, which when executed by the processor, cause the processor to:
acquire first captured images of a test point displayed by the near-eye display device, according to a plurality of preset virtual image distances;
determine a second captured image from the first captured images, according to a sharpness of each of the first captured images;
determine a standard position corresponding to the test point in the second captured image, according to a preset virtual image distance corresponding to the second captured image; and
determine a detection result of the near-eye display device, according to a measured position and the standard position corresponding to the test point in the second captured image.
11 . The electronic device of claim 10 , wherein the processor is further caused to:
determine an interpolated virtual image distance according to the plurality of preset virtual image distances and a preset distance;
determine target virtual image distances adjacent to the interpolated virtual image distance from the plurality of preset virtual image distances; and
generate enhanced images according to a first captured image corresponding to the target virtual image distances and the interpolated virtual image distance.
12 . The electronic device of claim 10 , wherein the processor is further caused to:
calculate the sharpness of each of the first captured images through a Modulation Transfer Function; and
determine a first captured image with the highest sharpness as the second captured image.
13 . The electronic device of claim 10 , wherein the processor is further caused to:
determine a first offset distance in a first preset direction and a second offset distance in a second preset direction for the test point, according to the measured position and the standard position; and
calculate the first offset angle based on the first offset distance and the second offset distance.
14 . The electronic device of claim 10 , wherein the processor is further caused to:
acquire third captured images of a test point displayed by the near-eye display device with different preset object distances using a camera device, wherein the preset object distances indicate distances between the lens and the display screen;
determine a fourth captured image from the third captured images, according to a sharpness of each of the third captured images;
determine a second offset angle of the near-eye display device with a target object distance, according to the target object distance corresponding to the fourth captured image and a field of view angle of the camera device during capturing the fourth captured image.
15 . The electronic device of claim 14 , wherein the processor is further caused to:
perform a weighted fitting on the target object distance according to the field of view angle, and obtain a fitting plane;
determine a plane vector of the fitting plane; and
calculate the second offset angle according to the plane vector.
16 . A non-transitory storage medium having stored thereon at least one computer-readable instructions, which when executed by a processor of an electronic device, causes the processor to perform a testing method for the near-eye display device, the method comprising:
acquiring first captured images of a test point displayed by the near-eye display device, according to a plurality of preset virtual image distances;
determining a second captured image from the first captured images, according to a sharpness of each of the first captured images;
determining a standard position corresponding to the test point in the second captured image, according to a preset virtual image distance corresponding to the second captured image; and
determining a detection result of the near-eye display device, according to a measured position and the standard position corresponding to the test point in the second captured image.
17 . The non-transitory storage medium of claim 16 , the method comprising:
determining an interpolated virtual image distance according to the plurality of preset virtual image distances and a preset distance;
determining target virtual image distances adjacent to the interpolated virtual image distance from the plurality of preset virtual image distances; and
generating enhanced images according to a first captured image corresponding to the target virtual image distances and the interpolated virtual image distance.
18 . The non-transitory storage medium of claim 16 , wherein determining the second captured image from the first captured images, according to the sharpness of each of the first captured images comprises:
calculating the sharpness of each of the first captured images through a Modulation Transfer Function; and
determining a first captured image with the highest sharpness as the second captured image.
19 . The non-transitory storage medium of claim 16 , wherein the detection result comprises a first offset angle, and determining the detection result of the near-eye display device, according to the measured position and the standard position corresponding to the test point in the second captured image comprises:
determining a first offset distance in a first preset direction and a second offset distance in a second preset direction for the test point, according to the measured position and the standard position; and
calculating the first offset angle based on the first offset distance and the second offset distance.
20 . The non-transitory storage medium of claim 16 , wherein the near-eye display device comprises a lens and a display screen, and the method further comprises:
acquiring third captured images of a test point displayed by the near-eye display device with different preset object distances using a camera device, wherein the preset object distances indicate distances between the lens and the display screen;
determining a fourth captured image from the third captured images, according to a sharpness of each of the third captured images;
determining a second offset angle of the near-eye display device with a target object distance, according to the target object distance corresponding to the fourth captured image and a field of view angle of the camera device during capturing the fourth captured image.