Monocular distance measurement method of VR equipment and electronic equipment

The distance between the VR device and the VR handle is directly calculated through the multi-layer fully connected neural network model, which solves the problem of low accuracy caused by image distortion correction and camera calibration in the existing technology, and improves the accuracy of monocular ranging.

CN118670341APending Publication Date: 2024-09-20HISENSE VISUAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310245669.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

Existing monocular ranging technology requires image distortion correction and camera calibration when calculating the distance between the VR controller and the VR device, resulting in low accuracy.

Method used

A multi-layer fully connected neural network model is used to perform nonlinear transformation on the handle's spot characteristics and light characteristics, and the distance between the VR device and the VR handle is directly calculated, avoiding the process of image distortion correction and camera calibration.

Benefits of technology

It improves the accuracy of monocular ranging, reduces correction errors and calibration errors, and enhances the accuracy of ranging results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118670341A
    Figure CN118670341A
Patent Text Reader

Abstract

The invention provides a monocular distance measurement method of VR equipment and electronic equipment. The monocular distance measurement method is used for improving the monocular distance measurement accuracy of the VR equipment. Comprising the following steps: inputting obtained handle light spot features and current light features into a monocular distance measurement model, and performing nonlinear transformation on the handle light spot features and the light features by using a first full connection layer in the monocular distance measurement model to obtain a plurality of first distance measurement features; performing nonlinear transformation on the plurality of first ranging features through a second full connection layer to obtain a plurality of second ranging features; performing nonlinear transformation on the plurality of second ranging features by using a third full connection layer to obtain a plurality of third ranging features; performing nonlinear transformation on the plurality of third ranging features through a fourth full connection layer to obtain a fourth ranging feature; performing nonlinear transformation on the plurality of fourth ranging features through a fifth full connection layer to obtain a target ranging feature; and obtaining a target distance corresponding to the target distance measurement feature by using a preset corresponding relationship between the distance measurement feature and the distance.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Among the technologies for accurately detecting the distance between objects, monocular distance measurement technology greatly reduces costs due to the lack of expensive distance sensors. Therefore, monocular distance measurement technology has great potential in measuring distance. The accuracy of the distance between the virtual reality (VR) controller and the VR device (i.e., VR helmet) directly affects the positioning accuracy of the VR controller. Therefore, it is particularly important to accurately calculate the distance between the VR controller and the VR device at a lower cost and performance.

[0003] In the prior art, the monocular ranging solution is based on the camera imaging principle to calculate the distance between the VR handle and the VR device. However, this method requires that the image used to calculate the distance cannot be distorted, so the acquired image needs to be distorted. To correct the image distortion, it is necessary to calibrate the internal and external parameters of the camera in the VR device. However, the process of image distortion correction and camera calibration will result in correction errors and calibration errors. Therefore, the accuracy of the monocular ranging of the VR device is low. Summary of the invention

[0004] The present application provides a monocular ranging method and electronic device for a VR device, which are used to improve the accuracy of the monocular ranging of the VR device.

[0005] In a first aspect, an embodiment of the present application provides a monocular ranging method for a VR device, the method comprising:

[0006] In response to a monocular ranging instruction triggered by a user, a handle light spot feature and a current light feature are obtained, wherein the handle light spot feature is obtained based on a handle image, and the handle image is taken by the VR device after receiving the monocular ranging instruction;

[0007] Inputting the handle spot feature and the light feature into a monocular ranging model, and performing nonlinear transformation on the handle spot feature and the light feature using a first fully connected layer in the monocular ranging model to obtain a plurality of first ranging features;

[0008] Performing a nonlinear transformation on the plurality of first ranging features through a second fully connected layer in the monocular ranging model to obtain a plurality of second ranging features, wherein the number of neurons in the second fully connected layer is greater than the number of neurons in the first fully connected layer;

[0009] Using a third fully connected layer in the monocular ranging model to perform a nonlinear transformation on the plurality of second ranging features to obtain a plurality of third ranging features, wherein the number of neurons in the third fully connected layer is greater than the number of neurons in the second fully connected layer;

[0010] Performing a nonlinear transformation on the plurality of third ranging features through a fourth fully connected layer in the monocular ranging model to obtain a fourth ranging feature, wherein the number of neurons in the fourth fully connected layer is the same as the number of neurons in the first fully connected layer;

[0011] Performing a nonlinear transformation on the plurality of fourth ranging features through a fifth fully connected layer in the monocular ranging model to obtain a target ranging feature, wherein the number of neurons in the fifth fully connected layer is less than the number of neurons in the fourth fully connected layer;

[0012] By using the correspondence between the ranging feature and the distance pre-set in the monocular ranging model, a target distance corresponding to the target ranging feature is obtained, wherein the target distance is the distance between the VR device and the VR handle.

[0013] A second aspect of the present application provides an electronic device, including a processor and a memory, wherein the processor and the memory are connected via a bus;

[0014] The memory stores a computer program, and the processor is configured to perform the following operations based on the computer program:

[0015] In response to a monocular ranging instruction triggered by a user, a handle light spot feature and a current light feature are obtained, wherein the handle light spot feature is obtained based on a handle image, and the handle image is taken by the VR device after receiving the monocular ranging instruction;

[0016] Inputting the handle spot feature and the light feature into a monocular ranging model, and performing nonlinear transformation on the handle spot feature and the light feature using a first fully connected layer in the monocular ranging model to obtain a plurality of first ranging features;

[0017] Performing a nonlinear transformation on the plurality of first ranging features through a second fully connected layer in the monocular ranging model to obtain a plurality of second ranging features, wherein the number of neurons in the second fully connected layer is greater than the number of neurons in the first fully connected layer;

[0018] Using a third fully connected layer in the monocular ranging model to perform a nonlinear transformation on the plurality of second ranging features to obtain a plurality of third ranging features, wherein the number of neurons in the third fully connected layer is greater than the number of neurons in the second fully connected layer;

[0019] Performing a nonlinear transformation on the plurality of third ranging features through a fourth fully connected layer in the monocular ranging model to obtain a fourth ranging feature, wherein the number of neurons in the fourth fully connected layer is the same as the number of neurons in the first fully connected layer;

[0020] Performing a nonlinear transformation on the plurality of fourth ranging features through a fifth fully connected layer in the monocular ranging model to obtain a target ranging feature, wherein the number of neurons in the fifth fully connected layer is less than the number of neurons in the fourth fully connected layer;

[0021] By using the correspondence between the ranging feature and the distance pre-set in the monocular ranging model, a target distance corresponding to the target ranging feature is obtained, wherein the target distance is the distance between the VR device and the VR handle.

[0022] According to a third aspect provided by an embodiment of the present invention, a computer storage medium is provided, wherein the computer storage medium stores a computer program, and the computer program is used to execute the method as described in the first aspect.

[0023] In the above-mentioned embodiment of the present application, the distance between the VR device and the VR handle is determined by inputting the handle spot feature and the current light feature into the monocular ranging model and performing multiple nonlinear transformations through multiple fully connected layers. Therefore, in this embodiment, there is no need to correct the distortion of the handle image, nor is there a need to calibrate the camera of the VR device. Therefore, there is no correction error and calibration error. In addition, the number of neurons in each fully connected layer in the monocular ranging model in this embodiment is increased first and then decreased, so that the global features can be extracted first and then the redundant features can be filtered out, so that the proposed features are more accurate, thereby improving the accuracy of the monocular ranging in the embodiment of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0025] Figure 1 One of the application scenario schematic diagrams provided by the embodiment of the present application is exemplarily shown;

[0026] Figure 2 The second schematic diagram of the application scenario provided by the embodiment of the present application is exemplarily shown;

[0027] Figure 3 One of the flow charts of the monocular ranging method of the VR device provided in the embodiment of the present application is exemplarily shown;

[0028] Figure 4 The flowchart for determining the handle light spot characteristics provided by the embodiment of the present application is exemplarily shown;

[0029] Figure 5 The schematic diagram of performing light spot detection provided by the embodiment of the present application is exemplarily shown;

[0030] Figure 6 An exemplary diagram of image quality comparison provided by an embodiment of the present application is shown;

[0031] Figure 7 The structural diagram of the monocular ranging model provided in the embodiment of the present application is exemplarily shown;

[0032] Figure 8 The schematic diagram of the process of training a monocular ranging model provided in an embodiment of the present application is exemplarily shown;

[0033] Fig. 9 The schematic diagram of the loss function provided in the embodiment of the present application is exemplarily shown;

[0034] Fig.10 A schematic diagram of a monocular distance measuring device for a VR device provided in an embodiment of the present application is exemplarily shown;

[0035] Fig.11 The hardware structure diagram of the electronic device provided in the embodiment of the present application is exemplified. DETAILED DESCRIPTION

[0036] In order to make the purpose, implementation mode and advantages of the present application clearer, the exemplary implementation mode of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0037] Based on the exemplary embodiments described in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the claims attached to this application. In addition, although the disclosure in this application is introduced according to one or several exemplary examples, it should be understood that each aspect of the disclosure can also constitute a complete implementation method separately.

[0038] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.

[0039] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover but not exclude inclusion, for example, a product or device comprising a series of components is not necessarily limited to those components clearly listed, but may include other components not clearly listed or inherent to these products or devices.

[0040] The term "module" as used in this application refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic or combination of hardware and / or software code that is capable of performing the functions associated with that element.

[0041] The idea of ​​the embodiments of the present application is summarized below.

[0042] The current monocular distance measurement solution is based on the camera imaging principle to calculate the distance between the VR handle and the VR device. However, this method requires that the image used to calculate the distance cannot be distorted, so the acquired image needs to be distorted. To correct the image distortion, it is necessary to calibrate the internal and external parameters of the camera in the VR device. However, the process of image distortion correction and camera calibration will result in correction errors and calibration errors. Therefore, the accuracy of monocular distance measurement is low.

[0043] Based on the problem of low accuracy of monocular ranging in the prior art, an embodiment of the present application provides a monocular ranging method for a VR device, by inputting the handle spot feature and the current light feature into the monocular ranging model and performing multiple nonlinear transformations through multiple fully connected layers to determine the distance between the VR device and the VR handle. Therefore, in this embodiment, there is no need to correct the distortion of the handle image, nor is there a need to calibrate the camera of the VR device. Therefore, there is no correction error and calibration error. In addition, the number of neurons in each fully connected layer in the monocular ranging model in this embodiment is increased first and then decreased, so that the global features can be extracted first and then the redundant features can be filtered out, so that the proposed features are more accurate, thereby improving the accuracy of the monocular ranging in the embodiment of the present application.

[0044] The embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0045] Figure 1 The following is a schematic diagram showing an application scenario of monocular ranging of a VR device provided in an embodiment of the present application; Figure 1The application scenario shown is described by taking the electronic device as a server as an example. The application scenario includes a VR device 110, a handle 120, and a server 130. The server 130 can be implemented by a single server or multiple servers. The server 130 can be implemented by a physical server or a virtual server.

[0046] In a possible application scenario, the user controls the VR device 110 through the handle 120 to send a monocular ranging instruction to the server 130. After receiving the monocular ranging instruction, the server 130 inputs the handle spot feature and the light feature into the monocular ranging model, and then the server 130 uses the first fully connected layer in the monocular ranging model to perform a nonlinear transformation on the handle spot feature and the light feature to obtain a plurality of first ranging features; and uses the second fully connected layer in the monocular ranging model to perform a nonlinear transformation on the plurality of first ranging features to obtain a plurality of second ranging features, wherein the number of neurons in the second fully connected layer is greater than the number of neurons in the first fully connected layer; and then the server 130 uses the third fully connected layer in the monocular ranging model to perform a nonlinear transformation on the plurality of second ranging features to obtain a plurality of third ranging features. Features, wherein the number of neurons in the third fully connected layer is greater than the number of neurons in the second fully connected layer; and the plurality of third ranging features are nonlinearly transformed through the fourth fully connected layer in the monocular ranging model to obtain a fourth ranging feature, wherein the number of neurons in the fourth fully connected layer is the same as the number of neurons in the first fully connected layer; then the server 130 performs a nonlinear transformation on the plurality of fourth ranging features through the fifth fully connected layer in the monocular ranging model to obtain a target ranging feature, wherein the number of neurons in the fifth fully connected layer is less than the number of neurons in the fourth fully connected layer; finally, the server 130 uses the pre-set correspondence between the ranging feature and the distance to obtain the target distance corresponding to the target ranging feature, wherein the target distance is the distance between the VR device and the VR handle.

[0047] like Figure 2 As shown, it is another application scenario schematic diagram of the present application, from Figure 2It can be seen that the application scenario is explained by taking the electronic device as a VR device as an example. The application scenario includes a VR device 110 and a handle 120. The user sends a monocular ranging instruction to the VR device 110 through the handle 120. After receiving the monocular ranging instruction, the VR device 110 inputs the handle spot feature and the light feature into the monocular ranging model, and uses the first fully connected layer in the monocular ranging model to perform a nonlinear transformation on the handle spot feature and the light feature to obtain a plurality of first ranging features; then the VR device 110 performs a nonlinear transformation on the plurality of first ranging features through the second fully connected layer in the monocular ranging model to obtain a plurality of second ranging features, wherein the number of neurons in the second fully connected layer is greater than the number of neurons in the first fully connected layer; and uses the third fully connected layer in the monocular ranging model to perform a nonlinear transformation on the plurality of second ranging features to obtain a plurality of third ranging features, wherein the third fully connected layer The number of neurons in the fourth fully connected layer is greater than the number of neurons in the second fully connected layer; then the VR device 110 performs a nonlinear transformation on the multiple third ranging features through the fourth fully connected layer in the monocular ranging model to obtain a fourth ranging feature, wherein the number of neurons in the fourth fully connected layer is the same as the number of neurons in the first fully connected layer; and performs a nonlinear transformation on the multiple fourth ranging features through the fifth fully connected layer in the monocular ranging model to obtain a target ranging feature, wherein the number of neurons in the fifth fully connected layer is less than the number of neurons in the fourth fully connected layer; finally, the VR device 110 uses the pre-set correspondence between the ranging feature and the distance to obtain the target distance corresponding to the target ranging feature, wherein the target distance is the distance between the VR device and the VR handle.

[0048] in, Figure 1 The server 130 and the VR device 110 can exchange information through a communication network, wherein the communication method adopted by the communication network can be divided into a wireless communication method or a wired communication method.

[0049] Exemplarily, the server 130 can access the network through cellular mobile communication technology to communicate with the VR device 110, wherein the cellular mobile communication technology, for example, includes the fifth generation mobile communication (5th Generation Mobile Networks, 5G) technology.

[0050] Optionally, the server 130 may access the network via short-range wireless communication to communicate with the VR device 110, wherein the short-range wireless communication method may include, for example, Wireless Fidelity (Wi-Fi) technology.

[0051] Among them, the description in this application only details a single VR device 110, a single handle 120 and a single server 130, but those skilled in the art should understand that the VR device 110, handle 120 and server 130 shown are intended to indicate that the technical solution of this application involves the operation of the VR device 110, handle 120 and server 130. It does not imply that there is a limitation on the number, type or location of the VR device 110, handle 120 and server 130. It should be noted that if additional modules are added to the illustrated environment or individual modules are removed therefrom, the underlying concept of the exemplary embodiment of this application will not be changed.

[0052] It should be noted that the monocular ranging method of VR equipment proposed in this application is not only applicable to Figure 1 and Figure 2 The application scenario shown is also applicable to any monocular ranging device with VR equipment.

[0053] The following describes the monocular ranging method of the VR device in an exemplary embodiment of the present application in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the methods and principles of the present application, and the implementation of the present application is not limited in this respect.

[0054] like Figure 3 FIG. 1 is a flow chart of a monocular ranging method for a VR device, which may include the following steps:

[0055] Step 301: in response to a monocular ranging instruction triggered by a user, obtaining a handle light spot feature and a current light feature, wherein the handle light spot feature is obtained based on a handle image, and the handle image is taken by the VR device after receiving the monocular ranging instruction;

[0056] The following is an introduction to the specific methods of determining the handle light spot characteristics and the current light characteristics. Figure 4 As shown, it is a schematic diagram of the process of determining the handle spot characteristics, which includes the following steps:

[0057] Step 401: performing light spot detection on the handle image using an edge detection algorithm to obtain the position of each light spot in the handle image;

[0058] For example, Figure 5 As shown, it is a schematic diagram of light spot detection, and the handle image after detection only shows the positions of each light spot.

[0059] It should be noted that the CV algorithm SimpleBlobDetector() is used in this embodiment for spot detection, but the spot detection method is not limited in this embodiment, and the spot detection method in this embodiment can be set according to actual conditions.

[0060] Step 402: for any light spot, determine the diameter of the light spot based on the position of each pixel in the light spot;

[0061] In one embodiment, step 402 may be implemented as follows: for any two pixel points in the light spot, based on the positions of the two pixel points in the handle image, obtaining the distance between the two pixel points; and determining the distance with the largest value among the distances as the diameter of the light spot. The distance between any two pixel points may be determined by formula (1):

[0062]

[0063] Among them, r is the distance between two pixels, x1 is the horizontal coordinate of one pixel, y1 is the vertical coordinate of one pixel, x2 is the horizontal coordinate of another pixel, and y2 is the vertical coordinate of another pixel.

[0064] Step 403: Determine the diameter with the largest value among the diameters corresponding to the light spots as the handle light spot feature.

[0065] In one embodiment, step 403 may be implemented as follows: determining light spots with diameters greater than a specified value among the light spots as target light spots, and determining the diameter with the largest value among the diameters corresponding to the target light spots as the handle light spot feature.

[0066] It should be noted that the specified value in this embodiment can be set according to actual conditions, and this embodiment does not limit the specified value.

[0067] In one embodiment, the light characteristic includes at least one of light intensity, light direction and color temperature.

[0068] In this embodiment, since the VR device obtains a grayscale image of the handle image, only the light intensity has a significant impact on the image quality of the grayscale image. Figure 6 As shown, for the same luminous body, in an environment with weak light intensity, the halo formed is larger due to the diffraction of light, that is, Figure 6 In the image on the left. In an environment with strong light intensity, the halo formed is smaller, that is, Figure 6 The image on the right. The light intensity can change the grayscale value of the pixels around the light spot, thereby affecting the detection accuracy of the light spot size. Therefore, the light feature used in this embodiment is the light intensity, and the light intensity in this embodiment is obtained by the photosensitive original device. However, the light feature is not limited in this embodiment, and the light feature can be set according to the specific actual situation. Among them, the relationship between the grayscale value and the light intensity can be expressed by formula (2):

[0069]

[0070] Among them, I(x, y) is the light intensity at the pixel point at the position (x, y) at a certain moment, g(x, y) is the grayscale value at the pixel point at the position (x, y) at a certain moment, x is the horizontal coordinate, and y is the vertical coordinate.

[0071] It can be seen from the above formula (2) that the change of light intensity will cause the change of pixel grayscale, thus affecting the final result of the spot size measurement. Therefore, the relationship between the size of the handle spot (i.e., the diameter of the spot in the embodiment of the present application) and the light intensity can be obtained. Among them, the corresponding relationship between the size of the handle spot and the light intensity is determined by the following method:

[0072] Set the light intensity under daily indoor lighting conditions as the standard light intensity S 标 At this time, the corresponding handle spot imaging is the standard imaging size, and the handle spot diameter is d 标 The handle spot size under any light intensity can be converted to the handle spot size under standard light intensity, which can be converted by formula (3):

[0073] d 标 =d 测 -Δd......(3);

[0074] Among them, d 测 is the size of the handle light spot measured under other light intensities, and Δd is the difference between the handle light spot size under standard light intensity and the measured handle light spot size.

[0075] In one embodiment, the Δd is obtained by formula (4):

[0076] Δd=-A*ln(S+B)+C....(4);

[0077] Among them, S is the light characteristic, that is, the light intensity in this embodiment, and A, B, and C are preset values.

[0078] Step 302: inputting the handle spot feature and the light feature into a monocular ranging model, and performing nonlinear transformation on the handle spot feature and the light feature using a first fully connected layer in the monocular ranging model to obtain a plurality of first ranging features;

[0079] In one embodiment, step 302 can be specifically implemented as follows: for any neuron in the first fully connected layer, use the neuron to perform weighted summation on the handle spot feature and the light feature, and then add the weight to a preset first multiplication factor to obtain a first intermediate feature, wherein the weight of the handle spot feature and the weight of the light feature are pre-set in the neuron; based on the first intermediate features obtained by each neuron in the first fully connected layer, the multiple first ranging features are obtained.

[0080] Among them, in the embodiment of the present application, each obtained first intermediate feature is determined as the multiple first ranging features.

[0081] It should be noted that the number of the first ranging features in this embodiment is the same as the number of neurons in the first fully connected layer.

[0082] Step 303: performing a nonlinear transformation on the plurality of first ranging features through a second fully connected layer in the monocular ranging model to obtain a plurality of second ranging features, wherein the number of neurons in the second fully connected layer is greater than the number of neurons in the first fully connected layer;

[0083] In one embodiment, step 303 can be implemented as follows: for any neuron in the second fully connected layer, using the neuron to perform weighted summation on the multiple first ranging features, and then adding the weights to a preset second multiplication factor to obtain a second intermediate feature, wherein the weights corresponding to the multiple first ranging features are pre-set in the neuron; based on the second intermediate features obtained by each neuron in the second fully connected layer, the multiple second ranging features are obtained.

[0084] In this embodiment of the present application, the obtained multiple second intermediate features are determined as the multiple second ranging features.

[0085] It should be noted that the number of the second ranging features in this embodiment is the same as the number of neurons in the second fully connected layer.

[0086] Step 304: using the third fully connected layer in the monocular ranging model to perform nonlinear transformation on the plurality of second ranging features to obtain a plurality of third ranging features, wherein the number of neurons in the third fully connected layer is greater than the number of neurons in the second fully connected layer;

[0087] In one embodiment, step 304 can be implemented as follows: for any neuron in the third fully connected layer, using the neuron to perform weighted summation on the multiple second ranging features, and then adding the weights with a preset third multiplication factor to obtain a third intermediate feature, wherein the weights corresponding to the multiple second ranging features are pre-set in the neuron; based on the third intermediate features obtained by each neuron in the third fully connected layer, the multiple third ranging features are obtained.

[0088] Among them, in the embodiment of the present application, the obtained multiple third intermediate features are determined as the multiple third ranging features.

[0089] It should be noted that the number of the third ranging features in this embodiment is the same as the number of neurons in the third fully connected layer.

[0090] Step 305: performing a nonlinear transformation on the plurality of third ranging features through a fourth fully connected layer in the monocular ranging model to obtain a fourth ranging feature, wherein the number of neurons in the fourth fully connected layer is the same as the number of neurons in the first fully connected layer;

[0091] In one embodiment, step 305 can be implemented as follows: for any neuron in the fourth fully connected layer, after performing weighted summation on the multiple third ranging features using the neuron, adding the weighted summation with a preset fourth multiplication factor to obtain a fourth intermediate feature, wherein the weights corresponding to the multiple third ranging features are pre-set in the neuron; and obtaining the fourth ranging feature based on the multiple fourth intermediate features obtained from each neuron in the fourth fully connected layer.

[0092] Among them, in the embodiment of the present application, the obtained multiple fourth intermediate features are determined as the multiple fourth ranging features.

[0093] It should be noted that the number of the fourth ranging features in this embodiment is the same as the number of neurons in the fourth fully connected layer.

[0094] Step 306: performing a nonlinear transformation on the plurality of fourth ranging features through a fifth fully connected layer in the monocular ranging model to obtain a target ranging feature, wherein the number of neurons in the fifth fully connected layer is less than the number of neurons in the fourth fully connected layer;

[0095] In one embodiment, step 306 can be specifically implemented as follows: for any neuron in the fifth fully connected layer, after performing weighted summation on the multiple fourth ranging features using the neuron, adding the weighted summation with a preset fifth multiplication factor to obtain a fifth intermediate feature, wherein the weights corresponding to the multiple fourth ranging features are pre-set in the neuron; and the target ranging feature is obtained based on the multiple fifth intermediate features obtained from each neuron in the fifth fully connected layer.

[0096] Among them, in the embodiment of the present application, the obtained multiple fifth intermediate features are determined as the target ranging features.

[0097] It should be noted that the number of target ranging features in this embodiment is the same as the number of neurons in the fifth fully connected layer.

[0098] Step 307: Utilizing the correspondence between the ranging feature and the distance preset in the target ranging model, a target distance corresponding to the target ranging feature is obtained, wherein the target distance is the distance between the VR device and the VR handle.

[0099] The target distance measurement features in this embodiment include target handle spot features and target light features.

[0100] In one embodiment, the corresponding relationship between the ranging feature and the distance in this embodiment can be expressed by formula (5), and the predicted distance between the VR device and the handle is obtained:

[0101] D=W2+W1×1 / (d′-A*ln(S′+B)+C)……(5);

[0102] Among them, D is the predicted distance between the VR device and the handle, W1 and W2 are preset weight values, d′ is the target handle spot feature, S′ is the target light feature, and A, B, and C are preset thresholds.

[0103] It should be noted that: A in this embodiment is 1.3262, B ​​is 30.4517, and C is 8.6299. However, the values ​​of A, B, and C in this embodiment can be set according to specific actual conditions, and this embodiment does not limit them. Also, the values ​​of W1 and W2 in this embodiment can be set according to actual conditions, and this embodiment does not limit them.

[0104] like Figure 7 As shown, it is a structural schematic diagram of the monocular ranging model in the embodiment of the present application, from Figure 7It can be seen that the monocular ranging model includes an input layer 710, a first fully connected layer 720, a second fully connected layer 730, a third fully connected layer 740, a fourth fully connected layer 750, a fifth fully connected layer 760, a hidden layer 770 and an output layer 780. The following is a detailed introduction to the functions of each layer in the monocular ranging model:

[0105] First, the handle spot feature and the current light feature are input into the monocular ranging model through the input layer 710, and then the handle spot feature and the light feature are nonlinearly transformed by the first fully connected layer 720 in the monocular ranging model to obtain multiple first ranging features, and then the multiple first ranging features are nonlinearly transformed by the second fully connected layer 730 in the monocular ranging model to obtain multiple second ranging features. Then the multiple second ranging features are nonlinearly transformed by the third fully connected layer 740 in the monocular ranging model to obtain multiple third ranging features. Then the multiple third ranging features are nonlinearly transformed by the fourth fully connected layer 750 in the monocular ranging model to obtain the fourth ranging feature. Then the multiple fourth ranging features are nonlinearly transformed by the fifth fully connected layer 760 in the monocular ranging model to obtain the target ranging feature, and the target distance corresponding to the target ranging feature is obtained by using the correspondence between the ranging feature and the distance pre-set in the hidden layer 770, and finally the target distance is output through the output layer 780.

[0106] It should be noted that the number of neurons in the first fully connected layer 720 in the embodiment of the present application is 16, the number of neurons in the second fully connected layer 730 is 32, the number of neurons in the third fully connected layer 740 is 64, the number of neurons in the fourth fully connected layer 750 is 16, and the number of neurons in the fifth fully connected layer 760 is 2. However, the number of neurons in each fully connected layer is not limited in this embodiment, and the number of neurons in each fully connected layer in this embodiment can be set according to actual conditions.

[0107] In order to make the monocular ranging model in the embodiment of the present application more accurate, the training method of the monocular ranging model in the embodiment of the present application is described below. Figure 8 As shown in FIG. 1 , a specific flow chart of training a monocular ranging model is shown, which includes the following steps:

[0108] Step 801: Acquire a training data set, wherein any set of training data in the training data set includes training features and training distances corresponding to the training features, the training features include training handle spot features and training light features, the training distance is a pre-marked distance between the VR device and the VR handle, and the training handle spot features are obtained by taking a handle image taken by the VR device at the training distance, and the training light features are light features obtained when taking the handle image;

[0109] In one embodiment, the training data set can be determined in the following manner: use a pre-set robot arm to clamp the VR handle and move it within a fixed range of the activity area, that is, imitate the user holding the VR handle to move. Record data within a specified time period, and the data includes the distance, light characteristics, and handle spot characteristics at each moment. Finally, multiple data are obtained. In order to obtain different lighting characteristics, the above steps can be repeated from 5 am to 9 pm to obtain training data under different light characteristics. The accuracy of the trained monocular ranging model is guaranteed.

[0110] Step 802: input the training data set into the monocular distance measurement model for detection, and obtain the predicted distances corresponding to the multiple groups of training data in the training data set;

[0111] Step 803: Obtaining a first error value based on the predicted distances and the training distances respectively corresponding to the plurality of sets of training data;

[0112] In one embodiment, step 803 can be implemented as follows: for any set of training data, based on the training distance corresponding to the training data and the predicted distance corresponding to the training data, obtain the intermediate error value corresponding to the training data; add the intermediate error values ​​corresponding to each training data to obtain the first error value. The first error value is obtained by formula (6):

[0113] L i =log(1+m i -n i )......(6);

[0114] Among them, L i is the intermediate error value corresponding to the i-th group of training data, m i is the training distance corresponding to the i-th group of training data, n i is the predicted distance corresponding to the i-th group of training data.

[0115] It should be noted that: in this embodiment, the loss function for determining the first error value is a log function, such as Fig. 9As shown, it is a schematic diagram of the log function. The reason why the log function is used as the loss function is that the error between the training distance and the predicted distance may be very large. Therefore, in the embodiment, the log function can be used to map the loss function value to a range with smaller changes, which is conducive to the convergence of the monocular ranging model.

[0116] Step 804: determine whether the first error value is greater than a first specified error value, if so, execute step 805, if not, execute step 810;

[0117] It should be noted that the first designated error value in this embodiment can be set according to actual conditions, and this embodiment does not limit the first designated error value.

[0118] Step 805: adjusting the specified parameters of the monocular ranging model to obtain an adjusted monocular ranging model;

[0119] Among them, the specified parameters in this embodiment are the weights and / or multiplication and separation rates corresponding to each feature in at least one neuron in at least one fully connected layer in the monocular ranging model. The specific settings can be made according to the actual situation, and this embodiment does not limit this. As an example, in step 805, the specific adjustment method can be: for any specified parameter, each time the specified parameter is adjusted, the specified parameter is increased or decreased by a specified threshold to obtain the adjusted parameter.

[0120] It should be noted that the adjustment method of each designated parameter in this embodiment may be the same or different. And the designated threshold value of increase or decrease corresponding to each designated parameter may be the same or different. The specific setting may be made according to the actual situation, and this embodiment does not limit it here.

[0121] Step 806: inputting a preset verification data set into the adjusted monocular distance measurement model for detection, and obtaining predicted distances corresponding to multiple groups of verification data in the verification data set, wherein any group of verification data in the verification data set includes a verification feature and a verification distance corresponding to the verification feature, and the verification feature includes a verification handle spot feature and a verification light feature, the verification distance is a pre-marked distance between the VR device and the VR handle, and the verification handle spot feature is obtained by taking a handle image taken by the VR device at the verification distance, and the verification light feature is a light feature obtained when taking the handle image;

[0122] The method for determining the verification data set is the same as the method for determining the training data set described above, and will not be described in detail in this embodiment.

[0123] Step 807: Obtain a second error value based on the prediction distances and verification distances respectively corresponding to the multiple groups of verification data;

[0124] In one embodiment, step 807 can be implemented as follows: for any set of verification data, subtract the predicted distance of the verification data from the verification distance of the verification data to obtain a verification error value; and determine the average value of the verification error values ​​corresponding to each verification data as the second error value. The second error value can be obtained by formula (7):

[0125]

[0126] Where s2 is the second error value, D i is the prediction distance of the i-th group of validation data, d i is the verification distance of the i-th group of verification data, and n is the total number of groups of verification data.

[0127] Step 808: determine whether the total number of the obtained second error values ​​is greater than the specified number, if so, execute step 809, if not, return to execute step 802;

[0128] It should be noted that the designated number in this embodiment is 5. However, this embodiment does not limit the designated number, and the designated number in this embodiment can be limited according to specific actual conditions.

[0129] Step 809: determine whether the second error value is greater than a specified number of second error values ​​adjacent to and consecutive to the second error value; if so, execute step 810; if not, return to execute step 802;

[0130] For example, the second error values ​​are A, B, C, D, E, F, G and H in sequence. If the second error value currently obtained is H and the specified number is 5, H is compared with C, D, E, F and G respectively, and if H is greater than C, D, E, F and G, it is determined that the second error value is greater than a specified number of second error values ​​adjacent to and consecutive to the second error value.

[0131] Step 810: End the training of the monocular ranging model to obtain a trained monocular ranging model.

[0132] The method for determining the training handle light spot feature and verifying the handle light spot feature in the embodiment of the present application is the same as the method for determining the handle light spot feature described above, and will not be repeated in this embodiment.

[0133] Based on the same inventive concept, the monocular distance measurement of the VR device disclosed above can also be implemented by a monocular distance measurement device of the VR device. The effect of the monocular distance measurement device of the VR device is similar to that of the aforementioned method, and will not be repeated here.

[0134] Fig.10 Schematic diagram of the structure of a monocular distance measuring device of a VR device according to an embodiment of the present disclosure.

[0135] like Fig.10 As shown, the monocular ranging device 1000 of the VR device of the present disclosure may include a feature acquisition module 1010, a first non-linear transformation module 1020, a second non-linear transformation module 1030, a third non-linear transformation module 1040, a fourth non-linear transformation module 1050, a target ranging feature determination module 1060 and a target distance determination module 1070.

[0136] The feature acquisition module 1010 is used to acquire the handle light spot feature and the current light feature in response to the monocular ranging instruction triggered by the user, wherein the handle light spot feature is obtained based on the handle image, and the handle image is taken by the VR device after receiving the monocular ranging instruction;

[0137] A first nonlinear transformation module 1020 is used to input the handle spot feature and the light feature into a monocular ranging model, and use the first fully connected layer in the monocular ranging model to perform nonlinear transformation on the handle spot feature and the light feature to obtain a plurality of first ranging features;

[0138] A second nonlinear transformation module 1030 is used to perform a nonlinear transformation on the plurality of first ranging features through a second fully connected layer in the monocular ranging model to obtain a plurality of second ranging features, wherein the number of neurons in the second fully connected layer is greater than the number of neurons in the first fully connected layer;

[0139] A third nonlinear transformation module 1040 is used to perform a nonlinear transformation on the plurality of second ranging features using a third fully connected layer in the monocular ranging model to obtain a plurality of third ranging features, wherein the number of neurons in the third fully connected layer is greater than the number of neurons in the second fully connected layer;

[0140] A fourth nonlinear transformation module 1050, configured to perform a nonlinear transformation on the plurality of third ranging features through a fourth fully connected layer in the monocular ranging model to obtain a fourth ranging feature, wherein the number of neurons in the fourth fully connected layer is the same as the number of neurons in the first fully connected layer;

[0141] A target ranging feature determination module 1060 is used to perform a nonlinear transformation on the plurality of fourth ranging features through a fifth fully connected layer in the monocular ranging model to obtain a target ranging feature, wherein the number of neurons in the fifth fully connected layer is less than the number of neurons in the fourth fully connected layer;

[0142] The target distance determination module 1070 is used to obtain the target distance corresponding to the target ranging feature by using the correspondence between the ranging feature and the distance pre-set in the monocular ranging model, wherein the target distance is the distance between the VR device and the VR handle.

[0143] In one embodiment, the first nonlinear transformation module 1020 is specifically configured to:

[0144] For any neuron in the first fully connected layer, after performing weighted summation on the handle spot feature and the light feature using the neuron, the summation is added to a preset first multiplication rate to obtain a first intermediate feature, wherein the weight of the handle spot feature and the weight of the light feature are preset in the neuron;

[0145] The multiple first ranging features are obtained based on the first intermediate features respectively obtained by each neuron in the first fully connected layer.

[0146] In one embodiment, the second nonlinear transformation module 1030 is specifically configured to:

[0147] For any neuron in the second fully connected layer, after performing weighted summation on the multiple first ranging features using the neuron, the summation is added to a preset second multiplication rate to obtain a second intermediate feature, wherein the weights corresponding to the multiple first ranging features are preset in the neuron;

[0148] The plurality of second ranging features are obtained based on the second intermediate features respectively obtained by each neuron in the second fully connected layer.

[0149] In one embodiment, the third nonlinear transformation module 1040 is specifically configured to:

[0150] For any one neuron in the third fully connected layer, using the neuron to perform weighted summation on the plurality of second ranging features, and then adding the weights to a preset third multiplication factor to obtain a third intermediate feature, wherein the weights corresponding to the plurality of second ranging features are preset in the neuron;

[0151] The plurality of third ranging features are obtained based on the third intermediate features respectively obtained by each neuron in the third fully connected layer.

[0152] In one embodiment, the fourth nonlinear transformation module 1050 is specifically configured to:

[0153] For any one neuron in the fourth fully connected layer, using the neuron to perform weighted summation on the plurality of third ranging features, and then adding the weighted summation to a preset fourth multiplication factor to obtain a fourth intermediate feature, wherein the weights corresponding to the plurality of third ranging features are preset in the neuron;

[0154] The fourth ranging feature is obtained based on multiple fourth intermediate features obtained by each neuron in the fourth fully connected layer.

[0155] In one embodiment, the target ranging feature determination module 1060 is specifically configured to:

[0156] For any one neuron in the fifth fully connected layer, using the neuron to perform weighted summation on the plurality of fourth ranging features, and then adding the weighted summation to a preset fifth multiplication factor to obtain a fifth intermediate feature, wherein the weights corresponding to the plurality of fourth ranging features are preset in the neuron;

[0157] The target ranging feature is obtained based on multiple fifth intermediate features obtained by each neuron in the fifth fully connected layer.

[0158] In one embodiment, the apparatus further comprises:

[0159] The handle light spot feature determination module 1080 is used to obtain the handle light spot feature by:

[0160] Performing light spot detection on the handle image using an edge detection algorithm to obtain the position of each light spot in the handle image;

[0161] For any light spot, based on the position of each pixel in the light spot, determine the diameter of the light spot;

[0162] The diameter with the largest value among the diameters corresponding to the light spots is determined as the handle light spot feature.

[0163] In one embodiment, the handle light spot feature determination module 1080 is specifically used to:

[0164] For any two pixel points in the light spot, based on the positions of the two pixel points in the handle image, obtain the distance between the two pixel points; and,

[0165] The distance with the largest value among the distances is determined as the diameter of the light spot.

[0166] In one embodiment, the light characteristic includes at least one of light intensity, light direction and color temperature.

[0167] After introducing a monocular ranging method and apparatus for a VR device according to an exemplary embodiment of the present invention, next, an electronic device according to another exemplary embodiment of the present invention is introduced.

[0168] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0169] In some possible implementations, the electronic device according to the present invention may include at least one processor and at least one computer storage medium. The computer storage medium stores program code, and when the program code is executed by the processor, the processor executes the steps of the monocular ranging method of the VR device according to various exemplary embodiments of the present invention described above in this specification. For example, the processor may execute the following steps: Figure 3 Steps 301-307 shown in .

[0170] Refer to the following Fig.11 The electronic device 1100 according to this embodiment of the present invention is described. Fig.11 The electronic device 1100 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0171] like Fig.11 As shown, the electronic device 1100 is in the form of a general electronic device. The components of the electronic device 1100 may include but are not limited to: the at least one processor 1101, the at least one computer storage medium 1102, and a bus 1103 connecting different system components (including the computer storage medium 1102 and the processor 1101).

[0172] Bus 1103 represents one or more of several types of bus structures, including a computer storage media bus or computer storage media controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.

[0173] Computer storage media 1102 may include readable media in the form of volatile computer storage media, such as random access computer storage media (RAM) 1121 and / or cache storage media 1122 , and may further include read-only computer storage media (ROM) 1123 .

[0174] The computer storage medium 1102 may also include a program / utility 1125 having a set (at least one) of program modules 1124, such program modules 1124 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0175] The electronic device 1100 may also communicate with one or more external devices 1104 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or may communicate with any device that enables the electronic device 1100 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1105. Furthermore, the electronic device 1100 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1106. As shown, the network adapter 1106 communicates with other modules for the electronic device 1100 via a bus 1103. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAD systems, tape drives, and data backup storage systems, etc.

[0176] In some possible implementations, various aspects of the monocular ranging method for a VR device provided by the present invention may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the monocular ranging method for a VR device according to various exemplary embodiments of the present invention described above in this specification.

[0177] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A monocular distance measurement method for VR equipment, characterized in that: The method comprises: In response to a monocular ranging instruction triggered by a user, a handle light spot feature and a current light feature are obtained, wherein the handle light spot feature is obtained based on a handle image, and the handle image is taken by the VR device after receiving the monocular ranging instruction; Inputting the handle spot feature and the light feature into a monocular ranging model, and performing nonlinear transformation on the handle spot feature and the light feature using a first fully connected layer in the monocular ranging model to obtain a plurality of first ranging features; Performing a nonlinear transformation on the plurality of first ranging features through a second fully connected layer in the monocular ranging model to obtain a plurality of second ranging features, wherein the number of neurons in the second fully connected layer is greater than the number of neurons in the first fully connected layer; Using a third fully connected layer in the monocular ranging model to perform a nonlinear transformation on the plurality of second ranging features to obtain a plurality of third ranging features, wherein the number of neurons in the third fully connected layer is greater than the number of neurons in the second fully connected layer; Performing a nonlinear transformation on the plurality of third ranging features through a fourth fully connected layer in the monocular ranging model to obtain a fourth ranging feature, wherein the number of neurons in the fourth fully connected layer is the same as the number of neurons in the first fully connected layer; Performing a nonlinear transformation on the plurality of fourth ranging features through a fifth fully connected layer in the monocular ranging model to obtain a target ranging feature, wherein the number of neurons in the fifth fully connected layer is less than the number of neurons in the fourth fully connected layer; By using the correspondence between the ranging feature and the distance pre-set in the monocular ranging model, a target distance corresponding to the target ranging feature is obtained, wherein the target distance is the distance between the VR device and the VR handle.

2. The method according to claim 1, characterized in that The first fully connected layer in the monocular ranging model is used to perform nonlinear transformation on the handle spot feature and the light feature to obtain multiple first ranging features, including: For any neuron in the first fully connected layer, after performing weighted summation on the handle spot feature and the light feature using the neuron, the summation is added to a preset first multiplication rate to obtain a first intermediate feature, wherein the weight of the handle spot feature and the weight of the light feature are preset in the neuron; The multiple first ranging features are obtained based on the first intermediate features respectively obtained by each neuron in the first fully connected layer.

3. The method according to claim 1, characterized in that The step of performing nonlinear transformation on the plurality of first ranging features through the second fully connected layer in the monocular ranging model to obtain a plurality of second ranging features includes: For any neuron in the second fully connected layer, after performing weighted summation on the multiple first ranging features using the neuron, the summation is added to a preset second multiplication rate to obtain a second intermediate feature, wherein the weights corresponding to the multiple first ranging features are preset in the neuron; The plurality of second ranging features are obtained based on the second intermediate features respectively obtained by each neuron in the second fully connected layer.

4. The method according to claim 1, characterized in that: The method of performing nonlinear transformation on the plurality of second ranging features using the third fully connected layer in the monocular ranging model to obtain a plurality of third ranging features includes: For any one neuron in the third fully connected layer, using the neuron to perform weighted summation on the plurality of second ranging features, and then adding the weights to a preset third multiplication factor to obtain a third intermediate feature, wherein the weights corresponding to the plurality of second ranging features are preset in the neuron; The plurality of third ranging features are obtained based on the third intermediate features respectively obtained by each neuron in the third fully connected layer.

5. The method according to claim 1, characterized in that The step of performing a nonlinear transformation on the third ranging feature through the fourth fully connected layer in the monocular ranging model to obtain a fourth ranging feature includes: For any one neuron in the fourth fully connected layer, using the neuron to perform weighted summation on the plurality of third ranging features, and then adding the weighted summation to a preset fourth multiplication factor to obtain a fourth intermediate feature, wherein the weights corresponding to the plurality of third ranging features are preset in the neuron; The fourth ranging feature is obtained based on multiple fourth intermediate features obtained by each neuron in the fourth fully connected layer.

6. The method according to claim 1, characterized in that The step of performing nonlinear transformation on the plurality of fourth ranging features through the fifth fully connected layer in the monocular ranging model to obtain target ranging features includes: For any one neuron in the fifth fully connected layer, using the neuron to perform weighted summation on the plurality of fourth ranging features, and then adding the weighted summation to a preset fifth multiplication factor to obtain a fifth intermediate feature, wherein the weights corresponding to the plurality of fourth ranging features are preset in the neuron; The target ranging feature is obtained based on multiple fifth intermediate features obtained by each neuron in the fifth fully connected layer.

7. The method according to claim 1, characterized in that The handle spot feature is obtained by the following method: Performing light spot detection on the handle image using an edge detection algorithm to obtain the position of each light spot in the handle image; For any light spot, based on the position of each pixel in the light spot, determine the diameter of the light spot; The diameter with the largest value among the diameters corresponding to the light spots is determined as the handle light spot feature.

8. The method according to claim 7, characterized in that The step of determining the diameter of any light spot based on the position of each pixel in the light spot includes: For any two pixel points in the light spot, based on the positions of the two pixel points in the handle image, obtain the distance between the two pixel points; and, The distance with the largest value among the distances is determined as the diameter of the light spot.

9. The method according to claim 1 or 2, characterized in that: The light characteristics include at least one of light intensity, light direction and color temperature.

10. An electronic device, characterized in that: comprising a processor and a memory, wherein the processor and the memory are connected via a bus; The memory stores a computer program, and the processor is configured to perform the following operations based on the computer program: In response to a monocular ranging instruction triggered by a user, a handle light spot feature and a current light feature are obtained, wherein the handle light spot feature is obtained based on a handle image, and the handle image is taken by the VR device after receiving the monocular ranging instruction; Inputting the handle spot feature and the light feature into a monocular ranging model, and performing nonlinear transformation on the handle spot feature and the light feature using a first fully connected layer in the monocular ranging model to obtain a plurality of first ranging features; Performing a nonlinear transformation on the plurality of first ranging features through a second fully connected layer in the monocular ranging model to obtain a plurality of second ranging features, wherein the number of neurons in the second fully connected layer is greater than the number of neurons in the first fully connected layer; Using a third fully connected layer in the monocular ranging model to perform a nonlinear transformation on the plurality of second ranging features to obtain a plurality of third ranging features, wherein the number of neurons in the third fully connected layer is greater than the number of neurons in the second fully connected layer; Performing a nonlinear transformation on the plurality of third ranging features through a fourth fully connected layer in the monocular ranging model to obtain a fourth ranging feature, wherein the number of neurons in the fourth fully connected layer is the same as the number of neurons in the first fully connected layer; Performing a nonlinear transformation on the plurality of fourth ranging features through a fifth fully connected layer in the monocular ranging model to obtain a target ranging feature, wherein the number of neurons in the fifth fully connected layer is less than the number of neurons in the fourth fully connected layer; By using the correspondence between the ranging feature and the distance pre-set in the monocular ranging model, a target distance corresponding to the target ranging feature is obtained, wherein the target distance is the distance between the VR device and the VR handle.