Method and apparatus for displaying image on head-mounted display device, and electronic device
The present application discloses a method and apparatus for displaying an image on a head-mounted display device, and an electronic device. A specific implementation solution is as follows: determining a reference pose for processing a to-be-display image at a current time, based on angular velocity data of the head-mounted display device at the current time, and a first corrected pose for processing a display image of the head-mounted display device at a previous time; processing a pose error between the reference pose and a preset pose for processing a display image to obtain a corrected pose difference; compensating the reference pose by using the corrected pose difference to obtain a second corrected pose for processing the to-be-display image at the current time; and rendering the to-be-display image of the head-mounted display device based on the second corrected pose to display the to-be-display image of the head-mounted display device.
1 . A method for displaying an image on a head-mounted display device, comprising:
determining a reference pose for processing a to-be-display image at a current time, based on angular velocity data of the head-mounted display device at the current time and a first corrected pose for image processing of the head-mounted display device at a previous time;
processing a pose error between the reference pose and a preset pose for image processing, to obtain a corrected pose difference;
compensating the reference pose by using the corrected pose difference to obtain a second corrected pose for processing the to-be-display image at the current time; and
rendering the to-be-display image of the head-mounted display device based on the second corrected pose, to display the to-be-display image of the head-mounted display device.
2 . The method according to claim 1 , wherein processing the pose error between the reference pose and the preset pose for image processing to obtain the corrected pose difference comprises:
correcting a current pose error corresponding to the current time by using a correction ratio to obtain the corrected pose difference, wherein the correction ratio is greater than 0 and less than 1.
3 . The method according to claim 2 , further comprising:
determining the correction ratio based on compensation reference information, the compensation reference information comprising at least one of: the current pose error corresponding to the current time, an accumulated value of pose errors, an environmental condition of a movable platform where the head-mounted display device is located, and steering information of the movable platform.
4 . The method according to claim 3 , wherein at least one of:
the correction ratio is positively correlated with the current pose error corresponding to the current time;
the correction ratio is positively correlated with the accumulated value of pose errors;
the environmental condition comprises road surface roughness, and the correction ratio is positively correlated with the road surface roughness; and
the steering information comprises a steering degree, and the correction ratio is positively correlated with the steering degree.
5 . The method according to claim 2 , further comprising:
determining a pose error change rule based on a pose error sequence, the pose error sequence comprising pose errors corresponding to a plurality of times respectively; and
adjusting the correction ratio based on the pose error change rule.
6 . The method according to claim 5 , wherein adjusting the correction ratio based on the pose error change rule comprises at least one of:
increasing the correction ratio in the case where a pose error corresponding to each time in a target time period is determined to be greater than or equal to a pose error corresponding to a target time based on the pose error change rule;
reducing the correction ratio in the case where the pose error corresponding to each time in the target time period is determined to be less than the pose error corresponding to the target time based on the pose error change rule;
increasing the correction ratio in the case where a changing trend of the pose errors is determined to be an increasing trend based on the pose error change rule; and
reducing the correction ratio in the case where the changing trend of the pose errors is determined to be a decreasing trend based on the pose error change rule,
wherein each of the target time, a starting time of the target time period, and an ending time of the target time period is one of the plurality of times, respectively, the starting time of the target time period being later than the target time, and a duration of the target time period is greater than or equal to a preset duration.
7 . The method according to claim 2 , further comprising:
receiving a user input operation; and
adjusting the correction ratio in response to the user input operation.
8 . The method according to claim 1 , wherein processing the pose error between the reference pose and the preset pose for image processing to obtain the corrected pose difference comprises:
performing low pass filtering on a current pose error corresponding to the current time to obtain the corrected pose difference.
9 . The method according to claim 8 , wherein
the performing low pass filtering on the current pose error corresponding to the current time comprises:
performing low pass filtering on the current pose error corresponding to the current time by a low pass filter; and
the method further comprises:
receiving a user input operation; and
adjusting a cutoff frequency of the low pass filter in response to the user input operation.
10 . The method according to claim 1 , further comprising:
in response to a user selection, switching an image displaying mode of the head-mounted display device to one of a 0 degree-of-freedom mode, a target mode, and a 3 degree-of-freedom mode; and
performing the step of determining the reference pose for processing the to-be-display image at the current time, based on the angular velocity data of the head-mounted display device at the current time, and the first corrected pose for image processing of the head-mounted display device at the previous time, in the case where the head-mounted display device is in the target mode.
11 . The method according to claim 1 , further comprising:
identifying a type of a platform where the head-mounted display device is located;
controlling the head-mounted display device to switch to a target mode in the case where the type of the platform is a movable platform; and
performing the step of determining the reference pose for processing the to-be-display image at the current time, based on the angular velocity data of the head-mounted display device at the current time, and the first corrected pose for image processing of the head-mounted display device at the previous time, in the case where the head-mounted display device is in the target mode.
12 . The method according to claim 1 , wherein the head-mounted display device is configured to be coupled to a movable platform where the head-mounted display device is located and be movable relative to the movable platform.
13 . The method according to claim 1 , wherein at least one of:
the preset pose is a pose configured such that an image is displayed at a preset position in a coordinate system of the head-mounted display device; and
the preset pose is a pose configured such that the image is aligned with the direction of gravity.
14 . An electronic device, comprising:
a memory configured to store a computer program product; and
a processor configured to execute the computer program product stored in the memory, wherein the computer program product, when executed, causes the processor to perform operations comprising:
acquiring angular velocity data of a head-mounted display device;
determining a reference pose for processing a to-be-display image, based on the angular velocity data and a previous first corrected pose for image processing of the head-mounted display device;
processing the reference pose to obtain a corrected pose difference;
compensating the reference pose by using the corrected pose difference to obtain a second corrected pose for processing the to-be-display image; and
rendering the to-be-display image of the head-mounted display device based on the second corrected pose, to display the to-be-display image of the head-mounted display device.
15 . A method for displaying an image on a head-mounted display device, the method comprising:
acquiring angular velocity data of the head-mounted display device;
determining a reference pose for processing a to-be-display image, based on the angular velocity data and a previous first corrected pose for image processing of the head-mounted display device;
processing a pose error between the reference pose and a preset pose for image processing to obtain a corrected pose difference;
compensating the reference pose by using the corrected pose difference to obtain a second corrected pose for processing the to-be-display image; and
rendering the to-be-display image of the head-mounted display device based on the second corrected pose, to display the to-be-display image of the head-mounted display device.
16 . The method according to claim 15 , further comprising:
in response to a user selection, switching an image displaying mode of the head-mounted display device to one of a 0 degree-of-freedom mode, a target mode, and a 3 degree-of-freedom mode; and
implementing the method according to claim 15 .
17 . The method according to claim 15 , wherein processing the pose error between the reference pose and the preset pose for image processing to obtain the corrected pose difference comprises:
correcting a current pose error corresponding to the current time by using a correction ratio to obtain the corrected pose difference, wherein the correction ratio is greater than 0 and less than 1.
18 . The method according to claim 17 , further comprising:
receiving a user input operation; and
adjusting the correction ratio in response to the user input operation.
19 . The method according to claim 17 , further comprising:
determining the correction ratio based on compensation reference information, after correction of the pose error is performed using the correction ratio.