CN111314729A - Panoramic image generation method, device, equipment and storage medium - Google Patents
Panoramic image generation method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN111314729A CN111314729A CN202010117557.9A CN202010117557A CN111314729A CN 111314729 A CN111314729 A CN 111314729A CN 202010117557 A CN202010117557 A CN 202010117557A CN 111314729 A CN111314729 A CN 111314729A
- Authority
- CN
- China
- Prior art keywords
- panoramic
- picture
- sub
- image
- pixel point
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 239000002131 composite material Substances 0.000 claims description 50
- 238000009877 rendering Methods 0.000 claims description 46
- 230000009191 jumping Effects 0.000 claims description 16
- 230000008569 process Effects 0.000 claims description 13
- 239000007787 solid Substances 0.000 claims description 13
- 238000003491 array Methods 0.000 claims description 4
- 238000004590 computer program Methods 0.000 claims description 4
- 230000005540 biological transmission Effects 0.000 abstract description 14
- 238000012545 processing Methods 0.000 abstract description 2
- 230000006835 compression Effects 0.000 abstract 1
- 238000007906 compression Methods 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 13
- 230000008859 change Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000006854 communication Effects 0.000 description 3
- 239000000284 extract Substances 0.000 description 3
- 239000003086 colorant Substances 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000005034 decoration Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/21—Server components or server architectures
- H04N21/218—Source of audio or video content, e.g. local disk arrays
- H04N21/2187—Live feed
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4038—Image mosaicing, e.g. composing plane images from plane sub-images
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/239—Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
- H04N21/2393—Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/44012—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving rendering scenes according to scene graphs, e.g. MPEG-4 scene graphs
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Studio Devices (AREA)
- Image Processing (AREA)
Abstract
The embodiment of the application discloses a method, a device, equipment and a storage medium for generating a panoramic image, and relates to the technical field of live broadcast. The technical scheme realizes compression processing of the panoramic sub-picture, reduces the data volume of picture transmission and improves the transmission efficiency.
Description
Technical Field
The present application relates to the field of live broadcast technologies, and in particular, an embodiment of the present application relates to a method, an apparatus, a device, and a storage medium for generating a panoramic image.
Background
With the development of network technology, real-time video communication such as live webcast and video chat room becomes an increasingly popular entertainment mode. In the real-time video communication process, the interactivity among users can be increased by giving gifts and showing special effects.
In order to obtain a better display effect in live broadcasting, panoramic live broadcasting is favored by more and more users. In the panoramic live broadcast, a server issues a plurality of pictures to a client so as to process the pictures at the client, such as splicing or mapping, and generate a panoramic image, and a main broadcast carries out live broadcast by taking the panoramic image as a background, so that a better display effect is obtained. However, the server issues a plurality of pictures to the client, which results in a large data volume and affects the live transmission efficiency.
Disclosure of Invention
The present application aims to solve at least one of the above technical drawbacks, and in particular, to solve the problem that the transmission data volume is large and affects the live transmission efficiency.
In a first aspect, an embodiment of the present application provides a method for generating a panoramic image, including the following steps:
receiving a composite picture sent by a live broadcast server; the synthetic picture is obtained by splicing a plurality of panoramic sub-pictures into a background image according to a preset layout;
scanning the synthesized picture row by row and column by column to obtain an edge pixel point array of the panoramic sub-picture on a background image;
and determining the edge line of the panoramic sub-picture according to the edge pixel point array and the layout, cutting the synthesized picture along the edge line, extracting each panoramic sub-picture, and rendering the panoramic sub-pictures to generate the panoramic image.
In one embodiment, the background image is a solid image;
the step of scanning the synthesized picture row by row and column by column to obtain the edge pixel point array of the panoramic sub-picture on the background image comprises the following steps:
in the scanning of the synthesized picture, stopping the scanning of the line or the line when a first pixel point which is different from the background color value of the pure color image is obtained, and recording the current pixel point as an edge pixel point;
and acquiring the edge pixel points of each row and each column, and respectively generating a row edge pixel point array and a column edge pixel point array of the panoramic sub-picture on the background image.
In an embodiment, in the scanning of the composite picture, the step of terminating the scanning of the row or the column when a first pixel point different from the background color value of the solid image is obtained, and recording the current pixel point as an edge pixel point includes:
in the process of scanning the synthesized picture line by line, acquiring color values of scanned pixel points in real time, stopping the line scanning at a first color value jumping position, and recording the pixel points at the color value jumping position as line edge pixel points;
and in the column-by-column scanning process, the color value of the scanned pixel point is acquired in real time, the column scanning of this time is stopped at the first color value jumping position, and the pixel point at the color value jumping position at this time is recorded as a column edge pixel point.
In an embodiment, the step of determining the edge line of the panoramic sub-picture according to the edge pixel point array and the layout includes:
acquiring the numerical value of the position coordinate of each edge pixel in the edge pixel array;
determining the side length of the panoramic sub-picture according to the numerical value of the position coordinate with the maximum number;
and obtaining the edge line of the panoramic sub-picture according to the side length and the layout.
In one embodiment, the panoramic sub-picture is a square pattern picture.
In an embodiment, the step of cropping the composite picture along the edge line and extracting each panoramic sub-picture, and rendering the panoramic sub-pictures to generate a panoramic image includes:
cutting the composite picture along the edge line, and extracting each panoramic sub-picture with a square pattern;
rendering the panoramic sub-picture according to a set mode to generate a panoramic image in a cubic style.
In one embodiment, the step of rendering the panoramic sub-picture to generate a panoramic image comprises:
splicing and rendering all the panoramic sub-pictures to generate a first panoramic image;
and fusing the live broadcast video of the main broadcast into the first panoramic image for playing, and rendering a panoramic image of the three-dimensional live broadcast room.
In a second aspect, an embodiment of the present application provides a method for generating a panoramic image, including the following steps:
acquiring a plurality of panoramic sub-pictures of the panoramic image;
splicing the plurality of panoramic sub-pictures into a background image according to a preset layout to obtain a synthetic picture;
issuing the synthesized picture to a client; enabling the client to scan the synthesized picture row by row and column by column to obtain an edge pixel point array of the panoramic sub-picture on a background image;
and determining the edge line of the panoramic sub-picture according to the edge pixel point array and the layout, cutting the synthesized picture along the edge line, extracting each panoramic sub-picture, and rendering the panoramic sub-pictures to generate the panoramic image.
In a third aspect, an embodiment of the present application provides an apparatus for generating a panoramic image, including:
the composite picture receiving module is used for receiving a composite picture sent by a live broadcast server; the synthetic picture is obtained by splicing a plurality of panoramic sub-pictures into a background image according to a preset layout;
the edge pixel acquisition module is used for scanning the synthesized picture row by row and column by column to acquire an edge pixel point array of the panoramic sub-picture on a background image;
and the panoramic image rendering module is used for determining the edge lines of the panoramic sub-pictures according to the edge pixel point arrays and the layout, cutting the synthesized picture along the edge lines, extracting each panoramic sub-picture, and rendering the panoramic sub-pictures to generate the panoramic image.
In a fourth aspect, an embodiment of the present application provides an apparatus for generating a panoramic image, including:
the panoramic sub-picture acquisition module is used for acquiring a plurality of panoramic sub-pictures of the panoramic image;
the synthetic picture generation module is used for splicing the plurality of panoramic sub-pictures into a background image according to a preset layout to obtain a synthetic picture;
the synthesized picture issuing module is used for issuing the synthesized picture to the client; and scanning the synthesized picture row by row and column by the client to obtain an edge pixel point array of the panoramic sub-picture on a background image, determining an edge line of the panoramic sub-picture according to the edge pixel point array and the layout, cutting the synthesized picture along the edge line, extracting each panoramic sub-picture, and rendering the panoramic sub-picture to generate the panoramic image.
In a fifth aspect, the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the steps of the panoramic image generation method mentioned in the above embodiments.
In a sixth aspect, the present application provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the steps of the method for generating a panoramic image as mentioned in the above embodiments.
The method, the device, the equipment and the storage medium for generating the panoramic image provided by the embodiment receive a synthesized picture obtained by splicing a plurality of panoramic sub-pictures into a background image according to a preset layout sent by a live broadcast server, scan the synthesized picture row by row and column by column to obtain an edge pixel point array of the panoramic sub-pictures on the background image, determine an edge line of the panoramic sub-pictures according to the edge pixel point array and the layout, cut the synthesized picture along the edge line and extract each panoramic sub-picture, render the panoramic sub-pictures to generate the panoramic image, and compress the panoramic sub-pictures, thereby reducing the data amount of picture transmission and improving the transmission efficiency.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic frame diagram of a webcast system according to an embodiment;
FIG. 2 is a flow diagram of a method for generating a panoramic image, according to an embodiment;
FIG. 3 is a diagram illustrating a first layout of a composite picture according to an embodiment;
FIG. 4 is a diagram illustrating a second layout of a composite picture according to an embodiment;
FIG. 5 is a schematic view of cropping of the panoramic sub-picture of the layout corresponding to the composite picture shown in FIG. 3;
FIG. 6 is another flow diagram of a method for generating a panoramic image, according to an embodiment;
fig. 7 is a schematic structural diagram of a panoramic image generation apparatus according to an embodiment;
fig. 8 is another schematic structural diagram of the panoramic image generation apparatus according to the embodiment.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those within the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
Before describing the method provided by the embodiment of the present application, an application scenario of the embodiment of the present application is described first. Referring to fig. 1, fig. 1 is a schematic diagram of a framework of a live webcast system provided by an embodiment, where the system framework may include a server and clients, each client includes one or more anchor clients (i.e., anchor, the same below) 10 and a plurality of viewer clients 20 (i.e., viewer clients, the same below), a live platform located on the server may include a plurality of virtual live rooms and a server 30, and the like, where each anchor client 10 and each viewer client 20 establish communication connection with the server 30 through a wired network or a wireless network.
Generally speaking, each virtual live broadcast room correspondingly plays different live broadcast contents, the anchor broadcasts are live broadcast through the anchor client 10, and audiences select to enter a certain virtual live broadcast room through the audience client 20 to watch the anchor broadcast for live broadcast. The viewer client 20 and the anchor client 10 may enter the live platform through a live Application (APP) installed on the terminal device.
The anchor client 10 and the audience client 20 are terminal devices, such as a smart phone, a tablet computer, an e-reader, a desktop computer, or a notebook computer, and the like, which is not limited thereto. The server 30 is a background server for providing background services for the terminal device, and may be implemented by an independent server or a server cluster composed of a plurality of servers. In one embodiment, the server 30 may be a live web platform.
The method for generating the panoramic image is suitable for the client to receive the panoramic sub-picture of the panoramic image in the panoramic gift issued by the server and generate the panoramic image by using the panoramic sub-picture, so that the image data is compressed, and the effect of improving the transmission efficiency is achieved.
Fig. 2 is a flowchart of a method for generating a panoramic image according to an embodiment, which may be performed by a client, as shown in fig. 2.
Specifically, as shown in fig. 2, the method for generating a panoramic image may include the following steps:
s110, receiving a composite picture sent by a live broadcast server; the synthetic picture is obtained by splicing a plurality of panoramic sub-pictures into a background image according to a preset layout.
In an embodiment, the composite picture may be used to render a composite picture of a panoramic gift, or may be a composite picture of a panoramic image background of a three-dimensional live room. A panoramic gift is a gift for seeking treasure in a three-dimensional panoramic environment, which may include a three-dimensional panoramic image and a three-dimensional gift image. Rendering a panoramic image in a live broadcast room under an environment corresponding to the panoramic gift so that a user can feel that the user is close to the environment rendered by the panoramic image, hiding a three-dimensional gift image such as a three-dimensional virtual treasure box at a preset position of the panoramic image so that the user can rotate the panoramic image, searching the three-dimensional virtual treasure box in the panoramic image, and triggering the three-dimensional virtual treasure box to obtain the reward of the corresponding virtual gift when the user finds the three-dimensional virtual treasure box.
In one embodiment, when the set sending time of the panoramic gifts is reached, the server automatically sends the synthetic pictures of the panoramic gifts to each client terminal entering the live broadcast room. In another embodiment, when the user triggers a certain button, the client sends a composite picture issuing request to the server, and the server sends the composite picture to the client in response to the request. The client receives a composite picture of the panoramic gift sent by the live broadcast server, and the composite picture can be obtained by splicing a plurality of panoramic sub-pictures in a background image by the server according to a preset layout.
The plurality of panoramic sub-pictures are pictures shot at different angles, and the panoramic sub-pictures are combined to obtain a complete panoramic image. In an embodiment, different numbers of panoramic sub-pictures can be divided as required, and the panoramic sub-pictures can be square, rectangular or other shapes. Splicing a plurality of panoramic sub-pictures on a background image according to a preset layout, wherein optionally, the background image can be a pure background image, and further, the color of the pure background image is preferably different from the color related to the panoramic sub-pictures. Since the panoramic image is a three-dimensional image, in an embodiment, the preset layout may be an expanded view of the three-dimensional image.
Fig. 3 is a first schematic diagram of a composite picture provided in an embodiment, as shown in fig. 3, the composite picture is obtained by splicing six pictures in a background image according to a preset layout, and the six pictures can be numbered and placed in a defined area of the background image according to the numbers for splicing. Optionally, there may be gaps between the panoramic sub-pictures, or no gaps to allow for tight stitching.
With continued reference to fig. 3, the resolution size of the background image is 2000 × 1500, assuming that the panoramic sub-pictures are all square, each picture is 500 × 500, a coordinate system is established with the upper left corner of the background image as the origin, each panoramic sub-picture represents the position of the whole sub-picture relative to the background image with the position of the upper left corner, each panoramic sub-picture is stitched on the background image according to the following layout example, such as placing the top picture (with the serial number of ①) at the position of (500,0), placing the left picture (with the serial number of ②) at the position of (0,500), placing the front picture (with the serial number of ③) at (500 ), placing the right picture (with the serial number of ④) at (1000, 500), placing the back picture (with the serial number of ⑤) at (1500, 500), and placing the bottom picture (with the serial number of ⑥) at (500,1000), and integrating into a synthesized picture.
In an embodiment, according to another preset layout, fig. 4 is a second layout diagram of the composite picture provided in an embodiment, for example, the six panoramic sub-pictures are stitched on the background image to obtain the composite image with the layout shown in fig. 4. In other embodiments, the panoramic sub-picture can be spliced for the preset by using other forms of expansion diagrams.
And S120, scanning the synthesized picture row by row and column by column to obtain an edge pixel point array of the panoramic sub-picture on the background image.
In an embodiment, the color of the background image is different from the color of the portion near the edge in the composite picture, and the client may scan the composite picture row by row and column by column. Because the colour of background image is more single, when being pure color background image, when scanning non-panorama subpicture portion part, also be the colour value of the background image of pure color and can not change, when the colour value jumps, scan the edge of panorama subpicture, record the marginal pixel point that the colour value takes place the jump department. In order to record and store the edge pixel points, a set of edge pixel points of the panoramic sub-picture on a plurality of rows and a plurality of columns on the background image can be obtained, and the set of the edge pixel points is expressed in an array mode to obtain an edge pixel point array.
S130, determining edge lines of the panoramic sub-pictures according to the edge pixel point arrays and the layout, cutting the synthesized picture along the edge lines, extracting all the panoramic sub-pictures, and rendering the panoramic sub-pictures to generate panoramic images.
The edge pixel array may include information such as position information and color values of the edge pixels. In an embodiment, the same panoramic image may correspond to layouts of multiple panoramic image sub-pictures on the background image, and taking a cubic panoramic image as an example, the preset layout may be a cubic expansion image.
Each edge line of the panoramic sub-picture exhibits a certain regularity, for example, in some embodiments, the abscissa of the pixel point on the same edge line may be the same, or the ordinate may be the same, or the abscissa and the ordinate exhibit a certain regularity to increase or decrease, and the like. And comparing the horizontal and vertical coordinates of each pixel point recorded by the edge pixel point array, determining the change characteristics of the horizontal and vertical coordinates of each edge pixel point, determining the side length, turning points and other characteristics of the panoramic sub-picture, and determining the edge line of the panoramic sub-picture in the background picture by combining the layout of the panoramic sub-picture in the background picture.
And cutting the synthesized picture along the edge line of the panoramic sub-picture, removing corner departments except the panoramic sub-picture, extracting each panoramic sub-picture, and rendering the panoramic sub-picture at a preset position to obtain a panoramic image. Optionally, the panoramic sub-pictures may be mapped onto a surface corresponding to the three-dimensional model to render the image, so as to obtain a panoramic image, or the panoramic sub-pictures may be spliced and rendered to obtain a panoramic image.
In the method for generating a panoramic image provided by this embodiment, a synthesized picture obtained by splicing a plurality of panoramic sub-pictures into a background image according to a preset layout and sent by a live broadcast server is received, the synthesized picture is scanned row by row and column by column to obtain an edge pixel point array of the panoramic sub-pictures on the background image, an edge line of the panoramic sub-pictures is determined according to the edge pixel point array and the layout, the synthesized picture is cut along the edge line and each panoramic sub-picture is extracted, the panoramic sub-pictures are rendered to generate the panoramic image, so that the panoramic sub-pictures are compressed, the data amount of picture transmission is reduced, and the transmission efficiency is improved.
In order to make the technical solutions of the present application clearer and easier to understand, specific implementation processes and modes of a plurality of steps in the technical solutions are described in detail below.
In an embodiment, rendering the panoramic sub-picture to generate a panoramic image in step S130 may include the following:
s301, splicing and rendering all the panoramic sub-pictures to generate a first panoramic image;
the client side scans the synthesized picture after receiving the synthesized picture sent by the server to obtain the edge line of each panoramic sub-picture, cuts the synthesized picture along the edge line, extracts each panoramic sub-picture, splices and renders each panoramic sub-picture to obtain a first panoramic image, and displays the first panoramic image on a client side interface of a live broadcast room so as to create a live broadcast watching environment in a three-dimensional space for a user.
S302, fusing the live broadcast video of the anchor broadcast into the first panoramic image for playing, and rendering the panoramic image of the three-dimensional live broadcast room.
Further, the live video of the anchor is fused into the first panoramic image to be played, and a three-dimensional panoramic live broadcast room is generated. Optionally, a play window may be set on the first panoramic image, and the live video may be played in the first panoramic image through the play window, where the play window may be suspended on the first panoramic image or embedded in the first panoramic image.
Optionally, in an embodiment, the playing window is disposed on the first panoramic image, and may rotate backwards following the rotation of the first panoramic image. In another embodiment, the playing window is embedded in the first panoramic image, the playing window is always located at the fixed position of the first panoramic image, and when the rotation range of the first panoramic image exceeds the area where the playing window is located, the playing window disappears on the display interface. In an embodiment, the playing window may also be suspended on the first panoramic image and set at a set position on the display interface, that is, the playing window does not rotate along with the rotation of the first panoramic image, and no matter how the first panoramic image rotates, the video is always played in the playing window at the set position on the display interface.
According to the method for generating the three-dimensional panoramic live broadcast room, the client can switch the common live broadcast environment in the traditional live broadcast mode into the environment of the three-dimensional panoramic live broadcast room to watch the anchor live broadcast according to the switching action of the user, the three-dimensional panoramic live broadcast room provides the feeling of the environment site corresponding to the panoramic image of the user, the live broadcast video of the anchor is fused into the first panoramic image, the visual feeling of the user is improved, the interactivity between the anchor and audiences is enhanced, and the method is favorable for improving the user remaining amount in the live broadcast room.
In an embodiment, in order to reduce the data processing amount, the background image is preferably a solid color image, such as a solid white image, or a solid black image, and further, the color of the solid color image is preferably different from the color in each panoramic sub-picture, if the colors involved in the panoramic sub-picture include red, green, black and blue, then the other colors except red, green, black and blue are selected as the background color of the background image, such as white, so as to determine the color jump and identify the edge line of the panoramic sub-picture.
In an embodiment, scanning the synthesized picture row by row and column by column in step S120 to obtain an edge pixel point array of the panoramic sub-picture on the background image may include the following steps:
and S1201, in the scanning of the synthetic picture, stopping the scanning of the line or the line when a first pixel point different from the background color value of the pure color image is obtained, and recording the current pixel point as an edge pixel point.
Because the color of background image and panorama subpicture is different, the border line department of panorama subpicture can take place the colour jump, in carrying out the scanning process to the composite image, when being in pure color image area, the colour value that the scanning obtained is the color value that maintains unchangeably, when scanning the first pixel point of being different from the background colour value of pure color image, this pixel point then is the border pixel point, records this border pixel point, like the position coordinate of this border pixel point etc., stop this round of scanning, begin next round of scanning.
In an embodiment, step S1201 may further include the steps of:
s201, in the process of scanning the synthesized picture line by line, obtaining color values of scanned pixel points in real time, stopping line scanning at a first color value jumping position, and recording the pixel points at the color value jumping position as line edge pixel points.
For example, in the embodiment, the rows and columns of the synthesized picture are numbered according to the resolution size of the synthesized picture, and if the resolution of the synthesized picture is 2000 × 1500, each row is numbered as X1, X2 … … X1500, and each column is numbered as Y1, Y2 … … Y2000.
The method comprises the steps of scanning a synthesized picture line by line, scanning a line X1 from left to right, acquiring color values of scanned pixel points on a line X1 in real time, if the color of a background image is pure white, the color values of the pixel points which are possibly obtained at the beginning are pure white color values, scanning a color value jump point, namely the color values of the acquired pixel points are non-pure white, the first non-pure white pixel point which is acquired at the moment is possibly a certain edge pixel point of a panoramic sub-picture on the line X1, stopping scanning the line X1, starting scanning the line X2, and so on until the X1500 is scanned, acquiring line edge pixel points of all lines, namely position coordinates of 1500 pixel points.
S202, in the column-by-column scanning process, color values of scanned pixel points are obtained in real time, column scanning of the time is stopped at a first color value jumping position, and the pixel points at the color value jumping position at the time are recorded as column edge pixel points.
Similarly, scanning the composite image column by column, firstly scanning the column Y1 from top to bottom, and acquiring color values of scanned pixel points on the column Y1 in real time, if the color of the background image is pure white, the color values of the pixel points which are possibly acquired at the beginning are all pure white color values, when a color value jump point is scanned, that is, the color values of the acquired pixel points are also non-pure white, the acquired first non-pure white pixel point may be a certain edge pixel point of the panoramic sub-image on the row Y1, terminating the row scanning of the column Y1, and starting to perform column scanning on the column Y2, so on, until Y2000 is scanned, acquiring the column edge pixel points of all columns, that is, the position coordinates of 2000 pixel points.
S1202, obtaining the edge pixel points of each row and each column, and respectively generating a row edge pixel point array and a column edge pixel point array of the panoramic sub-picture on the background image.
And acquiring row edge pixel points of each row, and storing the row edge pixel points in an array form to generate a row edge pixel point array of the panoramic sub-picture on the background image. Similarly, the column edge pixel points of each column are obtained, and the column edge pixel points are stored in an array form to generate a column edge pixel point array of the panoramic sub-picture on the background image.
It should be noted that, in the method for generating a panoramic image provided in this embodiment, because the panoramic sub-picture is obtained by splicing the pre-set three-dimensional expansion map, for example, the layout corresponding to the cubic expansion map, into the background image, and the edge pixel points obtained by scanning have a specific regularity, as exemplified by the layout shown in fig. 3, during the line-by-line scanning process, the first color value jumping points of multiple lines may occur at the left edges corresponding to the panoramic sub-pictures corresponding to the serial numbers ① and ⑥, so that the obtained set of pixel points may be the set of the left edge pixel points of the panoramic sub-pictures corresponding to the serial numbers ① and ⑥, and according to the obtained values of the abscissa of these pixel points, the side length corresponding to the left edge of the panoramic sub-picture may be determined.
Similarly, in the process of scanning column by column, the first color value jumping position of multiple columns may occur at the upper side edge corresponding to the panoramic sub-picture corresponding to the sequence numbers ②, ④ and ⑤, so the obtained set of pixel points may be the set of pixel points at the upper side edge of the panoramic sub-picture corresponding to the sequence numbers ②, ④ and ⑤, and the side length corresponding to the upper side edge of the panoramic sub-picture can be determined according to the obtained values of the vertical coordinates of the pixel points.
In an embodiment, the determining the edge line of the panoramic sub-picture according to the edge pixel point array and the layout in step S130 may include the following steps:
s1301, obtaining the numerical value of the position coordinate of each edge pixel in the edge pixel array.
With continued reference to the embodiment shown in fig. 3, coordinates of the row edge pixel array are obtained, and it can be seen that, the coordinates of the row edge pixel recorded on X1 are (500,0), the coordinates of the row edge pixel recorded on X2 are (500,1), the coordinates of the row edge pixel recorded on X3 are (500,3), the coordinates of the row edge pixel recorded on X4 are (500,4), and so on, optionally, in some embodiments the abscissa of each pixel in the row edge pixel array may be compared only, the abscissas of the pixel points recorded on X1 to X500 are all in a certain regularity, fluctuating slightly in the position of 500 as a whole, the abscissa of the pixel points recorded on X501 to X1000 is within the image range of the panoramic sub-picture, there is no obvious regularity, the abscissa of the pixel points recorded on X1001 to X1500 has a certain regularity, and fluctuates slightly in the position of 500 as a whole.
Similarly, coordinates of the column edge pixel array are obtained, and it is known that coordinates of the column edge pixel recorded on Y1 are (0,500), coordinates of the column edge pixel recorded on Y2 are (1,500), coordinates of the column edge pixel recorded on Y3 are (3,500), coordinates of the column edge pixel recorded on Y4 are (4,500), and the like, and optionally, in some embodiments, only vertical coordinates of each pixel in the column edge pixel array may be compared, vertical coordinates of pixels recorded on Y1 to Y500 all have a certain regularity, and slightly fluctuate in the position of 500 as a whole, vertical coordinates of pixels recorded on Y501 to Y1000 are within an image range of a sub-picture, and have no obvious regularity, and vertical coordinates of pixels recorded on Y1001 to Y2000 all have a certain regularity, and still slightly fluctuate in the position of 500 as a whole.
If the layout shown in fig. 4 is taken as an example to describe, and coordinates of the row edge pixel array are obtained, it can be seen that, coordinates of the row edge pixel recorded on X1 are (500,0), coordinates of the row edge pixel recorded on X2 are (500,1), coordinates of the row edge pixel recorded on X3 are (500,3), coordinates of the row edge pixel recorded on X4 are (500,4), and so on, optionally, in some embodiments the abscissa of each pixel in the row edge pixel array may be compared only, the abscissas of the pixel points recorded on X1 to X500 are all in a certain regularity, fluctuating slightly in the position of 500 as a whole, the abscissa of the pixel points recorded on X501 to X1000 is within the image range of the panoramic sub-picture, there is no obvious regularity, the abscissa of the pixel points recorded on X1001 to X1500 has a certain regularity, and fluctuates slightly in the position of 1000 as a whole.
Similarly, coordinates of the column edge pixel array are obtained, and it is known that coordinates of the column edge pixel recorded on Y1 are (0,500), coordinates of the column edge pixel recorded on Y2 are (1,500), coordinates of the column edge pixel recorded on Y3 are (3,500), coordinates of the column edge pixel recorded on Y4 are (4,500), and the like, and optionally, in some embodiments, only vertical coordinates of each pixel in the column edge pixel array may be compared, vertical coordinates of pixels recorded on Y1 to Y500 all have a certain regularity, and slightly fluctuate in the position of 500 as a whole, vertical coordinates of pixels recorded on Y501 to Y1000 are within an image range of a sub-picture, and have no obvious regularity, and vertical coordinates of pixels recorded on Y1001 to Y2000 all have a certain regularity, and still slightly fluctuate in the position of 500 as a whole.
According to the layout corresponding to fig. 4, the abscissa of the pixel points recorded on X1 to X500 is approximately equal to the side length of the panoramic sub-picture, the abscissa of X1001 to X1500 is twice the corresponding side length of the panoramic sub-picture, and the ordinate of the pixel points recorded on Y1 to Y500 and Y1001 to Y2000 is approximately equal to the side length of the panoramic sub-picture.
S1302, determining the side length of the panoramic sub-picture according to the numerical value of the position coordinate with the maximum number.
And according to the numerical value of the position coordinate, the numerical value of the position coordinate with the maximum number is associated with the side length of the panoramic sub-picture, if the numerical value is possibly equal to the side length of the panoramic sub-picture, the numerical value of the position coordinate with the maximum number is determined as the side length of the panoramic sub-picture, or the numerical value is an integral multiple of the side length of the panoramic sub-picture, and the side length of the panoramic sub-picture is obtained after the numerical value is reduced by a plurality of times.
For example, 1500 abscissa sets and 2000 ordinate sets are compared, and the coordinate value with the largest number of occurrences is screened out, and the coordinate value is taken as the side length of the square of the panoramic sub-picture.
In one embodiment, the panoramic sub-picture is a square pattern picture. In another embodiment, the panoramic sub-image may also be a rectangular pattern picture or the like.
And S1303, obtaining edge lines of the panoramic sub-picture according to the side length and the layout.
And acquiring a pattern corresponding to the layout of the panoramic sub-pictures in the background image, and determining the corresponding position of each panoramic sub-picture in the background image. After the external contour line of the panoramic sub-picture relative to the synthesized picture is determined, the edge line of each panoramic sub-picture is divided according to the side length of the panoramic sub-picture.
It should be noted that, with continued reference to the example corresponding to fig. 3, when the side length of the panoramic sub-picture is determined to be 500, according to the layout manner, the position coordinates of other pixel points on the edge of the panoramic sub-picture can be determined. It should be noted that if the edge line obtained according to the determined side length and the preset layout exceeds the range of the synthesized picture, the panoramic sub-picture is determined to be unqualified, the loading fails, and the panoramic sub-picture of the panoramic gift is fed back to the anchor terminal to be uploaded again.
In an embodiment, the cropping the composite picture along the edge line and extracting out each panoramic sub-picture in step S130, and rendering the panoramic sub-pictures to generate a panoramic image may include the following steps:
and S1301, cutting the synthesized picture along the edge line, and extracting each panoramic sub-picture with a square style.
Fig. 5 is a schematic view showing cropping of the panoramic sub-picture laid out in correspondence with the composite picture shown in fig. 3, wherein the composite picture is cropped along the edge lines (dotted lines shown in fig. 5) of the panoramic sub-picture to extract each of the panoramic sub-pictures of the square type, and the corner portions not belonging to the panoramic sub-picture are removed.
And S1302, rendering the panoramic sub-picture according to a set mode to generate a panoramic image with a cubic style.
And after obtaining each panoramic sub-picture, rendering each panoramic sub-picture to a position corresponding to the panoramic three-dimensional model in a mapping or splicing mode according to the selected panoramic three-dimensional model for synthesis to obtain a panoramic image adaptive to a cube, such as a sky box panoramic image.
Specifically, a panoramic sub-picture with serial number ① may be rendered on the top surface of the panoramic three-dimensional model, a panoramic sub-picture with serial number ② may be rendered on the left surface of the panoramic three-dimensional model, a panoramic sub-picture with serial number ③ may be rendered in front of the panoramic three-dimensional model, a panoramic sub-picture with serial number ④ may be rendered on the right surface of the panoramic three-dimensional model, a panoramic sub-picture with serial number ⑤ may be rendered on the back surface of the panoramic three-dimensional model, and a panoramic sub-picture with serial number ⑥ may be rendered on the bottom surface of the panoramic three-dimensional model, so as to generate a three-dimensional panoramic image.
Fig. 6 is another flowchart of a method for generating a panoramic image, which is executed on a server according to an embodiment. Specifically, as shown in fig. 6, the method for generating a panoramic image includes the following steps:
and S210, acquiring a plurality of panoramic sub-pictures of the panoramic image.
The server acquires a plurality of panoramic sub-pictures which are uploaded from the client and shot at different angles, wherein the panoramic sub-pictures can be spliced into a panoramic image. In some embodiments, the panoramic sub-picture may be a panoramic sub-picture carried by the system itself, and may also be a historical panoramic sub-picture uploaded by the client.
And S220, splicing the plurality of panoramic sub-pictures into a background image according to a preset layout to obtain a composite picture.
In one embodiment, when the set panoramic gift issuing time is reached, the server automatically issues the composite picture of the panoramic gift to each client entering the live broadcast room. The client receives a composite picture of the panoramic gift sent by the live broadcast server, and the composite picture can be obtained by splicing a plurality of panoramic sub-pictures in a background image by the server according to a preset layout. Optionally, the background image may be a solid background image, and further, the color of the solid background image is preferably different from the color related to the panoramic sub-picture. Since the panoramic image is a three-dimensional image, in an embodiment, the preset layout may be an expanded view of the three-dimensional image. Optionally, there may be a gap between the panoramic sub-pictures, or there may be no gap for close splicing.
In one embodiment, when the user presents the panoramic gift to the client, the server determines whether a synthetic picture of the corresponding panoramic image, such as a sky box picture, is generated, if so, the server directly issues the synthetic picture to the client, if not, the plurality of panoramic sub-pictures are pieced together in a background image according to a preset layout to generate the synthetic picture, wherein the background image may be a solid color image, such as a solid white picture, with a size of 2000 × 1500, if the panoramic sub-picture is set to be square, each panoramic sub-picture has a size of 500 × 500, and the server places a top picture of the panoramic image, such as a cubic sky box panoramic image, at a position (500,0) of the background image, a left picture at a position (0,500), a front picture at a position (500 ), and a right picture at a position (1000, 500), and (5) placing the post-picture at (1500, 500), placing the base picture at (500,1000), and splicing to obtain a composite picture, wherein the format of the composite picture can be a jpg format and the like.
S230, issuing the synthesized picture to a client; and scanning the synthesized picture row by row and column by the client to obtain an edge pixel point array of the panoramic sub-picture on a background image, determining an edge line of the panoramic sub-picture according to the edge pixel point array and the layout, cutting the synthesized picture along the edge line, extracting each panoramic sub-picture, and rendering the panoramic sub-picture to generate the panoramic image.
In an embodiment, the color of the background image is different from the color of the portion near the edge in the composite picture, and the client may scan the composite picture row by row and column by column. Because the colour of background image is more single, when being pure color background image, when scanning non-panorama subpicture portion part, also be the colour value of the background image of pure color and can not change, when the colour value jumps, scan the edge of panorama subpicture, record the marginal pixel point that the colour value takes place the jump department. In order to record and store the edge pixel points, a set of edge pixel points of the panoramic sub-picture on a plurality of rows and a plurality of columns on the background image can be obtained, and the set of the edge pixel points is expressed in an array mode to obtain an edge pixel point array.
The edge pixel array may include information such as position information and color values of the edge pixels. In an embodiment, the same panoramic image may correspond to layouts of multiple panoramic image sub-pictures on the background image, and taking a cubic panoramic image as an example, the preset layout may be a cubic expansion image.
Each edge line of the panoramic sub-picture exhibits a certain regularity, for example, in some embodiments, the abscissa of the pixel point on the same edge line may be the same, or the ordinate may be the same, or the abscissa and the ordinate exhibit a certain regularity to increase or decrease, and the like. And comparing the horizontal and vertical coordinates of each pixel point recorded by the edge pixel point array, determining the change characteristics of the horizontal and vertical coordinates of each edge pixel point, determining the side length, turning points and other characteristics of the panoramic sub-picture, and determining the edge line of the panoramic sub-picture in the background picture by combining the layout of the panoramic sub-picture in the background picture.
And cutting the synthesized picture along the edge line of the panoramic sub-picture, removing corner departments except the panoramic sub-picture, extracting each panoramic sub-picture, and rendering the panoramic sub-picture at a preset position to obtain a panoramic image. Optionally, the panoramic sub-pictures may be mapped onto a surface corresponding to the three-dimensional model to render the image, so as to obtain a panoramic image, or the panoramic sub-pictures may be spliced and rendered to obtain a panoramic image.
In the method for generating a panoramic image provided by the embodiment, a plurality of panoramic sub-pictures of the panoramic image are acquired; splicing a plurality of panoramic sub-pictures into a background image according to a preset layout to obtain a synthetic picture; issuing the synthesized picture to the client; enabling the client to scan the synthesized picture row by row and column by column to obtain an edge pixel point array of the panoramic sub-picture on the background image; and determining the edge lines of the panoramic sub-pictures according to the edge pixel point arrays and the layout, cutting the synthesized picture along the edge lines, extracting each panoramic sub-picture, and rendering the panoramic sub-pictures to generate panoramic images, so that the panoramic sub-pictures are compressed, the data volume of picture transmission is reduced, and the transmission efficiency is improved.
The following explains a related embodiment of the panoramic image generation apparatus in detail.
Fig. 7 is a schematic structural diagram of an apparatus for generating a panoramic image according to an embodiment, where the apparatus for generating a panoramic image may be implemented in a computer device, such as a device for generating a panoramic image, and further, the device for generating a panoramic image may be a client, such as a broadcaster and a viewer. This embodiment will be described by taking a viewer client as an example of a panoramic image generation device.
Specifically, as shown in fig. 7, the panoramic image generation apparatus 100 may include: a composite picture receiving module 110, an edge pixel obtaining module 120, and a panorama image rendering module 130.
The composite picture receiving module 110 is configured to receive a composite picture sent by a live broadcast server; the synthetic picture is obtained by splicing a plurality of panoramic sub-pictures into a background image according to a preset layout; an edge pixel obtaining module 120, configured to scan the synthesized picture row by row and column by column, and obtain an edge pixel point array of the panoramic sub-picture on a background image; and the panoramic image rendering module 130 is configured to determine an edge line of the panoramic sub-picture according to the edge pixel point array and the layout, cut the synthesized picture along the edge line, extract each panoramic sub-picture, and render the panoramic sub-picture to generate a panoramic image.
The device for generating the panoramic image provided by the embodiment is used for receiving a synthetic picture which is sent by a live broadcast server and is obtained by splicing a plurality of panoramic sub-pictures in a background image according to a preset layout, scanning the synthetic picture row by row and column by column, acquiring an edge pixel point array of the panoramic sub-pictures on the background image, determining an edge line of the panoramic sub-pictures according to the edge pixel point array and the layout, cutting the synthetic picture along the edge line and extracting each panoramic sub-picture, rendering the panoramic sub-pictures to generate the panoramic image, compressing the panoramic sub-pictures, reducing the data volume of picture transmission and improving the transmission efficiency.
In one embodiment, the background image is a solid color image.
The edge pixel obtaining module 120 includes: the edge pixel point recording unit and the edge pixel point array generating unit;
the edge pixel point recording unit is used for stopping the line or the line scanning when a first pixel point different from the background color value of the pure color image is obtained in the scanning of the synthetic picture, and recording the current pixel point as an edge pixel point; and the edge pixel point array generating unit is used for acquiring the edge pixel points of each row and each column and respectively generating a row edge pixel point array and a column edge pixel point array of the panoramic sub-picture on the background image.
In one embodiment, the edge pixel point recording unit includes: a row edge pixel point recording subunit and a column edge pixel point recording subunit;
a line edge pixel point recording subunit, configured to, during the line-by-line scanning process of the synthesized picture, obtain a color value of a scanned pixel point in real time, terminate the line scanning at a first color value jump, and record a pixel point at the color value jump as a line edge pixel point;
and the column edge pixel point recording subunit is used for acquiring the color value of the scanned pixel point in real time in the column-by-column scanning process, stopping the column scanning at the first color value jumping position, and recording the pixel point at the color value jumping position at the moment as the column edge pixel point.
In an embodiment, the panorama image rendering module includes: the device comprises a position coordinate obtaining unit, a side length determining unit and an edge line obtaining unit;
the position coordinate acquisition unit is used for acquiring the numerical value of the position coordinate of each edge pixel in the edge pixel array; the side length determining unit is used for determining the side length of the panoramic sub-picture according to the numerical value of the position coordinate with the maximum number; and the edge line obtaining unit is used for obtaining the edge line of the panoramic sub-picture according to the side length and the layout.
In one embodiment, the panoramic sub-picture is a square pattern picture.
In an embodiment, the panorama image rendering module includes: a panoramic sub-picture extracting unit and a panoramic image generating unit;
the panoramic sub-picture extracting unit is used for cutting the synthesized picture along the edge line and extracting panoramic sub-pictures with square patterns; and a panoramic image generation unit used for rendering the panoramic sub-picture according to a set mode and generating a panoramic image with a cubic style.
In an embodiment, the panorama image rendering module 130 includes: the device comprises a first panoramic image generation unit and a live broadcast room panoramic image rendering unit;
the first panoramic image generation unit is used for splicing and rendering all the panoramic sub-pictures to generate a first panoramic image; and the live broadcast room panoramic image rendering unit is used for fusing live broadcast video of the anchor broadcast into the first panoramic image for playing and rendering a panoramic image of the three-dimensional live broadcast room.
Fig. 8 is another schematic structural diagram of a panoramic image generation apparatus provided in an embodiment, which may be implemented in a computer device, such as a panoramic image generation device, and further, the panoramic image generation device may be a server or the like. The present embodiment is described taking a server as an example of a panoramic image generation apparatus.
Specifically, as shown in fig. 8, the panoramic image generation apparatus 200 may include: a panorama sub-picture obtaining module 210, a composite picture generating module 220, and a composite picture issuing module 230.
The panoramic sub-picture acquiring module 210 is configured to acquire a plurality of panoramic sub-pictures of a panoramic image; a synthesized picture generating module 220, configured to splice the multiple panoramic sub-pictures into a background image according to a preset layout to obtain a synthesized picture; a composite picture issuing module 230, configured to issue the composite picture to a client; and scanning the synthesized picture row by row and column by the client to obtain an edge pixel point array of the panoramic sub-picture on a background image, determining an edge line of the panoramic sub-picture according to the edge pixel point array and the layout, cutting the synthesized picture along the edge line, extracting each panoramic sub-picture, and rendering the panoramic sub-picture to generate the panoramic image.
The panoramic image generation device provided by the above can be used for executing the panoramic image generation method provided by any of the above embodiments, and has corresponding functions and advantages.
An embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the method for generating a panoramic image in any of the above embodiments.
The computer device provided above has corresponding functions and advantages when executing the method for generating a panoramic image provided in any of the above embodiments.
Embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a method for generating a panoramic image, including:
receiving a composite picture sent by a live broadcast server; the synthetic picture is obtained by splicing a plurality of panoramic sub-pictures into a background image according to a preset layout;
scanning the synthesized picture row by row and column by column to obtain an edge pixel point array of the panoramic sub-picture on a background image;
and determining the edge line of the panoramic sub-picture according to the edge pixel point array and the layout, cutting the synthesized picture along the edge line, extracting each panoramic sub-picture, and rendering the panoramic sub-pictures to generate the panoramic image.
The computer executable instructions, when executed by a computer processor, are further for performing a method of generating a panoramic image, comprising:
acquiring a plurality of panoramic sub-pictures of the panoramic image;
splicing the plurality of panoramic sub-pictures into a background image according to a preset layout to obtain a synthetic picture;
issuing the synthesized picture to a client; enabling the client to scan the synthesized picture row by row and column by column to obtain an edge pixel point array of the panoramic sub-picture on a background image;
and determining the edge line of the panoramic sub-picture according to the edge pixel point array and the layout, cutting the synthesized picture along the edge line, extracting each panoramic sub-picture, and rendering the panoramic sub-pictures to generate the panoramic image.
Of course, the storage medium containing the computer-executable instructions provided by the embodiments of the present invention is not limited to the operations of the panoramic image generation method described above, and may also perform related operations in the panoramic image generation method provided by any embodiments of the present invention, and has corresponding functions and advantages.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, and the computer software product may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk, or an optical disk of a computer, and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) to execute the method for generating a panoramic image according to any embodiment of the present invention.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, several modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.
Claims (11)
1. A method for generating a panoramic image, comprising the steps of:
receiving a composite picture sent by a live broadcast server; the synthetic picture is obtained by splicing a plurality of panoramic sub-pictures into a background image according to a preset layout;
scanning the synthesized picture row by row and column by column to obtain an edge pixel point array of the panoramic sub-picture on a background image;
and determining the edge line of the panoramic sub-picture according to the edge pixel point array and the layout, cutting the synthesized picture along the edge line, extracting each panoramic sub-picture, and rendering the panoramic sub-pictures to generate the panoramic image.
2. The method for generating a panoramic image according to claim 1, wherein the background image is a solid image;
the step of scanning the synthesized picture row by row and column by column to obtain the edge pixel point array of the panoramic sub-picture on the background image comprises the following steps:
in the scanning of the synthesized picture, stopping the scanning of the line or the line when a first pixel point which is different from the background color value of the pure color image is obtained, and recording the current pixel point as an edge pixel point;
and acquiring the edge pixel points of each row and each column, and respectively generating a row edge pixel point array and a column edge pixel point array of the panoramic sub-picture on the background image.
3. The method for generating the panoramic image according to claim 2, wherein in the scanning of the composite image, when a first pixel point different from the background color value of the solid image is obtained, the step of terminating the scanning of the line or the column and recording the pixel point at that time as an edge pixel point comprises:
in the process of scanning the synthesized picture line by line, acquiring color values of scanned pixel points in real time, stopping the line scanning at a first color value jumping position, and recording the pixel points at the color value jumping position as line edge pixel points;
and in the column-by-column scanning process, the color value of the scanned pixel point is acquired in real time, the column scanning of this time is stopped at the first color value jumping position, and the pixel point at the color value jumping position at this time is recorded as a column edge pixel point.
4. The method of claim 1, wherein the step of determining the edge lines of the panoramic sub-picture according to the array of edge pixels and the layout comprises:
acquiring the numerical value of the position coordinate of each edge pixel in the edge pixel array;
determining the side length of the panoramic sub-picture according to the numerical value of the position coordinate with the maximum number;
and obtaining the edge line of the panoramic sub-picture according to the side length and the layout.
5. The method of claim 1, wherein the step of cropping the composite picture along the edge lines to extract respective panoramic sub-pictures, and rendering the panoramic sub-pictures to generate a panoramic image comprises:
cutting the composite picture along the edge line, and extracting each panoramic sub-picture with a square pattern;
rendering the panoramic sub-picture according to a set mode to generate a panoramic image in a cubic style.
6. The method for generating a panoramic image according to claim 1, wherein the step of rendering the panoramic sub-picture to generate the panoramic image comprises:
splicing and rendering all the panoramic sub-pictures to generate a first panoramic image;
and fusing the live broadcast video of the main broadcast into the first panoramic image for playing, and rendering a panoramic image of the three-dimensional live broadcast room.
7. A method for generating a panoramic image, comprising the steps of:
acquiring a plurality of panoramic sub-pictures of the panoramic image;
splicing the plurality of panoramic sub-pictures into a background image according to a preset layout to obtain a synthetic picture;
issuing the synthesized picture to a client side, so that the client side scans the synthesized picture row by row and column by column, and an edge pixel point array of the panoramic sub-picture on a background image is obtained;
and determining the edge line of the panoramic sub-picture according to the edge pixel point array and the layout, cutting the synthesized picture along the edge line, extracting each panoramic sub-picture, and rendering the panoramic sub-pictures to generate the panoramic image.
8. An apparatus for generating a panoramic image, comprising:
the composite picture receiving module is used for receiving a composite picture sent by a live broadcast server; the synthetic picture is obtained by splicing a plurality of panoramic sub-pictures into a background image according to a preset layout;
the edge pixel acquisition module is used for scanning the synthesized picture row by row and column by column to acquire an edge pixel point array of the panoramic sub-picture on a background image;
and the panoramic image rendering module is used for determining the edge lines of the panoramic sub-pictures according to the edge pixel point arrays and the layout, cutting the synthesized picture along the edge lines, extracting each panoramic sub-picture, and rendering the panoramic sub-pictures to generate the panoramic image.
9. An apparatus for generating a panoramic image, comprising:
the panoramic sub-picture acquisition module is used for acquiring a plurality of panoramic sub-pictures of the panoramic image;
the synthetic picture generation module is used for splicing the plurality of panoramic sub-pictures into a background image according to a preset layout to obtain a synthetic picture;
the synthesized picture issuing module is used for issuing the synthesized picture to the client; and scanning the synthesized picture row by row and column by the client to obtain an edge pixel point array of the panoramic sub-picture on a background image, determining an edge line of the panoramic sub-picture according to the edge pixel point array and the layout, cutting the synthesized picture along the edge line, extracting each panoramic sub-picture, and rendering the panoramic sub-picture to generate the panoramic image.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method for generating a panoramic image according to any one of claims 1 to 6 when executing said program.
11. A storage medium containing computer executable instructions for performing the steps of the method of generating a panoramic image according to any one of claims 1 to 6 when executed by a computer processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010117557.9A CN111314729A (en) | 2020-02-25 | 2020-02-25 | Panoramic image generation method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010117557.9A CN111314729A (en) | 2020-02-25 | 2020-02-25 | Panoramic image generation method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111314729A true CN111314729A (en) | 2020-06-19 |
Family
ID=71162146
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010117557.9A Pending CN111314729A (en) | 2020-02-25 | 2020-02-25 | Panoramic image generation method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111314729A (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103177472A (en) * | 2012-09-20 | 2013-06-26 | 深圳市金立通信设备有限公司 | System and method for three-dimensional panoramic picture synthesis and display |
US20150193970A1 (en) * | 2012-08-01 | 2015-07-09 | Chengdu Idealsee Technology Co., Ltd. | Video playing method and system based on augmented reality technology and mobile terminal |
CN204948208U (en) * | 2015-09-18 | 2016-01-06 | 成都易瞳科技有限公司 | Panoramic picture image collection system |
CN106611403A (en) * | 2016-05-25 | 2017-05-03 | 北京数科技有限公司 | Image mosaicing method and apparatus |
CN106686397A (en) * | 2016-12-31 | 2017-05-17 | 北京星辰美豆文化传播有限公司 | Multi-person network broadcasting method and device and electronic equipment thereof |
CN107306347A (en) * | 2016-04-18 | 2017-10-31 | 中国科学院宁波材料技术与工程研究所 | A kind of real-time video streaming transmission method based on spliced panoramic camera |
CN107945112A (en) * | 2017-11-17 | 2018-04-20 | 浙江大华技术股份有限公司 | A kind of Panorama Mosaic method and device |
CN108322727A (en) * | 2018-02-28 | 2018-07-24 | 北京搜狐新媒体信息技术有限公司 | A kind of panoramic video transmission method and device |
CN109661816A (en) * | 2018-11-21 | 2019-04-19 | 京东方科技集团股份有限公司 | The method and display device of panoramic picture are generated and shown based on rendering engine |
-
2020
- 2020-02-25 CN CN202010117557.9A patent/CN111314729A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150193970A1 (en) * | 2012-08-01 | 2015-07-09 | Chengdu Idealsee Technology Co., Ltd. | Video playing method and system based on augmented reality technology and mobile terminal |
CN103177472A (en) * | 2012-09-20 | 2013-06-26 | 深圳市金立通信设备有限公司 | System and method for three-dimensional panoramic picture synthesis and display |
CN204948208U (en) * | 2015-09-18 | 2016-01-06 | 成都易瞳科技有限公司 | Panoramic picture image collection system |
CN107306347A (en) * | 2016-04-18 | 2017-10-31 | 中国科学院宁波材料技术与工程研究所 | A kind of real-time video streaming transmission method based on spliced panoramic camera |
CN106611403A (en) * | 2016-05-25 | 2017-05-03 | 北京数科技有限公司 | Image mosaicing method and apparatus |
CN106686397A (en) * | 2016-12-31 | 2017-05-17 | 北京星辰美豆文化传播有限公司 | Multi-person network broadcasting method and device and electronic equipment thereof |
CN107945112A (en) * | 2017-11-17 | 2018-04-20 | 浙江大华技术股份有限公司 | A kind of Panorama Mosaic method and device |
CN108322727A (en) * | 2018-02-28 | 2018-07-24 | 北京搜狐新媒体信息技术有限公司 | A kind of panoramic video transmission method and device |
CN109661816A (en) * | 2018-11-21 | 2019-04-19 | 京东方科技集团股份有限公司 | The method and display device of panoramic picture are generated and shown based on rendering engine |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111526412A (en) | Panoramic live broadcast method, device, equipment and storage medium | |
CN108124109A (en) | A kind of method for processing video frequency, equipment and computer readable storage medium | |
JP5851625B2 (en) | Stereoscopic video processing apparatus, stereoscopic video processing method, and stereoscopic video processing program | |
JP2013539256A (en) | Method for synthesizing images related to three-dimensional content | |
JP2012085301A (en) | Three-dimensional video signal processing method and portable three-dimensional display device embodying the method | |
CN113206992A (en) | Method for converting projection format of panoramic video and display equipment | |
CN111556357B (en) | Method, device and equipment for playing live video and storage medium | |
EP3434021B1 (en) | Method, apparatus and stream of formatting an immersive video for legacy and immersive rendering devices | |
KR20180076720A (en) | Video transmitting device and video playing device | |
WO2013104142A1 (en) | Video player, mobile terminal, and video playing method of mobile terminal | |
CN113747240A (en) | Video processing method, apparatus, storage medium, and program product | |
JP6934052B2 (en) | Display control device, display control method and program | |
CN114449303A (en) | Live broadcast picture generation method and device, storage medium and electronic device | |
JP2007522732A (en) | Changing the aspect ratio of the image displayed on the screen | |
CN111314729A (en) | Panoramic image generation method, device, equipment and storage medium | |
CN115580738B (en) | High-resolution video display method, device and system for on-demand transmission | |
KR20040024340A (en) | System for producing image album on digital television receiver using moving image capture and method therefor | |
WO2023029252A1 (en) | Multi-viewpoint video data processing method, device, and storage medium | |
JP2002336542A (en) | Videogame device, videogame screen control program, and its recording medium | |
JP2013518458A (en) | Method for transferring information and / or application data in a digital video stream and associated apparatus for generating and playing a video stream | |
CN116962744A (en) | Live webcast link interaction method, device and live broadcast system | |
KR101285382B1 (en) | A device having function editting of image and Method thereof | |
JP3391786B2 (en) | Image display control method and apparatus | |
CN113573117A (en) | Video live broadcast method and device and computer equipment | |
CN105100873A (en) | Method and device for synthesizing interaction signal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20210108 Address after: 511442 3108, 79 Wanbo 2nd Road, Nancun Town, Panyu District, Guangzhou City, Guangdong Province Applicant after: GUANGZHOU CUBESILI INFORMATION TECHNOLOGY Co.,Ltd. Address before: 29th floor, building B-1, Wanda Plaza, Wanbo business district, Nancun Town, Panyu District, Guangzhou City, Guangdong Province Applicant before: GUANGZHOU HUADUO NETWORK TECHNOLOGY Co.,Ltd. |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200619 |