WO2024060281A1 - Video splitting method and apparatus based on panoramic image, and device and storage medium - Google Patents

Video splitting method and apparatus based on panoramic image, and device and storage medium Download PDF

Info

Publication number
WO2024060281A1
WO2024060281A1 PCT/CN2022/122388 CN2022122388W WO2024060281A1 WO 2024060281 A1 WO2024060281 A1 WO 2024060281A1 CN 2022122388 W CN2022122388 W CN 2022122388W WO 2024060281 A1 WO2024060281 A1 WO 2024060281A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
panoramic
split
row
panoramic image
Prior art date
Application number
PCT/CN2022/122388
Other languages
French (fr)
Chinese (zh)
Inventor
邢冬逢
李国强
Original Assignee
深圳看到科技有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 深圳看到科技有限公司 filed Critical 深圳看到科技有限公司
Publication of WO2024060281A1 publication Critical patent/WO2024060281A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/268Signal distribution or switching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast

Definitions

  • the present invention relates to the technical field of image processing, and in particular to a video streaming method, device, equipment and storage medium based on panoramic images.
  • the existing security system uses multiple monitoring devices to monitor different directions of the same area, thereby achieving coverage of the same monitoring area.
  • multiple devices need to be equipped with corresponding processing equipment to process the images of each device, resulting in increased system deployment costs; therefore, existing security systems have gradually begun to use panoramic camera equipment to cover the monitoring area.
  • panoramic images output by panoramic camera equipment have a large resolution. Loading and outputting large-resolution images requires powerful data processing capabilities.
  • Existing monitoring equipment generally copies panoramic images in segments and then encodes the copied partial images.
  • the image data processing volume is large and the efficiency of the diversion output of panoramic images is low. Therefore, how to solve the low efficiency of the existing diversion output of panoramic images has become a technical problem that needs to be solved urgently.
  • the main purpose of the present invention is to provide a video streaming method, device, equipment and storage medium based on panoramic images, aiming to solve the technical problem of low efficiency in the streaming output of existing panoramic images.
  • the panoramic image-based video offloading method includes: setting the offloading image size according to the effective resolution of the panoramic image; Assume that the overlapping area size and the split image are at the preset coordinate position of the panoramic image, and set the starting coordinates of each split image; set the split image size, the row pixel value of the panoramic image, and each split image The starting coordinates are input to the row stride encoder to output the shunt image.
  • the present invention also provides a panoramic image-based video splitting device.
  • the panoramic image-based video splitting device includes: a splitting image size setting module for setting the splitting according to the effective resolution of the panoramic image. Image size; starting coordinate setting module, used to set the starting coordinates of each shunt image according to the shunt image size, the preset overlap area size and the preset coordinate position of the shunt image in the panoramic image; shunt image An output module is configured to input the split image size, the row pixel value of the panoramic image, and the starting coordinates of each split image to a row stride encoder to output the split image.
  • the present invention also provides a panoramic image-based video streaming device.
  • the panoramic image-based video streaming device includes a processor, a memory, and a device that is stored on the memory and can be used by the processor.
  • a panoramic image-based video offloading program is executed, wherein when the panoramic image-based video offloading program is executed by the processor, the above panoramic image-based video offloading steps are implemented.
  • the present invention also provides a computer-readable storage medium, which stores a panoramic image-based video streaming program, wherein the panoramic image-based video streaming program is processed by a processor. When executed, the steps of the above panoramic image-based video offloading method are implemented.
  • the present invention provides a video shunting method based on a panoramic image, wherein the method sets the size of the shunting image according to the effective resolution of the panoramic image; sets the starting coordinates of each shunting image according to the size of the shunting image, the size of the preset overlapping area, and the preset coordinate position of the shunting image in the panoramic image; and inputs the size of the shunting image, the row pixel value of the panoramic image, and the starting coordinates of each shunting image into a row stride encoder to output the shunting image.
  • the present invention determines the size of the shunting image according to the resolution of the panoramic image, and sets the starting coordinates of the shunting image in the panoramic image, and then according to the preset overlapping image, the starting coordinates of all shunting images in the panoramic image can be determined in sequence; the image data of the panoramic image is read through the row stride encoder, and according to the starting coordinates of the shunting image and the size of the shunting image, the shunting image data can be directly output from the panoramic image data, thereby outputting the shunting image, without the need to copy, crop, and then splice the panoramic image, thereby reducing the amount of data processing, improving the shunting output efficiency of the panoramic image, and solving the technical problem of low shunting output efficiency of the existing panoramic image.
  • Figure 1 is a schematic diagram of the hardware structure of a panoramic image-based video streaming device involved in the embodiment of the present invention.
  • FIG. 2 is a flow chart of a first embodiment of a video splitting method based on panoramic images according to the present invention.
  • Figure 3 is a schematic flowchart of the second embodiment of the panoramic image-based video offloading method of the present invention.
  • Figure 4 is a schematic diagram of image offloading of the panoramic image-based video offloading method of the present invention.
  • FIG. 5 is a schematic flowchart of the third embodiment of the panoramic image-based video offloading method of the present invention.
  • Figure 6 is a schematic flowchart of the fourth embodiment of the panoramic image-based video offloading method of the present invention.
  • Figure 7 is a schematic diagram of the functional modules of the first embodiment of the panoramic image-based video streaming device of the present invention.
  • the panoramic image-based video offloading method involved in the embodiment of the present invention is mainly applied to the panoramic image-based video offloading device.
  • the panoramic image-based video offloading device can be a PC, a portable computer, a mobile terminal and other devices with display and processing functions.
  • FIG. 1 is a schematic diagram of the hardware structure of a panoramic image-based video streaming device involved in the embodiment of the present invention.
  • the panoramic image-based video distribution device may include a processor 1001 (such as a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005.
  • the communication bus 1002 is used to realize connection and communication between these components;
  • the user interface 1003 can include a display screen (Display) and an input unit such as a keyboard (Keyboard);
  • the network interface 1004 can optionally include a standard wired interface and a wireless interface. (such as WI-FI interface);
  • the memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as disk memory.
  • the memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
  • Figure 1 does not constitute a limitation on the video streaming device based on panoramic images, and may include more or less components than shown, or some components may be combined or different. component layout.
  • the memory 1005 as a computer-readable storage medium in FIG. 1 may include an operating system, a network communication module, and a panoramic image-based video streaming program.
  • the network communication module is mainly used to connect to the server and perform data communication with the server; and the processor 1001 can call the panoramic image-based video streaming program stored in the memory 1005, and execute the panoramic image-based video streaming program provided by the embodiment of the present invention. video offloading method.
  • the embodiment of the present invention provides a video streaming method based on panoramic images.
  • FIG. 2 is a schematic flowchart of the first embodiment of the panoramic image-based video offloading method of the present invention.
  • the panoramic image-based video offloading method includes the following steps:
  • Step S10 set the size of the shunt image according to the effective resolution of the panoramic image
  • the panoramic image is captured by a panoramic camera.
  • the panoramic camera collects images through at least two fisheye lenses and splices them into a 360-degree panoramic video stream.
  • the resolution of the panoramic image is 7680 ⁇ 3840
  • the effective resolution after cropping is 7680 ⁇ 1440
  • a total of 2000 rows of pixel values are cropped at the top and bottom.
  • the panoramic image only has distortion at the upper and lower ends, and the pixels in the middle row will not be distorted.
  • the pixel row values of the panoramic image decrease, and The column values have not changed, so the effective resolution of the panorama image is the product of the original column values of the panorama image and the cropped row values.
  • the effective row pixel value of the panoramic image refers to the column value of the effective resolution, that is, how many pixels a row of the effective resolution has represents how many columns the effective resolution has; the effective column pixel value refers to the row of the effective resolution. Value, that is, how many pixels a column of effective resolution has, indicating how many rows there are of effective resolution.
  • step S10 specifically includes:
  • the row value of the split image resolution is determined based on the effective resolution of the panoramic image.
  • the proportion of the splitting image in the panoramic image is calculated, and the column value of the splitting image resolution is determined.
  • the rows in the effective resolution are value (i.e. width) as the resolution line value of the split image.
  • the row value i.e., width
  • the row value can also be divided, and multiple diversion images can be set to cover the effective resolution of the panoramic image; for example, if the effective resolution row value is 1000, the diversion image resolution row value can be set to 100, and there is a certain overlapping area between the two diversion images to ensure that the panoramic image can be fully covered to avoid image missing.
  • a preset diversion angle is set.
  • the overlapping coverage area needs to be considered here.
  • the area of the panoramic image that can be covered by the preset diversion angle is calculated.
  • the panoramic image resolution column value (i.e., length) contained in the coverage area is the column value of the diverted image resolution.
  • the size of the splitting resolution can be determined.
  • offloading is to intercept pictures of corresponding angles from the panoramic 360-degree picture and send them to the receiving end.
  • the angle is configured in the background (or monitoring), and any angle can be set for each stream.
  • the operating terminal can pull 4 video streams at the same time.
  • the horizontal FOV of each video stream is 120 degrees.
  • adjacent The two video streams overlap by 30 degrees. Taking the panoramic image 7680 ⁇ 1440 as an example, after cutting into 4 streams horizontally, the image resolution of each stream is 2560 ⁇ 1440, and the overlap between two adjacent streams is 640 ⁇ 1440.
  • the angle of each stream of the pulled 4-channel video stream can be set independently. It can be configured to the camera by calling the interface of the camera side through the operation terminal. The camera intercepts the stream of the corresponding angle from the panoramic stream according to this configuration and sends it to the camera. monitor.
  • Step S20 Set the starting coordinates of each split image according to the split image size, the preset overlap area size and the preset coordinate position of the split image in the panoramic image.
  • the encoder when the size of the split image is determined, the encoder needs to be given an encoding starting coordinate so that the encoder can read the split image in the panoramic image; in order to cover all effective areas of the panoramic image and avoid the problem of missing pictures, There needs to be a certain range of preset overlapping areas between shunt images. A reasonable overlap area size can be set based on the size of the shunt images and the number of shunts.
  • the pixels in the first column of the panoramic image can be used as the starting column coordinates of the first split image, and the coordinates of the first row of pixels in the panoramic image at the effective resolution of the panoramic image can be used as the starting row of the first split image.
  • the size of the preset overlapping area cannot be too large, otherwise it will easily lead to excessive picture duplication, data redundancy, and a waste of computing power; it cannot be too small, otherwise the coverage effect will not be achieved. If the edge area of the display device is incompletely displayed, It is easy to cause the edge area of the displayed image to be missing.
  • the size of the overlapping area can be set according to reasonable rules, such as setting the overlapping area to account for 15% of the split image, or when setting the angle of the split image, specifying a certain angle range as the overlapping area, etc.
  • step S20 specifically includes:
  • the readable area of the panoramic image by the row stride encoder is determined.
  • the starting coordinates of the diversion image in the panoramic image are set according to the readable area and the size of the diversion image.
  • the starting coordinates of adjacent split images of the split image are determined according to the preset overlapping image size and the starting coordinates.
  • the starting line coordinates of the split image resolution are set in the readable area; for example, the starting row coordinates of the effective resolution can be used as the starting line coordinates of the first split image resolution.
  • the starting column coordinates of the split image resolution can be set through the operation terminal.
  • the first column of the effective image resolution can be defaulted as the starting column coordinate of the first split image resolution, or any of the effective image resolutions can be set.
  • the resolution coordinates of the first split image in the panoramic image can be determined; and then according to the preset overlapping resolution, each step can be determined in turn.
  • the resolution coordinate of a shunt image in the panoramic image can be determined according to the starting row coordinates and starting column coordinates of the first split image resolution.
  • Step S30 The split image size, the row pixel value of the panoramic image, and the starting coordinates of the split image are input to a row stride encoder to output the split image.
  • the present application utilizes the row stride of the encoder (the row span of the memory image) to directly send the large picture to the encoder.
  • the encoding area is set to 2560 ⁇ 1440
  • the stride is 7680
  • the memory copy part is removed to achieve the required performance.
  • the encoder reads data according to the resolution of the large panoramic image, and reads the pixel data of the panoramic image in sequence according to the row order of the panoramic image resolution; for ease of understanding, each row of pixels of the panoramic image resolution is regarded as a group of data, assuming that the panoramic image is 7680 ⁇ 1440, which means that the stride encoder will read 1440 groups of pixel data; if the starting coordinates of the first shunt image in the panoramic image are (0, 0), then the stride encoder actually needs to encode the 1st data to the 2560th data in each group of pixel data, and the data segment from the 2561st data to the 7680th data of each row does not need to be processed or is directly deleted; that is, when the stride encoder completes the encoding of the 1st data to the 2560th data in the previous row of pixel data, the subsequent data of the previous row is no longer encoded, but continues to be encoded from the 1st data of the next row to the 2560th data of the row
  • the generation process of the first split image based on the panoramic image is as follows:
  • the panoramic image with row pixel values, the split image resolution size (ie split image size) and the starting coordinates of the first split image to be intercepted are input into the encoder, and the encoder calls the memory image row
  • the stride (row stride) plugin processes panoramic images.
  • the encoder reads the row pixel data of the panoramic image in row order, and determines the pixels that need to be encoded in the read panoramic image data according to the starting coordinates of the split image and the row value in the resolution size of the split image.
  • Split image data process the split image data by calling the stride plug-in, and directly output the split image.
  • the resolution size covered by the overlapping area can be calculated based on the preset splitting angle, and the starting point of the second splitting image in the panoramic image can be determined based on the calculation based on the edge pixel column of the first splitting image. Column coordinates.
  • the resolution of each branch image is the same.
  • the end column of the second branch image can be determined; and by analogy, the panoramic position of each branch image can be determined.
  • the starting column and ending column in the image can determine the resolution coordinates of each split image in the panoramic image.
  • the resolution coordinates of each split image to be intercepted are input into the encoder in sequence, the encoding starting coordinates of each split image are determined, and combined with the split image size, the video stream of each split image can be output in sequence.
  • the resolution coordinates of each channel can be determined, and the corresponding image data is read in the panoramic image through the row stride encoder, and then output as By shunting image data, multiple channels of video can be generated sequentially.
  • the data of the panoramic image is read through the row stride encoder, and then the image data corresponding to the shunt image is directly output according to the coordinates of the shunt image in the panoramic image, and the invalid data that is not the shunt image data is not processed or Direct deletion reduces memory pressure and data processing volume, thereby improving the output efficiency of split images.
  • the present invention provides a video splitting method based on panoramic images.
  • the method sets the splitting image size according to the effective resolution of the panoramic image; sets the starting point of the splitting image according to the splitting image size and the preset overlapping image size. Coordinates; input the split image size, the row pixel value of the panoramic image, and the starting coordinate of the split image to the row stride encoder to output the split image.
  • the present invention determines the size of the shunt image according to the resolution of the panoramic image, and sets the starting coordinates of the shunt image in the panoramic image, and then based on the preset overlapping image, can sequentially determine the position of all shunt images in the panoramic image.
  • FIG. 3 is a schematic flowchart of a video offloading method based on panoramic images according to a second embodiment of the present invention.
  • step S30 includes:
  • Step S31 According to the starting coordinates of the split image, run the row stride encoder to read the image data of the panoramic image.
  • Step S32 Determine valid data in the image data read by the row stride encoder based on the split image size and the row pixel values of the panoramic image.
  • the row alignment feature of stride can be used to allow the encoder to output the data of the first 1/4 coding area (2560 ⁇ 1440) in each data cycle in the stride as the data of the split image, and the following 3/4 If the data is deleted as invalid data, the shunt image can be directly output and the processing of redundant data can be avoided.
  • step S32 specifically includes:
  • Panoramic image row pixels are sequentially read through the row stride encoder to obtain panoramic image encoded data.
  • the effective row pixels of each row of the split image in the corresponding row of the panoramic image are determined.
  • valid data of the corresponding split image is determined in the panoramic image encoding data.
  • the effective image resolution of the panoramic image is determined, the invalid pixels are not cropped, so it is necessary to determine the position of the effective resolution in the panoramic image, that is, the first effective resolution The coordinates of the row pixel and the last row pixel in the panoramic image.
  • the encoder operates on the entire panoramic image, while the row stride encoder "screens" the shunt image data directly from the panoramic image data, so to read the shunt image correctly and completely, you need to determine the shunt image
  • the position in the panoramic image is the starting coordinate of the shunt image.
  • the effective resolution starting row can be determined to be located at the row coordinate of the panoramic image according to the distortion filtering operation.
  • the starting column of the first split image can be any column of the effective resolution, and can start from the first column, or it can be Start with other columns.
  • the row stride encoder reads data sequentially according to the rows of the panoramic image. For example, the encoder reads the data of the first row of pixels in the complete panoramic image before reading the second row. The data of pixels, and the data length of each row of pixels is the same. The coordinates of the split image and the resolution size of the split image "tell” the row stride encoder how to "distinguish" valid data and invalid data.
  • the row stride encoder will read all the effective resolution data of the panoramic image, which is arranged in row order according to the effective resolution of the panoramic image, that is, 5000 rows of data, each row of data has 10000 pixel data; assuming that these data are numbered, with 10000 pixel data as a cycle data; when the shunt image data needs to be output, the row stride encoder will start from the 1000th cycle data, starting from the 1000th pixel data in each row of data, and read 3000 pixel data, a total of 1000 corresponding pixel data in the cycle data as valid data, that is, shunt image data, output the valid data, and then convert it into a shunt image; and the other panoramic image data is regarded as invalid data and can be directly deleted.
  • FIG. 4 is a schematic diagram of image offloading based on the panoramic image-based video offloading method of the present invention.
  • the stride encoder reads each row of pixel data of the panoramic image in sequence according to the row order of the panoramic image. In the row corresponding to the row coordinates of the panoramic image of the split image, according to the starting coordinates of each split image, intercept the split image row corresponding to the width value of the split image in the corresponding row pixel data, and then skip the remaining rows of pixel data, Continue to read the corresponding shunt image row in the next row of the panoramic image until the reading of pixel data of all rows of the shunt image is completed.
  • Step S33 Output the valid data through the row stride encoder as split image data to obtain the split image.
  • FIG. 5 is a schematic flowchart of a third embodiment of a video offloading method based on panoramic images of the present invention.
  • step S10 it also includes:
  • Step S01 Screen all pixels of the panoramic image according to a preset distortion threshold, and determine the area where the distortion amount of the pixel is within the distortion threshold as a valid area;
  • Step S02 Determine the effective resolution of the panoramic image according to the pixel values contained in the effective area.
  • the distortion threshold parameter is set, and the distortion amount of each pixel is calculated by measuring the distortion of all pixels of the panoramic image. For more than half of the pixel rows whose pixel distortion is greater than the distortion threshold, it is determined to be an invalid pixel row; For pixel rows in which more than half of the pixel distortion is less than the distortion threshold, it is determined to be a valid pixel row, and distortion correction is performed.
  • distortion also known as distortion
  • distortion is an aberration that can turn straight lines into curves.
  • Wide-angle lenses, zoom lenses, and telephoto lenses can easily cause severe distortion. Tangents are particularly noticeable at the edges of the image, but no distortion is visible for radial lines along the radius. Due to the inherent characteristics of optical lenses, distortion (distortion) is caused in the captured pictures, which is detrimental to the imaging quality.
  • the pixel area determined to be the effective pixel row is regarded as the effective area, and all pixels contained in this area are effective pixels.
  • the effective resolution of the panoramic image can be determined.
  • Figure 6 is a schematic flowchart of a fourth embodiment of a video offloading method based on panoramic images of the present invention.
  • step S30 it also includes:
  • Step S031 determining the missing image size of the edge diversion image according to the diversion image size, the preset overlapping image size and the starting coordinates of the diversion image;
  • Step S032 According to the missing image size, starting from the first column on the other side of the panoramic image, intercept a complementary image with the same size as the missing image;
  • Step S033 Align and splice the supplementary image to the edge position of the panoramic image, and update the panoramic image so that the edge shunt image is read completely.
  • the edge shunt image on one side of the panoramic image is repeated with the shunt image on the other side of the panoramic image, and the encoder reads sequentially according to the image pixel rows. After completing the reading of a row of pixel data, it will jump to the first pixel of the next row of pixels and continue to read backward; when the edge shunt image is repeated with the shunt image on the other side, when the encoder reads the data, the front data and the rear data of each row of pixel data of the edge shunt image correspond to two rows of pixel data of the panoramic image, so each row of pixel data of the edge shunt image is misaligned by one row.
  • the panoramic image needs to be preprocessed before reading the shunt image; that is, the complementary image is intercepted for splicing, and the panoramic image is updated to obtain a panoramic image with a higher resolution and the same screen at both ends.
  • the 4-channel split image in the 4-channel split image, part of it is on the left side of the panoramic image, and the other part is on the right side of the panoramic image. It happens that the leftmost and rightmost parts of the panoramic image can be connected.
  • the image data is also contiguous in the encoder memory (the first pixel of a row follows the last pixel of the previous row).
  • the misalignment of one line is not obvious in the picture.
  • the left image of the panoramic image can be directly spliced to the right image in advance to ensure that the flat image does not span the spliced panoramic image.
  • the size of the missing area can be determined based on the position of the edge shunt image in the panoramic image, and then based on the size of the missing area, an image area of the same size is intercepted on the other side of the panoramic image and spliced to the edge of the panoramic image to form a larger Panoramic image, such as changing the panoramic image from 360 degrees to 390 degrees; then resetting the image parameter value of the modified panoramic image
  • the stride value (the image format and the length and width dimensions of the target image do not need to be modified).
  • Figure 6 is a schematic diagram of the functional modules of the first embodiment of the panoramic image-based video streaming device of the present invention.
  • the panoramic image-based video streaming device includes:
  • a split image size setting module 10 used to set the split image size according to the effective resolution of the panoramic image
  • the starting coordinate setting module 20 is used to set the starting coordinates of each shunt image according to the shunt image size, the preset overlap area size and the preset coordinate position of the shunt image in the panoramic image;
  • the split image output module 30 is configured to input the split image size, the row pixel value of the panoramic image, and the starting coordinates of each split image to a row stride encoder to output the split image.
  • the shunt image output module 30 specifically includes:
  • An image data reading unit configured to run the row stride encoder according to the starting coordinates of the shunt image and read the image data of the panoramic image;
  • a valid data determination unit configured to determine valid data in the image data read by the row stride encoder according to the split image size and the row pixel value of the panoramic image;
  • a split image obtaining unit is configured to output the valid data through the row stride encoder as split image data to obtain the split image.
  • the valid data determination unit specifically includes:
  • the encoding data obtaining subunit is used to sequentially read the panoramic image row pixels through the row stride encoder to obtain the panoramic image encoding data;
  • An effective row pixel determination subunit configured to determine the effective row pixels of each row of the shunt image in the corresponding row of the panoramic image according to the starting coordinates of the shunt image and the size of the shunt image;
  • a valid data determination subunit is configured to determine valid data corresponding to the split image in the panoramic image encoded data according to the valid row pixels.
  • the panoramic image-based video streaming device further includes an effective resolution determination module, which specifically includes:
  • An effective area determination unit configured to screen all pixels of the panoramic image according to a preset distortion threshold, and determine the area in which the distortion amount of the pixel is within the distortion threshold as an effective area;
  • An effective resolution determination unit is configured to determine the effective resolution of the panoramic image according to the pixel values contained in the effective area.
  • the offload image size setting module 10 specifically includes:
  • a row value determination unit configured to determine the row value of the split image resolution according to the effective resolution of the panoramic image
  • a column value determination unit configured to calculate the proportion of the split image in the panoramic image according to the preset split angle, and determine the column value of the split image resolution.
  • the starting coordinate setting module 20 specifically includes:
  • a readable area determination unit configured to determine the readable area of the row stride encoder in the panoramic image according to the effective resolution of the panoramic image
  • a starting coordinate setting unit configured to set the starting coordinates of the split image in the panoramic image according to the readable area and the split image size
  • An adjacent starting coordinate determining unit is configured to determine the starting coordinates of adjacent split images of the split image according to the preset overlapping image size and the starting coordinates.
  • the panoramic image-based video streaming device also includes a panoramic image splicing module, and the panoramic image splicing module specifically includes:
  • a missing image size determination unit configured to determine the missing image size of the edge shunt image according to the shunt image size, the preset overlapping image size and the starting coordinates of the shunt image;
  • a supplementary image interception unit configured to intercept a supplementary image of the same size as the missing image, starting from the first column on the other side of the panoramic image according to the missing image size;
  • An image splicing unit configured to align and splice the complementary image to the edge position of the panoramic image, and update the panoramic image so that the edge shunt image is read completely.
  • each module in the above-mentioned video splitting device based on panoramic images corresponds to each step in the above-mentioned video splitting method embodiment based on panoramic images, and their functions and implementation processes are no longer described one by one here.
  • embodiments of the present invention also provide a computer-readable storage medium.
  • the computer-readable storage medium of the present invention stores a panoramic image-based video streaming program, wherein when the panoramic image-based video streaming program is executed by a processor, the steps of the above panoramic image-based video streaming method are implemented.
  • the application may be used in a variety of general or special purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, including Distributed computing environment for any of the above systems or devices, etc.
  • the application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • the present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network.
  • program modules may be located in both local and remote computer storage media including storage devices.
  • the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation.
  • the technical solution of the present invention can be embodied in the form of a software product that is essentially or contributes to the existing technology.
  • the computer software product is stored in a storage medium (such as ROM/RAM) as mentioned above. , magnetic disk, optical disk), including several instructions to cause a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the method described in various embodiments of the present invention.

Abstract

The present application relates to image processing technology. Provided in the present application are a video splitting method and apparatus based on a panoramic image, and a device and a storage medium. In the method, the size of a split image is determined according to the resolution size of a panoramic image, starting coordinates of the split image in the panoramic image are set, and starting coordinates of all split images in the panoramic image can then be sequentially determined according to the size of the split image and the size of a preset overlapped image; and image data of the panoramic image is read by means of a row stride encoder, and according to the starting coordinates of each split image in the panoramic image and the size of the split image, data of the split images can be directly output from the data of the panoramic image, such that the split images are directly output without the need to perform copying, cropping and splicing on the panoramic image, thereby reducing the memory pressure and data processing amount of a processing device and improving the split output efficiency of the panoramic image.

Description

基于全景图像的视频分流方法、装置、设备及存储介质Panoramic image-based video offloading method, device, equipment and storage medium 技术领域Technical field
本发明涉及图像处理技术领域,尤其涉及一种基于全景图像的视频分流方法、装置、设备及存储介质。The present invention relates to the technical field of image processing, and in particular to a video streaming method, device, equipment and storage medium based on panoramic images.
背景技术Background technique
现有的安防系统,是采用多台监控设备监控同一区域的不同方向,从而实现对同一监控区域的覆盖。但是多台设备需要配备相应的处理设备,对每台设备的图像进行处理,造成系统布设成本提高;所以现有安防系统逐渐开始采用全景摄像设备覆盖监控区域。The existing security system uses multiple monitoring devices to monitor different directions of the same area, thereby achieving coverage of the same monitoring area. However, multiple devices need to be equipped with corresponding processing equipment to process the images of each device, resulting in increased system deployment costs; therefore, existing security systems have gradually begun to use panoramic camera equipment to cover the monitoring area.
技术问题technical problem
但是全景摄像设备输出的全景图像分辨率较大,对大分辨率图像的加载和输出需要强大的数据处理能力,现有监控设备一般是通过对全景图像分段拷贝,再对拷贝出来的部分图像进行编码,图像数据处理量大,全景图像的分流输出效率低下。因此,如何解决现有全景图像的分流输出效率低下成为了目前亟待解决的技术问题。However, the panoramic images output by panoramic camera equipment have a large resolution. Loading and outputting large-resolution images requires powerful data processing capabilities. Existing monitoring equipment generally copies panoramic images in segments and then encodes the copied partial images. The image data processing volume is large and the efficiency of the diversion output of panoramic images is low. Therefore, how to solve the low efficiency of the existing diversion output of panoramic images has become a technical problem that needs to be solved urgently.
技术解决方案Technical solutions
本发明的主要目的在于提供一种基于全景图像的视频分流方法、装置、设备及存储介质,旨在解决现有全景图像的分流输出效率低下的技术问题。The main purpose of the present invention is to provide a video streaming method, device, equipment and storage medium based on panoramic images, aiming to solve the technical problem of low efficiency in the streaming output of existing panoramic images.
为实现上述目的,本发明提供一种基于全景图像的视频分流方法,所述基于全景图像的视频分流方法包括:根据全景图像的有效分辨率,设置分流图像尺寸;根据所述分流图像尺寸、预设重叠区域尺寸以及所述分流图像在所述全景图像的预设坐标位置,设置各分流图像的起始坐标;将所述分流图像尺寸、所述全景图像的行像素值以及所述各分流图像的起始坐标输入到行stride编码器,以输出所述分流图像。In order to achieve the above object, the present invention provides a panoramic image-based video offloading method. The panoramic image-based video offloading method includes: setting the offloading image size according to the effective resolution of the panoramic image; Assume that the overlapping area size and the split image are at the preset coordinate position of the panoramic image, and set the starting coordinates of each split image; set the split image size, the row pixel value of the panoramic image, and each split image The starting coordinates are input to the row stride encoder to output the shunt image.
此外,为实现上述目的,本发明还提供一种基于全景图像的视频分流装置,所述基于全景图像的视频分流装置包括:分流图像尺寸设置模块,用于根据全景图像的有效分辨率,设置分流图像尺寸;起始坐标设置模块,用于根据所述分流图像尺寸、预设重叠区域尺寸以及所述分流图像在所述全景图像的预设坐标位置,设置各分流图像的起始坐标;分流图像输出模块,用于将所述分流图像尺寸、所述全景图像的行像素值以及所述各分流图像的起始坐标输入到行stride编码器,以输出所述分流图像。In addition, to achieve the above object, the present invention also provides a panoramic image-based video splitting device. The panoramic image-based video splitting device includes: a splitting image size setting module for setting the splitting according to the effective resolution of the panoramic image. Image size; starting coordinate setting module, used to set the starting coordinates of each shunt image according to the shunt image size, the preset overlap area size and the preset coordinate position of the shunt image in the panoramic image; shunt image An output module is configured to input the split image size, the row pixel value of the panoramic image, and the starting coordinates of each split image to a row stride encoder to output the split image.
此外,为实现上述目的,本发明还提供一种基于全景图像的视频分流设备,所述基于全景图像的视频分流设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的基于全景图像的视频分流程序,其中所述基于全景图像的视频分流程序被所述处理器执行时,实现如上述的基于全景图像的视频分流的步骤。In addition, to achieve the above object, the present invention also provides a panoramic image-based video streaming device. The panoramic image-based video streaming device includes a processor, a memory, and a device that is stored on the memory and can be used by the processor. A panoramic image-based video offloading program is executed, wherein when the panoramic image-based video offloading program is executed by the processor, the above panoramic image-based video offloading steps are implemented.
此外,为实现上述目的,本发明还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有基于全景图像的视频分流程序,其中所述基于全景图像的视频分流程序被处理器执行时,实现如上述的基于全景图像的视频分流方法的步骤。In addition, to achieve the above object, the present invention also provides a computer-readable storage medium, which stores a panoramic image-based video streaming program, wherein the panoramic image-based video streaming program is processed by a processor. When executed, the steps of the above panoramic image-based video offloading method are implemented.
有益效果beneficial effects
本发明提供一种基于全景图像的视频分流方法,所述方法根据全景图像的有效分辨率,设置分流图像尺寸;根据所述分流图像尺寸、预设重叠区域尺寸以及所述分流图像在所述全景图像的预设坐标位置,设置各分流图像的起始坐标;将所述分流图像尺寸、所述全景图像的行像素值以及所述各分流图像的起始坐标输入到行stride编码器,以输出所述分流图像。通过上述方式,本发明根据全景图像的分辨率大小,确定分流图像的尺寸大小,并且设置分流图像在全景图像中的起始坐标,再根据预设重叠图像,可以依次确定所有分流图像在全景图像中的起始坐标;通过行stride编码器读取全景图像的图像数据,并且根据分流图像的起始坐标以及分流图像大小,可以直接从全景图像数据中输出分流图像数据,从而输出分流图像,不需要将全景图像进行拷贝、裁剪再拼接,减少了数据处理量,提高了全景图像的分流输出效率,解决了现有全景图像的分流输出效率低下的技术问题。The present invention provides a video shunting method based on a panoramic image, wherein the method sets the size of the shunting image according to the effective resolution of the panoramic image; sets the starting coordinates of each shunting image according to the size of the shunting image, the size of the preset overlapping area, and the preset coordinate position of the shunting image in the panoramic image; and inputs the size of the shunting image, the row pixel value of the panoramic image, and the starting coordinates of each shunting image into a row stride encoder to output the shunting image. In the above manner, the present invention determines the size of the shunting image according to the resolution of the panoramic image, and sets the starting coordinates of the shunting image in the panoramic image, and then according to the preset overlapping image, the starting coordinates of all shunting images in the panoramic image can be determined in sequence; the image data of the panoramic image is read through the row stride encoder, and according to the starting coordinates of the shunting image and the size of the shunting image, the shunting image data can be directly output from the panoramic image data, thereby outputting the shunting image, without the need to copy, crop, and then splice the panoramic image, thereby reducing the amount of data processing, improving the shunting output efficiency of the panoramic image, and solving the technical problem of low shunting output efficiency of the existing panoramic image.
附图说明Description of the drawings
图1为本发明实施例方案中涉及的基于全景图像的视频分流设备的硬件结构示意图。Figure 1 is a schematic diagram of the hardware structure of a panoramic image-based video streaming device involved in the embodiment of the present invention.
图2为本发明基于全景图像的视频分流方法第一实施例的流程示意图。FIG. 2 is a flow chart of a first embodiment of a video splitting method based on panoramic images according to the present invention.
图3为本发明基于全景图像的视频分流方法第二实施例的流程示意图。Figure 3 is a schematic flowchart of the second embodiment of the panoramic image-based video offloading method of the present invention.
图4为本发明基于全景图像的视频分流方法的图像分流示意图。Figure 4 is a schematic diagram of image offloading of the panoramic image-based video offloading method of the present invention.
图5为本发明基于全景图像的视频分流方法第三实施例的流程示意图。FIG. 5 is a schematic flowchart of the third embodiment of the panoramic image-based video offloading method of the present invention.
图6为本发明基于全景图像的视频分流方法第四实施例的流程示意图。Figure 6 is a schematic flowchart of the fourth embodiment of the panoramic image-based video offloading method of the present invention.
图7为本发明基于全景图像的视频分流装置第一实施例的功能模块示意图。Figure 7 is a schematic diagram of the functional modules of the first embodiment of the panoramic image-based video streaming device of the present invention.
本发明的最佳实施方式Best Mode of Carrying Out the Invention
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described here are only used to explain the present invention and are not intended to limit the present invention.
本发明实施例涉及的基于全景图像的视频分流方法主要应用于基于全景图像的视频分流设备,该基于全景图像的视频分流设备可以是PC、便携计算机、移动终端等具有显示和处理功能的设备。The panoramic image-based video offloading method involved in the embodiment of the present invention is mainly applied to the panoramic image-based video offloading device. The panoramic image-based video offloading device can be a PC, a portable computer, a mobile terminal and other devices with display and processing functions.
参照图1,图1为本发明实施例方案中涉及的基于全景图像的视频分流设备的硬件结构示意图。本发明实施例中,基于全景图像的视频分流设备可以包括处理器1001(例如CPU),通信总线1002,用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信;用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard);网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口);存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器,存储器1005可选的还可以是独立于前述处理器1001的存储装置。Referring to FIG. 1 , FIG. 1 is a schematic diagram of the hardware structure of a panoramic image-based video streaming device involved in the embodiment of the present invention. In the embodiment of the present invention, the panoramic image-based video distribution device may include a processor 1001 (such as a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize connection and communication between these components; the user interface 1003 can include a display screen (Display) and an input unit such as a keyboard (Keyboard); the network interface 1004 can optionally include a standard wired interface and a wireless interface. (such as WI-FI interface); the memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
本领域技术人员可以理解,图1中示出的硬件结构并不构成对基于全景图像的视频分流设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the hardware structure shown in Figure 1 does not constitute a limitation on the video streaming device based on panoramic images, and may include more or less components than shown, or some components may be combined or different. component layout.
继续参照图1,图1中作为一种计算机可读存储介质的存储器1005可以包括操作系统、网络通信模块以及基于全景图像的视频分流程序。Continuing to refer to FIG. 1 , the memory 1005 as a computer-readable storage medium in FIG. 1 may include an operating system, a network communication module, and a panoramic image-based video streaming program.
在图1中,网络通信模块主要用于连接服务器,与服务器进行数据通信;而处理器1001可以调用存储器1005中存储的基于全景图像的视频分流程序,并执行本发明实施例提供的基于全景图像的视频分流方法。In Figure 1, the network communication module is mainly used to connect to the server and perform data communication with the server; and the processor 1001 can call the panoramic image-based video streaming program stored in the memory 1005, and execute the panoramic image-based video streaming program provided by the embodiment of the present invention. video offloading method.
本发明实施例提供了一种基于全景图像的视频分流方法。The embodiment of the present invention provides a video streaming method based on panoramic images.
参照图2,图2为本发明基于全景图像的视频分流方法第一实施例的流程示意图。Referring to FIG. 2, FIG. 2 is a schematic flowchart of the first embodiment of the panoramic image-based video offloading method of the present invention.
本实施例中,所述基于全景图像的视频分流方法包括以下步骤:In this embodiment, the panoramic image-based video offloading method includes the following steps:
步骤S10,根据全景图像的有效分辨率,设置分流图像尺寸;Step S10, set the size of the shunt image according to the effective resolution of the panoramic image;
本实施例中,全景图像是通过全景相机拍摄所得,全景相机是通过至少两个鱼眼镜头采集画面,拼接成一个360度的全景视频流。但是因为鱼眼镜头的广角特性,拍摄画面的顶部和底部的内容存在较大的畸变,没有参考价值,所以需要在全景图像中裁剪畸变量小的部分作为有效图像,比如全景图像的分辨率为7680×3840,经过裁剪的有效分辨率为7680×1440,顶部和底部总共裁剪了2000行的像素值。In this embodiment, the panoramic image is captured by a panoramic camera. The panoramic camera collects images through at least two fisheye lenses and splices them into a 360-degree panoramic video stream. However, due to the wide-angle characteristics of the fisheye lens, there is large distortion at the top and bottom of the captured image, which has no reference value. Therefore, it is necessary to crop the part with small distortion in the panoramic image as an effective image. For example, the resolution of the panoramic image is 7680×3840, the effective resolution after cropping is 7680×1440, and a total of 2000 rows of pixel values are cropped at the top and bottom.
具体地,根据鱼眼镜头的特点,全景图像只在上下端存在畸变,而中间行像素并不会产生畸变,当裁剪完全景图像上下端的畸变像素之后,全景图像的像素行值减小,而列值并没有改变,所以全景图像的有效分辨率即为全景图像原列值和裁剪之后的行值的乘积。Specifically, according to the characteristics of the fisheye lens, the panoramic image only has distortion at the upper and lower ends, and the pixels in the middle row will not be distorted. When the distorted pixels at the upper and lower ends of the full panoramic image are cropped, the pixel row values of the panoramic image decrease, and The column values have not changed, so the effective resolution of the panorama image is the product of the original column values of the panorama image and the cropped row values.
可以理解地,全景图像的有效行像素值是指有效分辨率的列值,即有效分辨率的一行具有多少像素点,表示有效分辨率有多少列;有效列像素值是指有效分辨率的行值,即有效分辨率的一列具有多少像素点,表示有效分辨率有多少行。Understandably, the effective row pixel value of the panoramic image refers to the column value of the effective resolution, that is, how many pixels a row of the effective resolution has represents how many columns the effective resolution has; the effective column pixel value refers to the row of the effective resolution. Value, that is, how many pixels a column of effective resolution has, indicating how many rows there are of effective resolution.
进一步地,所述步骤S10具体包括:Further, the step S10 specifically includes:
根据所述全景图像的有效分辨率,确定所述分流图像分辨率的所述行值。The row value of the split image resolution is determined based on the effective resolution of the panoramic image.
根据预设分流角度,计算所述分流图像在所述全景图像中的占比,确定所述分流图像分辨率的所述列值。According to the preset splitting angle, the proportion of the splitting image in the panoramic image is calculated, and the column value of the splitting image resolution is determined.
本实施例中,全景图像的有效分辨率中,因为在确定有效分辨率之前已经将全景图像中畸变量较大的像素排除,分流图像要想覆盖有效分辨率,则以有效分辨率中的行值(即宽度)作为分流图像的分辨率行值。In this embodiment, in the effective resolution of the panoramic image, because the pixels with large distortion in the panoramic image have been excluded before determining the effective resolution, if the split image wants to cover the effective resolution, the rows in the effective resolution are value (i.e. width) as the resolution line value of the split image.
可以理解地,如果全景图像的有效分辨率的行值(即宽度)过大,也可以对行值进行切分,设置多张分流图像对全景图像有效分辨率进行覆盖;比如有效分辨率行值为1000,可以设置分流图像分辨率行值为100,两张分流图像之间存在一定重叠区域,以保证能够完全覆盖全景图像,避免出现图像缺失。It can be understood that if the row value (i.e., width) of the effective resolution of the panoramic image is too large, the row value can also be divided, and multiple diversion images can be set to cover the effective resolution of the panoramic image; for example, if the effective resolution row value is 1000, the diversion image resolution row value can be set to 100, and there is a certain overlapping area between the two diversion images to ensure that the panoramic image can be fully covered to avoid image missing.
本实施例中,根据预设的分流视频数量,以360度全景图像为依据,设置预设分流角度,此处需要考虑重叠覆盖区域,根据预设分流角度与360度的占比,计算该预设分流角度能够覆盖的全景图像的区域,覆盖区域所包含的全景图像分辨率列值(即长度)即为分流图像分辨率的列值。In this embodiment, according to the preset number of diverted videos and based on the 360-degree panoramic image, a preset diversion angle is set. The overlapping coverage area needs to be considered here. According to the ratio of the preset diversion angle to 360 degrees, the area of the panoramic image that can be covered by the preset diversion angle is calculated. The panoramic image resolution column value (i.e., length) contained in the coverage area is the column value of the diverted image resolution.
进一步地,结合行值和列值,即可确定分流分辨率的大小。Furthermore, by combining the row values and column values, the size of the splitting resolution can be determined.
可以理解地是,分流就是从全景360度的画面中截取对应角度的画面送给接收端。It can be understood that offloading is to intercept pictures of corresponding angles from the panoramic 360-degree picture and send them to the receiving end.
具体实施例中,角度是后台(或者监控)配置的,每路流都可以设置任意角度。比如,把一个全景视频流切分成4路普通视频流(非全景),操作端可以同时拉取4路视频流,每路视频流的横向FOV是120度,为保证完全覆盖全景图像,相邻两路视频流有30度的重叠,以全景图像7680×1440为例,横向切成4路流之后,每路流的图像分辨率为2560×1440,相邻两路流的重叠部分为640×1440。In specific embodiments, the angle is configured in the background (or monitoring), and any angle can be set for each stream. For example, if a panoramic video stream is divided into 4 ordinary video streams (non-panoramic), the operating terminal can pull 4 video streams at the same time. The horizontal FOV of each video stream is 120 degrees. To ensure complete coverage of the panoramic image, adjacent The two video streams overlap by 30 degrees. Taking the panoramic image 7680×1440 as an example, after cutting into 4 streams horizontally, the image resolution of each stream is 2560×1440, and the overlap between two adjacent streams is 640× 1440.
可以理解地,拉取的4路流视频,每一路流的角度是可以单独设置的,可以通过操作端调用相机端的接口配置给相机,相机根据该配置从全景流中截取对应角度的流送给监控。Understandably, the angle of each stream of the pulled 4-channel video stream can be set independently. It can be configured to the camera by calling the interface of the camera side through the operation terminal. The camera intercepts the stream of the corresponding angle from the panoramic stream according to this configuration and sends it to the camera. monitor.
步骤S20,根据所述分流图像尺寸、预设重叠区域尺寸以及所述分流图像在所述全景图像的预设坐标位置,设置各分流图像的起始坐标。Step S20: Set the starting coordinates of each split image according to the split image size, the preset overlap area size and the preset coordinate position of the split image in the panoramic image.
本实施例中,当确定分流图像尺寸后,需要给编码器一个编码起始坐标,编码器才能在全景图像中读取分流图像;为了能够覆盖全景图像所有有效区域,避免出现画面缺失的问题,分流图像之间需要具有一定范围的预设重叠区域,可以根据分流图像尺寸和分流数量,设置合理的重叠区域尺寸。In this embodiment, when the size of the split image is determined, the encoder needs to be given an encoding starting coordinate so that the encoder can read the split image in the panoramic image; in order to cover all effective areas of the panoramic image and avoid the problem of missing pictures, There needs to be a certain range of preset overlapping areas between shunt images. A reasonable overlap area size can be set based on the size of the shunt images and the number of shunts.
具体地,可以将全景图像的第一列像素作为第一个分流图像的起始列坐标,以全景图像有效分辨率第一行像素在全景图像的坐标,作为第一个分流图像的起始行坐标,从而确定第一个分流图像在全景图像的起始坐标,进而根据重叠区域推导其他分流图像在全景图像的起始坐标;也可以根据用户实际需求,人为设定每一个分流图像的起始坐标。Specifically, the pixels in the first column of the panoramic image can be used as the starting column coordinates of the first split image, and the coordinates of the first row of pixels in the panoramic image at the effective resolution of the panoramic image can be used as the starting row of the first split image. coordinates, thereby determining the starting coordinates of the first shunt image in the panoramic image, and then deriving the starting coordinates of other shunt images in the panoramic image based on the overlapping area; the starting coordinates of each shunt image can also be artificially set according to the actual needs of the user. coordinate.
可以理解地,预设重叠区域大小不能过大,否则容易导致画面重复过多,数据冗余,浪费计算能力;也不能过小,否则达不到覆盖效果,如果显示设备边缘区域显示不完整,容易导致显示图像的边缘区域缺漏。Understandably, the size of the preset overlapping area cannot be too large, otherwise it will easily lead to excessive picture duplication, data redundancy, and a waste of computing power; it cannot be too small, otherwise the coverage effect will not be achieved. If the edge area of the display device is incompletely displayed, It is easy to cause the edge area of the displayed image to be missing.
具体的,可以根据合理的规则设置重叠区域大小,比如设置重叠区域在分流图像中占比为百分之十五,或者设置分流图像的角度时,规定一定的角度范围为重叠区域等。Specifically, the size of the overlapping area can be set according to reasonable rules, such as setting the overlapping area to account for 15% of the split image, or when setting the angle of the split image, specifying a certain angle range as the overlapping area, etc.
进一步地,所述步骤S20具体包括:Further, the step S20 specifically includes:
根据所述全景图像的有效分辨率,确定所述行stride编码器在所述全景图像的可读区域。According to the effective resolution of the panoramic image, the readable area of the panoramic image by the row stride encoder is determined.
根据所述可读区域和所述分流图像尺寸,设置所述分流图像在所述全景图像中的所述起始坐标。The starting coordinates of the diversion image in the panoramic image are set according to the readable area and the size of the diversion image.
根据所述预设重叠图像尺寸和所述起始坐标,确定所述分流图像的相邻分流图像的所述起始坐标。The starting coordinates of adjacent split images of the split image are determined according to the preset overlapping image size and the starting coordinates.
本实施例中,首先确定全景图像分辨率的行值(宽度),然后确定有效分辨率在全景图像分辨率的位置,因为有效分辨率的列值(长度)与全景图像分辨率的列值相等,所以只需要确定有效分辨率的第一行像素位于全景图像分辨率的行坐标即可,以有效图像分辨率第一行像素的行坐标作为第一分流图像的起始行坐标。In this embodiment, first determine the row value (width) of the panoramic image resolution, and then determine the position of the effective resolution in the panoramic image resolution, because the column value (length) of the effective resolution is equal to the column value of the panoramic image resolution. , so it is only necessary to determine that the first row of pixels of the effective resolution is located at the row coordinates of the panoramic image resolution, and the row coordinates of the first row of pixels of the effective image resolution are used as the starting row coordinates of the first split image.
具体地,首先确定有效分辨率第一行像素在全景图像分辨率中的行坐标,然后可以根据有效分辨率的行值(宽度),确定有效分辨率最后一行在全景图像分辨率的行坐标;结合有效分辨率大小,即可确定行stride编码器在全景图像的可读区域的坐标。Specifically, first determine the row coordinates of the first row of pixels of the effective resolution in the panoramic image resolution, and then determine the row coordinates of the last row of the effective resolution in the panoramic image resolution based on the row value (width) of the effective resolution; Combined with the effective resolution size, the coordinates of the row stride encoder in the readable area of the panoramic image can be determined.
可选地,根据分流图像分辨率,在可读区域内设置分流图像分辨率的起始行坐标;比如可以将有效分辨率的起始行坐标作为第一分流图像分辨率的起始行坐标。Optionally, according to the split image resolution, the starting line coordinates of the split image resolution are set in the readable area; for example, the starting row coordinates of the effective resolution can be used as the starting line coordinates of the first split image resolution.
具体地,可以通过操作端设置分流图像分辨率的起始列坐标,可以默认有效图像分辨率第一列,作为第一分流图像分辨率的起始列坐标,也可以设置有效图像分辨率的任一列,作为第一分流图像分辨率的起始列坐标。Specifically, the starting column coordinates of the split image resolution can be set through the operation terminal. The first column of the effective image resolution can be defaulted as the starting column coordinate of the first split image resolution, or any of the effective image resolutions can be set. A column that serves as the starting column coordinates of the first shunt image resolution.
具体地,根据第一分流图像分辨率的起始行坐标和起始列坐标,即可确定第一分流图像在全景图像中的分辨率坐标;然后根据预设重叠分辨率,即可依次确定每一个分流图像在全景图像中的分辨率坐标。Specifically, according to the starting row coordinates and starting column coordinates of the first split image resolution, the resolution coordinates of the first split image in the panoramic image can be determined; and then according to the preset overlapping resolution, each step can be determined in turn. The resolution coordinate of a shunt image in the panoramic image.
步骤S30,根将所述分流图像尺寸、所述全景图像的行像素值以及所述分流图像的起始坐标输入到行stride编码器,以输出所述分流图像。Step S30: The split image size, the row pixel value of the panoramic image, and the starting coordinates of the split image are input to a row stride encoder to output the split image.
一般地,从一个大的画面中截取一个小画面,通常需要向系统申请一块内存,然后把小画面的像素拷贝到这块内存中,再把这块内存交给编码器去编码生成视频流;由于全景视频比较大,这样做需要消耗比较多的CPU和内存资源,在嵌入式系统上很影响性能。Generally, to capture a small picture from a large picture, you usually need to apply for a memory from the system, then copy the pixels of the small picture to this memory, and then give this memory to the encoder to encode and generate a video stream; Since the panoramic video is relatively large, doing so consumes a lot of CPU and memory resources, which affects performance on embedded systems.
本实施例中,本申请利用编码器的行stride(内存图像行跨度),直接把大的画面送给编码器。比如,设置编码的区域为2560×1440,stride为7680,去掉了内存拷贝的部分,使性能达到要求。编码器按照大的全景图像的分辨率进行数据读取,并且按照全景图像分辨率的行顺序依次读取全景图像的像素数据;为了便于理解,将全景图像分辨率的每一行像素作为一个组数据,假设全景图像的7680×1440,即表示stride编码器会读取1440组像素数据;若第一分流图像在全景图像的的起始坐标为(0,0),那么stride编码器在每一组像素数据中,实际需要编码的是第1个数据到第2560个数据,而每一行的第2561个数据到第7680个数据的数据段则不需要进行处理,或者直接删除;也即当stride编码器完成前一行像素数据中第1个数据到第2560个数据的编码之后,前一行的后续数据不再进行编码,而从后一行的第1个数据继续编码,到该行像素数据的第2560个数据结束,并对每一行像素数据依次进行相同处理;最后按顺序输出经过编码的像素数据,从而输出第一分流图像。In this embodiment, the present application utilizes the row stride of the encoder (the row span of the memory image) to directly send the large picture to the encoder. For example, the encoding area is set to 2560×1440, the stride is 7680, and the memory copy part is removed to achieve the required performance. The encoder reads data according to the resolution of the large panoramic image, and reads the pixel data of the panoramic image in sequence according to the row order of the panoramic image resolution; for ease of understanding, each row of pixels of the panoramic image resolution is regarded as a group of data, assuming that the panoramic image is 7680×1440, which means that the stride encoder will read 1440 groups of pixel data; if the starting coordinates of the first shunt image in the panoramic image are (0, 0), then the stride encoder actually needs to encode the 1st data to the 2560th data in each group of pixel data, and the data segment from the 2561st data to the 7680th data of each row does not need to be processed or is directly deleted; that is, when the stride encoder completes the encoding of the 1st data to the 2560th data in the previous row of pixel data, the subsequent data of the previous row is no longer encoded, but continues to be encoded from the 1st data of the next row to the 2560th data of the row of pixel data, and the same processing is performed on each row of pixel data in sequence; finally, the encoded pixel data is output in sequence, thereby outputting the first shunt image.
为便于本领域技术人员理解,本实施例中通过例举第一个分流图像的生成过程,对本实施例进行解释。In order to facilitate understanding by those skilled in the art, this embodiment is explained by exemplifying the generation process of the first shunt image.
具体地,基于全景图像的第一个分流图像的生成过程如下:Specifically, the generation process of the first split image based on the panoramic image is as follows:
具体实施例中,将具有行像素值的全景图像、分流图像分辨率大小(即分流图像尺寸)以及要截取的第一个分流图像的起始坐标输入到编码器中,编码器调用内存图像行跨度(行stride)插件对全景图像进行处理。In a specific embodiment, the panoramic image with row pixel values, the split image resolution size (ie split image size) and the starting coordinates of the first split image to be intercepted are input into the encoder, and the encoder calls the memory image row The stride (row stride) plugin processes panoramic images.
可选地,编码器按行顺序依次读取全景图像的行像素数据,根据分流图像的起始坐标以及分流图像分辨率大小中的行值,在读取的全景图像数据中,确定需要编码的分流图像数据,通过调用行stride插件对分流图像数据进行处理,直接输出分流图像。Optionally, the encoder reads the row pixel data of the panoramic image in row order, and determines the pixels that need to be encoded in the read panoramic image data according to the starting coordinates of the split image and the row value in the resolution size of the split image. Split image data, process the split image data by calling the stride plug-in, and directly output the split image.
本实施例中,可以根据预设分流角度,计算重叠区域所覆盖的分辨率大小,根据第一路分流图像的边缘像素列进行计算,即可确定第二路分流图像在全景图像中的起始列坐标。In this embodiment, the resolution size covered by the overlapping area can be calculated based on the preset splitting angle, and the starting point of the second splitting image in the panoramic image can be determined based on the calculation based on the edge pixel column of the first splitting image. Column coordinates.
具体地,每一路分流图像的分辨率是相同的,在确定第二路分流图像的起始列时,即可确定第二分流图像的结束列;依次类推,即可确定每一路分流图像在全景图像中的起始列和结束列,即可确定每一路分流图像在全景图像中的分辨率坐标。Specifically, the resolution of each branch image is the same. When the starting column of the second branch image is determined, the end column of the second branch image can be determined; and by analogy, the panoramic position of each branch image can be determined. The starting column and ending column in the image can determine the resolution coordinates of each split image in the panoramic image.
具体地,将要截取的每一路分流图像的分辨率坐标依次输入到编码器中,确定每一路分流图像的编码起始坐标,结合分流图像尺寸,即可依次输出每一路分流图像的视频流。Specifically, the resolution coordinates of each split image to be intercepted are input into the encoder in sequence, the encoding starting coordinates of each split image are determined, and combined with the split image size, the video stream of each split image can be output in sequence.
本实施例中,根据预设重叠区域大小和第一分流图像的起始坐标,即可以确定每一路的分辨率坐标,通过行stride编码器在全景图像中读取对应的图像数据,再输出为分流图像数据,即可依次生成多路视频。In this embodiment, according to the preset overlapping area size and the starting coordinates of the first split image, the resolution coordinates of each channel can be determined, and the corresponding image data is read in the panoramic image through the row stride encoder, and then output as By shunting image data, multiple channels of video can be generated sequentially.
本实施例中,通过行stride编码器读取全景图像的数据,再根据分流图像在全景图像中的坐标,直接输出分流图像对应的图像数据,而对非分流图像数据的无效数据不做处理或者直接删除,减少了内存压力,也减少了数据处理量,从而提高分流图像的输出效率。In this embodiment, the data of the panoramic image is read through the row stride encoder, and then the image data corresponding to the shunt image is directly output according to the coordinates of the shunt image in the panoramic image, and the invalid data that is not the shunt image data is not processed or Direct deletion reduces memory pressure and data processing volume, thereby improving the output efficiency of split images.
本发明提供一种基于全景图像的视频分流方法,所述方法根据全景图像的有效分辨率,设置分流图像尺寸;根据所述分流图像尺寸和预设重叠图像尺寸,设置所述分流图像的起始坐标;将所述分流图像尺寸、所述全景图像的行像素值以及所述分流图像的起始坐标输入到行stride编码器,以输出所述分流图像。通过上述方式,本发明根据全景图像的分辨率大小,确定分流图像的尺寸大小,并且设置分流图像在全景图像中的起始坐标,再根据预设重叠图像,可以依次确定所有分流图像在全景图像中的起始坐标;通过行stride编码器读取全景图像的图像数据,并且根据分流图像的起始坐标以及分流图像大小,可以直接从全景图像数据中输出分流图像数据,从而输出分流图像,不需要将全景图像进行拷贝、裁剪再拼接,减少了数据处理量,提高了全景图像的分流输出效率,解决了现有全景图像的分流输出效率低下的技术问题。The present invention provides a video splitting method based on panoramic images. The method sets the splitting image size according to the effective resolution of the panoramic image; sets the starting point of the splitting image according to the splitting image size and the preset overlapping image size. Coordinates; input the split image size, the row pixel value of the panoramic image, and the starting coordinate of the split image to the row stride encoder to output the split image. Through the above method, the present invention determines the size of the shunt image according to the resolution of the panoramic image, and sets the starting coordinates of the shunt image in the panoramic image, and then based on the preset overlapping image, can sequentially determine the position of all shunt images in the panoramic image. The starting coordinates in; read the image data of the panoramic image through the row stride encoder, and according to the starting coordinates of the shunt image and the size of the shunt image, the shunt image data can be output directly from the panoramic image data, thereby outputting the shunt image, without Panoramic images need to be copied, cropped and then spliced, which reduces the amount of data processing, improves the efficiency of the split output of panoramic images, and solves the technical problem of low efficiency of split output of existing panoramic images.
参照图3,图3为本发明基于全景图像的视频分流方法第二实施例的流程示意图。Referring to FIG. 3 , FIG. 3 is a schematic flowchart of a video offloading method based on panoramic images according to a second embodiment of the present invention.
基于上述图2所示实施例,本实施例中,所述步骤S30,包括:Based on the above embodiment shown in Figure 2, in this embodiment, step S30 includes:
步骤S31,根据所述分流图像的起始坐标,运行所述行stride编码器,读取全景图像的图像数据。Step S31: According to the starting coordinates of the split image, run the row stride encoder to read the image data of the panoramic image.
步骤S32,根据所述分流图像尺寸和所述全景图像的行像素值,确定所述行stride编码器读取的所述图像数据中的有效数据。Step S32: Determine valid data in the image data read by the row stride encoder based on the split image size and the row pixel values of the panoramic image.
本实施例中,利用stride的行对齐特点,可以让编码器输出stride中每个数据循环中前面1/4编码区域(2560×1440)的数据,作为分流图像的数据,而后面3/4的数据,作为无效数据删除,即可直接输出分流图像,而避免对多余数据的处理。In this embodiment, the row alignment feature of stride can be used to allow the encoder to output the data of the first 1/4 coding area (2560×1440) in each data cycle in the stride as the data of the split image, and the following 3/4 If the data is deleted as invalid data, the shunt image can be directly output and the processing of redundant data can be avoided.
进一步地,所述步骤S32具体包括:Further, the step S32 specifically includes:
通过所述行stride编码器依次读取全景图像行像素,获得全景图像编码数据。Panoramic image row pixels are sequentially read through the row stride encoder to obtain panoramic image encoded data.
根据所述分流图像的起始坐标和所述分流图像尺寸,确定分流图像每一行在所述全景图像对应行的有效行像素。According to the starting coordinates of the split image and the split image size, the effective row pixels of each row of the split image in the corresponding row of the panoramic image are determined.
根据所述有效行像素,在所述全景图像编码数据中确定对应分流图像的有效数据。According to the valid row of pixels, valid data of the corresponding split image is determined in the panoramic image encoding data.
本实施例中,经过畸变筛选之后,虽然确定了全景图像的有效图像分辨率,但是并没有对无效像素进行裁剪,所以需要确定有效分辨率在全景图像中的位置,即有效分辨率的第一行像素和最后一行像素在全景图像中的坐标。In this embodiment, after distortion screening, although the effective image resolution of the panoramic image is determined, the invalid pixels are not cropped, so it is necessary to determine the position of the effective resolution in the panoramic image, that is, the first effective resolution The coordinates of the row pixel and the last row pixel in the panoramic image.
具体地,编码器是对整个全景图像进行操作的,而行stride编码器是从全景图像数据中直接“筛选”出分流图像数据,所以要正确且完整地读取分流图像,则需要确定分流图像在全景图像中所处的位置,即分流图像的起始坐标。Specifically, the encoder operates on the entire panoramic image, while the row stride encoder "screens" the shunt image data directly from the panoramic image data, so to read the shunt image correctly and completely, you need to determine the shunt image The position in the panoramic image is the starting coordinate of the shunt image.
具体地,可以根据畸变筛选操作确定有效分辨率起始行位于全景图像的行坐标,第一路分流图像的起始列可以是有效分辨率的任一列,可以从第一列开始,也可以是从其他列开始。Specifically, the effective resolution starting row can be determined to be located at the row coordinate of the panoramic image according to the distortion filtering operation. The starting column of the first split image can be any column of the effective resolution, and can start from the first column, or it can be Start with other columns.
可以理解地,行stride编码器在编码过程中,是按照全景图像的行依次进行数据读取的,比如编码器读取完全景图像的第一行像素的数据之后,才会读取第二行像素的数据,而每一行像素的数据长度相同,分流图像的坐标和分流图像分辨率大小即“告诉”行stride编码器如何“分辨”有效数据和无效数据。Understandably, during the encoding process, the row stride encoder reads data sequentially according to the rows of the panoramic image. For example, the encoder reads the data of the first row of pixels in the complete panoramic image before reading the second row. The data of pixels, and the data length of each row of pixels is the same. The coordinates of the split image and the resolution size of the split image "tell" the row stride encoder how to "distinguish" valid data and invalid data.
具体地,假设全景图像的有效分辨率为10000×5000,分流图像的起始截取坐标为(1000,1000),而分流图像的分辨率为3000×1000;那么行stride编码器会读取全景图像所有的有效分辨率数据,该数据按照全景图像有效分辨率的行顺序排列,即5000行数据,每行数据具有10000个像素点的数据;假设对这些数据进行编号,以10000个像素数据为一个循环数据;在需要输出分流图像数据时,行stride编码器即会从第1000个循环数据开始,以每一行数据中第1000个像素数据开始往后,读取3000个像素数据,总共读取1000个循环数据中的对应像素数据,作为有效数据,即分流图像数据,将该有效数据输出,再转换成分流图像;而其他的全景图像数据作为无效数据,直接删除即可。Specifically, assuming that the effective resolution of the panoramic image is 10000×5000, the starting interception coordinates of the shunt image are (1000, 1000), and the resolution of the shunt image is 3000×1000; then the row stride encoder will read all the effective resolution data of the panoramic image, which is arranged in row order according to the effective resolution of the panoramic image, that is, 5000 rows of data, each row of data has 10000 pixel data; assuming that these data are numbered, with 10000 pixel data as a cycle data; when the shunt image data needs to be output, the row stride encoder will start from the 1000th cycle data, starting from the 1000th pixel data in each row of data, and read 3000 pixel data, a total of 1000 corresponding pixel data in the cycle data as valid data, that is, shunt image data, output the valid data, and then convert it into a shunt image; and the other panoramic image data is regarded as invalid data and can be directly deleted.
具体地,参照图4,图4为本发明基于全景图像的视频分流方法的图像分流示意图。在stride编码器中输入每一个分流图像的起始坐标、分流图像分辨率(宽度值和高度值)以及全景图像的宽度值,将全景图像划分为多个分流图像对应的分流区域;并且相邻分流图像之间存在重叠区域,保证输出的分流图像能够将全景图像全覆盖。Specifically, refer to FIG. 4 , which is a schematic diagram of image offloading based on the panoramic image-based video offloading method of the present invention. Input the starting coordinates of each shunt image, the shunt image resolution (width value and height value) and the width value of the panoramic image into the stride encoder, and divide the panoramic image into shunt areas corresponding to multiple shunt images; and adjacent There are overlapping areas between the shunt images to ensure that the output shunt image can fully cover the panoramic image.
具体实施例中,stride编码器会按照全景图像的行顺序,依次读取全景图像的每一行像素数据。在分流图像在全景图像的行坐标对应的行中,根据每个分流图像的起始坐标,在对应行像素数据中截取对应分流图像宽度值的分流图像行,然后跳过其余的行像素数据,继续在全景图像的下一行中读取对应的分流图像行,直至完成分流图像所有行像素数据的读取。In a specific embodiment, the stride encoder reads each row of pixel data of the panoramic image in sequence according to the row order of the panoramic image. In the row corresponding to the row coordinates of the panoramic image of the split image, according to the starting coordinates of each split image, intercept the split image row corresponding to the width value of the split image in the corresponding row pixel data, and then skip the remaining rows of pixel data, Continue to read the corresponding shunt image row in the next row of the panoramic image until the reading of pixel data of all rows of the shunt image is completed.
其中,当分流图像存在跨行时,由于stride编码器是按照行顺序依次读取像素数据的,所以跨行的边缘分流图像在此处存在一行像素的错位,此时可以选择在分流之前对全景图像进行预处理,将全景图像中存在跨行的部分图片截取并拼接到全景图像的另一侧,从而获得一个更大分辨率的全景图像,避免stride编码器对边缘分流图像的跨行读取。Among them, when the split image has cross-rows, since the stride encoder reads pixel data sequentially in line order, there is a row of pixel misalignment in the edge split image across rows. At this time, you can choose to perform the panoramic image before splitting. Pre-processing, intercept the part of the panoramic image that has cross-lines and splice it to the other side of the panoramic image, thereby obtaining a panoramic image with a larger resolution and avoiding the stride encoder's cross-line reading of the edge shunt image.
步骤S33,通过所述行stride编码器输出所述有效数据,作为分流图像数据,获得所述分流图像。Step S33: Output the valid data through the row stride encoder as split image data to obtain the split image.
本实施例中,通过上述实施方式,不需要对全景图像进行预处理(如分割、拼接等),只需要通过行stride编码器从全景图像中直接读取对应的像素数据,作为分流图像的数据,从而直接输出分流图像,其中需要处理的数据也只有分流图像对应的数据,减少了数据处理量,从而提高分流图像的输出效率。In this embodiment, through the above implementation, there is no need to preprocess the panoramic image (such as segmentation, splicing, etc.). It is only necessary to directly read the corresponding pixel data from the panoramic image through the row stride encoder as the data of the split image. , thereby directly outputting the shunt image, and the data that needs to be processed is only the data corresponding to the shunt image, which reduces the amount of data processing and thereby improves the output efficiency of the shunt image.
参照图5,图5为本发明基于全景图像的视频分流方法第三实施例的流程示意图。Referring to FIG. 5 , FIG. 5 is a schematic flowchart of a third embodiment of a video offloading method based on panoramic images of the present invention.
基于上述图2所示实施例,本实施例中,所述步骤S10之前,还包括:Based on the above embodiment shown in Figure 2, in this embodiment, before step S10, it also includes:
步骤S01,根据预设畸变阈值,对所述全景图像的所有像素进行筛选,将所述像素的畸变量在所述畸变阈值内的区域判定为有效区域;Step S01: Screen all pixels of the panoramic image according to a preset distortion threshold, and determine the area where the distortion amount of the pixel is within the distortion threshold as a valid area;
步骤S02,根据所述有效区域内包含的像素值,确定所述全景图像的有效分辨率。Step S02: Determine the effective resolution of the panoramic image according to the pixel values contained in the effective area.
本实施例中,设置畸变阈值参数,通过对全景图像所有像素点进行畸变测量,计算每个像素点的畸变量,对于存在一半以上像素畸变量大于畸变阈值的像素行,判定为无效像素行;对于存在一半以上像素畸变量小于畸变阈值的像素行,判定为有效像素行,并进行畸变校正。In this embodiment, the distortion threshold parameter is set, and the distortion amount of each pixel is calculated by measuring the distortion of all pixels of the panoramic image. For more than half of the pixel rows whose pixel distortion is greater than the distortion threshold, it is determined to be an invalid pixel row; For pixel rows in which more than half of the pixel distortion is less than the distortion threshold, it is determined to be a valid pixel row, and distortion correction is performed.
具体的,畸变,也称为失真,它是一种可以把直线变成曲线的像差,广角镜头、变焦镜头,远距镜头容易造成严重的畸变。在图像的边缘切线尤其明显,但对于沿半径的放射线是看不到畸变的。由于光学透镜的固有特性,对拍摄的图片造成失真现象(畸变),这对成像质量是不利的。Specifically, distortion, also known as distortion, is an aberration that can turn straight lines into curves. Wide-angle lenses, zoom lenses, and telephoto lenses can easily cause severe distortion. Tangents are particularly noticeable at the edges of the image, but no distortion is visible for radial lines along the radius. Due to the inherent characteristics of optical lenses, distortion (distortion) is caused in the captured pictures, which is detrimental to the imaging quality.
进一步地,经过畸变校正之后,将判定为有效像素行的像素区域作为有效区域,该区域内所包含的所有像素即为有效像素,由此,即可确定全景图像的有效分辨率。Furthermore, after distortion correction, the pixel area determined to be the effective pixel row is regarded as the effective area, and all pixels contained in this area are effective pixels. Thus, the effective resolution of the panoramic image can be determined.
参照图6,图6为本发明基于全景图像的视频分流方法第四实施例的流程示意图。Referring to Figure 6, Figure 6 is a schematic flowchart of a fourth embodiment of a video offloading method based on panoramic images of the present invention.
基于上述图2所示实施例,本实施例中,所述步骤S30之前,还包括:Based on the above embodiment shown in Figure 2, in this embodiment, before step S30, it also includes:
步骤S031,根据所述分流图像尺寸、所述预设重叠图像尺寸以及所述分流图像的起始坐标,确定边缘分流图像的缺失图像尺寸;Step S031, determining the missing image size of the edge diversion image according to the diversion image size, the preset overlapping image size and the starting coordinates of the diversion image;
步骤S032,根据所述缺失图像尺寸,以所述全景图像另一侧第一列为始,截取与所述缺失图像尺寸大小相同的补足图像;Step S032: According to the missing image size, starting from the first column on the other side of the panoramic image, intercept a complementary image with the same size as the missing image;
步骤S033,将所述补足图像对齐拼接到所述全景图像的所述边缘位置,并更新所述全景图像,以使得所述边缘分流图像读取完整。Step S033: Align and splice the supplementary image to the edge position of the panoramic image, and update the panoramic image so that the edge shunt image is read completely.
本实施例中,因为相邻两路分流图像存在重叠区域,位于全景图像一侧的边缘分流图像与位于全景图像另一侧的分流图像存在重复,而编码器是按照图像像素行依次读取的,在完成读取一行像素数据之后,即会跳转到下一行像素的第一个像素继续向后读取;当边缘分流图像与另一侧分流图像存在重复时,编码器在读取数据时,边缘分流图像的每一行像素数据前段数据与后段数据对应的是全景图像的两行像素数据,所以边缘分流图像的每一行像素数据是存在一行的错位的。因此,为了使得边缘分流图像读取完整,且像素数据按行顺序排列,在读取分流图像之前,需要对全景图像进行预处理;即截取补足图像进行拼接,并且更新全景图像,获得分辨率更大且两端画面相同的全景图像。In this embodiment, because there is an overlapping area between two adjacent shunt images, the edge shunt image on one side of the panoramic image is repeated with the shunt image on the other side of the panoramic image, and the encoder reads sequentially according to the image pixel rows. After completing the reading of a row of pixel data, it will jump to the first pixel of the next row of pixels and continue to read backward; when the edge shunt image is repeated with the shunt image on the other side, when the encoder reads the data, the front data and the rear data of each row of pixel data of the edge shunt image correspond to two rows of pixel data of the panoramic image, so each row of pixel data of the edge shunt image is misaligned by one row. Therefore, in order to make the edge shunt image read completely and the pixel data arranged in row order, the panoramic image needs to be preprocessed before reading the shunt image; that is, the complementary image is intercepted for splicing, and the panoramic image is updated to obtain a panoramic image with a higher resolution and the same screen at both ends.
可选地,以4路分流图像为例:第4路分流图像中,有一部分在全景图像的左边,另外一部分在全景图像的右边,刚好全景图像的最左边跟最右边是可以连起来了,图像数据在编码器内存中也是连续的(一行的第一个像素是紧跟着上一行的最后一个像素)。Optionally, take the 4-channel split image as an example: in the 4-channel split image, part of it is on the left side of the panoramic image, and the other part is on the right side of the panoramic image. It happens that the leftmost and rightmost parts of the panoramic image can be connected. The image data is also contiguous in the encoder memory (the first pixel of a row follows the last pixel of the previous row).
可选的,可以用设置stride的方法来对第4路流进行编码,只是会存在一行的错位(第一行的左边接着第二行的右边),一行的错位在画面中是不明显的。Optionally, you can use the stride method to encode the fourth stream, but there will be a misalignment of one line (the left side of the first line and the right side of the second line). The misalignment of one line is not obvious in the picture.
可选的,如不考虑资源消耗,由于第四个视频流画面全景画面的右侧跨到了全景画面的左侧,因此可能会产生行像素点的偏移,因此如产生跨越全景画面边界的平面画面,在对全景图像分流之前,可提前将全景画面的左边画面直接拼接到右边画面,以保证平面画面没有跨越拼接后的全景画面。可以根据边缘分流图像在全景图像中的位置,确定缺失区域的大小,然后根据缺失区域的尺寸,在全景图像另一侧截取相同大小的图像区域,拼接到全景图像边缘处,形成一个更大的全景图像,比如将全景画面由360度变成390度;随后再重新设定修改后的全景图像的图像参数值中的image stride值(图像格式和目标图像的长宽尺寸并不需要修正)。Optionally, if resource consumption is not considered, since the right side of the panoramic screen of the fourth video stream spans to the left side of the panoramic screen, there may be an offset of row pixels. Therefore, if a plane crossing the boundary of the panoramic screen is generated, Before splitting the panoramic image, the left image of the panoramic image can be directly spliced to the right image in advance to ensure that the flat image does not span the spliced panoramic image. The size of the missing area can be determined based on the position of the edge shunt image in the panoramic image, and then based on the size of the missing area, an image area of the same size is intercepted on the other side of the panoramic image and spliced to the edge of the panoramic image to form a larger Panoramic image, such as changing the panoramic image from 360 degrees to 390 degrees; then resetting the image parameter value of the modified panoramic image The stride value (the image format and the length and width dimensions of the target image do not need to be modified).
参照图6,图6为本发明基于全景图像的视频分流装置第一实施例的功能模块示意图。Referring to Figure 6, Figure 6 is a schematic diagram of the functional modules of the first embodiment of the panoramic image-based video streaming device of the present invention.
本实施例中,所述基于全景图像的视频分流装置包括:In this embodiment, the panoramic image-based video streaming device includes:
分流图像尺寸设置模块10,用于根据全景图像的有效分辨率,设置分流图像尺寸;A split image size setting module 10, used to set the split image size according to the effective resolution of the panoramic image;
起始坐标设置模块20,用于根据所述分流图像尺寸、预设重叠区域尺寸以及所述分流图像在所述全景图像的预设坐标位置,设置各分流图像的起始坐标;The starting coordinate setting module 20 is used to set the starting coordinates of each shunt image according to the shunt image size, the preset overlap area size and the preset coordinate position of the shunt image in the panoramic image;
分流图像输出模块30,用于将所述分流图像尺寸、所述全景图像的行像素值以及所述各分流图像的起始坐标输入到行stride编码器,以输出所述分流图像。The split image output module 30 is configured to input the split image size, the row pixel value of the panoramic image, and the starting coordinates of each split image to a row stride encoder to output the split image.
进一步地,所述分流图像输出模块30具体包括:Further, the shunt image output module 30 specifically includes:
图像数据读取单元,用于根据所述分流图像的起始坐标,运行所述行stride编码器,读取全景图像的图像数据;An image data reading unit, configured to run the row stride encoder according to the starting coordinates of the shunt image and read the image data of the panoramic image;
有效数据确定单元,用于根据所述分流图像尺寸和所述全景图像的行像素值,确定所述行stride编码器读取的所述图像数据中的有效数据;A valid data determination unit, configured to determine valid data in the image data read by the row stride encoder according to the split image size and the row pixel value of the panoramic image;
分流图像获得单元,用于通过所述行stride编码器输出所述有效数据,作为分流图像数据,获得所述分流图像。A split image obtaining unit is configured to output the valid data through the row stride encoder as split image data to obtain the split image.
进一步地,所述有效数据确定单元具体包括:Further, the valid data determination unit specifically includes:
编码数据获得子单元,用于通过所述行stride编码器依次读取全景图像行像素,获得全景图像编码数据;The encoding data obtaining subunit is used to sequentially read the panoramic image row pixels through the row stride encoder to obtain the panoramic image encoding data;
有效行像素确定子单元,用于根据所述分流图像的起始坐标和所述分流图像尺寸,确定分流图像每一行在所述全景图像对应行的有效行像素;An effective row pixel determination subunit, configured to determine the effective row pixels of each row of the shunt image in the corresponding row of the panoramic image according to the starting coordinates of the shunt image and the size of the shunt image;
有效数据确定子单元,用于根据所述有效行像素,在所述全景图像编码数据中确定对应分流图像的有效数据。A valid data determination subunit is configured to determine valid data corresponding to the split image in the panoramic image encoded data according to the valid row pixels.
进一步地,所述基于全景图像的视频分流装置还包括有效分辨率确定模块,所述有效分辨率确定模块具体包括:Further, the panoramic image-based video streaming device further includes an effective resolution determination module, which specifically includes:
有效区域确定单元,用于根据预设畸变阈值,对所述全景图像的所有像素进行筛选,将所述像素的畸变量在所述畸变阈值内的区域判定为有效区域;An effective area determination unit, configured to screen all pixels of the panoramic image according to a preset distortion threshold, and determine the area in which the distortion amount of the pixel is within the distortion threshold as an effective area;
有效分辨率确定单元,用于根据所述有效区域内包含的像素值,确定所述全景图像的有效分辨率。An effective resolution determination unit is configured to determine the effective resolution of the panoramic image according to the pixel values contained in the effective area.
进一步地,所述分流图像尺寸设置模块10具体包括:Furthermore, the offload image size setting module 10 specifically includes:
行值确定单元,用于根据所述全景图像的所述有效分辨率,确定所述分流图像分辨率的所述行值;A row value determination unit configured to determine the row value of the split image resolution according to the effective resolution of the panoramic image;
列值确定单元,用于根据预设分流角度,计算所述分流图像在所述全景图像中的占比,确定所述分流图像分辨率的所述列值。A column value determination unit, configured to calculate the proportion of the split image in the panoramic image according to the preset split angle, and determine the column value of the split image resolution.
进一步地,所述起始坐标设置模块20具体包括:Furthermore, the starting coordinate setting module 20 specifically includes:
可读区域确定单元,用于根据所述全景图像的所述有效分辨率,确定所述行stride编码器在所述全景图像的可读区域;A readable area determination unit configured to determine the readable area of the row stride encoder in the panoramic image according to the effective resolution of the panoramic image;
起始坐标设置单元,用于根据所述可读区域和所述分流图像尺寸,设置所述分流图像在所述全景图像中的所述起始坐标;A starting coordinate setting unit, configured to set the starting coordinates of the split image in the panoramic image according to the readable area and the split image size;
相邻起始坐标确定单元,用于根据所述预设重叠图像尺寸和所述起始坐标,确定所述分流图像的相邻分流图像的所述起始坐标。An adjacent starting coordinate determining unit is configured to determine the starting coordinates of adjacent split images of the split image according to the preset overlapping image size and the starting coordinates.
进一步地,所述基于全景图像的视频分流装置还包括全景图像拼接模块,所述全景图像拼接模块具体包括:Further, the panoramic image-based video streaming device also includes a panoramic image splicing module, and the panoramic image splicing module specifically includes:
缺失图像尺寸确定单元,用于根据所述分流图像尺寸、所述预设重叠图像尺寸以及所述分流图像的起始坐标,确定边缘分流图像的缺失图像尺寸;A missing image size determination unit configured to determine the missing image size of the edge shunt image according to the shunt image size, the preset overlapping image size and the starting coordinates of the shunt image;
补足图像截取单元,用于根据所述缺失图像尺寸,以所述全景图像另一侧第一列为始,截取与所述缺失图像尺寸大小相同的补足图像;A supplementary image interception unit, configured to intercept a supplementary image of the same size as the missing image, starting from the first column on the other side of the panoramic image according to the missing image size;
图像拼接单元,用于将所述补足图像对齐拼接到所述全景图像的所述边缘位置,并更新所述全景图像,以使得所述边缘分流图像读取完整。An image splicing unit, configured to align and splice the complementary image to the edge position of the panoramic image, and update the panoramic image so that the edge shunt image is read completely.
其中,上述基于全景图像的视频分流装置中各个模块与上述基于全景图像的视频分流方法实施例中各步骤相对应,其功能和实现过程在此处不再一一赘述。Among them, each module in the above-mentioned video splitting device based on panoramic images corresponds to each step in the above-mentioned video splitting method embodiment based on panoramic images, and their functions and implementation processes are no longer described one by one here.
此外,本发明实施例还提供一种计算机可读存储介质。In addition, embodiments of the present invention also provide a computer-readable storage medium.
本发明计算机可读存储介质上存储有基于全景图像的视频分流程序,其中所述基于全景图像的视频分流程序被处理器执行时,实现如上述的基于全景图像的视频分流方法的步骤。The computer-readable storage medium of the present invention stores a panoramic image-based video streaming program, wherein when the panoramic image-based video streaming program is executed by a processor, the steps of the above panoramic image-based video streaming method are implemented.
其中,基于全景图像的视频分流程序被执行时所实现的方法可参照本发明基于全景图像的视频分流方法的各个实施例,此处不再赘述。For the method implemented when the panoramic image-based video streaming program is executed, reference may be made to various embodiments of the panoramic image-based video streaming method of the present invention, which will not be described again here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that, as used herein, the terms "include", "comprising" or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or system that includes a list of elements not only includes those elements, but It also includes other elements not expressly listed or that are inherent to the process, method, article or system. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
本申请可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。The application may be used in a variety of general or special purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, including Distributed computing environment for any of the above systems or devices, etc. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product that is essentially or contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM) as mentioned above. , magnetic disk, optical disk), including several instructions to cause a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the method described in various embodiments of the present invention.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the description and drawings of the present invention may be directly or indirectly applied in other related technical fields. , are all similarly included in the scope of patent protection of the present invention.

Claims (17)

  1. 一种基于全景图像的视频分流方法,其包括:A video streaming method based on panoramic images, which includes:
    根据预设畸变阈值,对全景图像的所有像素进行筛选,将所述像素的畸变量在所述畸变阈值内的区域判定为有效区域;Screen all pixels of the panoramic image according to the preset distortion threshold, and determine the area where the distortion amount of the pixel is within the distortion threshold as a valid area;
    根据所述有效区域内包含的像素值,确定所述全景图像的有效分辨率;Determine the effective resolution of the panoramic image according to the pixel values contained in the effective area;
    根据全景图像的有效分辨率,设置分流图像尺寸;Set the split image size according to the effective resolution of the panoramic image;
    根据所述全景图像的所述有效分辨率,确定所述行stride编码器在所述全景图像的可读区域;Determine the readable area of the row stride encoder in the panoramic image according to the effective resolution of the panoramic image;
    根据所述可读区域和所述分流图像尺寸,设置所述分流图像在所述全景图像中的所述起始坐标;Set the starting coordinates of the shunt image in the panoramic image according to the readable area and the shunt image size;
    根据所述预设重叠图像尺寸和所述起始坐标,确定所述分流图像的相邻分流图像的所述起始坐标;Determining the starting coordinates of the adjacent shunt images of the shunt image according to the preset overlapping image size and the starting coordinates;
    根据所述分流图像的起始坐标,运行所述行stride编码器,读取全景图像的图像数据;According to the starting coordinates of the shunt image, run the row stride encoder and read the image data of the panoramic image;
    通过所述行stride编码器依次读取全景图像行像素,获得全景图像编码数据;The panoramic image row pixels are sequentially read through the row stride encoder to obtain panoramic image encoded data;
    根据所述分流图像的起始坐标和所述分流图像尺寸,确定分流图像每一行在所述全景图像对应行的有效行像素;According to the starting coordinates of the split image and the size of the split image, determine the effective row pixels of each row of the split image in the corresponding row of the panoramic image;
    根据所述有效行像素,在所述全景图像编码数据中确定对应分流图像的有效数据;According to the effective row pixels, the effective data corresponding to the shunt image is determined in the panoramic image encoded data;
    通过所述行stride编码器输出所述有效数据,作为分流图像数据,获得所述分流图像。The effective data is output by the row stride encoder as split image data, and the split image is obtained.
  2. 根据权利要求1所述的基于全景图像的视频分流方法,其中所述根据全景图像的有效分辨率,设置分流图像尺寸的步骤包括:The panoramic image-based video splitting method according to claim 1, wherein the step of setting the split image size according to the effective resolution of the panoramic image includes:
    根据所述全景图像的所述有效分辨率,确定所述分流图像分辨率的所述行值;Determine the row value of the split image resolution according to the effective resolution of the panoramic image;
    根据预设分流角度,计算所述分流图像在所述全景图像中的占比,确定所述分流图像分辨率的所述列值。According to the preset splitting angle, the proportion of the splitting image in the panoramic image is calculated, and the column value of the splitting image resolution is determined.
  3. 根据权利要求1所述的基于全景图像的视频分流方法,其中所述将所述分流图像尺寸、所述全景图像的行像素值以及所述各分流图像的起始坐标输入到行stride编码器,以输出所述分流图像之前的步骤还包括:The video splitting method based on panoramic images according to claim 1, wherein the split image size, the row pixel value of the panoramic image and the starting coordinates of each split image are input to a row stride encoder, The steps before outputting the shunt image also include:
    根据所述分流图像尺寸、所述预设重叠图像尺寸以及所述分流图像的起始坐标,确定边缘分流图像的缺失图像尺寸;Determine the missing image size of the edge shunt image according to the shunt image size, the preset overlapping image size and the starting coordinates of the shunt image;
    根据所述缺失图像尺寸,以所述全景图像另一侧第一列为始,截取与所述缺失图像尺寸大小相同的补足图像;According to the missing image size, starting from the first column on the other side of the panoramic image, intercept a complementary image with the same size as the missing image;
    将所述补足图像对齐拼接到所述全景图像的所述边缘位置,并更新所述全景图像,以使得所述边缘分流图像读取完整。The complementary image is aligned and spliced to the edge position of the panoramic image, and the panoramic image is updated so that the edge shunt image is read completely.
  4. 一种基于全景图像的视频分流方法,其包括:A video streaming method based on panoramic images, which includes:
    根据全景图像的有效分辨率,设置分流图像尺寸;Set the split image size according to the effective resolution of the panoramic image;
    根据所述分流图像尺寸、预设重叠区域尺寸以及所述分流图像在所述全景图像的预设坐标位置,设置各分流图像的起始坐标;Set the starting coordinates of each shunt image according to the shunt image size, the preset overlap area size and the preset coordinate position of the shunt image in the panoramic image;
    将所述分流图像尺寸、所述全景图像的行像素值以及所述各分流图像的起始坐标输入到行stride编码器,以输出所述分流图像。The split image size, the row pixel value of the panoramic image, and the starting coordinates of each split image are input to a row stride encoder to output the split image.
  5. 根据权利要求4所述的基于全景图像的视频分流方法,其中所述将所述分流图像尺寸、所述全景图像的行像素值以及所述各分流图像的起始坐标输入到行stride编码器,以输出所述分流图像,包括:The video splitting method based on panoramic images according to claim 4, wherein the split image size, the row pixel value of the panoramic image and the starting coordinates of each split image are input to a row stride encoder, To output the shunt image, include:
    根据所述分流图像的起始坐标,运行所述行stride编码器,读取全景图像的图像数据;According to the starting coordinates of the shunt image, run the row stride encoder and read the image data of the panoramic image;
    根据所述分流图像尺寸和所述全景图像的行像素值,确定所述行stride编码器读取的所述图像数据中的有效数据;Determine the valid data in the image data read by the row stride encoder according to the split image size and the row pixel value of the panoramic image;
    通过所述行stride编码器输出所述有效数据,作为分流图像数据,获得所述分流图像。The effective data is output by the row stride encoder as split image data, and the split image is obtained.
  6. 根据权利要求5所述的基于全景图像的视频分流方法,其中所述根据所述分流图像尺寸和所述全景图像的行像素值,确定所述行stride编码器读取的所述图像数据中的有效数据,包括:According to the video shunting method based on panoramic images according to claim 5, wherein determining the valid data in the image data read by the row stride encoder according to the shunted image size and the row pixel value of the panoramic image comprises:
    通过所述行stride编码器依次读取全景图像行像素,获得全景图像编码数据;The panoramic image row pixels are sequentially read through the row stride encoder to obtain panoramic image encoded data;
    根据所述分流图像的起始坐标和所述分流图像尺寸,确定分流图像每一行在所述全景图像对应行的有效行像素;According to the starting coordinates of the split image and the size of the split image, determine the effective row pixels of each row of the split image in the corresponding row of the panoramic image;
    根据所述有效行像素,在所述全景图像编码数据中确定对应分流图像的有效数据。According to the effective row pixels, effective data corresponding to the split image is determined in the panoramic image encoded data.
  7. 根据权利要求4所述的基于全景图像的视频分流方法,其中所述根据全景图像的有效分辨率,设置分流图像尺寸之前,还包括:The panoramic image-based video splitting method according to claim 4, wherein before setting the split image size according to the effective resolution of the panoramic image, it further includes:
    根据预设畸变阈值,对所述全景图像的所有像素进行筛选,将所述像素的畸变量在所述畸变阈值内的区域判定为有效区域;According to a preset distortion threshold, all pixels of the panoramic image are screened, and a region where the distortion amount of the pixels is within the distortion threshold is determined as a valid region;
    根据所述有效区域内包含的像素值,确定所述全景图像的有效分辨率。The effective resolution of the panoramic image is determined according to the pixel values contained in the effective area.
  8. 根据权利要求7所述的基于全景图像的视频分流方法,其中所述根据全景图像的有效分辨率,设置分流图像尺寸,包括:The panoramic image-based video splitting method according to claim 7, wherein the step of setting the splitting image size according to the effective resolution of the panoramic image includes:
    根据所述全景图像的所述有效分辨率,确定所述分流图像分辨率的所述行值;Determine the row value of the split image resolution according to the effective resolution of the panoramic image;
    根据预设分流角度,计算所述分流图像在所述全景图像中的占比,确定所述分流图像分辨率的所述列值。According to the preset splitting angle, the proportion of the splitting image in the panoramic image is calculated, and the column value of the splitting image resolution is determined.
  9. 根据权利要求8所述的基于全景图像的视频分流方法,其中所述根据所述分流图像尺寸、预设重叠区域尺寸以及所述分流图像在所述全景图像的预设坐标位置,设置各分流图像的起始坐标,包括:The video splitting method based on panoramic images according to claim 8, wherein each split image is set according to the split image size, the preset overlap area size and the preset coordinate position of the split image in the panoramic image. The starting coordinates include:
    根据所述全景图像的所述有效分辨率,确定所述行stride编码器在所述全景图像的可读区域;Determine the readable area of the row stride encoder in the panoramic image according to the effective resolution of the panoramic image;
    根据所述可读区域和所述分流图像尺寸,设置所述分流图像在所述全景图像中的所述起始坐标;Set the starting coordinates of the shunt image in the panoramic image according to the readable area and the shunt image size;
    根据所述预设重叠图像尺寸和所述起始坐标,确定所述分流图像的相邻分流图像的所述起始坐标。The starting coordinates of adjacent split images of the split image are determined according to the preset overlapping image size and the starting coordinates.
  10. 根据权利要求4所述的基于全景图像的视频分流方法,其中所述将所述分流图像尺寸、所述全景图像的行像素值以及所述各分流图像的起始坐标输入到行stride编码器,以输出所述分流图像之前,还包括:The video splitting method based on panoramic images according to claim 4, wherein the split image size, the row pixel value of the panoramic image and the starting coordinates of each split image are input to a row stride encoder, Before outputting the shunt image, also include:
    根据所述分流图像尺寸、所述预设重叠图像尺寸以及所述分流图像的起始坐标,确定边缘分流图像的缺失图像尺寸;Determine the missing image size of the edge shunt image according to the shunt image size, the preset overlapping image size and the starting coordinates of the shunt image;
    根据所述缺失图像尺寸,以所述全景图像另一侧第一列为始,截取与所述缺失图像尺寸大小相同的补足图像;According to the missing image size, starting from the first column on the other side of the panoramic image, intercept a complementary image with the same size as the missing image;
    将所述补足图像对齐拼接到所述全景图像的所述边缘位置,并更新所述全景图像,以使得所述边缘分流图像读取完整。The complementary image is aligned and spliced to the edge position of the panoramic image, and the panoramic image is updated so that the edge shunt image is read completely.
  11. 一种基于全景图像的视频分流装置,其包括: A video streaming device based on panoramic images, which includes:
    分流图像尺寸设置模块,用于根据全景图像的有效分辨率,设置分流图像尺寸;其中,所述有效分辨率包括全景图像的有效行像素值和有效列像素值;The split image size setting module is used to set the split image size according to the effective resolution of the panoramic image; wherein the effective resolution includes the effective row pixel values and the effective column pixel values of the panoramic image;
    起始坐标设置模块,用于根据所述分流图像尺寸以及所述分流图像在所述全景图像的预设坐标位置,设置各分流图像的起始坐标;A starting coordinate setting module, configured to set the starting coordinates of each shunt image according to the size of the shunt image and the preset coordinate position of the shunt image in the panoramic image;
    分流图像输出模块,用于将所述分流图像尺寸、所述全景图像的行像素值以及所述各分流图像的起始坐标输入到行stride编码器,以输出所述分流图像。A split image output module is configured to input the split image size, the row pixel value of the panoramic image, and the starting coordinates of each split image to a row stride encoder to output the split image.
  12. 根据权利要求11所述的视频分流装置,其中所述分流图像输出模块具体包括:The video streaming device according to claim 11, wherein the streaming image output module specifically includes:
    图像数据读取单元,用于根据所述分流图像的起始坐标,运行所述行stride编码器,读取全景图像的图像数据;An image data reading unit, configured to run the row stride encoder according to the starting coordinates of the shunt image and read the image data of the panoramic image;
    有效数据确定单元,用于根据所述分流图像尺寸和所述全景图像的行像素值,确定所述行stride编码器读取的所述图像数据中的有效数据;A valid data determination unit, configured to determine valid data in the image data read by the row stride encoder according to the split image size and the row pixel value of the panoramic image;
    分流图像获得单元,用于通过所述行stride编码器输出所述有效数据,作为分流图像数据,获得所述分流图像。A split image obtaining unit is configured to output the valid data through the row stride encoder as split image data to obtain the split image.
  13. 根据权利要求12所述的视频分流装置,其中所述有效数据确定单元具体包括:The video streaming device according to claim 12, wherein the valid data determining unit specifically includes:
    编码数据获得子单元,用于通过所述行stride编码器依次读取全景图像行像素,获得全景图像编码数据;The coded data acquisition subunit is used to sequentially read the panoramic image row pixels through the row stride encoder to obtain the panoramic image coded data;
    有效行像素确定子单元,用于根据所述分流图像的起始坐标和所述分流图像尺寸,确定分流图像每一行在所述全景图像对应行的有效行像素;An effective row pixel determination subunit, used to determine effective row pixels of each row of the diversion image in a corresponding row of the panoramic image according to the starting coordinates of the diversion image and the size of the diversion image;
    有效数据确定子单元,用于根据所述有效行像素,在所述全景图像编码数据中确定对应分流图像的有效数据。A valid data determination subunit is configured to determine valid data corresponding to the split image in the panoramic image encoded data according to the valid row pixels.
  14. 根据权利要求11所述的视频分流装置,其中所述基于全景图像的视频分流装置还包括有效分辨率确定模块,所述有效分辨率确定模块具体包括:The video streaming device according to claim 11, wherein the panoramic image-based video streaming device further includes an effective resolution determination module, and the effective resolution determination module specifically includes:
    有效区域确定单元,用于根据预设畸变阈值,对所述全景图像的所有像素进行筛选,将所述像素的畸变量在所述畸变阈值内的区域判定为有效区域;An effective area determination unit, configured to screen all pixels of the panoramic image according to a preset distortion threshold, and determine the area in which the distortion amount of the pixel is within the distortion threshold as an effective area;
    有效分辨率确定单元,用于根据所述有效区域内包含的像素值,确定所述全景图像的有效分辨率。An effective resolution determination unit is configured to determine the effective resolution of the panoramic image according to the pixel values contained in the effective area.
  15. 根据权利要求14所述的视频分流装置,其中所述分流图像尺寸设置模块具体包括:The video streaming device according to claim 14, wherein the streaming image size setting module specifically includes:
    行值确定单元,用于根据所述全景图像的所述有效分辨率,确定所述分流图像分辨率的所述行值;A row value determination unit configured to determine the row value of the split image resolution according to the effective resolution of the panoramic image;
    列值确定单元,用于根据预设分流角度,计算所述分流图像在所述全景图像中的占比,确定所述分流图像分辨率的所述列值。A column value determination unit, configured to calculate the proportion of the split image in the panoramic image according to the preset split angle, and determine the column value of the split image resolution.
  16. 根据权利要求15所述的视频分流装置,其中所述起始坐标设置模块20具体包括:The video streaming device according to claim 15, wherein the starting coordinate setting module 20 specifically includes:
    可读区域确定单元,用于根据所述全景图像的所述有效分辨率,确定所述行stride编码器在所述全景图像的可读区域;a readable area determining unit, configured to determine a readable area of the row stride encoder in the panoramic image according to the effective resolution of the panoramic image;
    起始坐标设置单元,用于根据所述可读区域和所述分流图像尺寸,设置所述分流图像在所述全景图像中的所述起始坐标;A starting coordinate setting unit, configured to set the starting coordinates of the split image in the panoramic image according to the readable area and the split image size;
    相邻起始坐标确定单元,用于根据所述预设重叠图像尺寸和所述起始坐标,确定所述分流图像的相邻分流图像的所述起始坐标。An adjacent starting coordinate determining unit is configured to determine the starting coordinates of adjacent split images of the split image according to the preset overlapping image size and the starting coordinates.
  17. 根据权利要求11所述的视频分流装置,其中所述基于全景图像的视频分流装置还包括全景图像拼接模块,所述全景图像拼接模块具体包括:The video streaming device according to claim 11, wherein the panoramic image-based video streaming device further includes a panoramic image splicing module, and the panoramic image splicing module specifically includes:
    缺失图像尺寸确定单元,用于根据所述分流图像尺寸、所述预设重叠图像尺寸以及所述分流图像的起始坐标,确定边缘分流图像的缺失图像尺寸;a missing image size determining unit, configured to determine the missing image size of the edge split image according to the split image size, the preset overlapping image size and the starting coordinates of the split image;
    补足图像截取单元,用于根据所述缺失图像尺寸,以所述全景图像另一侧第一列为始,截取与所述缺失图像尺寸大小相同的补足图像;A supplementary image interception unit, configured to intercept a supplementary image of the same size as the missing image, starting from the first column on the other side of the panoramic image according to the missing image size;
    图像拼接单元,用于将所述补足图像对齐拼接到所述全景图像的所述边缘位置,并更新所述全景图像,以使得所述边缘分流图像读取完整。An image splicing unit, configured to align and splice the complementary image to the edge position of the panoramic image, and update the panoramic image so that the edge shunt image is read completely.
PCT/CN2022/122388 2022-09-20 2022-09-29 Video splitting method and apparatus based on panoramic image, and device and storage medium WO2024060281A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211143230.4A CN115484417A (en) 2022-09-20 2022-09-20 Video distribution method, device and equipment based on panoramic image and storage medium
CN202211143230.4 2022-09-20

Publications (1)

Publication Number Publication Date
WO2024060281A1 true WO2024060281A1 (en) 2024-03-28

Family

ID=84423850

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/122388 WO2024060281A1 (en) 2022-09-20 2022-09-29 Video splitting method and apparatus based on panoramic image, and device and storage medium

Country Status (2)

Country Link
CN (1) CN115484417A (en)
WO (1) WO2024060281A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170223368A1 (en) * 2016-01-29 2017-08-03 Gopro, Inc. Apparatus and methods for video compression using multi-resolution scalable coding
CN107105218A (en) * 2017-05-05 2017-08-29 珠海全志科技股份有限公司 A kind of visual field picture image generation method and device
CN107945112A (en) * 2017-11-17 2018-04-20 浙江大华技术股份有限公司 A kind of Panorama Mosaic method and device
CN109978755A (en) * 2019-03-11 2019-07-05 广州杰赛科技股份有限公司 Panoramic image synthesis method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170223368A1 (en) * 2016-01-29 2017-08-03 Gopro, Inc. Apparatus and methods for video compression using multi-resolution scalable coding
CN107105218A (en) * 2017-05-05 2017-08-29 珠海全志科技股份有限公司 A kind of visual field picture image generation method and device
CN107945112A (en) * 2017-11-17 2018-04-20 浙江大华技术股份有限公司 A kind of Panorama Mosaic method and device
CN109978755A (en) * 2019-03-11 2019-07-05 广州杰赛科技股份有限公司 Panoramic image synthesis method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN115484417A (en) 2022-12-16

Similar Documents

Publication Publication Date Title
CN108650542B (en) Method for generating vertical screen video stream and processing image, electronic equipment and video system
US8228396B2 (en) Image processing apparatus, image capturing apparatus, and image distortion correction method
US8274572B2 (en) Electronic camera capturing a group of a plurality of specific objects
US7145947B2 (en) Video data processing apparatus and method, data distributing apparatus and method, data receiving apparatus and method, storage medium, and computer program
CN112261387B (en) Image fusion method and device for multi-camera module, storage medium and mobile terminal
CN112449140B (en) Video super-resolution processing method and device
US8335398B2 (en) Zoom lens distortion correcting apparatus
JP6812862B2 (en) Image processing system, imaging device, image processing method and program
TW201026069A (en) Encoding and decoding method for video screen layout, encoding device, decoding device, and data structure
WO2018040577A1 (en) Method and system for realizing adaptive screen rotation in image collection process
WO2021115179A1 (en) Image processing method, image processing apparatus, storage medium, and terminal device
CN111818295B (en) Image acquisition method and device
KR102161888B1 (en) Method and encoder for encoding a video stream in a video coding format supporting Auxiliary frames
JP2018137567A (en) Video transmitter and video receiver
US20220247928A1 (en) Image processing method and apparatus, aerial camera and storage medium
WO2022111330A1 (en) Image stitching method and apparatus for multi-camera device, storage medium, and terminal
CN108174084A (en) panoramic video processing method and terminal device
WO2024060281A1 (en) Video splitting method and apparatus based on panoramic image, and device and storage medium
US9478011B2 (en) Method and system for processing of images
JP2009088850A (en) Moving image distribution system and moving image distributing method
CN113938617A (en) Multi-channel video display method and equipment, network camera and storage medium
CN111860363A (en) Video image processing method and device, electronic equipment and storage medium
WO2024001852A1 (en) Image processing method, image processing apparatus and storage medium
KR102461031B1 (en) Network-based image processing method and apparatus therefor
CN111526302A (en) Stackable panoramic video real-time splicing method