US20210192678A1
2021-06-24
16/650,141
2018-05-29
US 11,301,953 B2
2022-04-12
WO; PCT/CN2018/088806; 20180529
WO; WO2019/062177; 20190404
John B Strege
Miles & Stockbridge P.C.
2038-06-17
Disclosed are a panoramic video asymmetrical mapping method and a corresponding inverse mapping method: by means of the mapping methods, mapping a spherical surface corresponding to a panoramic image or video A onto a two-dimensional image or video B; projecting the spherical surface onto an isosceles quadrangular pyramid with a square bottom plane, and further projecting the isosceles quadrangular pyramid onto a planar surface; using isometric projection on a main viewpoint region in the projection and using a relatively high sampling density to ensure that the video quality of the region of the main viewpoint is high, while using a relatively low sample density for non-main viewpoint regions so as to reduce bit rate. While ensuring that the video quality of the region of the main viewpoint remains unchanged, the present panoramic video asymmetrical mapping technique greatly reduces the resolution of the remaining regions in the video, effectively reducing the bit rate required for encoding a virtual reality video. The panoramic video asymmetrical inverse mapping technique provides a method for mapping from a planar surface to a spherical surface, and by means of said method, a planar surface video may be mapped back to a spherical surface for rendering and viewing.
Get notified when new applications in this technology area are published.
G06T3/0031 » CPC main
Geometric image transformation in the plane of the image for topological mapping of a higher dimensional structure on a lower dimensional surface
G06T3/4007 » CPC further
Geometric image transformation in the plane of the image; Scaling the whole image or part thereof Interpolation-based scaling, e.g. bilinear interpolation
G06T3/4038 » CPC further
Geometric image transformation in the plane of the image; Scaling the whole image or part thereof for image mosaicing, i.e. plane images composed of plane sub-images
G06T3/00 IPC
Geometric image transformation in the plane of the image
G06T3/40 IPC
Geometric image transformation in the plane of the image Scaling the whole image or part thereof
This application is a national stage filing under 35 U.S.C. § 371 of PCT/CN2018/088806, filed on May 29, 2018 which claims priority to CN Application No. 201710882161.1 filed on Sep. 26, 2017. The applications are incorporated herein by reference in their entirety.
The present disclosure generally relates to a field of virtual reality (VR) video technology, specifically relates to a novel main viewpoint-based panoramic video mapping method and a corresponding inverse mapping method, the mapping technology is used for panoramic video, and in the premise of ensuring that the quality of the main viewpoint region of the panoramic video is unchanged, the file size and the coding bit rate of the panoramic video can be greatly reduced.
With the development of virtual reality video, the demand for virtual reality video is increasing. Compared with a traditional video with a view angle of about 100 degrees or more, a virtual reality video need to provide a view angle of 360 degrees, therefore, a virtual reality video requires a greater resolution. In addition, virtual reality videos usually need to be watched on head-mounted devices, and in order to avoid causing dizziness to the user, the suggested frame rate needs to be above 60 frames per second, or even 120 frames per second. Due to the increase in resolution and frame rate, the bit rates required for a virtual reality video coding is also greatly increased compared to a traditional video.
Although the virtual reality video provides a view angle of 360 degrees, the user will only watch the image in a vicinity of one viewpoint for a short period of time, and this viewing direction is called the main viewpoint of the user. In view of this feature, asymmetric mapping technology and stream switching technology are proposed to achieve the purpose of saving bit rates. The asymmetric mapping technique uses a higher sampling density to sample a main viewpoint region, while uses a lower sampling density to sample other regions. The stream switching technology encodes and stores multiple bit streams of asymmetrically mapped video with different main viewpoints on a server end, and the client chooses to receive the corresponding bit stream according to the position of the user's viewpoint.
Although the asymmetric mapping technology and the stream switching technology may increase the storage and coding cost of the server side, network transport cost and decoding complexity of the client can be effectively reduced, which is effective in one-to-many application scenarios. However, the coding efficiency of the prior asymmetric mapping technology is low, and it needs to be improved.
To overcome the drawbacks in the existing technologies, to further improve coding efficiency of the asymmetric mapping technology, the present disclosure provides a panoramic video asymmetrical mapping method and a corresponding inverse mapping method. While ensuring that the video quality of the region of the main viewpoint remains unchanged, the present panoramic video asymmetrical mapping technique greatly reduces the resolution of the remaining regions in the video, effectively reducing the bit rate required for encoding a virtual reality video. The panoramic video asymmetrical inverse mapping technique provides a method for mapping from a planar surface to a spherical surface, and by means of said method, a planar surface video may be mapped back to a spherical surface for rendering and viewing.
The technical solution provided by the present invention is:
A novel main viewpoint-based panoramic video asymmetrical mapping method, mapping a spherical surface corresponding to a panoramic image or video A onto a two-dimensional image or video B; projecting the spherical surface onto an isosceles quadrangular pyramid with a square bottom plane, and further projecting the isosceles quadrangular pyramid onto a planar surface; using isometric projection on a main viewpoint region in the projection and using a relatively high sampling density to ensure that the video quality of the region of the main viewpoint is high, while using a relatively low sample density for non-main viewpoint regions so as to reduce bit rate. Specifically, a right-handed coordinate system is established based on the sphere center O, wherein the Z axis points to the direction at longitude and latitude of (0°, 0°) of the spherical surface, the Y axis points to the direction of the north pole of the spherical surface, and the X axis points to the direction at longitude and latitude of (90°, 0°) of the spherical surface. Then, a quadrangular pyramid W is established, wherein, the center of the bottom plane of the quadrangular pyramid W is on the positive Z axis, the apex is on the negative Z axis, and the base edges are respectively parallel to the X axis and parallel to the Y axis; the connecting line between the center D of the bottom plane of the quadrangular pyramid and the sphere center O is denoted as l1, and the connecting line between the midpoint of a base edge of the quadrangular pyramid and the sphere center O is denoted as l2, and the angle formed by l1 and l2 is Īø; the bottom plane of the quadrangular pyramid is denoted as plane Iā³, the side surface intersecting with the positive X axis is denoted as plane IIā³, the side surface intersecting with the positive Y axis is denoted as plane IIIā³, the side surface intersecting with the negative X axis is denoted as plane IVā³, and the side surface intersecting with the negative Y axis is denoted as plane Vā³. When the pitch angle, the yaw angle and the roll angle of the main viewpoint are respectively β1, β2 and β3, a corresponding quadrangular pyramid Qā² is obtained by rotating the quadrangular pyramid Q about the sphere center O by (β1, β2, β3). The sphere center O and the four base edges of the quadrangular pyramid Qā² form four sector planes, and the four sector planes divide the spherical surface into two regions. Wherein, one region including the main viewpoint is referred to as the main viewpoint region, and the main viewpoint region corresponds to the bottom plane of the pyramid and is denoted as region I, and the other regions are referred to as the non-main viewpoint regions; the sphere center O and four side edges of the quadrangular pyramid Qā² form four sector planes, which further divide one non-main viewpoint region into four sub-regions, and the four sub-regions respectively correspond to the four side surfaces IIā³, IIIā³, IVā³ and Vā³, and are respectively referred to as regions II, III, IV and V. The mapping method of the present invention maps the described region I onto a rectangular plane Iā² with a resolution of WIā²ĆHIā², and maps the regions II, III, IV and V onto four isosceles triangular planes IIā², IIIā², IVā², and Vā², wherein the base edge and the height of the four isosceles triangular planes are respectively
W II ā² Ć H II ā² 2 , H II ā² Ć W II ā² 2 , W II ā² Ć H II ā² 2 , H II ā² Ć W II ā² 2 ,
and then the four isosceles triangular planes are spliced into a rectangular plane VIā² with a resolution of WIIā²ĆHIIā² The parameters Īø, WIā², HIā², WIIā², HIIā², β1, β2, and β3 can be set as required. The rectangular plane Iā² and rectangular plane VIā² are the two-dimensional image or video B obtained by mapping.
The mapping formats of panoramic image A comprises a longitude and latitude image, a cube-mapped image, or a panoramic video captured by a multi-channel camera, but is not limited thereto. The two-dimensional image or video B includes the rectangular plane Iā² and the rectangular plane VIā².
For the panoramic image mapping method, specifically, the mapping a spherical surface corresponding to a panoramic image or video A onto a two-dimensional image or video B including the following steps:
First step: for each pixel in the rectangular plane Iā², according to its coordinate (XIā², YIā²) in the plane Iā², calculating its corresponding coordinate āCoordinateā²ā in the bottom plane of the quadrangular pyramid Qā², then further calculating its corresponding coordinate āCoordinateā on the spherical surface according to the perspective projection method, and finally according to the spherical coordinate āCoordinateā, taking the pixel value of the corresponding position (or the corresponding pixel value obtained based on neighbor pixels by interpolation) on the spherical surface, as the pixel value of the pixel (XI, YI) in the plane Iā². The specific steps to calculate the spherical coordinate āCoordinateā according to the plane coordinate (XIā², YIā²) are as follows:
(1.1) the point, corresponding to the point in the plane Iā² with the coordinate (XIā², YIā²), in the bottom plane of the quadrangular pyramid Qā² is denoted as AIā², the connecting lines between the midpoints of the opposite base edges of the quadrangular pyramid Qā² are denoted as m1 and m2, the projections of the point AIā² on m1 and m2 are respectively denoted as BIā² and CIā², and the center of the bottom plane of the quadrangular pyramid Qā² is denoted as D, and the position of AIā² can be determined based on the angle BIā²OD and the angle CIā²OD; in the present invention, the magnitudes of the angle BIā²OD and the angle CIā²OD can be calculated based on the value of (XIā², YIā²), the magnitude of the angle BIā²OD and the value of XIā² are in a relationship of a linear function, and the magnitude of the angle CIā²OD and the value of YIā² are in a relationship of a linear function;
(1.2) The coordinate of AIā², āCoordinateā²ā, is determined according to the magnitude of the angle BIā²OD, the magnitude of the angle CIā²OD and the values of β1, β2 and β3;
(1.3) According to the coordinate of the point AIā², the coordinate of the intersection of the ray {right arrow over (OAIā²)} and the spherical surface, āCoordinateā, is obtained.
Second step: for each pixel in the four isosceles triangular planes IIā², IIIā², IVā² and Vā², according to its coordinate (XIIā², YIIā²) (the X and Y coordinate axes are respectively perpendicular to and parallel to the base of the isosceles triangle), calculating its corresponding coordinate āCoordinateā²ā on the side surface of the quadrangular pyramid Qā², then further calculating its corresponding coordinate āCoordinateā on the spherical surface according to the perspective projection method, and finally according to the spherical coordinate āCoordinateā, taking the pixel value of the corresponding position (or the corresponding pixel value obtained based on neighbor pixels by interpolation) on the spherical surface, as the pixel value of the pixel (XIIā², YIIā²). The specific steps to calculate the spherical coordinate āCoordinateā according to the plane coordinate (XIIā², YIIā²) are as follows:
(2.1) The point, corresponding to the pixel (XIIā², YIIā²), on the side surface of the quadrangular pyramid Qā² is denoted as AIIā², the connecting line between the midpoint of the base edge of the side surface and the apex of the quadrangular pyramid Qā² is denoted as n1, and the connecting line between the center of the bottom plane and the apex of the quadrangular pyramid Qā² is denoted as n2, and the projections of point AIIā² on n1 and n2 are denoted as BIIā² and CIIā², respectively, and the center of the bottom plane of the quadrangular pyramid Qā² is denoted as D, and the position of AIIā² can be determined based on the angle BIIā²OD and the angle CIIā²OD; in the present invention, the magnitudes of the angle BIIā²OD and the angle AIIā²CIIā²BIIā² can be calculated based on the value of (XIIā², YIIā²), and the magnitude of the angle AIIā²CIIā²BIIā² and the value of Yip are in a relationship of a linear function, the relationship between the magnitude of the angle BIIā²OD and the value of XIIā² is ā BIIā²OD=f(XIIā²), the f function can be any function that satisfies the following conditions:
Īø=f(0)
180°=f(H)
Wherein, H is the height of the isosceles triangle, and the heights of the four isosceles triangular planes IIā², IIIā², IVā² and Vā² are respectively
H II ā² 2 , W II ā² 2 , H II ā² 2 , W II ā² 2 ;
(2.2) Calculating the coordinate of AIIā², āCoordinateā²ā, based on the magnitudes of the angle BIIā²OD and the angle AIIā²CIIā²BIIā² and the values of β1, β2 and β3;
(2.3) Calculating the coordinate of the intersection of the ray OAIIā² and the spherical surface, āCoordinateā, based on the coordinate of the point AIIā².
Third step: splicing the four isosceles triangular planes IIā², IIIā², IVā² and Vā² obtained in the second step into a rectangular plane VIā² with a resolution of WIIā²ĆHIIā².
The rectangular plane Iā² and rectangular plane VIā² are the two-dimensional image or video B obtained by mapping.
For the above-mentioned panoramic video mapping process, further, in (2.1), f(XIIā²) may be:
f ī¢ ( X II ā² ) = Īø + ( 180 ° - Īø ) Ć tan ī¢ ( X II ā² Ć· H Ć 180 ° Ć C ) tan ī¢ ( 180 ° Ć C )
(Wherein, C is a constant that is greater than 0 and less than 0.5).
On the other hand, in the process of the panoramic image inverse mapping method, mapping a two-dimensional image or video B back to a spherical surface based on a main viewpoint. The two-dimensional image or video B includes a rectangular plane Iā² with a resolution of WIā²ĆHIā² and a rectangular plane VIā² with a resolution of WIIā²ĆHIIā², wherein, the rectangular plane VIā² may be further divided into four isosceles triangular planes IIā², IIIā², IVā² and Vā², and the base edge and the height of the four isosceles triangles are respectively
W II ā² Ć H II ā² 2 , H II ā² Ć W II ā² 2 , W II ā² Ć H II ā² 2 , H II ā² Ć W II ā² 2 .
The inverse mapping method firstly projects the above-mentioned plane onto a quadrangular pyramid by means of such as isometric projection, and then maps the quadrangular pyramid onto a spherical surface. Specifically, a right-handed coordinate system is established based on the sphere center O, wherein the Z axis points to the direction at longitude and latitude of (0°, 0°) of the spherical surface, the Y axis points to the direction of the north pole of the spherical surface, and the X axis points to the direction at longitude and latitude of (90°, 0°) of the spherical surface. Then, a quadrangular pyramid W is established, the center of the bottom plane of the quadrangular pyramid W is on the positive Z axis, the apex is on the negative Z axis, and the base edges are respectively parallel to the X axis and parallel to the Y axis; the connecting line between the center D of the bottom plane of the quadrangular pyramid and the sphere center O is denoted as l1, and the connecting line between the midpoint of a base edge of the quadrangular pyramid and the sphere center O is denoted as l2, and the angle formed by l1 and l2 is Īø, and Īø represents the size of the main viewpoint region; the bottom plane of the quadrangular pyramid is denoted as plane Iā³, the side surface intersecting with the positive X axis is denoted as plane IIā³, the side surface intersecting with the positive Y axis is denoted as plane IIIā³, the side surface intersecting with the negative X axis is denoted as plane IVā³, and the side surface intersecting with the negative Y axis is denoted as plane Vā³. When the pitch angle, the yaw angle and the roll angle of the main viewpoint are respectively β1, β2 and β3, a corresponding quadrangular pyramid Qā² is obtained by rotating the quadrangular pyramid Q about the sphere center O by (β1, β2, β3). The sphere center O and the four base edges of the quadrangular pyramid Qā² form four sector planes, and the four sector planes divide the spherical surface into two regions. Wherein, one region including the main viewpoint is referred to as the main viewpoint region, and the main viewpoint region corresponds to the bottom plane of the pyramid and is denoted as region I; the other regions are referred to as the non-main viewpoint regions, and the center O and four side edges of the quadrangular pyramid Qā² form four sector planes, which further divide one non-main viewpoint region into four sub-regions, and the four sub-regions respectively correspond to the four side surfaces IIā², IIIā², IVā² and Vā², and are respectively referred to as regions II, III, IV and V. The inverse mapping method of the present invention maps the rectangular plane Iā² with the resolution of WIā²ĆHIā² contained in the two-dimensional image or video B onto the main viewpoint I of the spherical surface, and maps the four isosceles triangular planes IIā², IIIā², IVā² and Vā² contained in the two-dimensional image or video B onto the non-main viewpoints II, III, IV and V of the spherical surface. The values of the parameters Īø, WIā², HIā², WIIā², HIIā², β1, β2 and β3 can be obtained from a bit stream, but is not limited thereto.
For the above-mentioned panoramic image inverse mapping method, further, the method of projecting the planar image or video B back to the spherical surface is to perform the following operations on all points on the spherical surface:
First step: according to the coordinate of the point on the spherical surface, āCoordinateā, and the values of β1, β2, and β3, determining which one of the regions I, II, III, IV and V the point is located in; if the point is in region I, go to the second step; if the point is in region II, III, IV, or V, go to the fifth step;
Second step: the point whose spherical coordinate is āCoordinateā is denoted as AIā², the connecting lines between the midpoints of the opposite base edges of the quadrangular pyramid Qā² are denoted as m1 and m2, and the projections of the point AIā² on m1 and m2 are respectively denoted as BIā² and CIā², and the center of the bottom plane of the quadrangular pyramid Qā² is denoted as D; and calculating the magnitudes of the angle BIā²OD and the angle CIā²OD according to the coordinate of AIā², āCoordinateā, and the values of β1, β2 and β3;
Third step: calculating the value of the plane coordinate (XIā², YIā²) according to the magnitudes of the angle BIā²OD and the angle CIā²OD, wherein, the value of XIā² and the magnitude of the angle BIā²OD are in a relationship of a linear function, and the value of YIā² and the magnitude of the angle CIā²OD are in a relationship of a linear function;
Fourth step: using the pixel value (or the pixel value obtained by interpolation based on neighboring pixels) at (XIā², YIā²) on the rectangular plane Iā² as the pixel value of the point with the coordinate āCoordinateā on the spherical surface; omit the subsequent steps;
Fifth step: the point whose spherical coordinate is āCoordinateā is denoted as AIIā², and, the connecting line between the midpoint of the base edge of the side surface and the apex of the quadrangular pyramid Qā² is denoted as n1, and the plane passing n1 and the sphere center O is denoted as α3, and the connecting line between the center of the bottom plane and the apex of the quadrangular pyramid Qā² is denoted as n2, and the projections of point AIIā² on α3 and n2 are denoted as BIIā² and CIIā², respectively, and the center of the bottom plane of the quadrangular pyramid Qā² is denoted as D; calculating the magnitudes of the angle BIIā²OD and the angle AIIā²CIIā²BIIā² according to the coordinate of AIIā², āCoordinateā, and the values of β1, β2 and β3;
Sixth step: calculating the value of the plane coordinate (XIIā², YIIā²) according to the magnitudes of the angle BIIā²OD and the angle AIIā²CIIā²BIIā² (the X and Y coordinate axes are respectively perpendicular to and parallel to the base of the isosceles triangle), the value of YIIā² and the magnitude of the angle AIIā²CIIā²BIIā² are in a relationship of a linear function, and the relationship between the magnitude of the angle BIIā²OD and the value of XIIā² is ā BIIā²OD=f(XIIā²), the f function can be any function that satisfies the following conditions:
Īø=f(0)
180°=f(H)
Wherein, H is the height of the isosceles triangle, and the heights of the four isosceles triangular planes IIā², IIIā², IVā² and Vā² are respectively
H II ā² 2 , W II ā² 2 , H II ā² 2 , W II ā² 2 ;
Seventh step: Using the pixel value (or the pixel value obtained by interpolation based on neighboring pixels) at (XIIā², YIIā²) on the triangular plane as the pixel value of the point with the coordinate āCoordinateā on the spherical surface; omit the subsequent steps;
Perform the processes from the first step to the seventh step on all points on the spherical surface, thereby obtaining a panoramic image of the spherical surface.
For the above-mentioned panoramic image inverse mapping method, further, in the sixth step, f(XIIā²) may be:
f ī¢ ( X II ā² ) = Īø + ( 180 ° - Īø ) Ć tan ī¢ ( X II ā² Ć· H Ć 180 ° Ć C ) tan ī¢ ( 180 ° Ć C )
(Wherein, C is a constant that is greater than 0 and less than 0.5).
Compared with the prior art, the beneficial effects of the present invention are as follows:
Disclosed are a panoramic video asymmetrical mapping method and a corresponding inverse mapping method, mapping a spherical surface corresponding to a panoramic image or video A onto a two-dimensional image or video B; projecting the spherical surface onto an isosceles quadrangular pyramid with a square bottom plane, and further projecting the isosceles quadrangular pyramid onto a planar surface; using isometric projection on a main viewpoint region in the projection and using a relatively high sampling density to ensure that the video quality of the region of the main viewpoint is high, while using a relatively low sample density for non-main viewpoint regions so as to reduce bit rate. While ensuring that the video quality of the region of the main viewpoint remains unchanged, the present panoramic video asymmetrical mapping technique greatly reduces the resolution of the remaining regions in the video, effectively reducing the bit rate required for encoding a virtual reality video. The panoramic video asymmetrical inverse mapping technique provides a method for mapping from a planar surface to a spherical surface, and by means of said method, a planar surface video may be mapped back to a spherical surface for rendering and viewing.
The present invention overcomes the shortcomings of the prior art, further improves coding efficiency of the asymmetric mapping technology, and has the following advantages:
(1) In the present invention, in the main viewpoint region, the angles on the spherical surface and the planar coordinates are in a relationship of a linear function, that is, in the main viewpoint region, equidistant sampling is performed according to the angles, so as to ensure that the sampling of the main viewpoint region is uniform;
(2) In the present invention, the parameter Īø and the function f of the panoramic image mapping method are both adjustable, that is, the range of the main viewpoint region and the speed variation in the sampling density are both adjustable;
(3) When the parameter θ and the function f(XII) are reasonably set, the quality of the main viewpoint region can be guaranteed, and the bit rate can be greatly saved. For example, when θ=45°,
ā ī¢ ī¢ DOB = f ī¢ ( X II ā² ) = Īø + ( 180 ° - Īø ) Ć tan ī¢ ( X II ā² Ć· H Ć 180 ° Ć 0.35 ) tan ī¢ ( 180 ° Ć 0.35 ) ,
a video with a resolution of 4096Ć2048 will be mapped into a video with a resolution of 1024Ć1024 in both plane Iā² and plane VIā², and then plane I and plane II are spliced into a video with a resolution of 2048Ć1024. Compared with the prior asymmetric mapping technology, the coding efficiency can be improved by about 10-30%.
(4) Through the inverse mapping method, a planar image B in the present invention can be mapped back to a spherical surface for rendering and viewing.
FIG. 1 is a schematic diagram of a mapping relationship between a spherical surface and a plane in a mapping process of the present invention;
Wherein, a) is a schematic diagram of a corresponding quadrangular pyramid and a spherical surface when the pitch angle, the yaw angle and the roll angle of the main viewpoint are (0°, 0°, 0°), respectively; (b) is a schematic diagram of a corresponding quadrangular pyramid and a spherical surface when the pitch angle, the yaw angle and the roll angle of the main viewpoint are (β1, β2, β3), respectively; c) is a schematic diagram of a rectangular plane IⲠand a rectangular plane VIⲠobtained by mapping a spherical surface to a plane by the method of the present invention;
In (a): O is the sphere center; the Z axis points to the direction at longitude and latitude of (0°, 0°) of the spherical surface, the Y axis points to the direction of the north pole of the spherical surface, and the X axis points to the direction at longitude and latitude of (90°, 0°) of the spherical surface; in the quadrangular pyramid, a quadrangular pyramid W is established, wherein, the center of the bottom plane of the quadrangular pyramid W is on the positive Z axis, the apex is on the negative Z axis, and the base edges are respectively parallel to the X axis and parallel to the Y axis; the angle formed by the connecting line between the center D of the bottom plane of the quadrangular pyramid and the sphere center O and the connecting line between the midpoint of a base edge of the quadrangular pyramid and the sphere center O is θ, and θ represents the size of the main viewpoint region;
In (b): the quadrangular pyramid is obtained by rotating the quadrangular pyramid in (a) about the sphere center O by the pitch angle, the yaw angle and the roll angle;
In (c): Iā² is a rectangular plane; IIā², IIIā², IVā², Vā² are four isosceles triangular planes, VIā² is a rectangular plane VIā² stitched by IIā², IIIā², IVā² and Vā²;
FIG. 2 is a schematic diagram of a mapping relationship between a point with coordinate (XIā², YIā²) in a rectangular plane Iā² and a point AIā² on a quadrangular pyramid in the present invention;
Wherein, (a) is a schematic diagram of a point with coordinate (XIā², YIā²) in a rectangular plane Iā²; (b) is a schematic diagram of the point AIā² on a quadrangular pyramid; wherein, O is the sphere center, Dis the center of the main viewpoint, m1 and m2 are connecting lines between the midpoints of the opposite base edges of the quadrangular pyramid, respectively, point AIā² is the corresponding point on the quadrangular pyramid mapped from the point with coordinate (XIā², YIā²) in the rectangular plane Iā², BIā² and CIā² are projections of point AIā² on m1 and m2, respectively.
FIG. 3 is a schematic diagram of a mapping relationship between a point with coordinate (XIā², YIā²) in a triangular plane and a point AIIā² on a quadrangular pyramid in the present invention;
Wherein, (a) is a schematic diagram of a point with coordinate (XIIā², YIIā²) in a triangular plane; (b) is a schematic diagram of the point AIIā² on a quadrangular pyramid; wherein, O is the sphere center, Dis the center of the main viewpoint, n1 is the connecting line between the midpoint of the base edge of the side surface and the apex of the quadrangular pyramidal, n2 is the connecting line between the center D of the bottom plane and the apex of the quadrangular pyramidal, point AIIā² is the corresponding point on the quadrangular pyramid mapped from the point with coordinate (XIIā², YIIā²) in the triangular plane, BIIā² and CIIā² are projections of point AIIā² on n1 and n2, respectively.
FIG. 4 is an effect diagram of an embodiment of the panoramic image mapping method according to the present invention.
FIG. 5 is a schematic diagram of calculating the angle BOD and the angle COD in the panoramic image inverse mapping method of the present invention;
Wherein, points B and C are projections of point A on the ZOX and ZOY planes, respectively; point D is a point on the positive Z axis, and E is a point on the negative Z axis.
FIG. 6 is a schematic diagram of a mapping relationship between the point AIā² located on the spherical surface in region land a point with coordinate (XIā², YIā²) in the rectangular plane Iā² in the panoramic image inverse mapping method according to the present invention;
Wherein, (a) is a schematic diagram of the point AIā² located in the region Ion a spherical surface, O is the sphere center, Dis the center of the main viewpoint, m1 and m2 are connecting lines between the midpoints of the opposite base edges of the quadrangular pyramid, respectively, BIā² and CIā² are projections of point AIā² on m1 and m2, respectively; (b) is a schematic diagram of a point with coordinate (XIā², YIā²) in the rectangular plane Iā².
FIG. 7 is a schematic diagram of a mapping relationship between a point AIIā² in region II, III, IV or V of a spherical surface and a point (XIIā², YIIā²) in a triangular plane in the panoramic image inverse mapping method of the present invention;
Wherein, (a) is a schematic diagram of the point AIIā² in region II, III, IV or V on the spherical surface, O is the sphere center, Dis the center of the main viewpoint, n1 is the connecting line between the midpoint of the base edge of the side surface and the apex of the quadrangular pyramidal, n2 is the connecting line between the center D of the bottom plane and the apex of the quadrangular pyramidal, BIIā² and CIIā² are projections of point AIIā² on n1 and n2, respectively; (b) is a schematic diagram of a point (XIIā², YIIā²) with coordinate (XIIā², YIIā²) in a triangular plane.
Hereinafter, the present disclosure is further described through the embodiments, but the scope of the present disclosure is not limited in any manner.
Embodiments of the present invention provide a panoramic image mapping method based on a main viewpoint, including a panoramic image mapping method and a corresponding inverse mapping method. Embodiments of the mapping method and the inverse mapping method are described as follows.
In an embodiment of the panoramic image mapping method, a spherical surface corresponding to a panoramic image A of a certain mapping format (such as a latitude and longitude map, a cube map image, etc.) is mapped to a planar image B corresponding to the panoramic mapping designed in the present invention. The planar image B includes a rectangular plane Iā² with a resolution of WIā²ĆHIā² and a rectangular plane VIā² with a resolution of WIIā²ĆHIIā². The panoramic image mapping method firstly project the spherical surface onto an isosceles quadrangular pyramid with a square bottom plane, and then project the quadrangular pyramid onto a planar surface; in the projection, use isometric projection on a main viewpoint region and use a relatively high sampling density to ensure that the video quality of the region of the main viewpoint is high, while use a relatively low sample density for non-main viewpoint regions so as to reduce bit rate. As shown in FIG. 1, a right-handed coordinate system is established based on the sphere center O, wherein the Z axis points to the direction at longitude and latitude of (0°, 0°) of the spherical surface, the Y axis points to the direction of the north pole of the spherical surface, and the X axis points to the direction at longitude and latitude of (90°, 0°) of the spherical surface. Then, a quadrangular pyramid W is established, wherein, the center of the bottom plane of the quadrangular pyramid W is on the positive Z axis, the apex is on the negative Z axis, and the base edges are respectively parallel to the X axis and parallel to the Y axis; the connecting line between the center D of the bottom plane of the quadrangular pyramid and the sphere center O is denoted as l1, and the connecting line between the midpoint of a base edge of the quadrangular pyramid and the sphere center O is denoted as l2, and the angle formed by l1 and l2 is Īø, and Īø represents the size of the main viewpoint region; the bottom plane of the quadrangular pyramid is denoted as plane Iā³, the side surface intersecting with the positive X axis is denoted as plane IIā³, the side surface intersecting with the positive Y axis is denoted as plane IIIā³, the side surface intersecting with the negative X axis is denoted as plane IVā³, and the side surface intersecting with the negative Y axis is denoted as plane Vā³. When the pitch angle, the yaw angle and the roll angle of the main viewpoint are respectively β1, β2 and β3, a corresponding quadrangular pyramid Qā² is obtained by rotating the quadrangular pyramid Q about the sphere center O by (β1, β2, β3). The sphere center O and the four base edges of the quadrangular pyramid Qā² form four sector planes, and the four sector planes divide the spherical surface into two regions. Wherein, one region including the main viewpoint is referred to as the main viewpoint region, and the main viewpoint region corresponds to the bottom plane of the pyramid and is denoted as region I, and the other regions are referred to as the non-main viewpoint regions; the sphere center O and four side edges of the quadrangular pyramid Qā² form four sector planes, which further divide one non-main viewpoint region into four sub-regions, and the four sub-regions respectively correspond to the four side surfaces IIā², IIIā², IVā² and Vā², and are respectively referred to as regions II, III, IV and V. The mapping method of the present invention maps the described region I onto a rectangular plane Iā² with a resolution of WIā²ĆHIā², and maps the regions II, III, IV and V onto four isosceles triangular planes IIā², IIIā², IVā², and Vā², wherein the base edge and the height of the four isosceles triangular planes are respectively
W II ā² Ć H II ā² 2 , H II ā² Ć W II ā² 2 , W II ā² Ć H II ā² 2 , H II ā² Ć W II ā² 2 ,
and then the four isosceles triangular planes are spliced into a rectangular plane VIā² with a resolution of WIIā²ĆHIIā². The parameters Īø, WIā², HIā², WIIā², β1, β2, and β3 can be set as required. The specific processes of the panoramic image mapping method are as follows:
First step: for each pixel in the rectangular plane Iā², according to its coordinate (XIā², YIā²) in the plane Iā², calculating its corresponding coordinate āCoordinateā²ā in the bottom plane of the quadrangular pyramid Qā², then further calculating its corresponding coordinate āCoordinateā on the spherical surface according to the perspective projection method, and finally according to the spherical coordinate āCoordinateā, taking the pixel value of the corresponding position (or the corresponding pixel value obtained based on neighbor pixels by interpolation) on the spherical surface, as the pixel value of the pixel (XI, YI) in the plane Iā². The specific steps to calculate the spherical coordinate āCoordinateā according to the plane coordinate (XIā², YIā²) are as follows:
(1.1) As shown in FIG. 2, the point (XIā², YIā²) in the plane Iā² corresponds to the point AIā² in the bottom plane of the quadrangular pyramid Qā², and the connecting lines between the midpoints of the opposite base edges of the quadrangular pyramid Qā² are denoted as m1 and m2, and the projections of the point AIā² on m1 and m2 are respectively Br and Cr. The angles BIā²OD and CIā²OD are calculated according to the value of (XIā², YIā²), and the calculation formulas are as follows:
ā ī¢ ī¢ B I ā² ī¢ OD = 2 ī¢ Īø Ć Y I ā² W I ā² - Īø
ā ī¢ ī¢ C I ā² ī¢ OD = - 2 ī¢ Īø Ć Y X ā² H I ā² + Īø
(1.2) The coordinate of AIā², āCoordinateā²ā, which is expressed by Cartesian coordinates, is determined according to the magnitude of the angle BIā²OD, the magnitude of the angle CIā²OD and the values of β1, β2 and β3, and the calculation formula thereof is:
( X A I ā² , Y A I ā² , Z A I ā² ) = ī¢ ( k Ć tan ī¢ ( ā ī¢ ī¢ B I ā² ī¢ OD ) Ā· k Ć tan ī¢ ( ā ī¢ ī¢ C I ā² ī¢ OD ) , k ) Ć T = ī¢ k Ć ( tan ī¢ ( ā ī¢ ī¢ B I ā² ī¢ OD ) Ā· tan ī¢ ( ā ī¢ ī¢ C I ā² ī¢ OD ) , 1 ) Ć T
Wherein, T is a 3Ć3 dimensional rotation matrix generated according to the pitch angle β1, the yaw angle β2 and the roll angle β3; k is the length of the line segment OD;
(1.3) According to the coordinate of the point AIā², the coordinate of the intersection of the ray {right arrow over (OAIā²)} and the spherical surface, āCoordinateā, is obtained, and the coordinate āCoordinateā is represented by the Cartesian coordinates, and the calculation formula thereof is:
( X sphere , Y sphere , Z sphere ) = ī¢ R Ć ( X A I ā² , Y A I ā² , Z A I ā² ) ļ X A I ā² , Y A I ā² , Z A I ā² ļ = ī¢ R Ć k Ć ( tan ī¢ ( ā ī¢ ī¢ B I ā² ī¢ OD ) , tan ī¢ ( ā ī¢ ī¢ C I ā² ī¢ OD ) , 1 ) Ć T k Ć ļ ( tan ī¢ ( ā ī¢ ī¢ B I ā² ī¢ OD ) , tan ī¢ ( ā ī¢ ī¢ C I ā² ī¢ OD ) , 1 ) Ć T ļ = ī¢ R Ć ( tan ī¢ ( ā ī¢ ī¢ B I ā² ī¢ OD ) , tan ī¢ ( ā ī¢ ī¢ C I ā² ī¢ OD ) , 1 ) Ć T ļ ( tan ī¢ ( ā ī¢ ī¢ B I ā² ī¢ OD ) , tan ī¢ ( ā ī¢ ī¢ C I ā² ī¢ OD ) , 1 ) Ć T ļ
Wherein, R is the radius of the sphere;
ļ X A 1 ā² , Y A 1 ā² , Z A 1 ā² ļ
represents the modulus of the line segment OAIā², that is, the length of the line segment OAIā², and dividing
( X A 1 ā² , Y A 1 ā² , Z A 1 ā² )
by
ļ X A 1 ā² , Y A 1 ā² , Z A 1 ā² ļ
is a normalization operation on
( X A 1 ā² , Y A 1 ā² , Z A 1 ā² ) .
It should be noted that the value of k in the above step (1.2) is unknown, but it does not affect the subsequent calculation, because k will be eliminated when the normalization operation is performed on
( X A 1 ā² , Y A 1 ā² , Z A 1 ā² )
in step (1.3).
Second step: for each pixel in the four isosceles triangular planes IIā², IIIā², IVā² and Vā², according to its coordinate (XIIā², YIIā²) (the X and Y coordinate axes are respectively perpendicular to and parallel to the base of the isosceles triangle), calculating its corresponding coordinate āCoordinateā²ā on the side surface of the quadrangular pyramid Qā², then further calculating its corresponding coordinate āCoordinateā on the spherical surface according to the perspective projection method, and finally according to the spherical coordinate āCoordinateā, taking the pixel value of the corresponding position (or the corresponding pixel value obtained based on neighbor pixels by interpolation) on the spherical surface, as the pixel value of the pixel (XIIā², YIIā²). The specific steps to calculate the spherical coordinate āCoordinateā according to the plane coordinate(XIIā², YIIā²) are as follows:
(2.1) As shown in FIG. 3, the pixel (XIIā², YIIā²) corresponds to the point AIIā² on the side surface of the quadrangular pyramid Qā², the connecting line between the midpoint of the base edge of the side surface and the apex of the quadrangular pyramid Qā² is denoted as n1, and the connecting line between the center of the bottom plane and the apex of the quadrangular pyramid Qā² is denoted as n2, and the projections of point AIIā² on n1 and n2 are denoted as BIIā² and CIIā², respectively. The magnitude of the angle BIIā²OD and the angle AIIā²CIIā²BIIā² are calculated according to the value of (XIIā², YIIā²), and the calculation formulas are as follows:
ā ī¢ B II ā² ī¢ OD = f ī¢ ( X II ā² ) ā ī¢ ī¢ A II ā² ī¢ C II ā² ī¢ B II ā² = ( Y II ā² - L 2 ) Ć· ( H - X II ā² H Ć L ) Ć 90 °
Wherein, the f function can be any function that satisfies the following conditions:
Īø=f(0)
180°=f(H)
Wherein, H is the height of the isosceles triangle, and the heights of the four isosceles triangular planes IIā², IIIā², IVā² and Vā² are respectively
H II ā² 2 , W II ā² 2 , H II ā² 2 , W II ā² 2 ;
L is the base of an isosceles triangle, and the heights of the four isosceles triangular planes IIā², IIIā², IVā² and Vā² are respectively WIIā², WIIā² and HIIā²;
(2.2) The coordinate of AIIā², āCoordinateā²ā, which is expressed by Cartesian coordinates, is determined according to the magnitude of the angle BIIā²OD, the magnitude of the angle AIIā²CIIā²BIIā² and the values of β1, β2 and β3, and the calculation formula thereof is:
ā { ( X A II ā² , Y A II ā² , Z A II ā² ) = k Ć ( 1 , tan ī¢ ( ā ī¢ ī¢ A II ā² ī¢ C II ā² ī¢ B II ā² ) , cot ī¢ ( ā ī¢ B II ā² ī¢ OD ) ) Ć T Isosceles ī¢ ī¢ triangle ī¢ ī¢ II ā² ( X A II ā² , Y A II ā² , Z A II ā² ) = k Ć ( tan ī¢ ( ā ī¢ ī¢ A II ā² ī¢ C II ā² ī¢ B II ā² ) , 1 , cot ī¢ ( ā ī¢ B II ā² ī¢ OD ) ) Ć T Isosceles ī¢ ī¢ triangle ī¢ ī¢ III ā² ( X A II ā² , Y A II ā² , Z A II ā² ) = k Ć ( - 1 , - tan ī¢ ( ā ī¢ ī¢ A II ā² ī¢ C II ā² ī¢ B II ā² ) , cot ī¢ ( ā ī¢ B II ā² ī¢ OD ) ) Ć T Isosceles ī¢ ī¢ triangle ī¢ ī¢ IV ā² ( X A II ā² , Y A II ā² , Z A II ā² ) = k Ć ( - tan ī¢ ( ā ī¢ ī¢ A II ā² ī¢ C II ā² ī¢ B II ā² ) , - 1 , cot ī¢ ( ā ī¢ B II ā² ī¢ OD ) ) Ć T Isosceles ī¢ ī¢ triangle ī¢ ī¢ V ā²
Wherein, T is a 3Ć3 dimensional rotation matrix generated according to the pitch angle β1, the yaw angle β2 and the roll angle β3; k is the length of the line segment CIIā²BIIā²;
(2.3) According to the coordinate of the point AIIā², the coordinate of the intersection of the ray {right arrow over (OAIIā²)} and the spherical surface, āCoordinateā, is obtained, and the coordinate āCoordinateā is represented by the Cartesian coordinates, and the calculation formula thereof is:
( X sphere , Y sphere , Z sphere ) = R Ć ( X A I ā² , Y A I ā² , Z A I ā² ) ļ X A I ā² , Y A I ā² , Z A I ā² ļ
Wherein, R is the radius of the sphere;
ļ X A I ā² , Y A I ā² , Z A I ā² ļ
represents the modulus of the line segment OAIā², that is, the length of the line segment OAIā², and dividing
( X A I ā² , Y A I ā² , Z A I ā² )
by
ļ X A I ā² , Y A I ā² , Z A I ā² ļ
is a normalization operation on
( X A I ā² , Y A I ā² , Z A I ā² ) .
It should be noted that the value of k in the above step (2.2) is unknown, but it does not affect the subsequent calculation, because k will be eliminated when the normalization operation is performed on
( X A I ā² , Y A I ā² , Z A I ā² )
in step (2.3).
Third step: splicing the four isosceles triangular planes IIā², IIIā², IVā² and Vā² obtained in the second step into a rectangular plane VIā² with a resolution of WIIā²ĆHIIā²;
So far, all the steps of the embodiment of the panoramic image mapping method are completed, and the effect of the embodiment is as shown in FIG. 4.
On the other hand, in an embodiment of the panoramic image inverse mapping method, mapping a two-dimensional image or video B back to a spherical surface based on a main viewpoint. The two-dimensional image or video B includes a rectangular plane Iā² with a resolution of WIā²ĆHIā² and a rectangular plane VIā² with a resolution of WIIā²ĆBIIā², wherein, the rectangular plane VIā² may be further divided into four isosceles triangular planes IIā², IIIā², IVā² and Vā², and the base edge and the height of the four isosceles triangles are respectively
W II ā² Ć H II ā² 2 , H II ā² Ć W II ā² 2 , W II ā² Ć H II ā² 2 , H II ā² Ć W II ā² 2 .
The inverse mapping method firstly projects the above-mentioned plane onto a quadrangular pyramid by means of such as isometric projection, and then maps the quadrangular pyramid onto a spherical surface. Specifically, a right-handed coordinate system is established based on the sphere center O, wherein the Z axis points to the direction at longitude and latitude of (0°, 0°) of the spherical surface, the Y axis points to the direction of the north pole of the spherical surface, and the X axis points to the direction at longitude and latitude of (90°, 0°) of the spherical surface. Then, a quadrangular pyramid W is established, the center of the bottom plane of the quadrangular pyramid W is on the positive Z axis, the apex is on the negative Z axis, and the base edges are respectively parallel to the X axis and parallel to the Y axis; the connecting line between the center D of the bottom plane of the quadrangular pyramid and the sphere center O is denoted as l1, and the connecting line between the midpoint of a base edge of the quadrangular pyramid and the sphere center O is denoted as l2, and the angle formed by l1 and l2 is Īø, and Īø represents the size of the main viewpoint region; the bottom plane of the quadrangular pyramid is denoted as plane Iā³, the side surface intersecting with the positive X axis is denoted as plane IIā³, the side surface intersecting with the positive Y axis is denoted as plane IIIā³, the side surface intersecting with the negative X axis is denoted as plane IVā³, and the side surface intersecting with the negative Y axis is denoted as plane Vā³. When the pitch angle, the yaw angle and the roll angle of the main viewpoint are respectively β1, β2 and β3, a corresponding quadrangular pyramid Qā² is obtained by rotating the quadrangular pyramid Q about the sphere center O by (β1, β2, β3). The sphere center O and the four base edges of the quadrangular pyramid Qā² form four sector planes, and the four sector planes divide the spherical surface into two regions. Wherein, one region including the main viewpoint is referred to as the main viewpoint region, and the main viewpoint region corresponds to the bottom plane of the pyramid and is denoted as region I; the other regions are referred to as the non-main viewpoint regions, and the center O and four side edges of the quadrangular pyramid Qā² form four sector planes, which further divide one non-main viewpoint region into four sub-regions, and the four sub-regions respectively correspond to the four side surfaces IIā², IIIā², IVā² and Vā², and are respectively referred to as regions II, III, IV and V. The inverse mapping method of the present invention maps the rectangular plane Iā² with the resolution of WIā²ĆHIā² contained in the two-dimensional image or video B onto the main viewpoint I of the spherical surface, and maps the four isosceles triangular planes IIā², IIIā², IVā² and Vā² contained in the two-dimensional image or video B onto the non-main viewpoints II, III, IV and V of the spherical surface. The values of the parameters Īø, WIā², HIā², WIIā², HIIā², β1, β2 and β3 can be obtained from a bit stream, but is not limited thereto. The specific processes of the panoramic image inverse mapping method are as follows:
First step: according to the coordinate of the point on the spherical surface, āCoordinateā, and the values of β1, β2, and β3, determining which one of the regions I, II, III, IV and V the point is located in; the specific determination method is:
Firstly, the coordinate of the point on the sphere, āCoordinateā, is rotated according to β1, β2 and β3, wherein the coordinate āCoordinateā is expressed by Cartesian coordinates as (Xsphere, Ysphere, Zsphere), and the point after rotation is referred to as A, and the coordinate of A is:
(XA,YA,ZA)=(Xsphere,Ysphere,Zsphere)ĆTā²
Wherein, Tā² is a 3Ć3 dimensional rotation matrix generated according to a pitch angle āβ1, a yaw angle āβ2 and a roll angle āβ3;
As shown in FIG. 5, the point A is projected onto the ZOX plane and the ZOY plane, the projection points are point B and point C respectively, and the magnitudes of the angle BOD and the angle COD are calculated:
ā COD=arctan(YA,ZA)
ā BOD=arctan(XA,ZA)
Determine the region where the point is located according to the angle BOD and the angle COD:
ā { if - Īø < ā ī¢ ī¢ COD < Īø && - Īø < ā ī¢ ī¢ BOD < Īø belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ I if - Īø < ā ī¢ ī¢ COD < Īø && ā ī¢ ī¢ BOD = Īø belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ I ī¢ ī¢ or ī¢ ī¢ II if - Īø < ā ī¢ ī¢ COD < Īø && ā ī¢ ī¢ BOD = - Īø belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ I ī¢ ī¢ or ī¢ ī¢ VI if ā ī¢ ī¢ COD = Īø && - Īø < ā ī¢ ī¢ BOD < Īø belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ I ī¢ ī¢ or ī¢ ī¢ III if ā ī¢ ī¢ COD = - Īø && - Īø < ā ī¢ ī¢ BOD < Īø belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ I ī¢ ī¢ or ī¢ ī¢ V
If not, the point is in region II, III, IV or V, and it need to be further determined according to the values of XA, and YA:
ā { X A > Y A > - X A belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ II Y A > X A > - Y A belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ III - X A > Y A > - X A belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ IV - Y A > X A > Y A belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ V X A = Y A && X A > - Y A belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ II ī¢ ī¢ or ī¢ ī¢ III X A = - Y A && X A < Y A belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ III ī¢ ī¢ or ī¢ ī¢ IV X A = Y A && X A < - Y A belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ IV ī¢ ī¢ or ī¢ ī¢ V X A = - Y A && X A > Y A belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ II ī¢ ī¢ or ī¢ ī¢ V
If the point is in region I, go to the second step; if the point is in region II, III, IV, or V, go to the fifth step;
Second step: as shown in FIG. 6, the point whose spherical coordinate is āCoordinateā is denoted as AIā², and the coordinate āCoordinateā is denoted as (Xsphere, Ysphere, Zsphere) by the Cartesian coordinates. The connecting lines between the midpoints of the opposite base edges of the quadrangular pyramid Qā² are denoted as m1 and m2, and the projections of the point AIā² on m1 and m2 are respectively denoted as BIā² and CIā², and the center of the bottom plane of the quadrangular pyramid Qā² is denoted as D. Calculate the magnitudes of the angle BIā²OD and the angle CIā²OD according to the coordinate of AIā², āCoordinateā, and the values of β1, β2 and β3:
( X A I ā² , Y A I ā² , Z A I ā² ) = ( X sphere , Y sphere , Z sphere ) Ć T ā² ā ī¢ ī¢ C I ā² ī¢ OD = arctan ī¢ ( Y A I ā² , Z A I ā² ) ā ī¢ ī¢ B I ā² ī¢ OD = arctan ī¢ ( X A I ā² , Z A I ā² )
Wherein, Tā² is a 3Ć3 dimensional rotation matrix generated according to the pitch angle āβ1, the yaw angle āβ2 and the roll angle β3;
The calculation of the angle BIā²OD and the angle CIā²OD is the same as the calculation method of the angle BOD and the angle COD in the first step, therefore, the values of the angle BOD and the angle COD in the first step can also be directly used as the values of the angle BIā²OD and the angle CIā²OD;
Third step: calculate the value of the plane coordinate (XIā², YIā²) according to the magnitudes of the angle BIā²OD and the angle CIā²OD. The calculation formulas are as follows:
X I ā² = ā ī¢ ī¢ C I ā² ī¢ OD - Īø - 2 ī¢ ī¢ Īø Ć H I ā² Y I ā² = ā ī¢ ī¢ B I ā² ī¢ OD + Īø 2 ī¢ ī¢ Īø Ć W I ā²
Fourth step: Use the pixel value at (XIā², YIā²) on the rectangular plane Iā² (or the pixel value obtained by interpolation based on neighboring pixels) as the pixel value whose coordinate is āCoordinateā on the spherical surface; omit the subsequent steps;
Fifth step: as shown in FIG. 7, the point, whose spherical coordinate is āCoordinateā, is denoted as AIIā², and the coordinate āCoordinateā is denoted as (Xsphere, Ysphere, Zsphere) by the Cartesian coordinates. The connecting line between the midpoint of the base edge of the side surface and the apex of the quadrangular pyramid Qā² is denoted as n1, and the plane passing n1 and the sphere center O is denoted as α3, and the connecting line between the center of the bottom plane and the apex of the quadrangular pyramid Qā² is denoted as n2, and the projections of point AIIā² on α3 and n2 are denoted as BIIā² and CIIā², respectively, and the center of the bottom plane of the quadrangular pyramid Qā² is denoted as D. Calculate the magnitudes of the angle BIIā²OD and the angle AIIā²CIIā²BIIā² according to the coordinate of AIIā², āCoordinateā, and the values of β1, β2 and β3;
(Xā²AIIā²,Yā²AIIā²,Zā²AIIā²)=(Xsphere,Ysphere,Zsphere)ĆTā²
Wherein, Tā² is a 3Ć3 dimensional rotation matrix generated according to the pitch angle āβ1, the yaw angle āβ2 and the roll angle āβ3;
{ ā ī¢ ī¢ A II ā² ī¢ C II ā² ī¢ B II ā² = arctan ī¢ ( Y A II ā² , X A II ā² ) , ā ī¢ ī¢ B II ā² ī¢ OD = arctan ī¢ ( X A II ā² , Z A II ā² ) belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ I ā ī¢ ī¢ A II ā² ī¢ C II ā² ī¢ B II ā² = arctan ī¢ ( X A II ā² , Y A II ā² ) , ā ī¢ ī¢ B II ā² ī¢ OD = arctan ī¢ ( Y A II ā² , Z A II ā² ) belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ III ā ī¢ ī¢ A II ā² ī¢ C II ā² ī¢ B II ā² = arctan ī¢ ( Y A II ā² , X A II ā² ) , ā ī¢ ī¢ B II ā² ī¢ OD = arctan ī¢ ( - X A II ā² , Z A II ā² ) belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ IV ā ī¢ ī¢ A II ā² ī¢ C II ā² ī¢ B II ā² = arctan ī¢ ( X A II ā² , Y A II ā² ) , ā ī¢ ī¢ B II ā² ī¢ OD = arctan ī¢ ( - Y A II ā² , Z A II ā² ) belongs ī¢ ī¢ to ī¢ ī¢ region ī¢ ī¢ V ā
Sixth step: calculate the value of the plane coordinate (XIIā², YIIā²) according to the magnitudes of the angle BIIā²OD and the angle AIIā²CIIā²BIIā² (the X and Y coordinate axes are respectively perpendicular to and parallel to the base of the isosceles triangle), The relationship between the value of Yip and the magnitude of the angle AIIā²CIIā²BIIā² is:
Y II ā² = ā ī¢ ī¢ A II ā² ī¢ C II ā² ī¢ B II ā² Ć· 90 ī¢ Ā° Ć ( H - X II ā² H Ć L ) + L 2
The relationship between the magnitude of the angle BIIā²OD and the value of XIIā² is ā BIIā²OD=f(XIIā²), and the f function can be any function that satisfies the following conditions:
Īø=f(0)
180°=f(H)
Wherein, H is the height of the isosceles triangle, and the heights of the four isosceles triangular planes IIā², IIIā², IVā² and Vā² are respectively
H II ā² 2 , W II ā² 2 , H II ā² 2 , W II ā² 2 ;
Seventh step: Use the pixel value at (XIIā², YIIā²) on the triangular plane (or the pixel value obtained by interpolation based on neighboring pixels) as the pixel value of the point with the coordinate āCoordinateā on the spherical surface; omit the subsequent steps;
So far, all the steps of the embodiment of the panoramic image inverse mapping method are completed.
It needs to be noted that the embodiments as disclosed are intended to facilitating further understanding of the present disclosure; however, those skilled in the art may understand that various substitutions and modifications are possible without departing from the spirit and scope of the present disclosure. Therefore, the present disclosure should not be limited to the contents disclosed in the embodiments, but should be governed by the appended claims.
1. A main viewpoint-based panoramic video mapping method, mapping a spherical surface corresponding to a panoramic image or video A onto a two-dimensional image or video B; projecting the spherical surface onto an isosceles quadrangular pyramid with a square bottom plane, and further projecting the isosceles quadrangular pyramid onto a planar surface; using isometric projection on a main viewpoint region in the projection and using a relatively high sampling density to ensure that the video quality of the region of the main viewpoint is high, while using a relatively low sample density for non-main viewpoint regions so as to reduce bit rate.
2. The panoramic video mapping method of claim 1, wherein, the panoramic video mapping method comprising:
firstly, a right-handed coordinate system is established based on the sphere center O, wherein the Z axis points to the direction at longitude and latitude of (0°, 0°) of the spherical surface, the Y axis points to the direction of the north pole of the spherical surface, and the X axis points to the direction at longitude and latitude of (90°, 0°) of the spherical surface;
then, a quadrangular pyramid W is established, wherein, the center of the bottom plane of the quadrangular pyramid W is on the positive Z axis, the apex is on the negative Z axis, and the base edges are respectively parallel to the X axis and parallel to the Y axis, and, the connecting line between the center D of the bottom plane of the quadrangular pyramid and the sphere center O is denoted as l1, and the connecting line between the midpoint of a base edge of the quadrangular pyramid and the sphere center O is denoted as l2, and the angle formed by l1 and l2 is Īø, and Īø represents the size of the main viewpoint region;
the bottom plane of the quadrangular pyramid is denoted as plane Iā³, the side surface intersecting with the positive X axis is denoted as plane IIā³, the side surface intersecting with the positive Y axis is denoted as plane IIIā³, the side surface intersecting with the negative X axis is denoted as plane IVā³, and the side surface intersecting with the negative Y axis is denoted as plane Vā³; when the pitch angle, the yaw angle and the roll angle of the main viewpoint are respectively β1, β2 and β3, a corresponding quadrangular pyramid Qā² is obtained by rotating the quadrangular pyramid Q about the sphere center O by (β1, β2, β3);
the sphere center O and the four base edges of the quadrangular pyramid Qā² form four sector planes, which divide the spherical surface into two regions, wherein, one region including the main viewpoint is referred to as the main viewpoint region, which corresponds to the bottom plane of the pyramid and is denoted as region I, and the other regions are referred to as the non-main viewpoint regions;
the sphere center O and four side edges of the quadrangular pyramid Qā² form four sector planes, which further divide one non-main viewpoint region into four sub-regions, which respectively correspond to the four side surfaces IIā², IIIā², IVā² and Vā², and are respectively referred to as regions II, III, IV and V;
projecting the region I onto a rectangular plane Iā² with a resolution of WIā², EIā², and projecting the regions II, III, IV and V onto four isosceles triangular planes IIā², IIIā², IVā², and Vā², wherein the base edge and the height of the four isosceles triangular planes are respectively
W II ā² Ć H II ā² 2 , H II ā² Ć W II ā² 2 , W II ā² Ć H II ā² 2 , H II ā² Ć W II ā² 2 ;
and then the four isosceles triangular planes are spliced into a rectangular plane VIā² with a resolution of WIIā²ĆHIIā²;
the rectangular plane Iā² and the rectangular plane VIā² are the two-dimensional image or video B obtained by mapping;
the parameters Īø, WIā², HIā², BIIā², HIIā², β1, β2, and β3 are set as required.
3. The panoramic video mapping method of claim 2, wherein, the panoramic video mapping method comprises the following steps:
first step: for each pixel in the rectangular plane Iā², according to its coordinate (XIā², YIā²) in the plane Iā², calculating its corresponding coordinate āCoordinateā²ā in the bottom plane of the quadrangular pyramid Qā², then further calculating its corresponding coordinate āCoordinateā on the spherical surface according to the perspective projection method, and finally according to the spherical coordinate āCoordinateā, taking the pixel value of the corresponding position or the corresponding pixel value obtained based on neighbor pixels by interpolation on the spherical surface, as the pixel value of the pixel (XI, YI) in the plane Iā²;
second step: for each pixel in the four isosceles triangular planes IIā², IIIā², IVā² and Vā², according to its coordinate (XIIā², YIIā²), calculating its corresponding coordinate āCoordinateā²ā on the side surface of the quadrangular pyramid Qā², then further calculating its corresponding coordinate āCoordinateā on the spherical surface according to the perspective projection method, and finally according to the spherical coordinate āCoordinateā, taking the pixel value of the corresponding position or the corresponding pixel value obtained based on neighbor pixels by interpolation on the spherical surface, as the pixel value of the pixel (XIIā², YIIā²);
third step: splicing the four isosceles triangular planes IIā², IIIā², IVā² and Vā² obtained in the second step into a rectangular plane VIā² with a resolution of WIIā²ĆHIIā².
4. The panoramic video mapping method of claim 3, wherein, in the first step, calculating the spherical coordinate āCoordinateā according to the plane coordinate (XIā², YIā²) comprises the following steps:
(1.1) the point, corresponding to the point in the plane Iā² with the coordinate (XIā², YIā²), in the bottom plane of the quadrangular pyramid Qā² is denoted as AIā², and the connecting lines between the midpoints of the opposite base edges of the quadrangular pyramid Qā² are denoted as m1 and m2, the projections of the point AIā² on m1 and m2 are respectively denoted as BIā² and CIā², and the center of the bottom plane of the quadrangular pyramid Qā² is denoted as D, and the position of AIā² can be determined based on the angle BIā²OD and the angle CIā²OD; optionally, the magnitudes of the angle BIā²OD and the angle CIā²OD can be calculated based on the value of (XIā², YIā²), and, the magnitude of the angle BIā²OD and the value of XIā² are in a relationship of a linear function, and the magnitude of the angle CIā²OD and the value of YIā² are in a relationship of a linear function;
(1.2) the coordinate of AIā², āCoordinateā²ā, is determined according to the magnitude of the angle BIā²OD, the magnitude of the angle CIā²OD and the values of β1, β2 and β3;
(1.3) the coordinate of the intersection of the ray {right arrow over (OAIā²)} and the spherical surface, āCoordinateā, is obtained according to the coordinate of the point Ar.
5. The panoramic video mapping method of claim 3, wherein, in the second step, calculating the spherical coordinate āCoordinateā according to the plane coordinate (XIIā², YIIā²) comprises the following steps:
(2.1) the point, corresponding to the pixel (XIIā², YIIā²), on the side surface of the quadrangular pyramid Qā² is denoted as AIIā², the connecting line between the midpoint of the base edge of the side surface and the apex of the quadrangular pyramid Qā² is denoted as n1, and the connecting line between the center of the bottom plane and the apex of the quadrangular pyramid Qā² is denoted as n2, and the projections of point AIIā² on n1 and n2 are denoted as BIIā² and CIIā², respectively, and the center of the bottom plane of the quadrangular pyramid Qā² is denoted as D, and the position of AIIā² can be determined based on the angle BIā²OD and the angle CIā²OD; optionally, the magnitudes of the angle BIIā²OD and the angle AIIā²CIIā²BIIā² can be calculated based on the value of (XIIā², YIIā²), and, the magnitude of the angle AIIā²CIIā²BIIā² and the value of YIIā² are in a relationship of a linear function, and the relationship between the magnitude of the angle BIIā²OD and the value of XIIā² is ā BIIā²OD=f(XIIā²), wherein the f function can be any function that satisfies the following conditions:
Īø=f(0)
180°=f(H)
wherein, H is the height of the isosceles triangle, and the heights of the four isosceles triangular planes IIā², IIIā², IVā² and Vā² are respectively
H II ā² 2 , W II ā² 2 , H II ā² 2 , W II ā² 2 ;
(2.2) calculating the coordinate of AIIā², āCoordinateā²ā, based on the magnitudes of the angle BIIā²OD and the angle AIIā²CIIā²BIIā² and the values of β1, β2 and β3;
(2.3) calculating the coordinate of the intersection of the ray {right arrow over (OAIIā²)} and the spherical surface, āCoordinateā, based on the coordinate of the point AIIā².
6. The panoramic video mapping method of claim 5, wherein, in (2.1), f(XIIā²) is:
f ī¢ ( X II ā² ) = Īø + ( 180 ī¢ Ā° - Īø ) Ć tan ī¢ ( X II ā² Ć· H Ć 180 ī¢ Ā° Ć C ) tan ī¢ ( 180 ī¢ Ā° Ć C )
wherein, C is a constant that is greater than 0 and less than 0.5.
7. The panoramic video mapping method of claim 1, wherein, the mapping formats of panoramic image A comprises a longitude and latitude image, a cube-mapped image, or a panoramic video captured by a multi-channel camera, but is not limited thereto.
8. A main viewpoint-based panoramic video inverse mapping method, mapping a two-dimensional image or video B back to a spherical surface based on a main viewpoint; the two-dimensional image or video B includes a rectangular plane Iā² with a resolution of WIā²ĆHIā² and a rectangular plane VIā² with a resolution of WIIā²ĆHIIā², wherein, the rectangular plane VIā² is further divided into four isosceles triangular planes IIā², IIIā², IVā² and Vā², and the base edge and the height of the four isosceles triangles are respectively
W II ā² Ć H II ā² 2 , H II ā² Ć W II ā² 2 , W II ā² Ć H II ā² 2 , H II ā² Ć W II ā² 2 ;
the inverse mapping method firstly projects the above-mentioned plane onto a quadrangular pyramid by means of such as isometric projection, and then projects the quadrangular pyramid onto a spherical surface; comprising:
a right-handed coordinate system is established based on the sphere center O, wherein the Z axis points to the direction at longitude and latitude of (0°, 0°) of the spherical surface, the Y axis points to the direction of the north pole of the spherical surface, and the X axis points to the direction at longitude and latitude of (90°, 0°) of the spherical surface;
a quadrangular pyramid W is established, wherein, the center of the bottom plane of the quadrangular pyramid W is on the positive Z axis, the apex is on the negative Z axis, and the base edges are respectively parallel to the X axis and parallel to the Y axis, and, the connecting line between the center D of the bottom plane of the quadrangular pyramid and the sphere center O is denoted as l1, and the connecting line between the midpoint of a base edge of the quadrangular pyramid and the sphere center O is denoted as l2, and the angle formed by l1 and l2 is Īø, and Īø represents the size of the main viewpoint region, and, the bottom plane of the quadrangular pyramid is denoted as plane Iā³, the side surface intersecting with the positive X axis is denoted as plane IIā³, the side surface intersecting with the positive Y axis is denoted as plane IIIā³, the side surface intersecting with the negative X axis is denoted as plane IVā³, and the side surface intersecting with the negative Y axis is denoted as plane Vā³;
when the pitch angle, the yaw angle and the roll angle of the main viewpoint are respectively β1, β2 and β3, a corresponding quadrangular pyramid QⲠis obtained by rotating the quadrangular pyramid Q about the sphere center O by (β1, β2, β3), and, the sphere center O and the four base edges of the quadrangular pyramid QⲠform four sector planes, which divide the spherical surface into two regions, wherein, one region including the main viewpoint is referred to as the main viewpoint region, which corresponds to the bottom plane of the pyramid and is denoted as region I, and the other regions are referred to as the non-main viewpoint regions;
the center O and four side edges of the quadrangular pyramid Qā² form four sector planes, which further divide one non-main viewpoint region into four sub-regions, which respectively correspond to the four side surfaces IIā², IIIā², IVā² and Vā², and are respectively referred to as regions II, III, IV and V;
projecting the rectangular plane Iā² with the resolution of WIā²ĆHIā² contained in the two-dimensional image or video B onto the main viewpoint I of the spherical surface, and projecting the four isosceles triangular planes IIā², IIIā², IVā² and Vā² contained in the two-dimensional image or video B onto the non-main viewpoints II, III, IV and V of the spherical surface;
the values of the parameters Īø, WIā², HIā², WIIā², HIIā², β1, β2 and β3 are obtained from a bit stream, but is not limited thereto.
9. The panoramic video inverse mapping method of claim 8, wherein, projecting a planar image or video B back to the spherical surface comprises performing the following operations on all points on the spherical surface:
first step: according to the coordinate of the point on the spherical surface, āCoordinateā, and the values of β1, β2, and β3, determining which one of the regions I, II, III, IV and V the point is located in; if the point is in region I, go to the second step; if the point is in region II, III, IV, or V, go to the fifth step;
second step: the point whose spherical coordinate is āCoordinateā is denoted as AIā², the connecting lines between the midpoints of the opposite base edges of the quadrangular pyramid Qā² are denoted as m1 and m2, and the projections of the point AIā² on m1 and m2 are respectively denoted as BIā² and CIā², and the center of the bottom plane of the quadrangular pyramid Qā² is denoted as D; and calculating the magnitudes of the angle BIā²OD and the angle CIā²OD according to the coordinate of AIā², āCoordinateā, and the values of β1, β2 and β3;
third step: calculating the value of the plane coordinate (XIā², YIā²) according to the magnitudes of the angle BIā²OD and the angle CIā²OD, wherein, the value of XIā² and the magnitude of the angle BIā²OD are in a relationship of a linear function, and the value of YIā² and the magnitude of the angle CIā²OD are in a relationship of a linear function;
fourth step: using the pixel value at (XIā², YIā²) on the rectangular plane Iā², or the pixel value obtained by interpolation based on neighboring pixels, as the pixel value whose coordinate is āCoordinateā on the spherical surface; omit the subsequent steps;
fifth step: the point whose spherical coordinate is āCoordinateā is denoted as AIIā², and, the connecting line between the midpoint of the base edge of the side surface and the apex of the quadrangular pyramid Qā² is denoted as n1, and the plane passing n1 and the sphere center O is denoted as α3, and the connecting line between the center of the bottom plane and the apex of the quadrangular pyramid Qā² is denoted as n2, and the projections of point AIIā² on α3 and n2 are denoted as BIIā² and CIIā², respectively, and the center of the bottom plane of the quadrangular pyramid Qā² is denoted as D; calculating the magnitudes of the angle BIIā²OD and the angle AIIā²CIIā²BIā² according to the coordinate of AIIā², āCoordinateā, and the values of β1, β2 and β3;
sixth step: calculating the value of the plane coordinate (XIIā², YIIā²) according to the magnitudes of the angle BIIā²OD and the angle AIIā²CIIā²BIIā², the value of YIIā² and the magnitude of the angle AIIā²CIIā²BIIā² are in a relationship of a linear function, and the relationship between the magnitude of the angle BIIā²OD and the value of XIIā² is ā BIIā²OD=f(XIIā²), the f function can be any function that satisfies the following conditions:
Īø=f(0)
180°=f(H)
wherein, H is the height of the isosceles triangle, and the heights of the four isosceles triangular planes IIā², IIIā², IVā² and Vā² are respectively
H II ā² 2 , W II ā² 2 , H II ā² 2 , W II ā² 2 ;
seventh step: use the pixel value at (XIIā², YIIā²) on the triangular plane, or the pixel value obtained by interpolation based on neighboring pixels, as the pixel value of the point with the coordinate āCoordinateā on the spherical surface;
performing the processes from the first step to the seventh step on all points on the spherical surface, thereby obtaining a panoramic image of the spherical surface.
10. The panoramic video inverse mapping method of claim 9, wherein, in the sixth step, f(XIIā²) is:
f ī¢ ( X II ā² ) = Īø + ( 180 ī¢ Ā° - Īø ) Ć tan ī¢ ( X II ā² Ć· H Ć 180 ī¢ Ā° Ć C ) tan ī¢ ( 180 ī¢ Ā° Ć C )
wherein, C is a constant that is greater than 0 and less than 0.5.