Method, device, equipment and medium for detecting virtual image distance

By photographing images on the optical axis of virtual reality products and calculating virtual image distance using the parallax principle, the problems of long detection time and low stability in the prior art are solved, and efficient and accurate virtual image distance detection is achieved.

CN116558782BActive Publication Date: 2025-08-19GOERTEK OPTICAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310483589.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-25
Publication Date
2025-08-19
Estimated Expiration
2043-04-25

AI Technical Summary

Technical Problem

When detecting the virtual image distance of virtual reality products, the prior art has problems such as long detection time, low stability and being affected by the matching of the screen refresh rate and the camera exposure time.

Method used

By shooting images at two positions at the preset shooting distance on the optical axis of the product to be tested, the virtual image distance is calculated using the parallax principle to reduce the number of images taken, and avoid the mismatch between the screen refresh rate and the camera exposure time.

Benefits of technology

It realizes efficient and accurate detection of virtual image distances of virtual reality products, reducing detection time and improving stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116558782B_ABST
    Figure CN116558782B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for detecting virtual image distance, which belongs to the technical field of optical detection. First, by utilizing the characteristic that images are larger when near and smaller when far, the camera is moved at a preset shooting distance in the direction of the optical axis, and module images are taken twice at the first shooting position and the second shooting position of the product to be tested, so as to obtain the first pixel distance of the first shooting position and the second pixel distance of the second shooting position of the product to be tested; then, by utilizing the parallax principle, the virtual image distance of the product to be tested at the first shooting position is calculated according to the first pixel distance, the second pixel distance and the preset shooting distance. In the present application, the problem of mismatch between the screen refresh rate and the camera exposure time can be avoided, and the number of images taken is greatly reduced, which can effectively reduce the detection time. In this way, the virtual image distance of the product to be tested can be detected efficiently and accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of optical detection, and in particular to a method for detecting virtual image distance, a device for detecting virtual image distance, a device for detecting virtual image distance, and a computer-readable storage medium. Background Art

[0002] Controlling the VID (Virtual Image Distance) of display modules in virtual reality products is crucial and a mandatory component of assembly and factory inspection. Currently, the primary approach to VID detection involves adjusting the camera's focal length to capture an image of the module and calculating the image clarity and the change in clarity during the focus adjustment process. This approach determines the object distance corresponding to the sharpest focus as the product's VID.

[0003] The current detection algorithm has the following main problems: a large number of image captures result in a long detection time; since the images captured are on the module screen, there is the influence of screen flicker; the changes in screen refresh rates and the matching of the camera's fixed exposure time will affect the clarity calculation, and the test stability is low. Summary of the Invention

[0004] The main purpose of this application is to provide a method for detecting virtual image distance, a device for detecting virtual image distance, a device for detecting virtual image distance and a computer-readable storage medium, aiming to solve the technical problem of difficulty in efficiently and accurately detecting the virtual image distance of the product to be tested.

[0005] To achieve the above objectives, the present application provides a method for detecting a virtual image distance, the method comprising:

[0006] Determining a first pixel distance at a first shooting position of the product to be tested and a second pixel distance at a second shooting position of the product to be tested; wherein the first shooting position and the second shooting position are both on the optical axis of the product to be tested, and the first shooting position and the second shooting position are separated by a preset shooting distance;

[0007] Based on the first pixel distance, the second pixel distance, and the preset shooting distance, a virtual image distance of the product to be tested at the first shooting position is determined.

[0008] Exemplarily, the step of determining a first pixel distance at a first shooting position of the product to be tested includes:

[0009] Acquire a test image captured at a first shooting position of the product to be tested;

[0010] Key points in the test image are identified, and a first pixel distance is determined based on the key points.

[0011] Exemplarily, the step of determining the first pixel distance based on the key point includes:

[0012] The first pixel distance is determined according to the sum of the intervals between the key points and the number of the intervals.

[0013] Exemplarily, the first pixel distance includes a first horizontal pixel distance and a first vertical pixel distance, and the step of determining the first pixel distance according to the sum of the intervals between the key points and the number of the intervals includes:

[0014] Determine the first horizontal pixel distance according to the sum of the horizontal spacings between the key points and the number of the horizontal spacings;

[0015] The first longitudinal pixel distance is determined according to the sum of the longitudinal spacings between the key points and the number of the longitudinal spacings.

[0016] Exemplarily, the step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes:

[0017] determining a first ratio based on the first pixel distance and the second pixel distance, wherein a magnitude of the first ratio is the second pixel distance divided by the first pixel distance;

[0018] determining a second ratio based on the virtual image distance to be solved at the first shooting position and the shooting distance at the second shooting position, wherein the second ratio is the virtual image distance to be solved divided by the shooting distance, and the shooting distance at the second shooting position is the sum of the virtual image distance to be solved and the preset shooting distance;

[0019] The virtual image distance to be solved is calculated based on the first ratio and the second ratio to obtain the virtual image distance of the product to be tested at the first shooting position, wherein the magnitude of the first ratio is equal to the magnitude of the second ratio.

[0020] Exemplarily, the step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes:

[0021] determining a virtual image distance of the product to be tested at the first shooting position based on a first horizontal pixel distance of the first pixel distance, a second horizontal pixel distance of the second pixel distance, and the preset shooting interval; or

[0022] The virtual image distance of the product to be tested at the first shooting position is determined based on the first longitudinal pixel distance of the first pixel distance, the second longitudinal pixel distance of the second pixel distance, and the preset shooting interval.

[0023] Exemplarily, the step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes:

[0024] determining a first virtual image distance of the product to be tested at the first shooting position based on a first horizontal pixel distance of the first pixel distance, a second horizontal pixel distance of the second pixel distance, and the preset shooting interval;

[0025] determining a second virtual image distance of the product to be tested at the first shooting position based on a first horizontal pixel distance of the first pixel distance, a second horizontal pixel distance of the second pixel distance, and the preset shooting interval;

[0026] Based on the first virtual image distance and the second virtual image distance, a target virtual image distance of the product to be tested at the first shooting position is determined.

[0027] The present application also provides a device for detecting a virtual image distance, the device comprising:

[0028] a first determining module, configured to determine a first pixel distance at a first shooting position of the product to be tested and a second pixel distance at a second shooting position of the product to be tested; wherein the first shooting position and the second shooting position are both on the optical axis of the product to be tested, and a preset shooting distance is between the first shooting position and the second shooting position;

[0029] The second determining module is configured to determine a virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval.

[0030] The present application also provides a device for detecting virtual image distance, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the method for detecting virtual image distance as described above are implemented.

[0031] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for detecting the virtual image distance as described above are implemented.

[0032] Embodiments of the present application propose a method for detecting virtual image distance, a device for detecting virtual image distance, a device for detecting virtual image distance, and a computer-readable storage medium, which determine a first pixel distance at a first shooting position of a product to be tested and a second pixel distance at a second shooting position of the product to be tested; wherein the first shooting position and the second shooting position are both on the optical axis of the product to be tested, and a preset shooting distance is between the first shooting position and the second shooting position; based on the first pixel distance, the second pixel distance, and the preset shooting distance, the virtual image distance of the product to be tested at the first shooting position is determined.

[0033] In this application, first, taking advantage of the characteristic that images appear larger when closer and smaller when farther away, the camera is moved in the optical axis direction at a preset shooting distance, and two module images are captured at the first shooting position and the second shooting position of the product to be tested, obtaining the first pixel distance at the first shooting position and the second pixel distance at the second shooting position of the product to be tested; then, using the parallax principle, the virtual image distance of the product to be tested at the first shooting position is calculated based on the first pixel distance, the second pixel distance, and the preset shooting distance. In this application, the problem of mismatch between the screen refresh rate and the camera exposure time can be avoided, and the number of captured images is greatly reduced, which can effectively reduce the detection time. In this way, the virtual image distance of the product to be tested can be detected efficiently and accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a structural diagram of the operating equipment of the hardware operating environment involved in the embodiment of the present application;

[0035] Figure 2 This is a flow chart of an embodiment of a method for detecting a virtual image distance according to an embodiment of the present application;

[0036] Figure 3 A schematic diagram of shooting positions for an embodiment of a method for detecting a virtual image distance according to an embodiment of the present application;

[0037] Figure 4 A schematic diagram of a test chart for an embodiment of a method for detecting virtual image distance according to an embodiment of the present application;

[0038] Figure 5 A schematic diagram of image triangulation in accordance with an embodiment of a method for detecting virtual image distance according to an embodiment of the present application;

[0039] Figure 6 This is a schematic diagram of an embodiment of a device for detecting a virtual image distance according to an embodiment of the present application.

[0040] The realization of the objectives, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0041] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0042] Reference Figure 1 , Figure 1 This is a schematic diagram of the operating equipment structure of the hardware operating environment involved in the embodiment of the present application.

[0043] like Figure 1 As shown, the operating device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0044] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the operating device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0045] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module and a computer program.

[0046] exist Figure 1 In the running device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the running device of the present application can be set in the running device, and the running device calls the computer program stored in the memory 1005 through the processor 1001 and performs the following operations:

[0047] Determining a first pixel distance at a first shooting position of the product to be tested and a second pixel distance at a second shooting position of the product to be tested; wherein the first shooting position and the second shooting position are both on the optical axis of the product to be tested, and the first shooting position and the second shooting position are separated by a preset shooting distance;

[0048] Based on the first pixel distance, the second pixel distance, and the preset shooting distance, a virtual image distance of the product to be tested at the first shooting position is determined.

[0049] In one embodiment, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:

[0050] The step of determining a first pixel distance at a first shooting position of the product to be tested includes:

[0051] Acquire a test image captured at a first shooting position of the product to be tested;

[0052] Key points in the test image are identified, and the first pixel distance is determined according to a sum of intervals between the key points and a number of the intervals.

[0053] In one embodiment, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:

[0054] The first pixel distance includes a first horizontal pixel distance and a first vertical pixel distance, and the step of determining the first pixel distance according to the sum of the intervals between the key points and the number of the intervals includes:

[0055] Determine the first horizontal pixel distance according to the sum of the horizontal spacings between the key points and the number of the horizontal spacings;

[0056] The first longitudinal pixel distance is determined according to the sum of the longitudinal spacings between the key points and the number of the longitudinal spacings.

[0057] In one embodiment, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:

[0058] The step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes:

[0059] determining a first ratio based on the first pixel distance and the second pixel distance, wherein the first ratio is the second pixel distance divided by the first pixel distance;

[0060] Based on the first ratio and the preset shooting distance, a virtual image distance of the product to be tested at the first shooting position is determined.

[0061] In one embodiment, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:

[0062] The step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes:

[0063] The virtual image distance of the product to be tested at the first shooting position is determined based on a first transverse pixel distance of the first pixel distance, a second transverse pixel distance of the second pixel distance, and the preset shooting interval.

[0064] In one embodiment, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:

[0065] The step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes:

[0066] The virtual image distance of the product to be tested at the first shooting position is determined based on the first longitudinal pixel distance of the first pixel distance, the second longitudinal pixel distance of the second pixel distance, and the preset shooting interval.

[0067] In one embodiment, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:

[0068] The step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes:

[0069] determining a first virtual image distance of the product to be tested at the first shooting position based on a first horizontal pixel distance of the first pixel distance, a second horizontal pixel distance of the second pixel distance, and the preset shooting interval;

[0070] determining a second virtual image distance of the product to be tested at the first shooting position based on a first horizontal pixel distance of the first pixel distance, a second horizontal pixel distance of the second pixel distance, and the preset shooting interval;

[0071] Based on the first virtual image distance and the second virtual image distance, a target virtual image distance of the product to be tested at the first shooting position is determined.

[0072] The present application embodiment provides a method for detecting virtual image distance, referring to Figure 2 In a first embodiment of the method for detecting the virtual image distance, the method includes:

[0073] Step S10, determining a first pixel distance at a first shooting position of the product to be tested and a second pixel distance at a second shooting position of the product to be tested; wherein the first shooting position and the second shooting position are both on the optical axis of the product to be tested, and the first shooting position and the second shooting position are separated by a preset shooting distance;

[0074] In this embodiment, the product to be tested may be an AR (Augmented Reality), VR (Virtual Reality) or MR (Mixed Reality) product, and detecting the VID of the product to be tested refers to the distance between the projected virtual image and the pupil of the human eye.

[0075] In one embodiment, the first shooting position of the product to be tested is as follows Figure 3 The camera position 1 is shown, and the second shooting position of the product to be tested is as follows Figure 3 The camera position 2 shown, the first shooting position and the second shooting position are all on the optical axis of the product to be tested. The camera moves up and down on the optical axis of the product to be tested and shoots test images.

[0076] Then, based on a first test image captured at a first shooting position and a second test image captured at a second shooting position of the product to be tested, a first pixel distance on the first test image and a second pixel distance on the second test image can be calculated, respectively. The pixel distance refers to the distance from the center of a pixel to the center of an adjacent pixel.

[0077] Step S20 : determining a virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval.

[0078] After determining a first pixel distance at a first shooting position of the product to be tested, a second pixel distance at a second shooting position of the product to be tested, and a preset shooting distance between the first shooting position and the second shooting position, the virtual image distance of the product to be tested at the first shooting position is determined based on the first pixel distance, the second pixel distance, and the preset shooting distance. Thus, the parallax principle is applied in the field of virtual reality to determine the virtual image distance of the product to be tested at the first shooting position.

[0079] In this embodiment, a first pixel distance at a first shooting position of the product to be tested and a second pixel distance at a second shooting position of the product to be tested are determined; wherein the first shooting position and the second shooting position are both on the optical axis of the product to be tested, and a preset shooting distance is between the first shooting position and the second shooting position; based on the first pixel distance, the second pixel distance and the preset shooting distance, the virtual image distance of the product to be tested at the first shooting position is determined.

[0080] In this embodiment, first, taking advantage of the characteristic that images appear larger when closer and smaller when farther away, the camera is moved along the optical axis at a preset shooting distance. Two module images are captured at the first and second shooting positions of the product to be tested, obtaining a first pixel distance at the first shooting position and a second pixel distance at the second shooting position. Then, utilizing the parallax principle, the virtual image distance of the product to be tested at the first shooting position is calculated based on the first pixel distance, the second pixel distance, and the preset shooting distance. In this application, the mismatch between the screen refresh rate and the camera exposure time can be avoided, while the number of captured images is significantly reduced, effectively reducing detection time. In this way, the virtual image distance of the product to be tested can be efficiently and accurately detected.

[0081] An embodiment of the present application provides a method for detecting a virtual image distance. In one embodiment of the method for detecting a virtual image distance, the step of determining a first pixel distance at a first shooting position of a product to be tested includes:

[0082] Acquire a test image captured at a first shooting position of the product to be tested;

[0083] Key points in the test image are identified, and the first pixel distance is determined according to a sum of intervals between the key points and a number of the intervals.

[0084] In this embodiment, the test chart used for testing on the product to be tested can be a non-fixed chart form such as a checkerboard or dot matrix, and different charts can be defined according to specific usage scenarios and needs. For example, the test chart can be defined as black dots on a white background, a cross on a black background, or a white rectangle on a black background. In one embodiment, the defined test chart is Figure 4 As shown, light up the display module of the product to be tested and display Figure 4 image.

[0085] After shooting the test chart at the first shooting position of the product to be tested, a test image is obtained. By identifying the key points in the test image, such as Figure 4 The white dots on the black background shown determine the first pixel distance based on the key points.

[0086] In addition, based on the second test image captured at the second shooting position of the product to be tested, a method for calculating the second pixel distance on the second test image is similar to the above method for determining the first pixel distance, and is not described in detail here.

[0087] After key points in the test image are identified, a first pixel distance is calculated based on the sum of the distances between the key points and the number of the distances.

[0088] Exemplarily, the first pixel distance includes a first horizontal pixel distance and a first vertical pixel distance, and the step of determining the first pixel distance according to the sum of the intervals between the key points and the number of the intervals includes:

[0089] Determine the first horizontal pixel distance according to the sum of the horizontal spacings between the key points and the number of the horizontal spacings;

[0090] The first longitudinal pixel distance is determined according to the sum of the longitudinal spacings between the key points and the number of the longitudinal spacings.

[0091] by Figure 4 For example, first, the coordinates of 9 key points are identified at the first shooting position:

[0092]

[0093] Then, the sum of the horizontal spacing between the 9 key points is determined as:

[0094] (P 1-2 .xP 1-1 .x)+(P 1-3 .xP 1-2 .x)+(P 1-5 .xP 1-4 .x)+(P 1-6 .xP 1-5 .x)

[0095] +(P 1-8 .xP 1-7 .x)+(P 1-9 .xP 1-8 .x)

[0096] Determine the sum of the vertical spacing between the 9 key points:

[0097] (P 1-4 .yP 1-1 .y)+(P 1-5 .yP 1-2 .y)+(P 1-6 .yP 1-3 .y)+(P 1-7 .yP1-4 .y)

[0098] +(P 1-8 .yP 1-5 .y)+(P 1-9 .yP 1-6 .y)

[0099] The number of horizontal spacings and vertical spacings between the 9 key points are both 6. Based on the sum of the horizontal spacings and the number of horizontal spacings, the first horizontal pixel distance can be calculated.

[0100]

[0101] Based on the sum of the above longitudinal spacing and the number of longitudinal spacings, the first longitudinal pixel distance can be calculated as

[0102]

[0103] Similarly, the coordinates of 9 key points are identified at the second shooting position:

[0104]

[0105] Calculate the second horizontal pixel distance and the second longitudinal pixel distance The specific calculation process will not be described here.

[0106] An embodiment of the present application provides a method for detecting a virtual image distance. In one embodiment of the method for detecting a virtual image distance, the step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting distance includes:

[0107] determining a first ratio based on the first pixel distance and the second pixel distance, wherein the first ratio is the second pixel distance divided by the first pixel distance;

[0108] Based on the first ratio and the preset shooting distance, a virtual image distance of the product to be tested at the first shooting position is determined.

[0109] In one embodiment, the step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes:

[0110] determining a first ratio based on the first pixel distance and the second pixel distance, wherein a magnitude of the first ratio is the second pixel distance divided by the first pixel distance;

[0111] determining a second ratio based on the virtual image distance to be solved at the first shooting position and the shooting distance at the second shooting position, wherein the second ratio is the virtual image distance to be solved divided by the shooting distance, and the shooting distance at the second shooting position is the sum of the virtual image distance to be solved and the preset shooting distance;

[0112] The virtual image distance to be solved is calculated based on the first ratio and the second ratio to obtain the virtual image distance of the product to be tested at the first shooting position, wherein the magnitude of the first ratio is equal to the magnitude of the second ratio.

[0113] In one embodiment, referring to Figure 5 When photographing the product at the first shooting position, the camera is located at the vertex of the small triangle. The first pixel distance a is determined, and the virtual image distance to be solved at the first shooting position is V. When photographing the product at the second shooting position, the camera is located at the vertex of the large triangle. The second pixel distance a2 is determined, and the shooting distance at the second shooting position is V2. The preset shooting distance between the first shooting position and the second shooting position is L, that is, V2 = V + L.

[0114] Since the closer the camera is to the product under test, the larger the image and the larger the product under test appear in the captured image, the two triangles, one large and one small, meet the definition of similar triangles. The first ratio is the first pixel distance a / the second pixel distance a2, and the second ratio is the virtual image distance V to be solved at the first shooting position / the shooting distance V2 at the second shooting position. According to the relationship between similar triangles, the first ratio is equal to the second ratio, which means: V / V2 = a / a2.

[0115] Then, according to the inverse proportional relationship between the camera movement distance and the image size, we can get: therefore,

[0116] Then, because V2=V+L, we can get Right now

[0117] Exemplarily, the step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes:

[0118] The virtual image distance of the product to be tested at the first shooting position is determined based on a first transverse pixel distance of the first pixel distance, a second transverse pixel distance of the second pixel distance, and the preset shooting interval.

[0119] When determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting spacing, the virtual image distance of the product to be tested at the first shooting position may be determined based on a first horizontal pixel distance of the first pixel distance, a second horizontal pixel distance of the second pixel distance, and the preset shooting spacing:

[0120] Exemplarily, the step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes:

[0121] The virtual image distance of the product to be tested at the first shooting position is determined based on the first longitudinal pixel distance of the first pixel distance, the second longitudinal pixel distance of the second pixel distance, and the preset shooting interval.

[0122] Alternatively, the virtual image distance of the product to be tested at the first shooting position may be determined based on the first longitudinal pixel distance of the first pixel distance, the second longitudinal pixel distance of the second pixel distance, and a preset shooting interval: The method for calculating the virtual image distance based on the longitudinal pixel distance is similar to the method for calculating the virtual image distance based on the transverse pixel distance, and will not be described in detail here.

[0123] Exemplarily, the step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes:

[0124] determining a first virtual image distance of the product to be tested at the first shooting position based on a first horizontal pixel distance of the first pixel distance, a second horizontal pixel distance of the second pixel distance, and the preset shooting interval;

[0125] determining a second virtual image distance of the product to be tested at the first shooting position based on a first horizontal pixel distance of the first pixel distance, a second horizontal pixel distance of the second pixel distance, and the preset shooting interval;

[0126] Based on the first virtual image distance and the second virtual image distance, a target virtual image distance of the product to be tested at the first shooting position is determined.

[0127] When determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting distance, in addition to calculating the virtual image distance based on the longitudinal pixel distance or the transverse pixel distance, the virtual image distance can also be calculated by combining the longitudinal pixel distance or the transverse pixel distance. In this embodiment, when calculating the first virtual image distance: And the second virtual image distance: Afterwards, a target virtual image distance of the product to be tested at the first shooting position is determined based on the first virtual image distance and the second virtual image distance.

[0128] In this embodiment, the method of determining the target virtual image distance based on the first virtual image distance and the second virtual image distance is not limited. In one embodiment, the target virtual image distance is obtained by averaging the first virtual image distance and the second virtual image distance:

[0129]

[0130] Reference Figure 6 In addition, an embodiment of the present application further provides a device for detecting a virtual image distance, the device comprising:

[0131] A first determining module M1 is configured to determine a first pixel distance at a first shooting position of the product to be tested and a second pixel distance at a second shooting position of the product to be tested; wherein the first shooting position and the second shooting position are both on the optical axis of the product to be tested, and a preset shooting distance is between the first shooting position and the second shooting position;

[0132] The second determining module M2 is configured to determine a virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval.

[0133] Exemplarily, the first determining module is further configured to:

[0134] Acquire a test image captured at a first shooting position of the product to be tested;

[0135] Key points in the test image are identified, and the first pixel distance is determined according to a sum of intervals between the key points and a number of the intervals.

[0136] Exemplarily, the first determining module is further configured to:

[0137] Determine the first horizontal pixel distance according to the sum of the horizontal spacings between the key points and the number of the horizontal spacings;

[0138] The first longitudinal pixel distance is determined according to the sum of the longitudinal spacings between the key points and the number of the longitudinal spacings.

[0139] Exemplarily, the second determining module is further configured to:

[0140] determining a first ratio based on the first pixel distance and the second pixel distance, wherein the first ratio is the second pixel distance divided by the first pixel distance;

[0141] Based on the first ratio and the preset shooting distance, a virtual image distance of the product to be tested at the first shooting position is determined.

[0142] Exemplarily, the second determining module is further configured to:

[0143] The virtual image distance of the product to be tested at the first shooting position is determined based on a first transverse pixel distance of the first pixel distance, a second transverse pixel distance of the second pixel distance, and the preset shooting interval.

[0144] Exemplarily, the second determining module is further configured to:

[0145] The virtual image distance of the product to be tested at the first shooting position is determined based on the first longitudinal pixel distance of the first pixel distance, the second longitudinal pixel distance of the second pixel distance, and the preset shooting interval.

[0146] Exemplarily, the second determining module is further configured to:

[0147] determining a first virtual image distance of the product to be tested at the first shooting position based on a first horizontal pixel distance of the first pixel distance, a second horizontal pixel distance of the second pixel distance, and the preset shooting interval;

[0148] determining a second virtual image distance of the product to be tested at the first shooting position based on a first horizontal pixel distance of the first pixel distance, a second horizontal pixel distance of the second pixel distance, and the preset shooting interval;

[0149] Based on the first virtual image distance and the second virtual image distance, a target virtual image distance of the product to be tested at the first shooting position is determined.

[0150] The virtual image distance detection device provided in this application utilizes the virtual image distance detection method described in the aforementioned embodiment to address the technical issue of difficulty in efficiently and accurately detecting the virtual image distance of a product under test. Compared to conventional techniques, the beneficial effects of the virtual image distance detection device provided in the embodiment of this application are the same as those of the virtual image distance detection method described in the aforementioned embodiment. Other technical features of the virtual image distance detection device are the same as those disclosed in the aforementioned embodiment and are not further elaborated upon here.

[0151] In addition, an embodiment of the present application also provides a device for detecting the virtual image distance, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the method for detecting the virtual image distance as described above are implemented.

[0152] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for detecting the virtual image distance as described above are implemented.

[0153] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0154] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to conventional technology can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0155] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for detecting virtual image distance, characterized in that: The method comprises: Determining a first pixel distance at a first photographing position of the product to be tested and a second pixel distance at a second photographing position of the product to be tested; wherein the first photographing position and the second photographing position are both on the optical axis of the product to be tested, and the first photographing position and the second photographing position are separated by a preset photographing distance; the pixel distance refers to the distance from the center of a pixel to the center of an adjacent pixel; Determining a virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval; The step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes: determining a first ratio based on the first pixel distance and the second pixel distance, wherein a magnitude of the first ratio is the second pixel distance divided by the first pixel distance; determining a second ratio based on the virtual image distance to be solved at the first shooting position and the shooting distance at the second shooting position, wherein the second ratio is the virtual image distance to be solved divided by the shooting distance, and the shooting distance at the second shooting position is the sum of the virtual image distance to be solved and the preset shooting distance; The virtual image distance to be solved is calculated based on the first ratio and the second ratio to obtain the virtual image distance of the product to be tested at the first shooting position, wherein the magnitude of the first ratio is equal to the magnitude of the second ratio.

2. The method for detecting the virtual image distance according to claim 1, wherein: The step of determining a first pixel distance at a first shooting position of the product to be tested includes: Acquire a test image captured at a first shooting position of the product to be tested; Key points in the test image are identified, and the first pixel distance is determined according to a sum of intervals between the key points and a number of the intervals.

3. The method for detecting the virtual image distance according to claim 2, wherein: The first pixel distance is a first horizontal pixel distance or a first vertical pixel distance, and the step of determining the first pixel distance according to the sum of the intervals between the key points and the number of the intervals includes: Determine the first horizontal pixel distance according to the sum of the horizontal spacings between the key points and the number of the horizontal spacings; The first longitudinal pixel distance is determined according to the sum of the longitudinal spacings between the key points and the number of the longitudinal spacings.

4. The method for detecting the virtual image distance according to claim 3, wherein: When the first pixel distance is a first horizontal pixel distance and the second pixel distance is a second horizontal pixel distance, the step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes: Based on the first horizontal pixel distance, the second horizontal pixel distance, and the preset shooting interval, a virtual image distance of the product to be tested at the first shooting position is determined.

5. The method for detecting the virtual image distance according to claim 3, wherein: When the first pixel distance is a first longitudinal pixel distance and the second pixel distance is a second longitudinal pixel distance, the step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes: Based on the first longitudinal pixel distance, the second longitudinal pixel distance and the preset shooting interval, a virtual image distance of the product to be tested at the first shooting position is determined.

6. The method for detecting the virtual image distance according to claim 3, wherein: The step of determining the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance, and the preset shooting interval includes: Determining a first virtual image distance of the product to be tested at the first shooting position based on the first horizontal pixel distance, the second horizontal pixel distance, and the preset shooting interval; Determining a second virtual image distance of the product to be tested at the first shooting position based on the first longitudinal pixel distance, the second longitudinal pixel distance, and the preset shooting interval; Based on the first virtual image distance and the second virtual image distance, a target virtual image distance of the product to be tested at the first shooting position is determined.

7. A device for detecting virtual image distance, characterized in that: The device comprises: a first determining module, configured to determine a first pixel distance at a first photographing position of the product to be tested and a second pixel distance at a second photographing position of the product to be tested; wherein the first photographing position and the second photographing position are both on the optical axis of the product to be tested, and the first photographing position and the second photographing position are separated by a preset photographing distance; and a pixel distance refers to the distance from the center of a pixel to the center of an adjacent pixel; The second determination module is used to determine the virtual image distance of the product to be tested at the first shooting position based on the first pixel distance, the second pixel distance and the preset shooting distance; and is also used to: determine a first ratio based on the first pixel distance and the second pixel distance, wherein the magnitude of the first ratio is the second pixel distance divided by the first pixel distance; determine a second ratio based on the virtual image distance to be solved at the first shooting position and the shooting distance of the second shooting position, wherein the magnitude of the second ratio is the virtual image distance to be solved divided by the shooting distance, and the shooting distance of the second shooting position is the sum of the virtual image distance to be solved and the preset shooting distance; calculate the virtual image distance to be solved based on the first ratio and the second ratio to obtain the virtual image distance of the product to be tested at the first shooting position, wherein the magnitude of the first ratio is equal to the magnitude of the second ratio.

8. A device for detecting virtual image distance, characterized in that: The device for detecting the virtual image distance includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the method for detecting the virtual image distance according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for detecting the virtual image distance according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Virtual image distance test method and device, head-mounted equipment and computer readable storage medium

    CN110336996A

  • Virtual image distance measurement method, apparatus and device

    US20200342642A1