Method and apparatus for generating indoor panoramic video
10827117 ยท 2020-11-03
Assignee
Inventors
Cpc classification
H04N13/111
ELECTRICITY
International classification
Abstract
Embodiments of the present application disclose a method and apparatus for generating an indoor panoramic video. For each of frames of the fish-eye video, coordinates of each of pixels of this frame in an image coordinate system are converted into coordinates in a spherical coordinate system to obtain a spherical coordinate system-based hemispherical fish-eye image. The frustum parameters of each of the N texture images of N viewing angles for the hemispherical fish-eye image are determined according to a shape of a preset living room. Based on the frustum parameters of each of the N texture images of N viewing angles, the N texture images of N viewing angles for the hemispherical fish-eye image are obtained. The N texture images of N viewing angles are rendered onto the N faces inside the preset living room, to generate the panoramic video image corresponding to the frame. As such, in the embodiment of the present application, a panoramic video image having a stereoscopic effect can be generated. The real-time performance for generating a panoramic video is improved, as no complicated image stitching algorithm is used. In addition, the cost for camera devices can be reduced, as there is no need for several cameras or an aerial camera.
Claims
1. A method for generating an indoor panoramic video, which is applicable to a video processing device, comprising: acquiring a fish-eye video; for each frame of the fish-eye video, converting, according to a first preset rule, coordinates of each of pixels of the frame in an image coordinate system into coordinates in a spherical coordinate system to obtain a spherical coordinate system-based hemispherical fish-eye image; determining, according to a shape of a preset living room, frustum parameters of each of N texture images of N viewing angles for the hemispherical fish-eye image, wherein the shape of the preset living room is set based on a scene corresponding to the frame, wherein the frustum parameters include azimuth parameters, elevation parameters, left, right, down, up, front, and back boundary parameters; and obtaining, based on the frustum parameters of each of the N texture images of N viewing angles, the N texture images of N viewing angles for the hemispherical fish-eye image, and rendering the N texture images of N viewing angles onto N faces inside the preset living room, to generate a panoramic video image corresponding to the frame.
2. The method of claim 1, wherein, converting, according to a first preset rule, coordinates of each of pixels of the frame in an image coordinate system into coordinates in a spherical coordinate system to obtain a spherical coordinate system-based hemispherical fish-eye image comprises: converting, according to following formulas, the coordinates (u, v) of each of the pixels of the frame in the image coordinate system into the coordinates (x, y, z) in the spherical coordinate system to obtain the spherical coordinate system-based hemispherical fish-eye image:
u0.5=x=R*cos()*cos()
v0.5=y=R*cos()*sin()
z=R*sin() wherein, R is a radius of a hemisphere for the hemispherical fish-eye image, is an angle between a point in the hemispherical fish-eye image and the Y-axis, and is an angle between a point in the hemispherical fish-eye image and the X-axis.
3. The method of claim 1, wherein, when the preset living room is a cuboid living room, determining, according to a shape of a preset living room, frustum parameters of each of N texture images of N viewing angles for the hemispherical fish-eye image comprises: constructing an inscribed cuboid of a sphere corresponding to the hemispherical fish-eye image, wherein a length-to-width-to-height radio of the inscribed cuboid is the same as a length-to-width-to-height radio of the cuboid living room; and determining, according to the inscribed cuboid, the frustum parameters of each of the N texture images of N viewing angles for the hemispherical fish-eye image.
4. The method of claim 3, wherein, the frustum parameters comprise angle parameters and viewport parameters of a frustum; determining, according to the inscribed cuboid, the frustum parameters of each of the N texture images of N viewing angles for the hemispherical fish-eye image comprises: determining the angle parameters of the frustum of each of the N texture images of N viewing angles according to angles between faces of the inscribed cuboid, wherein the angle parameters comprise azimuth parameters and elevation parameters; and determining the viewport parameters of the frustum of each of the N texture images of N viewing angles according to lengths of edges of the inscribed cuboid, wherein the viewport parameters comprise left, right, down, up, front and back boundary parameters.
5. The method of claim 1, wherein, when the preset living room is a cuboid living room, obtaining the N texture images of N viewing angles for the hemispherical fish-eye image comprises: obtaining four texture images in directions respectively pointing to four walls and one texture image in a direction pointing to a floor for the hemispherical fish-eye image.
6. The method of claim 5, wherein, rendering the N texture images of N viewing angles onto N faces inside the preset living room, comprises: drawing faces in which the four walls and the floor inside the preset living room are located, and determining coordinates for each of the faces; adjusting, according to the frustum parameters of the four texture images in the directions respectively pointing to the four walls and the one texture image in the direction pointing to the floor for the hemispherical fish-eye image, the coordinates for the four texture images in the directions respectively pointing to the four walls and the one texture image in the direction pointing to the floor for the hemispherical fish-eye image to positions corresponding to the coordinates for the faces in which the four walls and the floor are located.
7. The method of claim 1, wherein, acquiring a fish-eye video, comprises: receiving a fish-eye video sent by one fish-eye camera placed at the center of the ceiling of the living room.
8. A camera device comprising a fish-eye camera and a processor, wherein, the fish-eye camera is configured for shooting a fish-eye video of a preset living room, and sending the fish-eye video to the processor; and the processor is configured for performing operations of: acquiring a fish-eye video; for each frame of the fish-eye video, converting, according to a first preset rule, coordinates of each of pixels of the frame in an image coordinate system into coordinates in a spherical coordinate system to obtain a spherical coordinate system-based hemispherical fish-eye image; determining, according to a shape of a preset living room, frustum parameters of each of N texture images of N viewing angles for the hemispherical fish-eye image, wherein the shape of the preset living room is set based on a scene corresponding to the frame, wherein the frustum parameters include azimuth parameters, elevation parameters, left, right, down, up, front and back boundary parameters; and obtaining, based on the frustum parameters of each of the N texture images of N viewing angles, the N texture images of N viewing angles for the hemispherical fish-eye image, and rendering the N texture images of N viewing angles onto N faces inside the preset living room, to generate a panoramic video image corresponding to the frame.
9. A non-transitory storage medium for storing an executable program code, wherein the executable program code, when executed, performs the method for generating an indoor panoramic video of claim 1.
10. The camera device of claim 8, wherein the processor is configured for converting, according to following formulas, the coordinates (u, v) of each of the pixels of the frame in the image coordinate system into the coordinates (x, y, z) in the spherical coordinate system to obtain the spherical coordinate system-based hemispherical fish-eye image:
u0.5=x=R*cos()*cos()
v0.5=y=R*cos()*sin()
z=R*sin() wherein, R is a radius of a hemisphere for the hemispherical fish-eye image, is an angle between a point in the hemispherical fish-eye image and the Y-axis, and is an angle between a point in the hemispherical fish-eye image and the X-axis.
11. The camera device of claim 8, wherein the processor is configured for, when the preset living room is a cuboid living room, constructing an inscribed cuboid of a sphere corresponding to the hemispherical fish-eye image, wherein a length-to-width-to-height radio of the inscribed cuboid is the same as a length-to-width-to-height radio of the cuboid living room; and determining, according to the inscribed cuboid, the frustum parameters of each of the N texture images of N viewing angles for the hemispherical fish-eye image.
12. The camera device of claim 11, wherein the frustum parameters comprise angle parameters and viewport parameters of a frustum; the processor is configured for: determining the angle parameters of the frustum of each of the N texture images of N viewing angles according to angles between faces of the inscribed cuboid, wherein the angle parameters comprise azimuth parameters and elevation parameters; and determining the viewport parameters of the frustum of each of the N texture images of N viewing angles according to lengths of edges of the inscribed cuboid, wherein the viewport parameters comprise left, right, down, up, front and back boundary parameters.
13. The camera device of claim 8, wherein the processor is configured for, when the preset living room is a cuboid living room, obtaining four texture images in directions respectively pointing to four walls and one texture image in a direction pointing to a floor for the hemispherical fish-eye image.
14. The camera device of claim 13, wherein the processor is configured for: drawing faces in which the four walls and the floor inside the preset living room are located, and determining coordinates for each of the faces; and adjusting, according to the frustum parameters of the four texture images in the directions respectively pointing to the four walls and the one texture image in the direction pointing to the floor for the hemispherical fish-eye image, the coordinates for the four texture images in the directions respectively pointing to the four walls and the one texture image in the direction pointing to the floor for the hemispherical fish-eye image to positions corresponding to the coordinates for the faces in which the four walls and the floor are located.
15. The camera device of claim 8, wherein the processor is configured for receiving a fish-eye video sent by one fish-eye camera placed at the center of the ceiling of the living room.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) To describe the solutions of embodiments of the present application and the prior art more clearly, the accompanying drawings to be used in the embodiments and the prior art are described briefly below. Obviously, the accompanying drawings described below are merely some embodiments of the application, based on which those skilled in the art can obtain other drawings without creative efforts.
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
DETAILED DESCRIPTION
(12) To make the objectives, technical solutions, and advantages of the present application more comprehensible, the present application is described in detail below in association with embodiments with reference to the accompanying drawings. Obviously, the described embodiments are merely a part of but not all the embodiments of the present application. All other embodiments obtained without creative efforts in view of the embodiments of the present application by those skilled in the art fall within the scope of the present application.
(13) In order to solve the problem in the prior art, embodiments of the present application provide a method and apparatus for generating an indoor panoramic video, applicable to a video processing device. The method for generating an indoor panoramic video provided by an embodiment of the present application is described firstly in detail below.
(14)
(15) S101: acquiring a fish-eye video.
(16) Specifically, the S101 may include: receiving a fish-eye video sent by one fish-eye camera placed at the center of the ceiling of a living room.
(17) S102: for each frame of the fish-eye video, converting, according to a first preset rule, coordinates of each of pixels of the frame in an image coordinate system into coordinates in a spherical coordinate system to obtain a spherical coordinate system-based hemispherical fish-eye image.
(18) Specifically, the S102 may include: converting, according to following formulas, the coordinates (u, v) of each of the pixels of the frame in the image coordinate system into the coordinates (x, y, z) in the spherical coordinate system to obtain the spherical coordinate system-based hemispherical fish-eye image:
u0.5=x=R*cos()*cos()
v0.5=y=R*cos()*sin()
z=R*sin()
(19) wherein, R is the radius of the hemisphere for the hemispherical fish-eye image, is an angle between a point in the hemispherical fish-eye image and the Y-axis, and is an angle between a point in the hemispherical fish-eye image and the X-axis.
(20) S103: determining, according to a shape of a preset living room, frustum parameters of each of N texture images of N viewing angles for the hemispherical fish-eye image. The shape of the preset living room is set based on a scene corresponding to the frame. In the embodiment of the present application, N is a positive integer.
(21) Specifically, when the preset living room is a cuboid living room, the S103 may include:
(22) constructing an inscribed cuboid of a sphere corresponding to the hemispherical fish-eye image; wherein, a length-to-width-to-height radio of the inscribed cuboid is the same as a length-to-width-to-height radio of the cuboid living room; and
(23) determining, according to the inscribed cuboid, the frustum parameters of each of the N texture images of N viewing angles for the hemispherical fish-eye image.
(24) In the embodiment shown in the present application, the frustum parameters may include angle parameters and viewport parameters of the frustum; determining, according to the inscribed cuboid, the frustum parameters of each of the N texture images of N viewing angles for the hemispherical fish-eye image may include:
(25) determining the angle parameters of the frustum of each of the N texture images of N viewing angles according to angles between faces of the inscribed cuboid, wherein the angle parameters include azimuth parameters and elevation parameters; and
(26) determining the viewport parameters of the frustum of each of the N texture images of N viewing angles according to lengths of edges of the inscribed cuboid, wherein the viewport parameters include left, right, down, up, front and back boundary parameters.
(27) S104: obtaining, based on the frustum parameters of each of the N texture images of N viewing angles, the N texture images of N viewing angles for the hemispherical fish-eye image.
(28) In the embodiment as shown in the present application, when the preset living room is a cuboid living room, obtaining the N texture images of N viewing angles for the hemispherical fish-eye image may include: obtaining four texture images in directions respectively pointing to four walls and one texture image in a direction pointing to a floor for the hemispherical fish-eye image.
(29) S105: rendering the N texture images of N viewing angles onto N faces inside the preset living room, to generate a panoramic video image corresponding to the frame.
(30) In the embodiment shown in the present application, the S105 may include:
(31) drawing faces in which the four walls and the floor inside the preset living room are located, and determining coordinates for each face;
(32) adjusting, according to the frustum parameters of the four texture images in the directions respectively pointing to the four walls and the one texture image in the direction pointing to the floor for the hemispherical fish-eye image, the coordinates for the four texture images in the directions respectively pointing to the four walls and the one texture image in the direction pointing to the floor for the hemispherical fish-eye image to positions corresponding to the coordinates for the faces in which the four walls and the floor are located.
(33) Assuming that the living room is a supermarket with a cuboid shape, and a fish-eye video sent by a fish-eye camera placed at the center of the ceiling of the living room is received. It is also assumed that one frame of this fish-eye video is shown in
(34) For this frame of the fish-eye video, the coordinates (u, v) of each of pixels of the frame in the image coordinate system are converted, according to the following formulas, into the coordinates (x, y, z) in the spherical coordinate system to obtain a spherical coordinate system-based hemispherical fish-eye image:
u0.5=x=R*cos()*cos()
v0.5=y=R*cos()*sin()
z=R*sin()
(35) wherein, R is the radius of the hemisphere for the hemispherical fish-eye image, is the angle between a point in the hemispherical fish-eye image and the Y-axis, and is the angle between a point in the fish-eye hemisphere image and the X-axis.
(36) The obtained spherical coordinate system-based hemispherical fish-eye image is shown in
(37) It is assumed that the cuboid supermarket has a length-to-width-to-height ratio of 5:4:3, the inscribed cuboid of the sphere corresponding to the hemispherical fish-eye image is constructed to have the same length-to-width-to-height ratio of 5:4:3. It can be understood that, when the radius of the sphere is fixed and the length-to-width-to-height ratio of the inscribed cuboid is fixed, the length, width and height of this inscribed cuboid can be determined based on the radius of the sphere and the length-to-width-to-height ratio of this inscribed cuboid. It is assumed that the length, width and height of this inscribed cuboid are respectively represented by Length, Width and Height.
(38) The frustum parameters of each of the N texture images of N viewing angles for the hemispherical fish-eye image may be determined according to the inscribed cuboid. The frustum parameters may include angle parameters and viewport parameters of the frustum. The angle parameters may include azimuth parameters and elevation parameters; the viewport parameters may include left, right, down, up, front and back boundary parameters.
(39) In the embodiment as shown in the present application, the N texture images of N viewing angles for the hemispherical fish-eye image may be one texture image in a direction pointing to a floor (Floor) and four texture images in directions respectively pointing to four walls (Left wall, Back wall, Right wall and Front wall) for the hemispherical fish-eye image. As shown in
Table 1
(40) TABLE-US-00001 viewport parameters angle parameters left right down up forward back azimuth elevation boundary boundary boundary boundary boundary boundary Floor 0 90 Width/2 Width/2 Length/2 Length/2 Height/2 R Left wall 0 0 Length/2 Length/2 Height/2 0 Width/2 R Back wall 90 0 Width/2 Width/2 Height/2 0 Length/2 R Right wall 180 0 Length/2 Length/2 Height/2 0 Width/2 R Front wall 270 0 Width/2 Width/2 Height/2 0 Length/2 R
(41) Based on the frustum parameters of each of the five texture images described above, the five texture images of five viewing angles for the hemispherical fish-eye image are obtained. It can be understood by those skilled in the art that the obtaining of the texture images for the hemispherical fish-eye image based on the frustum parameters may be achieved by the existing technology. The detailed description thereof is thus omitted here. The obtained four texture images in the directions respectively pointing to the four walls and the obtained one texture image in the direction pointing to the floor for the hemispherical fish-eye image are shown in
(42) In a practical application, this video processing device may present an input interface, such that the user may input the actual values of the length, width and height of the cuboid supermarket. The video processing device scales down the actual values of the length, width and height in equal proportion to be matched with the five texture images of five viewing angles. Specifically, it is assumed that the hemispherical fish-eye image has an radius R of 0.1 m, and the actual values of the length, width and height of the cuboid supermarket are 5 m, 4 m and 3 m respectively. The actual values of the length, width and height are first divided by 5 (the maximum among the length, width and height), and then multiplied by 0.1 (radius R of the hemispherical fish-eye image), so as to obtain the length of 0.1 m, the width of 0.08 m and the height of 0.06 m, which are scaled down in equal proportion.
(43) Based on the above obtained values, the faces in which the four walls and the floor inside the preset living room are located are drawn, and the coordinates for each face may be determined. Based on the frustum parameters of the four texture images in the directions respectively pointing to the four walls and the one texture image in the direction pointing to the floor for the hemispherical fish-eye image, the drawn face corresponding to each texture image is determined. The coordinates for the each texture image are adjusted to positions corresponding to the coordinates for the face corresponding to this texture image. It can be understood by those skilled in the art that one texture image may be rendered onto a face by the existing technology. The detailed description thereof is thus omitted here. The panoramic video image generated from the fish-eye video image is shown in
(44) Each of the frames of the obtained fish-eye video is processed in the method described above. As such, the indoor panoramic video corresponding to the fish-eye video is obtained.
(45) In the embodiment as shown in
(46) In a practical application, the above method can also be applied to a living room having a corner to generate an indoor panoramic video for the living room having a corner.
(47) Assuming that the preset living room has one corner, N is 7. For each of the frames of the fish-eye video, coordinates of each of the pixels of the frame in the image coordinate system are converted into coordinates in a spherical coordinate system to obtain a spherical coordinate system-based hemispherical fish-eye image. The frustum parameters of the 7 texture images of 7 viewing angles for the hemispherical fish-eye image are determined, and then the 7 texture images of 7 viewing angles for the hemispherical fish-eye image are obtained. The 7 texture images of 7 viewing angles are rendered onto the 7 faces inside the preset living room, to generate a panoramic video image for the living room having a corner, as shown in
(48) In a practical application, for a storey including multiple cuboid living rooms, an indoor panoramic video image for each cuboid living room can be generated by the above method. As shown in
(49) In accordance with the above method embodiment, embodiments of the present application further provide an apparatus for generating an indoor panoramic video.
(50)
(51) The acquisition module 901 is configured for acquiring a fish-eye video.
(52) In a practical application, the acquisition module 901 may be further configured for receiving a fish-eye video sent by one fish-eye camera placed at the center of the ceiling of the living room.
(53) A conversion module 902 is configured for, for each frame of the fish-eye video, converting, according to a first preset rule, coordinates of each of pixels of the frame in an image coordinate system into coordinates in a spherical coordinate system to obtain a spherical coordinate system-based hemispherical fish-eye image.
(54) In a practical application, the conversion module 902 may be further configured for converting, according to following formulas, the coordinates (u, v) of each of the pixels of the frame in the image coordinate system into the coordinates (x, y, z) in the spherical coordinate system to obtain the spherical coordinate system-based hemispherical fish-eye image:
u0.5=x=R*cos()*cos()
v0.5=y=R*cos()*sin()
z=R*sin()
(55) wherein, R is a radius of a hemisphere for the hemispherical fish-eye image, is an angle between a point in the hemispherical fish-eye image and the Y-axis, and is an angle between a point in the hemispherical fish-eye image and the X-axis.
(56) A determination module 903 is configured for determining, according to a shape of a preset living room, frustum parameters of each of N texture images of N viewing angles for the hemispherical fish-eye image, wherein the shape of the preset living room is set based on a scene corresponding to the frame.
(57) In a practical application, the determination module 903 may include: a construction sub-module and a determination sub-module (not shown in the figure); wherein,
(58) the construction sub-module is configured for, when the preset living room is a cuboid living room, constructing an inscribed cuboid of a sphere corresponding to the hemispherical fish-eye image, wherein a length-to-width-to-height radio of the inscribed cuboid is the same as a length-to-width-to-height radio of the cuboid living room; and
(59) the determination sub-module is configured for determining, according to the inscribed cuboid, the frustum parameters of each of the N texture images of N viewing angles for the hemispherical fish-eye image. In the present embodiment, N is positive integer.
(60) Specifically, the frustum parameters include angle parameters and viewport parameters of the frustum; the determination sub-module may include: an angle parameter determination sub-module and a viewport parameter determination sub-module (not shown in the figure); wherein,
(61) The angle parameter determination sub-module is configured for determining the angle parameters of the frustum of each of the N texture images of N viewing angles according to angles between faces of the inscribed cuboid, wherein the angle parameters include azimuth parameters and elevation parameters; and
(62) The viewport parameter determination sub-module is configured for determining the viewport parameters of the frustum of each of the N texture images of N viewing angles according to lengths of edges of the inscribed cuboid, wherein the viewport parameters include left, right, down, up, front and back boundary parameters.
(63) A obtaining module 904 is configured for obtaining, based on the frustum parameters of each of the N texture images of N viewing angles, the N texture images of N viewing angles for the hemispherical fish-eye image.
(64) In a practical application, the obtaining module 904 may be further configured for:
(65) when the preset living room is a cuboid living room, obtaining, based on the frustum parameters of each of the N texture images of N viewing angles, four texture images in the directions respectively pointing to four walls and one texture image in a direction pointing to a floor for the hemispherical fish-eye image.
(66) A generation module 905 is configured for rendering the N texture images of N viewing angles onto N faces inside the preset living room, to generate a panoramic video image corresponding to the frame.
(67) In a practical application, the generation module 905 may include a living room drawing sub-module and a panoramic video image generation sub-module (not shown in the figure); wherein,
(68) The living room drawing sub-module is configured for drawing faces in which the four walls and the floor inside the preset living room are located, and determining coordinates for each of the faces; and
(69) The panoramic video image generation sub-module is configured for adjusting, according to the frustum parameters of the four texture images in the directions respectively pointing to the four walls and the one texture image in the direction pointing to the floor for the hemispherical fish-eye image, the coordinates for the four texture images in the directions respectively pointing to the four walls and the one texture image in the direction pointing to the floor for the hemispherical fish-eye image to positions corresponding to the coordinates for the faces in which the four walls and the floor are located, so as to generate the panoramic video image corresponding to the frame.
(70) In the embodiment shown in
(71) Based on the same design concept as that of the above method, an embodiment of the present application further provides a camera device, as shown in
(72) acquiring a fish-eye video;
(73) for each frame of the fish-eye video, converting, according to a first preset rule, coordinates of each of pixels of the frame in an image coordinate system into coordinates in a spherical coordinate system to obtain a spherical coordinate system-based hemispherical fish-eye image;
(74) determining, according to a shape of a preset living room, frustum parameters of each of N texture images of N viewing angles for the hemispherical fish-eye image, wherein the shape of the preset living room is set based on a scene corresponding to the frame; and
(75) obtaining, based on the frustum parameters of each of the N texture images of N viewing angles, the N texture images of N viewing angles for the hemispherical fish-eye image, and rendering the N texture images of N viewing angles onto N faces inside the preset living room, to generate a panoramic video image corresponding to the frame.
(76) In the embodiment shown in
(77) Based on the same design concept as that of the above method, an embodiment of the present application further provides an executable program code which, when executed, performs the method for generating an indoor panoramic video. The method includes:
(78) acquiring a fish-eye video;
(79) for each frame of the fish-eye video, converting, according to a first preset rule, coordinates of each of pixels of the frame in an image coordinate system into coordinates in a spherical coordinate system to obtain a spherical coordinate system-based hemispherical fish-eye image;
(80) determining, according to a shape of a preset living room, frustum parameters of each of N texture images of N viewing angles for the hemispherical fish-eye image, wherein the shape of the preset living room is set based on a scene corresponding to the frame; and
(81) obtaining, based on the frustum parameters of each of the N texture images of N viewing angles, the N texture images of N viewing angles for the hemispherical fish-eye image, and rendering the N texture images of N viewing angles onto N faces inside the preset living room, to generate a panoramic video image corresponding to the frame.
(82) In the embodiment shown in the present application, each frame of the fish-eye video can be rendered onto N faces inside the preset living room, and thus a panoramic video image having a stereoscopic effect is generated. The real-time performance for generating a panoramic video is improved, as no complicated image stitching algorithm is used in embodiments of the present application. In addition, the cost for camera devices can be reduced, as there is no need to stitch multiple videos shot by several cameras and there is no need for an aerial camera in embodiments of the present application.
(83) Based on the same design concept as that of the above method, an embodiment of the present application further provides a storage medium. The storage medium is configured for storing an executable program code which, when executed, performs the method for generating an indoor panoramic video. The method includes:
(84) acquiring a fish-eye video; for each frame of the fish-eye video, converting, according to a first preset rule, coordinates of each of pixels of the frame in an image coordinate system into coordinates in a spherical coordinate system to obtain a spherical coordinate system-based hemispherical fish-eye image;
(85) determining, according to a shape of a preset living room, frustum parameters of each of N texture images of N viewing angles for the hemispherical fish-eye image, wherein the shape of the preset living room is set based on a scene corresponding to the frame; and
(86) obtaining, based on the frustum parameters of each of the N texture images of N viewing angles, the N texture images of N viewing angles for the hemispherical fish-eye image, and rendering the N texture images of N viewing angles onto N faces inside the preset living room, to generate a panoramic video image corresponding to the frame.
(87) The above storage medium may be, but not limited to, a DVR (Digital Video Record), an NVR (Network Video Recorder), a memory of a camera, and so forth.
(88) In the embodiment shown in the present application, each frame of the fish-eye video can be rendered onto N faces inside the preset living room, and thus a panoramic video image having a stereoscopic effect is generated. The real-time performance for generating a panoramic video is improved, as no complicated image stitching algorithm is used in embodiments of the present application. In addition, the cost for camera devices can be reduced, as there is no need to stitch multiple videos shot by several cameras and there is no need for an aerial camera in embodiments of the present application.
(89) It should be noted that the relationship terms used here, such as first, second, and the like are only used to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply that there is actual relationship or order between these entities or operations. Moreover, the terms include, comprise, or any variants thereof are intended to cover a non-exclusive inclusion, such that processes, methods, articles, or devices, including a series of elements, include not only those elements that have been listed, but also other elements that have not specifically been listed or the elements intrinsic to these processes, methods, articles, or devices. Without further limitations, elements limited by the wording include(s) a/an . . . , comprise(s) a/an . . . do not exclude additional identical elements in the processes, methods, articles, or devices, including the listed elements.
(90) All of the embodiments in the description are described in a correlated manner, and identical or similar parts in various embodiments can refer to one another. In addition, the description for each embodiment focuses on the differences from other embodiments. In particular, the embodiment of the apparatus is described briefly, since it is substantially similar to the embodiment of the method, and the related contents can refer to the description of the embodiment of the method.
(91) It can be understood by those skilled in the art that all or a part of steps in the implementations of the above method can be accomplished by instructing related hardware through programs, which can be stored in a computer-readable storage medium, such as in ROM/RAM, a disk, an optical disk, and so on.
(92) The embodiments described above are simply preferable embodiments of the present application, and are not intended to limit the scope of protection of the present application. Any modifications, alternatives, improvements, or the like within the spirit and principle of the present application shall be included within the scope of protection of the present application.