A method for processing environmental image data in video see-through, applicable to a system of a mixed reality head-mounted display;
- at least two cameras of the system corresponding to two eyes of a user capture real environment images, which are displayed and viewed on a left screen and a right screen of the mixed reality head-mounted display;
- wherein:
- based on user's interactive commands, the system post-processes the real environment images to create visual effects of zooming in/out of objects within the real environment images;
- the interactive commands include preset zoom-in and zoom-out commands;
- the system predicts a zoom distance based on the interactive commands;
- the system post-processes the real environment images according to the following steps:
- step 1:
- in response to a zoom-in command given by the user who views the real environment images through VST, determining a target pixel T based on a distance Z which is a vertical perpendicular distance between the target pixel T and the mixed reality head-mounted display, wherein a pixel closest to one end of said distance Z opposite another end thereof at the mixed reality head-mounted display is defined as the target pixel T;
- step 1 comprises the following steps:
- assuming the left screen and the right screen of the mixed reality head-mounted display align pixels based on field of view (FOV) of a left camera and a right camera of the system respectively, a total number of pixels of an image captured by a respective one of the left camera and right camera is equal to a total number of screen pixels of a respective one of the left screen and the right screen either with or without correction;
- given that a total number of pixels along an X-axis of a respective one of the left screen and the right screen is Xtotal, the FOV of the left camera and the right camera is known, an interpupillary distance (DIPD) between the left camera and the right camera is known, and let a pixel per degree (PPD) being PPD=Xtotal/FOV;
- using point L to represent a center point of the left screen and a center point of the left camera simultaneously, and using point R to represent a center point of the right screen and a center point of the right camera simultaneously, a line connecting said point L and said point R or a line parallel to the line connecting said point L and said point R is defined as the X-axis;
- establishing XY coordinate systems on the left screen and the right screen respectively, with said point L and said point R being origins of the XY coordinate systems respectively;
- wherein on the left screen, a distance on an imaging plane of the left screen between a point corresponding to perpendicular projection of said point L on the imaging plane of the left screen and a parallax viewing position according to which the target pixel T is viewed is defined as XL, and on the right screen, a distance on an imaging plane of the right screen between a point corresponding to perpendicular projection of said point R on the imaging plane of the right screen and a parallax viewing position according to which the target pixel T is viewed is defined as XR;
- values of said XL and said XR are represented on the left screen and on the right screen respectively as pixel values;
- as an object as viewed from the left screen and the right screen is zoomed in, the parallax viewing positions on the left screen and the right screen move along or parallel to the X-axis symmetrically from said point L and said point R towards a center of the mixed reality head-mounted display;
- a normal line passing perpendicularly through the X-axis at said point L is defined as a left central line, and a normal line passing perpendicularly through the X-axis at said point R is defined as a right central line;
- an angle between the left central line and a line passing through said point L and the parallax viewing position on the left screen according to which the target pixel T is viewed as defined as θL;
- an angle between the right central line and a line passing through said point R and the parallax viewing position on the right screen according to which the target pixel T is viewed as defined as θR;
- in the real world, D is used to represent values of how much a perpendicular projection point of the target pixel T onto the X-axis is distanced from said point L and said point R, wherein a normal line extending from the target pixel T and intersecting perpendicularly with the X-axis divides D into DL and DR, wherein DL is a distance between said point L and an intersection point of the X-axis and the normal line extending from the target pixel T and intersecting perpendicularly with the X-axis, and DR is a distance between said point R and the intersection point of the X-axis and the normal line extending from the target pixel T and intersecting perpendicularly with the X-axis;
- defining DL+DR=DIPD, wherein DIPD is the interpupillary distance between the left camera and the right camera and also a fixed known distance between said point L and said point R;
- during zoom in/out process of the target pixel T, DL and DR remain unchanged;
- scanning row by row a left image and a right image captured by the left camera and the right camera respectively, comparing all pixels in each row to find pixels in the left image and the right image with identical depth information or grayscale colors and consistent positional arrangements;
- obtaining values of XL and XR of each of these pixels, and then calculate for each of these pixels:
- θ
- L
- =
- X
- L
- /
- PPD
- ,
- and
- θ
- R
- =
- X
- R
- /
- PPD
- ,
- as well as the distance Z according to the following formula:
- Z
- =
- D
- IPD
- TAN
-
- (
- θ
- L
- )
- +
- TAN
-
- (
- θ
- R
- )
- ;
- defining the pixel closest to said one end of said distance Z opposite said another end thereof at the mixed reality head-mounted display as the target pixel T, which is currently at an original position;
- said target pixel T at said original position is defined as Told;
- saving original position data of Told, wherein said original position data of Told includes a value of XL corresponding to Told, defined as Xold-left, a value of θL corresponding to Told, defined as θold-left, a value of XR corresponding to Told, defined as Xold-right, a value of OR corresponding to Told, defined as θold-right, and a value of Zold, which is a vertical perpendicular distance between Told and the mixed reality head-mounted display;
- step 2:
- in response to the zoom-in command, obtaining a value of Znew based on the zoom-in command, wherein Znew is defined as a vertical perpendicular distance between the mixed reality head-mounted display and Tnew which is a new position of Told after being zoomed in from the original position, and then calculating Xnew-left and Xnew-right of Tnew, wherein Xnew-left is a value of XL corresponding to Tnew, and Xnew-right is a value of XR corresponding to Tnew;
- step 3:
- after obtaining Xnew-left and Xnew-right, magnifying images displayed on the left screen and the right screen by (Xnew/Xold) times, wherein Xnew represents a value of XL or XR corresponding to Tnew, and Xold represents a value of XL or XR corresponding to Told, then translating each pixel of the magnified image on the left screen simultaneously by a same distance as how the parallax viewing position on the left screen translate when Xold-left is changed to Xnew-left when the target pixel T is zoomed in, and also translating each pixel of the magnified image on the right screen simultaneously by a same distance as how the parallax viewing position on the right screen translate when Xold-right is changed to Xnew-right when the target pixel T is zoomed in.