Image processing method and device, special effect rendering method and device, equipment and storage medium
By performing panoramic deformation and matting processing on images captured by binocular panoramic cameras under virtual reality technology, and combining depth information for special effects rendering, the problem of inaccurate binocular matting results is solved, and more efficient image processing and Rendering effect.
Patent Information
- Application Number
- CN202310288171.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-22
- Publication Date
- 2024-09-24
AI Technical Summary
Under virtual reality technology, the images captured by binocular panoramic cameras have large distortion, and it is difficult for existing technology to ensure the accuracy and consistency of binocular matting results.
By performing panoramic de-distortion processing on the received picture frames, the distortion is reduced, and then matting is performed based on the de-distorted picture frames, and special effects rendering is performed based on depth information to ensure the accuracy and consistency of the matting results.
It improves the accuracy and consistency of binocular matting results, enhances the authenticity of special effects rendering, and solves the problem of poor matting effects under virtual reality technology.
Smart Images

Figure CN118694990A
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular to an image processing and special effects rendering method, apparatus, device, and storage medium. Background Art
[0002] Virtual reality (VR) technology is gradually being applied to people's lives. With the development of VR technology, current VR devices also have the same functions as physical electronic devices, and can install and use application software. For example, in the currently popular live broadcast software, VR devices can present the installed live broadcast client on the display panel of its virtual scene, and the live broadcast audience can trigger the live broadcast client to enter the live broadcast related functional applications.
[0003] In the implementation of live broadcast applications under VR technology, the host side is also different from the implementation in the real world. For example, the host side under VR technology needs to use a binocular panoramic camera to capture images to form a binocular panoramic video stream, and transmit it to the live broadcast client through the live broadcast server for the live broadcast audience to watch. Similar to the functions of real live broadcast applications, the host or the audience can trigger special effects in the live broadcast to display the triggered special effects in real time on the live broadcast screen.
[0004] Generally, the special effects rendering in live broadcast often involves processing the picture frames in the original video stream. For example, in a special effect implementation, it is necessary to obtain the cutout of the characters in the picture frame, which requires the character cutout processing. However, the existing image processing methods cannot achieve effective cutout of the characters in such images, and cannot guarantee the accuracy and consistency of VR binocular cutout results. Summary of the invention
[0005] The present invention provides an image processing and special effects rendering method, device, equipment and storage medium to achieve effective cutout of picture frames, thereby improving the accuracy and consistency of binocular cutout results.
[0006] In a first aspect, an embodiment of the present disclosure provides an image processing method, the image processing method comprising:
[0007] Performing panoramic dedistortion processing on the received picture frames to obtain dedistorted picture frames;
[0008] Determine a picture frame to be processed according to the dedistorted picture frame, and obtain a cutout picture frame based on the picture frame to be processed;
[0009] According to the cutout picture frame, a target cutout picture frame corresponding to the received picture frame is determined, and the target object in the target cutout picture frame is edge optimized based on panoramic dedistortion.
[0010] In a second aspect, an embodiment of the present disclosure provides a special effects rendering method, the special effects rendering method comprising:
[0011] In response to the received special effect triggering instruction, obtaining the special effect rendering material corresponding to the special effect triggering instruction;
[0012] Taking the left-eye panoramic picture frame and the right-eye panoramic picture frame in the received binocular panoramic picture frames as received picture frames, and processing the received picture frames according to the method described in the embodiment of the first aspect to obtain a binocular target cutout picture frame;
[0013] Special effects rendering is performed according to the binocular target cutout picture frame, special effects rendering material and the determined depth information to obtain a binocular panoramic special effects picture frame.
[0014] In a third aspect, an embodiment of the present disclosure further provides an image processing device, the image processing device comprising:
[0015] A dedistortion processing module, used for performing panoramic dedistortion processing on the received picture frames to obtain dedistorted picture frames;
[0016] A target cutout determination module, used to determine a to-be-processed picture frame according to the dedistorted picture frame, and obtain a cutout picture frame based on the to-be-processed picture frame;
[0017] The panoramic cutout determination module is used to determine a target cutout picture frame corresponding to the received picture frame according to the cutout picture frame, and the target object in the target cutout picture frame is edge optimized based on panoramic dedistortion.
[0018] In a fourth aspect, an embodiment of the present disclosure further provides a special effects rendering device, the special effects rendering device comprising:
[0019] A material acquisition module, used to obtain a special effect rendering material corresponding to the special effect triggering instruction in response to the received special effect triggering instruction;
[0020] a cutout picture determination module, configured to take a left-eye panoramic picture frame and a right-eye panoramic picture frame in the received binocular panoramic picture frames as received picture frames, and process the received picture frames according to the method described in the embodiment of the first aspect to obtain a binocular target cutout picture frame;
[0021] The special effect picture determination module is used to perform special effect rendering according to the binocular target cutout picture frame, special effect rendering material and the determined depth information to obtain a binocular panoramic special effect picture frame.
[0022] In a fifth aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0023] one or more processors;
[0024] a storage device for storing one or more programs,
[0025] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any embodiment of the present invention.
[0026] In a sixth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method as described in any embodiment of the present invention.
[0027] The technical solution of the disclosed embodiment can first perform panoramic dedistortion processing on the received picture frame through the provided image processing method to obtain a dedistorted picture frame; then determine the picture frame to be processed based on the dedistorted picture frame, and obtain a cutout picture frame based on the picture frame to be processed; finally, determine the target cutout picture frame corresponding to the picture frame based on the cutout picture frame. The above technical solution of this embodiment first performs panoramic dedistortion processing on the received picture frame, and performs cutout and edge optimization processing on the target object based on the picture frame after panoramic dedistortion, which can achieve effective cutout of such images and improve the accuracy and consistency of binocular cutout results. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0029] Figure 1 A flowchart of an image processing method provided by an embodiment of the present disclosure is given;
[0030] Figure 2 A display diagram of a picture frame captured by a panoramic camera in the prior art is given;
[0031] Figure 3 A diagram showing the effect of de-distorting a picture frame in an image processing method provided by an embodiment of the present disclosure is provided;
[0032] Figure 4 An example flowchart of an image processing method executed in a certain application scenario provided by an embodiment of the present disclosure is given;
[0033] Figure 5 A flowchart of a special effects rendering method provided by an embodiment of the present disclosure is given;
[0034] Figure 6 An example diagram of the execution flow of a special effects rendering method provided in an embodiment of the present disclosure is given;
[0035] Figure 7 A structural schematic diagram of an image processing device provided by an embodiment of the present disclosure is given;
[0036] Figure 8 A structural schematic diagram of a special effects rendering device provided by an embodiment of the present disclosure is given;
[0037] Fig. 9 A structural diagram of an electronic device provided by an embodiment of the present disclosure is given. DETAILED DESCRIPTION
[0038] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0039] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0040] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0041] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0042] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0043] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0044] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0045] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0046] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0047] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0048] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0049] It should be noted that the current VR devices also have the same functions as physical electronic devices, and can install and apply application software. For example, for the currently popular live broadcast software, VR devices can present the installed live broadcast client on the display panel of its virtual scene, and can enter the live broadcast related functional applications through the triggering of the live broadcast client by the live broadcast audience. For the audience, when the audience wears the VR device (such as VR glasses), a virtual panel will be presented in front of the audience, and there will be triggerable functional application software on the virtual panel. For example, when the audience triggers the live broadcast application software, they can watch the live broadcast in the virtual scene. When the audience wears the VR device to trigger the live broadcast interface, they can choose the live broadcast room they want to enter and watch the live broadcast in the virtual reality scene. When the anchor broadcasts live to the camera, the camera captures the anchor's live broadcast screen, and transmits the live broadcast screen to the video client in real time through the server, so that the player can watch the live broadcast screen in the virtual reality scene in real time.
[0050] In the implementation of live broadcast applications under VR technology, the host side is also different from the implementation in the real world. Wearing VR equipment is equivalent to a 3D scene, and the image captured by a panoramic camera is required. The normal display screen is what you see in the 3D scene. For example, the host side under VR technology needs to use a binocular panoramic camera to capture images to form a binocular panoramic video stream, and transmit it to the live broadcast client through the live broadcast server for the live broadcast audience to watch.
[0051] Generally, video clients or anchor terminals often have special effect triggering applications. For example, when the audience wants to send the special effect of "flower" to the anchor, the special effect of "flower" will be presented in real time. When the anchor wants to present the special effect of the anchor in the sea to the audience, the corresponding special effect can also be triggered to achieve the corresponding effect. When the special effect is triggered and rendered, it is not directly overlaid on the live screen. It is necessary to cut out the part that needs to be rendered (such as a character) separately, and then render it based on the character plus the special effect material, and then render it into the corresponding scene. At this time, the problem of portrait cutout is involved. When cutting out in the prior art, a cutout model can be pre-trained, and the image can be input into the cutout model to output the desired cutout. However, the panoramic image in the binocular scene is greatly distorted, and the accuracy and consistency of the binocular cutout results cannot be guaranteed. Therefore, it should be considered how to effectively cut out the picture frames captured by the binocular panoramic camera.
[0052] Based on this, the present disclosure provides an image processing method. Figure 1 A flow chart of an image processing method provided by an embodiment of the present disclosure is given. The embodiment of the present disclosure is applicable to the case of performing cutout processing on a picture frame. The method can be executed by an image processing device, which can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which is preferably a mobile terminal, a desktop computer, a laptop computer, a server, etc.
[0053] like Figure 1 As shown, the image processing method provided by the embodiment of the present disclosure may specifically include:
[0054] S101. Perform panoramic dedistortion processing on received picture frames to obtain dedistorted picture frames.
[0055] In this embodiment, the picture frames are captured by a panoramic camera with a wider shooting angle than that of an ordinary camera. The presentation forms of people and scenery in the images captured by this type of camera are distorted to a certain extent, especially at the edges. The picture frames can form a video stream and be continuously transmitted to the client in real time. For example, a VR binocular camera uses two fisheye cameras to shoot, and each camera can shoot a video with a 180-degree viewing angle. The fisheye lens is composed of a dozen different lenses. During the imaging process, the incident light is refracted to varying degrees and projected onto an imaging plane of limited size, so that the fisheye lens has a larger field of view than an ordinary lens. It should be noted that the picture frame can be a binocular image, but is not limited to a binocular image. For a binocular image, the left and right images in the binocular image can be processed separately. Exemplary, Figure 2 A display diagram of a picture frame captured by a panoramic camera in the prior art is given. Figure 2 It can be seen that the outline of the box itself should be a straight line, but in the picture frame, the outline of the box 1 is distorted and has a certain curvature.
[0056] Considering that the picture frame has certain distortion, it is necessary to perform panoramic de-distortion on the picture frame before performing cutout processing on the picture frame. The specific implementation of panoramic de-distortion on the picture frame is to perform projection transformation, and fisheye projection is adopted in this embodiment. The picture frame is composed of various pixels. When the picture frame is known, the pixel coordinates of each pixel and the pixel value of the pixel can be obtained. When performing panoramic de-distortion on the picture frame, the pixel coordinates of each pixel in the picture frame can be transformed, and then based on the correspondence between the pixel coordinates before the transformation and the pixel coordinates after the transformation, the pixel value of the pixel corresponding to the pixel coordinate before the transformation is set to the pixel value of the pixel corresponding to the pixel coordinate after the transformation.
[0057] In this embodiment, the picture frame is captured by a panoramic camera, and the captured picture is equivalent to a spherical picture. In order to make the curved picture correspondingly imaged, the data of the spherical picture needs to be projected into a plane. In this embodiment, the picture frame can be understood as data under equirectangular projection (ERP).
[0058] It is understandable that in equidistant cylindrical projection, the coordinates in the Cartesian coordinate system are converted into coordinates in the spherical coordinate system, and then some of the coordinates in the spherical coordinate system are linearly mapped to the pixel coordinate system, which will produce large distortion. Since the data under the equidistant cylindrical projection will have large distortion at the edges, in this embodiment, it is reprojected into fisheye data to reduce distortion. The pixel point information in the picture frame can be converted into data under the fisheye projection by using the fisheye projection change. In this embodiment, the picture frame is subjected to panoramic dedistortion processing, that is, the picture frame obtained after the fisheye projection is recorded as the dedistorted picture frame.
[0059] In this embodiment, before performing the cutout processing on the picture frame, the picture frame is first subjected to the panoramic dedistortion processing to obtain the dedistorted picture frame, and the dedistorted picture frame is used as the basic data for the subsequent cutout processing, which can improve the cutout effect and the accuracy of the cutout. Figure 3 A diagram showing the effect of de-distorting a frame in an image processing method provided by the present disclosure is given. Figure 3 It can be seen that after the panoramic dedistortion process, the outline 1 of the box in the dedistorted frame has been freed from distortion and the outline has become a straight line.
[0060] S102: Determine a picture frame to be processed according to the dedistorted picture frame, and obtain a cutout picture frame based on the picture frame to be processed.
[0061] In this embodiment, after obtaining the dedistorted picture frame in the above steps, the dedistorted picture can also be optimized, and the optimized picture frame is recorded as the picture frame to be processed. Directly performing cutout processing on the captured high-resolution picture frame will result in errors at the edge of the cutout result, and the stability of the cutout result cannot be guaranteed. It also occupies a large amount of computing resources and has a low processing efficiency. Therefore, before performing cutout processing on the dedistorted picture, the dedistorted picture frame is first downsampled, and the dedistorted picture frame after the downsampling processing is used as the picture frame to be processed.
[0062] Continuing with the above description, after determining the image frame to be processed, the image frame to be processed can be subjected to cutout processing. In this embodiment, the image frame to be processed can be subjected to cutout processing through a network model. The purpose of image processing through the network model is to identify the target object in the image and cut out the target object. Therefore, in this embodiment, the network model can be regarded as a target object cutout model formed through training. It is equivalent to using image training samples combined with given training logic to perform model training on the pre-built cutout model, thereby forming the final network model.
[0063] Specifically, the picture to be processed is taken as input data and input into the network model. After the network model performs cutout processing on the picture to be processed, the output result is a cutout picture frame, which is recorded as a cutout picture frame in this embodiment. Preferably, the network model is used to cut out the target object in the picture frame, and it can be based on a large number of various types of marked picture frames as samples, and the picture frame should contain the target object. Exemplarily, if the picture frame is a live picture frame, and the person in the live picture frame needs to be cut out, the dedistorted and optimized live picture frame can be input into the network model, and a cutout picture frame containing only the person can be obtained.
[0064] S103: Determine a target cutout frame corresponding to the received frame according to the cutout frame, and implement edge optimization of a target object in the target cutout frame based on panoramic dedistortion.
[0065] It should be noted that the original picture frame is distorted. After the picture frame is subjected to panoramic dedistortion processing and the processed picture is subjected to target object cutout, more effective edge optimization can be achieved. The target object can be specifically understood as the object to be obtained in the picture frame, for example, the target object can be a person, a building, etc. The edge optimization of the target object depends on the dedistortion effect of the panoramic dedistortion of the picture frame, and the two are correlated.
[0066] In this embodiment, since the cutout picture frame is input into the network model for cutout after the dedistorted picture frame is downsampled, the cutout result obtained will also be the cutout result of the corresponding resolution. There is a large error between the edge of the target object of the cutout result and the high-resolution picture frame input at the beginning. Therefore, it is necessary to optimize the edge area of the cutout task in the cutout picture frame. After obtaining the cutout picture frame, the edge area of the target object in the cutout picture frame is further optimized to obtain a more accurate cutout edge. Exemplarily, the way to optimize the edge area is: the dedistorted picture frame is used as a guide map to perform guided filtering on the cutout picture frame. The picture frame obtained after the guided filtering process has been upsampled, and the output resolution is improved. The cutout result with improved resolution is then Gaussian blurred to achieve smoothing, and the smoothed picture frame is then binarized to obtain the processed cutout optimized picture frame.
[0067] In the present embodiment, the output result, i.e., the cutout optimized picture frame, is converted back into the original format, and the fisheye data is converted back into the data format of the equidistant cylindrical projection. The process of de-distorting and restoring the cutout optimized picture is equivalent to the reverse process of projecting the panoramic de-distortion of the picture frame. Specifically, by obtaining the pixel point information of the cutout optimized picture frame, the pixel point information includes the pixel point coordinates and the pixel value, the pixel point coordinates of each pixel point in the cutout optimized picture frame are projected and transformed to obtain the pixel coordinate value of the equidistant cylindrical projection, and then the pixel value is assigned to the corresponding pixel point, so that the target cutout picture frame with the same image format as the picture frame can be restored. Exemplarily, the pixel value range of each pixel point in the target cutout picture frame is 0 to 255, wherein 255 represents the target object and 0 represents the background.
[0068] An image processing method provided by the disclosed embodiment can first perform panoramic dedistortion processing on the received picture frame to obtain a dedistorted picture frame; then determine the picture frame to be processed based on the dedistorted picture frame, and obtain a cutout picture frame based on the picture frame to be processed; finally, determine the target cutout picture frame corresponding to the received picture frame based on the cutout picture frame. The above technical scheme of this embodiment first performs panoramic dedistortion processing on the received picture frame, and performs cutout and edge optimization processing on the target object based on the picture frame after panoramic dedistortion, which can achieve effective cutout of such images and improve the accuracy and consistency of binocular cutout results.
[0069] As an optional embodiment of the above-mentioned embodiment of the present disclosure, the implementation of performing panoramic dedistortion processing on the received picture frame to obtain the dedistorted picture frame can be optimized into the following steps:
[0070] a1) Obtaining pixel information of the picture frame.
[0071] The pixel information includes the pixel coordinates and the corresponding pixel values. Specifically, the pixel coordinates and pixel values of each pixel in the picture frame are obtained. Different pixels in the picture frame have different pixel coordinates and pixel values. The pixel value may be a value between 0 and 255. Specifically, the pixel information of each pixel in the picture frame can be obtained through a preset pixel information extraction device.
[0072] b1) determining a dedistorted picture frame of the picture frame according to the pixel point information.
[0073] After the pixel coordinates and pixel values of each pixel in the picture frame are obtained as described above, the pixel coordinates of each pixel in the picture frame are projected and transformed, and the pixel coordinates of each pixel after the projection transformation can be obtained. Among them, the coordinate transformation can be performed based on the projection de-distortion model, and the projection de-distortion model can be understood as a mapping model for fisheye projection of the data of the picture frame. After the projection change, the correspondence between the coordinates of each pixel before the transformation and the coordinates of each pixel after the transformation can be determined. When the pixel values of each pixel after the transformation are assigned, they can be assigned based on the pixel values of the corresponding pixels before the transformation. It is equivalent to forming a new picture frame on a new layer, and filling the pixel values on the layer where the pixel values are all 0 to form a circle.
[0074] In this embodiment, after the coordinates of each pixel point in the picture frame are transformed based on the projection de-distortion model, it can be understood that the transformed picture frame only contains the pixel point coordinates of the pixel points, and it is also necessary to assign pixel values to each pixel point. The pixel values of each pixel point in the picture frame before the transformation are respectively assigned to the corresponding pixel points in the picture frame after the de-distortion projection, so as to ensure that after the panoramic de-distortion processing, the edge of the picture frame is panoramically de-distorted, but the specific content in the picture frame does not change.
[0075] This optional embodiment concretizes the steps of performing panoramic dedistortion processing on the received picture frames to obtain dedistorted picture frames, performs panoramic dedistortion processing on the picture frames based on the projection dedistortion model, and uses the formed dedistorted picture frames as basic data for subsequent cutout processing, thereby ensuring effective cutout of the picture frames and improving the accuracy of cutout.
[0076] Further, the implementation optimization of determining the dedistorted picture frame of the picture frame according to the pixel point information is the following steps:
[0077] b11) Obtaining the pixel value and the first pixel coordinates of the pixel in the picture frame from the pixel information.
[0078] In this embodiment, the pixel point information includes pixel point coordinates and pixel values. The pixel value and pixel point coordinates of each pixel point in the picture frame are obtained from the pixel point information, and the pixel point coordinates are marked as first pixel point coordinates.
[0079] b12) Substituting the first pixel point coordinates into the projection de-distortion model to obtain the coordinate results as the second pixel point coordinates of the corresponding pixel point.
[0080] Among them, there are many projection functions in fisheye projection, the most common one is equidistant projection d=fθ, the exit angle is smaller than the incident angle, and each pixel point is projected onto the plane in the form of similar triangles. When the original two sides are known, the position of each pixel point after projection can be obtained accordingly.
[0081] In this embodiment, after substituting the first pixel point coordinate into the projection de-distortion model, the coordinate result after the projection transformation of the first pixel point coordinate can be obtained, and the coordinate result is used as the pixel point coordinate of the corresponding pixel point, which is recorded as the second pixel point coordinate in this embodiment. The first pixel point coordinate of each pixel point in the picture frame is subjected to projection de-distortion transformation to obtain the second pixel point coordinate of each pixel point.
[0082] b13) Based on the coordinates of the second pixel point and the pixel values of the corresponding pixel points, a dedistorted picture frame of the picture frame is formed.
[0083] Specifically, after the projection change is performed, the corresponding relationship between the coordinates of each pixel point before the transformation and the coordinates of each pixel point after the transformation can be determined. When the pixel value of each pixel point after the transformation is assigned, the assignment can be based on the pixel value of the corresponding pixel point before the transformation. In this embodiment, after the coordinates of each pixel point in the picture frame are transformed based on the projection de-distortion model, it can be understood that the converted picture frame only contains the pixel coordinates of the pixel point, and the pixel value of each pixel point needs to be assigned. The pixel value of each pixel point in the picture frame before the transformation is assigned to the corresponding pixel point in the picture frame after the de-distortion projection, so as to ensure that after the panoramic de-distortion processing, the edge of the picture frame is de-distorted, but the specific content in the picture frame has not changed. According to the corresponding relationship between the coordinates of each second pixel point and the coordinates of the first pixel point, the pixel value of the corresponding pixel point can be assigned to the corresponding pixel point, thereby forming a de-distorted picture frame of the picture frame.
[0084] This optional embodiment specifies how to determine the dedistorted picture frame of the picture frame according to a given projection dedistortion model combined with pixel information, perform projection transformation on the pixel coordinates of the pixel points in the picture frame based on the projection dedistortion model, and assign pixel values to each pixel after the coordinate transformation according to the pixel values of the pixel points in the picture frame, so as to realize the dedistorted picture frame after panoramic dedistortion processing. The formed dedistorted picture frame serves as the basic data for subsequent cutout processing, which ensures the effective cutout of the picture frame and improves the accuracy of cutout.
[0085] As another optional embodiment of the above-mentioned embodiment of the present disclosure, the implementation of determining the to-be-processed picture frame according to the dedistorted picture frame may be optimized into the following steps:
[0086] a2) Determine the input resolution of the dedistorted picture frame.
[0087] Considering that the resolution of the picture frame is very high when it is transmitted in the form of video stream, the resolution of the dedistorted picture frame is also very high. If the high-resolution image frame is cut out, there will be a certain error at the edge, resulting in a poor cutout effect. In addition, the high-resolution picture frame is cut out, which takes up a lot of computing resources, affects the cutout efficiency, and cannot guarantee the real-time performance of the picture frame playback.
[0088] In view of the above problems, in this embodiment, the resolution of the dedistorted picture frame is processed to reduce the error and computing resource occupation when the picture frame is cut out. First, this step is used to determine the input resolution of the dedistorted picture frame. Exemplarily, the input resolution of a dedistorted picture frame is 8K.
[0089] b2) Sampling the dedistorted picture frame according to a first set multiple of the input resolution, and determining the first picture frame after the sampling process as the picture frame to be processed.
[0090] This step is used to downsample the dedistorted picture frame to reduce the resolution of the picture frame. The first set multiple can be a value less than 1, and the first set multiple is preferably set to 1 / 8. Specifically, the dedistorted picture frame is downsampled according to the first set multiple of the input resolution, and the picture frame obtained after the sampling process is recorded as the first picture frame, and the first picture frame is determined as the picture frame to be processed.
[0091] This optional embodiment concretizes the steps of determining the picture frames to be processed based on the dedistorted picture frames, and downsamples the dedistorted picture frames and uses the downsampled picture frames as the picture frames to be processed, thereby providing a guarantee for a smaller error in the subsequent cutout processing, saving computing resources during the cutout processing, improving the cutout efficiency and ensuring the real-time performance of the picture frame playback.
[0092] As another optional embodiment of the above-mentioned embodiment of the present disclosure, the step of determining, according to the cutout picture frame, a target cutout picture frame corresponding to the received picture frame may include:
[0093] a3) Optimizing the edge area of the target object in the cutout picture frame to obtain a processed cutout optimized picture frame.
[0094] In this embodiment, there is a large error in the edge of the target object between the cutout picture frame and the initially input high-resolution picture frame. After obtaining the cutout picture frame, the edge area of the target object in the cutout picture frame is further optimized to obtain a more accurate cutout edge. Exemplarily, the way to optimize the edge area is: use the dedistorted picture frame as a guide map to perform guided filtering on the cutout picture frame. The picture frame obtained after the guided filtering process has been upsampled, and the output resolution is improved. The cutout result with improved resolution is then Gaussian blurred to achieve smoothing, and the smoothed picture frame is then binarized to obtain the processed cutout optimized picture frame.
[0095] b3) performing dedistortion restoration on the cutout optimized picture frame to obtain a target cutout picture frame corresponding to the picture frame image after restoration.
[0096] In this embodiment, since the picture frame undergoes an image format conversion during the panoramic dedistortion process before the cutout, in order to ensure that the output target cutout picture frame can also be applied to the virtual reality scene for picture display, it is necessary to ensure that the image format is the same. This step is equivalent to converting the output result, that is, the cutout optimized picture frame, into the original format, and converting the fisheye data into the data format of the equidistant cylindrical projection. The process of dedistorting and restoring the cutout optimized picture is equivalent to the reverse process of the projected panoramic dedistortion process on the picture frame. Specifically, by obtaining the pixel point information of the cutout optimized picture frame, the pixel point information includes the pixel point coordinates and the pixel value, the pixel point coordinates of each pixel point in the cutout optimized picture frame are projected and transformed to obtain the pixel coordinate value of the equidistant cylindrical projection, and then the pixel value is assigned to the corresponding pixel point, so that the target cutout picture frame corresponding to the picture frame image can be restored.
[0097] This optional embodiment concretizes the steps of determining a target cutout picture frame corresponding to a picture frame based on the cutout picture frame, by optimizing the edge area of the target object in the cutout picture frame, and then restoring the processed picture frame to the target cutout picture frame with the same image format as the picture frame, thereby achieving effective cutout of the picture frame and improving the cutout accuracy.
[0098] Further, the edge area of the target object in the cutout picture frame is processed to obtain the processed cutout optimized picture frame, which is realized by the following steps:
[0099] a31) performing guided filtering on the cutout picture frame according to the dedistorted picture frame to obtain a filtered cutout picture frame.
[0100] In this embodiment, the guided filtering can be understood as having guidance, that is, by inputting an image as a guidance map, the filter knows where the edge is, and can better protect the edge, and finally maintain the edge details while filtering. In this step, a picture frame is determined according to the dedistorted picture frame. For example, the original picture of the dedistorted picture frame can be used or a picture frame can be obtained by downsampling the dedistorted picture frame. The picture frame is used as a guidance map to perform guided filtering on the cutout picture frame, thereby obtaining a filtered cutout picture frame after filtering. It can be understood that guiding filtering the cutout picture frame according to the dedistorted picture frame can improve edge quality while eliminating noise.
[0101] a32) performing smoothing on the edge area of the target object in the filtered cutout picture frame to obtain a first cutout picture frame.
[0102] After obtaining the filtered cutout picture frame, the edge region of the target object in the filtered cutout picture frame may be further smoothed, preferably using convolution to implement Gaussian blur to smooth the edge to further eliminate noise, for example, setting the convolution kernel size to 7*7 and the variance to 2.8. Specifically, after smoothing the edge region of the target object in the filtered cutout picture, the obtained cutout picture frame is recorded as the first cutout picture frame.
[0103] a33) performing binarization processing on the first cutout picture frame according to the confidence of the target object in the cutout picture frame, and determining the obtained second cutout picture frame as the cutout optimized picture frame.
[0104] In this embodiment, it can be considered that when the image frame to be processed is input into the network model to obtain the cutout image frame, the confidence that each pixel in the cutout image frame is the target object can be obtained. Exemplarily, the confidence can be expressed as a percentage, and the value can be 0-100%.
[0105] Continuing with the above description, according to the confidence of the target object in the cutout picture frame, the first cutout picture frame is binarized, the area with lower confidence is set to 0, the area with higher confidence is set to 1, and the rest is smoothed.
[0106] In this embodiment, when the confidence is less than a, the area is directly set to 0, and when the confidence is greater than b, the area is directly set to 1. Each pixel has a confidence, and the pixel with a confidence greater than b is considered to be the target object and is set to 1, and the pixel with a confidence less than a is considered not to be the target object and is set to 0. The pixel with a confidence greater than a and less than b is considered to be the edge of the target object, and it can be smoothed based on the smoothing function. Based on this step, a binary image is determined, that is, the second cutout frame.
[0107] Specifically, according to the confidence of the target object in the cutout picture frame, the first cutout picture frame is binarized, the binarized picture is recorded as the second cutout picture frame, and the second cutout picture frame is used as the cutout optimization picture frame.
[0108] The above technical solution specifies the steps of optimizing the edge area of the target object in the cutout picture frame to obtain the processed cutout optimized picture frame. First, the cutout picture frame is subjected to guided filtering according to the dedistorted picture frame, then smoothed, and finally binarized. Through filtering and target object edge smoothing, the optimized cutout optimized picture frame is obtained, which ensures effective cutout and improves the accuracy of cutout.
[0109] Further, the implementation of performing guided filtering on the cutout picture frame according to the dedistorted picture frame to obtain the filtered cutout picture frame is optimized as follows:
[0110] a311) Sampling the dedistorted picture frame according to a second set multiple of the input resolution of the dedistorted picture frame to obtain a second picture frame.
[0111] This step is used to downsample the dedistorted picture frame to reduce the resolution of the picture frame and obtain a downsampled picture frame, which is recorded as a second picture frame in this embodiment. The second set multiple can take a value less than 1, and the first set multiple is preferably set to 1 / 2. Specifically, the dedistorted picture frame is downsampled according to the second set multiple of the input resolution, and the picture frame obtained after the sampling process is recorded as the second picture frame.
[0112] a312) Input the second picture frame and the cutout picture frame into a given guided filter, and use the output filtering result as the filtered cutout picture frame.
[0113] Among them, the given guided filter can be understood as an edge-preserving filter, which is used to improve edge quality and eliminate noise. The guided filter is guided, that is, by inputting an image as a guided map, the filter knows where the edge is, and can better protect the edge, and finally maintain the edge details while filtering. Specifically, the second picture frame and the cutout picture frame determined above are input into the guided filter, and the filtering result can be output and used as the filtered cutout picture frame. It can be known that the cutout picture frame is a low-resolution picture frame, and the filtered picture frame is a high-resolution picture frame.
[0114] The above technical solution concretizes the steps of performing guided filtering on the cutout picture frame according to the dedistorted picture frame to obtain the filtered cutout picture frame. By inputting the picture frame after the dedistorted picture frame is downsampled and the cutout picture frame into the guided filter, the edge quality of the cutout picture frame is improved and noise is eliminated.
[0115] In order to more clearly describe the image processing method provided by the embodiment of the present invention, an example of image processing of a picture frame in a practical application scenario is used for illustration. Figure 4 An example flow chart of an image processing method executed in a certain application scenario provided by an embodiment of the present disclosure is given, such as Figure 4 As shown, the execution steps of the image processing method specifically include:
[0116] S1. Obtain pixel information of a picture frame, where the picture frame is captured by a panoramic camera.
[0117] S2. Obtain pixel values and first pixel coordinates of pixels in the picture frame from the pixel information.
[0118] S3. Substituting the first pixel point coordinates into the projection de-distortion model to obtain a coordinate result as the second pixel point coordinates of the corresponding pixel point.
[0119] S4. Form a dedistorted picture frame based on the second pixel point coordinates and the pixel values of the corresponding pixel points.
[0120] S5, determining the input resolution of the dedistorted picture frame;
[0121] S6. Sampling the dedistorted picture frame according to a first set multiple of the input resolution, and determining the first picture frame after the sampling process as the picture frame to be processed.
[0122] S7: Obtain a cutout picture frame based on the picture frame to be processed.
[0123] S8. Sampling the dedistorted picture frame according to a second set multiple of the input resolution of the dedistorted picture frame to obtain a second picture frame.
[0124] S9, inputting the second picture frame and the cutout picture frame into a given guided filter, and using the outputted filtering result as the filtered cutout picture frame.
[0125] S10, performing smoothing processing on the edge area of the target object in the filtered cutout picture frame to obtain a first cutout picture frame.
[0126] S11. According to the confidence of the target object in the cutout picture frame, binarize the first cutout picture frame, and determine the obtained second cutout picture frame as the cutout optimized picture frame.
[0127] S12, performing dedistortion restoration on the cutout optimized picture frame to obtain a target cutout picture frame corresponding to the picture frame after restoration.
[0128] Figure 5 A flow chart of a special effects rendering method provided by an embodiment of the present disclosure is given. The embodiment of the present disclosure is applicable to the situation where a special effects rendering is performed after a picture frame is cut out. The method can be executed by a special effects rendering device, which can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which is preferably a mobile terminal, a desktop computer, a laptop computer, a server, etc.
[0129] like Figure 5 As shown, the special effects rendering method provided by the embodiment of the present disclosure may specifically include:
[0130] S201. In response to a received special effect triggering instruction, obtain a special effect rendering material corresponding to the special effect triggering instruction.
[0131] It is important to know that for special effects rendering, no matter whether it is triggered by the client or the anchor, the special effects rendering will only be performed after the execution subject receives the special effects trigger instruction. In this embodiment, there is no specific restriction on the triggering form of the special effects rendering function. For example, for the client, the audience can trigger the special effects rendering by clicking the response icon on the panel presented in the virtual reality scene. This step is equivalent to obtaining special effects rendering materials in response to the received special effects trigger instruction. Special effects rendering materials can be specifically understood as the relevant materials required for special effects rendering, such as which special effect is triggered, and obtaining the rendering materials related to the special effect.
[0132] S202: Take the left-eye panoramic picture frame and the right-eye panoramic picture frame in the received binocular panoramic picture frames as received picture frames, and process the received picture frames according to the image processing method described in the above embodiment to obtain a binocular target cutout picture frame.
[0133] In this embodiment, while obtaining the special effects rendering material, the received binocular panoramic picture frame can also be processed to obtain the binocular target cutout picture frame. In this step, a binocular camera is used to capture the binocular panoramic picture frame, wherein the binocular panoramic picture frame includes a left-eye panoramic picture frame and a right-eye panoramic picture frame, and the left-eye panoramic picture frame and the right-eye panoramic picture frame can be used as the received picture frame. Exemplarily, the VR binocular camera uses two fisheye cameras to shoot, and each camera can shoot a video with a 180-degree viewing angle. The fisheye lens is composed of a dozen different lenses. During the imaging process, the incident light is refracted to varying degrees and projected onto an imaging plane of limited size, so that the fisheye lens has a larger field of view than an ordinary lens.
[0134] Continuing with the above description, after the received picture frame is obtained, the received picture frame is processed according to the image processing method described in the above embodiment, and the obtained cutout picture frame is recorded as the binocular target cutout picture frame. It can be clearly seen that the binocular target cutout picture frame can be considered as the following picture frame that needs to be processed with special effects.
[0135] S203, performing special effects rendering according to the binocular target cutout picture frame, special effects rendering material and the determined depth information to obtain a binocular panoramic special effects picture frame.
[0136] Among them, the determined depth information ensures that the target object in the binocular target cutout frame will not be directly covered as a plane during rendering, but will be presented bit by bit considering the depth information visually. With the depth information, the rendering can be guaranteed to be more realistic. Specifically, special effects rendering is performed based on the binocular target cutout frame, special effects rendering materials and the determined depth information, and the rendered special effects picture is obtained, which is recorded as a binocular panoramic special effects picture frame.
[0137] Exemplarily, in order to more clearly illustrate the special effects rendering method provided by the embodiment of the present disclosure, a relevant description is given by taking a certain application scenario as an example in the implementation of a live broadcast application under VR technology. Figure 6 An example diagram of the execution flow of a special effects rendering method provided in an embodiment of the present disclosure is given, such as Figure 6 As shown, the anchor end under VR technology needs to use a binocular panoramic camera to capture images to form a binocular panoramic video stream, and transmit it to the live client through the live server for the live audience to watch. Before sending the binocular panoramic video stream to the client, it is necessary to decode the video stream, perform depth calculation, and perform image processing of the target object cutout on the panoramic picture frame in the video stream. Then, based on the depth information and special effect rendering materials, the target object cutout is processed by special effects, and a panoramic special effect picture frame is generated to encode and form a video stream for transmission to the client for the live audience to watch. At the same time, the audience can also feedback to the anchor end by touching the corresponding function buttons in the virtual scene, such as special effects and gifts. It can be known that special effects processing based on the special effects method provided in the embodiment of the present disclosure can ensure that the special effects rendering effect is more realistic.
[0138] For example, when the anchor is broadcasting live, if he wants to cut out the anchor's character in the live broadcast picture and then add the special effect of sea water flowing upwards to the character cutout, the image processing method described in the above embodiment is used to cut out the character in the panoramic picture frame of the live broadcast picture, and then the character cutout is processed with special effects based on the depth information and the special effect rendering material of the sea water flowing upwards. Since the depth information is added, the effect of the sea water slowly flowing over the character can be displayed, rather than the sea water special effect directly covering the character.
[0139] A special effects rendering method provided by an embodiment of the present disclosure can first respond to a received special effects trigger instruction to obtain a special effects rendering material corresponding to the special effects trigger instruction; then use a left-eye panoramic picture frame and a right-eye panoramic picture frame in the received binocular panoramic picture frame as received picture frames, and process the received picture frames according to the image processing method described in the above embodiment to obtain a binocular target cutout picture frame; finally, special effects rendering is performed according to the binocular target cutout picture frame, the special effects rendering material and the determined depth information to obtain a binocular panoramic special effects picture frame. The above technical solution of this embodiment uses the left-eye panoramic picture frame and the right-eye panoramic picture frame as the received picture frames. Considering that the image format of the received picture frames has a large distortion, the image processing method described in the above embodiment is used to process the received picture frames. Before the received picture frames are cut out, the received picture frames are first dedistorted. The dedistorted picture frames have reduced distortion. The dedistorted picture frames are then cut out through a pre-trained target network model, which can effectively cut out such images and improve the accuracy of the cutout. Special effects rendering is performed based on the effective cutout results, which can improve the special effects rendering effect. At the same time, special effects rendering is performed using depth information, and the special effects are presented bit by bit in the perspective presentation considering the depth information, rather than directly covering the binocular target cutout picture frames, to ensure that the rendering is more realistic.
[0140] Figure 7 A structural schematic diagram of an image processing device provided by an embodiment of the present disclosure is given. Figure 7 As shown, the device includes: a dedistortion processing module 31, a target cutout determination module 32 and a panoramic cutout determination module 33, wherein:
[0141] The dedistortion processing module 31 is used to perform panoramic dedistortion processing on the received picture frames to obtain dedistorted picture frames;
[0142] A target cutout determination module 32 is used to determine a to-be-processed picture frame according to the dedistorted picture frame, and obtain a cutout picture frame based on the to-be-processed picture frame;
[0143] The panoramic cutout determination module 33 is used to determine a target cutout picture frame corresponding to the received picture frame according to the cutout picture frame, and the target object in the target cutout picture frame is edge optimized based on panoramic dedistortion.
[0144] An image processing device provided by the disclosed embodiment can first perform panoramic dedistortion processing on the received picture frame to obtain a dedistorted picture frame; then determine the picture frame to be processed based on the dedistorted picture frame, and obtain a cutout picture frame based on the picture frame to be processed; finally, determine a target cutout picture frame corresponding to the image of the picture frame based on the cutout picture frame, and implement edge optimization of the target object in the target cutout picture frame based on panoramic dedistortion. The above technical scheme of this embodiment first performs panoramic dedistortion processing on the received picture frame, and performs cutout and edge optimization processing on the target object based on the picture frame after panoramic dedistortion, which can achieve effective cutout of such images and improve the accuracy and consistency of binocular cutout results.
[0145] Furthermore, the panoramic dedistortion processing module includes:
[0146] An information acquisition unit, used to acquire pixel information of the picture frame;
[0147] The dedistortion determination unit is used to determine a dedistorted picture frame of the picture frame according to the pixel point information.
[0148] Furthermore, the dedistortion determination unit is specifically configured to:
[0149] Obtaining pixel values and first pixel coordinates of the pixel in the picture frame from the pixel information;
[0150] Substituting the first pixel point coordinates into the projection de-distortion model to obtain a coordinate result as the second pixel point coordinates of the corresponding pixel point;
[0151] Based on the second pixel point coordinates and the pixel values of the corresponding pixel points, a dedistorted picture frame of the picture frame is formed.
[0152] Furthermore, the target cutout determination module is specifically used for:
[0153] Determining an input resolution of the dedistorted picture frame;
[0154] The dedistorted picture frame is sampled according to a first set multiple of the input resolution, and a first picture frame after the sampling process is determined as a picture frame to be processed.
[0155] Furthermore, the panoramic cutout determination module includes:
[0156] An optimization processing unit, used for optimizing the edge area of the target object in the cutout picture frame to obtain a processed cutout optimized picture frame;
[0157] The dedistortion restoration unit is used to perform dedistortion restoration on the cutout optimized picture frame to obtain a target cutout picture frame corresponding to the picture frame after restoration.
[0158] Furthermore, the optimization processing unit is specifically used for:
[0159] Performing guided filtering on the cutout picture frame according to the dedistorted picture frame to obtain a filtered cutout picture frame;
[0160] Smoothing the edge area of the target object in the filtered cutout picture frame to obtain a first cutout picture frame;
[0161] According to the confidence of the target object in the cutout picture frame, the first cutout picture frame is binarized, and the obtained second cutout picture frame is determined as the cutout optimized picture frame.
[0162] Furthermore, the optimization processing unit is used to perform guided filtering on the cutout picture frame according to the dedistorted picture frame to obtain a filtered cutout picture frame, including:
[0163] Sampling the dedistorted picture frame according to a second set multiple of the input resolution of the dedistorted picture frame to obtain a second picture frame;
[0164] The second picture frame and the cutout picture frame are input into a given guided filter, and the output filtering result is used as a filtered cutout picture frame.
[0165] The image processing device provided in the embodiments of the present disclosure can execute the image processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0166] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0167] Figure 8 A structural diagram of a special effects rendering device provided by an embodiment of the present disclosure is given. Figure 8 As shown, the device includes: a material acquisition module 41, a cutout picture determination module 42 and a special effect picture determination module 43, wherein:
[0168] The material acquisition module 41 is used to obtain the special effect rendering material corresponding to the special effect triggering instruction in response to the received special effect triggering instruction;
[0169] A cutout picture determination module 42 is used to take the left-eye panoramic picture frame and the right-eye panoramic picture frame in the received binocular panoramic picture frame as received picture frames, and process the received picture frames according to the method described in the above embodiment to obtain a binocular target cutout picture frame;
[0170] The special effect picture determination module 43 is used to perform special effect rendering according to the binocular target cutout picture frame, special effect rendering material and the determined depth information to obtain a binocular panoramic special effect picture frame.
[0171] The disclosed embodiment provides a special effects processing device, which takes the left-eye panoramic picture frame and the right-eye panoramic picture frame as received picture frames. Considering that the image format of the received picture frames has large distortion, the image processing method described in the above embodiment is used to process the received picture frames. Before the received picture frames are cut out, the received picture frames are first subjected to dedistortion processing. The dedistorted picture frames have reduced distortion. Cutout processing is performed based on the dedistorted picture frames, which can achieve effective cutout of such images and improve the accuracy of cutout. Special effects rendering is performed based on the effective cutout results, which can improve the special effects rendering effect. At the same time, special effects rendering is performed using depth information, and the special effects are presented bit by bit in the perspective presentation taking into account the depth information, rather than directly covering the binocular target cutout picture frames, to ensure that the rendering is more realistic.
[0172] Fig. 9 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure is given. Fig. 9 , which shows an electronic device (eg, Fig. 9 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0173] like Fig. 9 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 505. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0174] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0175] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0176] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0177] The electronic device provided by the embodiment of the present disclosure and the image processing method or special effects rendering method provided by the above-mentioned embodiments belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above-mentioned embodiments, and this embodiment has the same beneficial effects as the above-mentioned embodiments.
[0178] An embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the image processing method or special effect rendering method provided in the above embodiment is implemented.
[0179] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0180] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0181] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0182] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: performs panoramic dedistortion processing on the received picture frame to obtain a dedistorted picture frame; determines a picture frame to be processed according to the dedistorted picture frame, and obtains a cutout picture frame based on the picture frame to be processed; determines a target cutout picture frame corresponding to the picture frame according to the cutout picture frame, and achieves edge optimization of a target object in the target cutout picture frame based on panoramic dedistortion.
[0183] Or in response to a received special effect trigger instruction, obtain a special effect rendering material corresponding to the special effect trigger instruction; use the left-eye panoramic picture frame and the right-eye panoramic picture frame in the received binocular panoramic picture frame as received picture frames, and process the received picture frames according to the method described in the above embodiment to obtain a binocular target cutout picture frame; perform special effect rendering according to the binocular target cutout picture frame, the special effect rendering material and the determined depth information to obtain a binocular panoramic special effect picture frame.
[0184] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0185] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some implementations as replacements, the functions marked in the boxes can also occur in an order different from that marked in the accompanying drawings. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0186] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0187] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing.
[0188] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0189] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0190] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. An image processing method, characterized in that: include: Performing panoramic dedistortion processing on the received picture frames to obtain dedistorted picture frames; Determine a picture frame to be processed according to the dedistorted picture frame, and obtain a cutout picture frame based on the picture frame to be processed; According to the cutout picture frame, a target cutout picture frame corresponding to the received picture frame is determined, and the target object in the target cutout picture frame is edge optimized based on panoramic dedistortion.
2. The method according to claim 1, characterized in that The step of performing panoramic dedistortion processing on the received picture frames to obtain dedistorted picture frames includes: Obtaining pixel information of the picture frame; A dedistorted picture frame of the picture frame is determined according to the pixel point information.
3. The method according to claim 2, characterized in that Determining a dedistorted picture frame of the picture frame according to the pixel point information includes: Obtaining pixel values and first pixel coordinates of the pixel in the picture frame from the pixel information; Substituting the first pixel point coordinates into the projection de-distortion model to obtain the second pixel point coordinates of the corresponding pixel point; Based on the second pixel point coordinates and the pixel values of the corresponding pixel points, a dedistorted picture frame of the picture frame is formed.
4. The method according to claim 1, characterized in that The step of determining a to-be-processed picture frame according to the dedistorted picture frame comprises: Determining an input resolution of the dedistorted picture frame; The dedistorted picture frame is sampled according to a first set multiple of the input resolution, and a first picture frame after the sampling process is determined as a picture frame to be processed.
5. The method according to claim 1, characterized in that The step of determining a target cutout picture frame corresponding to the received picture frame according to the cutout picture frame comprises: Processing the edge area of the target object in the cutout picture frame to obtain a processed cutout optimized picture frame; The cutout optimized picture frame is dedistorted and restored to obtain a target cutout picture frame corresponding to the picture frame after restoration.
6. The method according to claim 5, characterized in that The step of processing the edge area of the target object in the cutout picture frame to obtain the processed cutout optimized picture frame includes: Performing guided filtering on the cutout picture frame according to the dedistorted picture frame to obtain a filtered cutout picture frame; Smoothing the edge area of the target object in the filtered cutout picture frame to obtain a first cutout picture frame; According to the confidence of the target object in the cutout picture frame, the first cutout picture frame is binarized, and the obtained second cutout picture frame is determined as the cutout optimized picture frame.
7. The method according to claim 6, characterized in that The step of performing guided filtering on the cutout picture frame according to the dedistorted picture frame to obtain a filtered cutout picture frame includes: Sampling the dedistorted picture frame according to a second set multiple of the input resolution of the dedistorted picture frame to obtain a second picture frame; The second picture frame and the cutout picture frame are input into a given guided filter, and the output filtering result is used as a filtered cutout picture frame.
8. A special effects rendering method, characterized in that: include: In response to the received special effect triggering instruction, obtaining the special effect rendering material corresponding to the special effect triggering instruction; Taking the left-eye panoramic picture frame and the right-eye panoramic picture frame in the received binocular panoramic picture frame as received picture frames, and processing the received picture frames according to the method described in any one of claims 1 to 7 to obtain a binocular target cutout picture frame; Special effects rendering is performed according to the binocular target cutout picture frame, special effects rendering material and the determined depth information to obtain a binocular panoramic special effects picture frame.
9. An image processing device, characterized in that: include: A dedistortion processing module, used for performing panoramic dedistortion processing on the received picture frames to obtain dedistorted picture frames; A target cutout determination module, used to determine a to-be-processed picture frame according to the dedistorted picture frame, and obtain a cutout picture frame based on the to-be-processed picture frame; The panoramic cutout determination module is used to determine a target cutout picture frame corresponding to the received picture frame according to the cutout picture frame, and the target object in the target cutout picture frame is edge optimized based on panoramic dedistortion.
10. A special effects rendering device, characterized in that: include: A material acquisition module, used to obtain a special effect rendering material corresponding to the special effect triggering instruction in response to the received special effect triggering instruction; a cutout picture determination module, configured to take a left-eye panoramic picture frame and a right-eye panoramic picture frame in the received binocular panoramic picture frame as received picture frames, and process the received picture frames according to the method described in any one of claims 1 to 7 to obtain a binocular target cutout picture frame; The special effect picture determination module is used to perform special effect rendering according to the binocular target cutout picture frame, special effect rendering material and the determined depth information to obtain a binocular panoramic special effect picture frame.
11. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
3d-image capturing device
CN102362487A
Method and system for displaying parts of bodies of experiencers in VR environment
CN106383576A
Three-dimensional virtual reality live method and device, and electronic device
CN106385576A
Full-automatic foreground and background separation method based on binocular vision
CN107301642A
Method and system for detecting and correcting target in fisheye camera picture
CN111723801A
