Method for generating panoramic video from panoramic picture
By converting panoramic pictures into a spherical latitude and longitude coordinate format and integrating picture materials, a panoramic video that supports MPEG4 format is generated, which solves the problem of panoramic videos being unable to be played on short video platforms and achieves richer interactivity and wider dissemination.
Patent Information
- Application Number
- CN202410922653.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-10
AI Technical Summary
Existing panoramic videos cannot be played directly on mainstream short video platforms. They lack interactive information and scene depth, and cannot effectively utilize hot materials.
By converting the panoramic image into a spherical latitude and longitude coordinate format, importing picture materials and integrating them into the panoramic image, the fused panoramic video is generated. It supports the general format MPEG4 and can be played directly on the short video platform.
The interactivity and playback of panoramic videos are enhanced, users can view the core content without manual rotation, and the scope of use and dissemination of panoramic videos is expanded.
Smart Images

Figure CN118764602A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for generating a panoramic video from a panoramic picture, and belongs to the technical field of generation and playback of panoramic videos. Background Art
[0002] As a new video field, panoramic video is usually a spherical video with a 360° field of view. Standing inside the sphere and watching it, it feels like being in real space. By rotating the spherical video, you can see whatever you want in the 360° space and be completely immersed in the environment shown in the video.
[0003] Panoramic video is an interactive multimedia, but currently panoramic video is mainly generated by 360-degree shooting with dedicated panoramic cameras and other equipment, or generated based on panoramic pictures. The visual elements of this type of panoramic video are mainly images that actually exist in space and continuous panoramic images. It lacks scene depth annotation and interactive information. Therefore, the existing technology supplements the details of the panoramic video by adding hotspots to the panoramic video to associate various pictures, videos, sounds, etc., such as panoramic house viewing, panoramic digital scenic spots, panoramic exhibition hall visits, etc., which have more typical applications.
[0004] Currently, panoramic house viewing, panoramic digital scenic spots and other contents generated based on panoramic pictures, although some interactive materials such as audio, video or pictures have been added, they often exist in the form of HTML5 programs, or can only be opened with a dedicated player. The playback and interaction of hot data are achieved through program settings. However, they cannot be directly played and used on the current mainstream short video platforms (such as: Douyin, Xiaohongshu, etc.). Summary of the invention
[0005] The technical problem to be solved by the present invention is: to provide a method for generating a panoramic video by using panoramic pictures, which can add hot spots to the panoramic video. The panoramic video generated by this method can be played and used on mainstream short video platforms.
[0006] In order to solve the above technical problems, the technical solution proposed by the present invention is: a method for generating a panoramic video from a panoramic picture, comprising the following steps:
[0007] S1. Select a panoramic picture for generating a panoramic video;
[0008] S2, importing the picture material into the panoramic picture to merge the picture material with the panoramic picture;
[0009] The method of importing any image material into a panoramic image includes the following steps:
[0010] S21, converting the panoramic image into a spherical latitude and longitude coordinate format, assuming that the radius of the sphere is R and the center of the sphere is O, selecting a position E (θ0, φ0) on the spherical surface as the center point of the image material, and making the image material perpendicular to OE;
[0011] S22, let the pixel width of the panoramic image be W P , high is H P , the pixel width of the image material is W, the height is H, and the spherical radius R is normalized to 1;
[0012] Take the center point of the image material as the origin, establish a rectangular coordinate system, traverse all pixels in the image material, and for any pixel A(x,y), its normalized coordinates are marked as (u,v), then:
[0013] u=2x / W-1,v=2y / H-1, where u∈[-1,1],v∈[-1,1];
[0014] S23, calculating the longitude and latitude coordinates (θ, φ) of each pixel in the image material projected onto the spherical surface:
[0015] where θ∈[-π / 2,π / 2],
[0016] where φ∈[-π,π];
[0017] S24, convert the longitude and latitude coordinates of each pixel in the image material into the coordinates (X p ,Y p ):
[0018] X p =(φ / (2π))×W p ,
[0019] Y p =(θ / π+0.5)×H p ;
[0020] S25, based on the coordinate position (X p ,Y p ), replacing pixels at corresponding positions in the panoramic image with pixels in the picture material, so that the picture material is merged with the panoramic image to obtain a merged panoramic image;
[0021] S3. All panoramic pictures obtained after processing in step S2 are synthesized into a panoramic video according to a set time slice sequence.
[0022] The present invention performs secondary editing and synthesis on the panoramic picture and the picture material used as the scene annotation material to obtain a fused panoramic picture, enriching the display elements of the panoramic picture, and serving as a frame of a panoramic video, thereby generating a panoramic video according to the time slice sequence. In other words, the present invention can directly display hotspot data in a panoramic video. Compared with the prior art, the scene annotation material no longer needs to be displayed through a program, but is directly played in a universal panoramic video format, so that it can be directly used on a variety of short video platforms such as Douyin and Xiaohongshu, enhancing the use effect and dissemination range of panoramic pictures. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a schematic diagram of converting a panoramic image into a spherical latitude and longitude coordinate format.
[0024] Figure 2 It is a schematic diagram of the location of image materials.
[0025] Figure 3 It is a schematic diagram of importing image materials into a panoramic image.
[0026] Figure 4 This is a schematic diagram of the time slice setting. DETAILED DESCRIPTION
[0027] The existing technology adds various hot data such as pictures, videos, and sounds to panoramic videos, and requires the use of programs to interact with the panoramic videos. Therefore, it cannot be directly played and used on short video platforms, and a solution is urgently needed.
[0028] Example 1
[0029] This embodiment shows a method for generating a panoramic video from a panoramic picture, which fuses various picture hot spots into the panoramic picture and then generates a panoramic video. The method includes the following steps:
[0030] S1. Select a panoramic picture from which a panoramic video needs to be generated, and then generate a panoramic video based on the panoramic picture.
[0031] S2. Set scene annotations, select required hotspot data of picture materials, import the picture materials into the panoramic picture, and merge the picture materials with the panoramic picture; preferably, when importing the picture materials, the length and width of the picture can be appropriately adjusted as needed.
[0032] The method of importing any image material into a panoramic image includes the following steps:
[0033] S21, such as Figure 1 and Figure 2As shown, the panoramic image is converted into a spherical latitude and longitude coordinate format. Assuming that the radius of the sphere is R and the center of the sphere is O, a position E (θ0, φ0) is selected on the spherical surface as the center point of the image material, and the image material is made perpendicular to OE, where θ0 is the latitude and φ0 is the longitude;
[0034] S22, after setting the position and size of the picture material, overlay the picture material into the corresponding area of the panoramic picture, and then generate a new panoramic picture, that is, Figure 3 As shown, let the pixel width of the panoramic image be W P , high is H P , the pixel width of the image material is W, the height is H, and the spherical radius R is normalized to 1;
[0035] Taking the center point of the image material as the origin, a rectangular coordinate system is established on the plane of the image material, and all pixels in the image material are traversed. For any pixel A(x,y), its normalized coordinates are marked as (u,v), then:
[0036] u=2x / W-1,v=2y / H-1, where u∈[-1,1],v∈[-1,1];
[0037] S23, based on the stereoscopic projection method, calculate the longitude and latitude coordinates (θ, φ) of each pixel in the image material projected onto the spherical surface:
[0038] where θ∈[-π / 2,π / 2],
[0039] where φ∈[-π,π];
[0040] Among them, θ is latitude and φ is longitude;
[0041] S24, convert the longitude and latitude coordinates of each pixel in the image material into the coordinates (X p ,Y p ):
[0042] X p =(φ / (2π))×W p ,
[0043] Y p =(θ / π+0.5)×H p ;
[0044] S25, overlaying the image material onto the panoramic image, that is, according to the coordinate position (X) of each pixel in the image material in the panoramic image, p ,Y p), replace the pixels at the corresponding positions in the panoramic image with the pixels in the picture material, so that the picture material and the panoramic image are merged to obtain a fused panoramic image.
[0045] S3, all the picture materials are processed according to step S2 to obtain a series of fused panoramic pictures, and all the panoramic pictures obtained after the processing of step S2 are synthesized into a panoramic video according to the set time slice sequence. This is the prior art. The panoramic video can adopt the universal format MPEG4 format, support mobile phones, computers and a variety of playback software to play, so that it can be directly uploaded to the short video platform for playback and use.
[0046] When using this embodiment, the center point of the picture material may not be located at the center of the panoramic picture, so the user needs to rotate the panoramic video to see the content of the material picture. Therefore, this embodiment can also be improved as follows:
[0047] Before executing step S3, the fused panoramic image is translated to translate the center point of the image material to the center position of the panoramic image.
[0048] In this embodiment, each pixel in the fused panoramic image is translated along the X-axis, and the Y-axis coordinate remains unchanged. In this way, the X-axis coordinate origin of the translated panoramic image coincides with point E, so that the plane image material is located at the center of the panoramic image. The translation amount is d x =(φ0 / 2π)*W p .
[0049] In order to ensure that the position after translation is still within the width of the panoramic image, assume that the coordinates of a pixel before translation are (x, y), and the coordinates of the pixel after translation are (x ′ ,y ′ ),but:
[0050] x ′ =(x+d x )mod W p ,y ′ =y, where mod is the modulus operator;
[0051] Through the above processing, the coordinates of each pixel in the panoramic image are translated, and the picture material will be located at the center of the panoramic image. In the final panoramic video, the picture material will also be located in the center area of the first perspective of the panoramic video playback, so that users can easily view the core content elements without manually rotating the panoramic video.
[0052] Example 2
[0053] The difference between this embodiment and the first embodiment is that this embodiment can display hot spots such as picture materials and video materials in the panoramic video, that is, in addition to importing picture materials into the panoramic picture, video materials are also imported into the panoramic picture.
[0054] During implementation, in step S2, the video material is converted into multiple picture materials by frame, and each picture material is fused into a panoramic picture according to the method of step S2 to generate a fused panoramic picture of each frame. Finally, all panoramic pictures are combined into a panoramic video according to the set time slice sequence.
[0055] Preferably, when the video material is imported into the panoramic picture, each frame of the panoramic picture generated corresponding to the video material is reassembled to generate a new panoramic video clip, the duration of the panoramic video is consistent with the playback duration of the video material, and the panoramic video clip is finally merged into the final panoramic video. Moreover, by panning the fused panoramic picture, the video material can be located in the center area of the panoramic video clip.
[0056] Example 3
[0057] The difference between this embodiment and embodiment one is that this embodiment adds a function of displaying hot spots such as audio materials in the panoramic video, that is, before executing step S3, the audio material is set, and during the entire playback time of the audio material, the panoramic picture is cyclically translated along the X-axis direction at a certain time interval, and the translation amount can be set as needed, so that the center point of the panoramic picture changes continuously, thereby generating a series of panoramic pictures with different center point positions, and the generated panoramic pictures are mixed with the audio material to generate a panoramic video.
[0058] In this embodiment, in order to ensure that the position after translation is still within the width of the panoramic image, it is assumed that the translation amount per second is d x , the coordinates of a pixel before translation are (x, y), and the coordinates of the pixel after translation are (x ′ ,y ′ ),but:
[0059] x ′ =(x+d x )mod W p ,y ′ =y, where mod is the modulus operator;
[0060] Each time the video is panned, a new panoramic image is generated, and the panned panoramic images and audio are combined to form a panoramic video. The playback effect of the panoramic video is that the panoramic image continues to pan and rotate as the audio plays, so that users can experience the 360-degree panoramic image from all angles without manually rotating the panoramic video.
[0061] like Figure 4 As shown, in this embodiment, the time slices of scene materials (including picture materials, video materials, audio materials) and background music in the panoramic video can be set by the following method, and the playback order of the time slices can be flexibly adjusted as needed:
[0062] 1) Panoramic video PanoZ1 with audio material fusion, duration t1;
[0063] 2) PanoZ2, a panoramic video fused with picture materials, with a duration of t2;
[0064] 3) PanoZ3, a panoramic video fused with video materials, with a duration of t3;
[0065] 4) Background music: You can set a background music that covers the entire panoramic video.
[0066] In Embodiment 1 and Embodiment 2, the setting of the time slices may also be adjusted according to the above method, and irrelevant time slices may be deleted.
[0067] Example 4
[0068] The difference between this embodiment and embodiments 1-3 is that: there is only one panoramic picture in embodiments 1-3, while this embodiment uses multiple panoramic pictures, and steps S2 and S3 are executed for each panoramic picture, each panoramic picture corresponds to a panoramic video clip, and then the multiple panoramic video clips are integrated into one panoramic video to generate a panoramic video with richer scene content.
Claims
1. A method for generating a panoramic video from a panoramic picture, comprising the following steps: S1. Select a panoramic picture for generating a panoramic video; S2, importing the material picture into the panoramic picture to merge the material picture with the panoramic picture; The method of importing any material picture into a panoramic picture includes the following steps: S21, converting the panoramic image into a spherical latitude and longitude coordinate format, assuming that the radius of the sphere is R and the center of the sphere is O, selecting a position E (θ0, φ0) on the spherical surface as the center point of the material image, and making the material image perpendicular to OE; S22, let the pixel width of the panoramic image be W P , high is H P , the pixel width of the material image is W, the height is H, and the spherical radius R is normalized to 1; With the center point of the material image as the origin, a rectangular coordinate system is established to traverse all pixels in the material image. For any pixel A(x,y), its normalized coordinates are marked as (u,v), then: u=2x / W-1,v=2y / H-1, where u∈[-1,1],v∈[-1,1]; S23, calculating the longitude and latitude coordinates (θ, φ) of each pixel in the material image projected onto the spherical surface: Where θ∈[-π / 2,π / 2], where φ∈[-π,π]; S24, convert the latitude and longitude coordinates of each pixel in the source image into coordinates in the panoramic image (X p ,Y p ): X p =(φ / (2π))×W p , Y p =(θ / π+0.5)×H p ; S25, based on the coordinate position (X p ,Y p ), replacing pixels at corresponding positions in the panoramic image with pixels in the source image, so that the source image and the panoramic image are merged to obtain a fused panoramic image; S3. All panoramic pictures obtained after processing in step S2 are synthesized into a panoramic video according to a set time slice sequence.
2. The method for generating a panoramic video from a panoramic picture according to claim 1, characterized in that: Before executing step S3, the material video is converted into multiple material pictures frame by frame, and each material picture is fused into the panoramic picture according to the method of step S2.
3. The method for generating a panoramic video from a panoramic picture according to claim 1 or 2, characterized in that: When executing step S2, the length and width of the material image are adjusted as needed.
4. The method for generating a panoramic video from a panoramic picture according to claim 1 or 2, characterized in that: Before executing step S3, the fused panoramic image is translated to translate the center point of the source image to the center of the panoramic image. Assuming that the coordinates of a certain pixel before translation are (x, y), the coordinates of the pixel after translation are (x ′ ,y ′ ),but: Translation d x =(φ0 / 2π)*W p , x ′ =(x+d x )mod W p ,y ′ =y, where mod is the modulo operator.
5. The method for generating a panoramic video from a panoramic picture according to claim 1 or 2, characterized in that: Before executing step S3, set the audio material, and during the entire playback time of the audio material, circularly translate the panoramic image along the X-axis direction at certain time intervals so that the center point of the panoramic image changes continuously, thereby generating a series of panoramic images with different center point positions.
6. The method for generating a panoramic video from a panoramic picture according to claim 1 or 2, characterized in that: There are multiple panoramic pictures, and step S2 and step S3 are performed on each panoramic picture. Each panoramic picture corresponds to a panoramic video segment, and then the multiple panoramic video segments are integrated into a panoramic video.
Citation Information
Patent Citations
Method and system for using virtual lens to realize VR panoramic video post editing
CN106331645A
Education system based on virtual reality and method thereof
CN107577347A
Panoramic video processing method, device and equipment and storage medium
CN111182218A
Video generation method and device, electronic equipment and computer readable medium
CN114125551A
Manufacturing method for synthesizing high-definition VR panoramic video by embedding video material into LivePanoVR panoramic video
CN114697550A
