Image processing methods and apparatuses, computer-readable media and electronic devices

By layering the depth data of the image and repairing the data for each layer, the image quality problem caused by missing data when the RGB camera acquires the three-dimensional scene image is solved, a simplified data repair process and efficient image processing are achieved, and the cost is reduced. Computing resource requirements.

CN113920023BActive Publication Date: 2024-10-15GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111151629.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-29
Publication Date
2024-10-15
Estimated Expiration
2041-09-29

AI Technical Summary

Technical Problem

When existing RGB cameras acquire 3D scene images, data loss due to occlusion and other reasons leads to reduced image quality. The existing technology requires a large number of continuous frame images and complex computing resources, making it difficult to simplify the data repair process and increase speed.

Method used

Image layering is performed by obtaining the depth data of the image to be processed. After a preset number of layers, data is repaired for each layer to generate a three-dimensional scene image, simplifying the data repair process and reducing computing resource requirements.

Benefits of technology

Effectively control the number of data repairs, simplify the process, improve the running speed, and be able to perform data repair on a single frame image, reducing the requirements for computing resources and improving the efficiency of image data repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113920023B_ABST
    Figure CN113920023B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image processing method, an image processing device, a computer-readable medium and an electronic device, and relates to the field of image processing technology. The method comprises: obtaining depth data of an image to be processed, and performing image layering on the image to be processed according to the depth data to obtain a preset number of image layers to be processed; performing data repair on each image layer to be processed to obtain a repaired image layer corresponding to each image layer to be processed; and generating a three-dimensional scene image corresponding to the image to be processed based on the preset number of repaired image layers. The present disclosure can effectively control the number of executions of data repair by performing a preset number of layering on the image to be processed and performing data repair on each layer respectively, with a simple process and a fast running speed; at the same time, data repair can be performed through a single frame image, avoiding the process of requiring a large amount of data for a large amount of calculation in the related technology, thereby reducing the requirements of image repair on the computing resources of the repair device.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the advancement of science and technology, computer vision has been increasingly widely used in real life. However, the RGB cameras used in daily life can only obtain color data and corresponding depth data within the field of view, and cannot obtain partial color data and depth information of certain objects in the scene. This phenomenon causes the loss of data at the corresponding position on the image, which seriously affects the quality of the reconstructed three-dimensional scene image. For example, when there is occlusion in the environment, the camera cannot obtain partial color and partial depth information of the occluded object, resulting in large "holes" in the image data.

[0003] In related technologies, a large number of continuous frame images are usually used to repair the hole areas contained in the image data to improve the quality of the 3D scene image. However, this method requires a large number of continuous frame images as input, and also requires camera calibration and other operations to calculate information such as depth. The operation is relatively complex and has high requirements on the computing resources of the image processing equipment. Summary of the invention

[0004] The purpose of the present disclosure is to provide an image processing method, an image processing device, a computer-readable medium and an electronic device, thereby simplifying the image data repair process at least to a certain extent, improving the image data repair speed, and avoiding the limitation of the computing resources of the image repair device.

[0005] According to a first aspect of the present disclosure, there is provided an image processing method, comprising: acquiring depth data of an image to be processed, and performing image layering on the image to be processed according to the depth data to obtain a preset number of image layers to be processed; performing data repair on each image layer to be processed to obtain a repaired image layer corresponding to each image layer to be processed; and generating a three-dimensional scene image corresponding to the image to be processed based on the preset number of repaired image layers.

[0006] According to a second aspect of the present disclosure, an image processing device is provided, comprising: an image layering module, used to obtain depth data of an image to be processed, and perform image layering on the image to be processed according to the depth data to obtain a preset number of image layers to be processed; an image restoration module, used to perform data restoration on each image layer to be processed to obtain a restored image layer corresponding to each image layer to be processed; and an image generation module, used to generate a three-dimensional scene image corresponding to the image to be processed based on the preset number of restored image layers.

[0007] According to a third aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.

[0008] According to a fourth aspect of the present disclosure, an electronic device is provided, characterized in that it includes: a processor; and a memory for storing one or more programs, which enables the one or more processors to implement the above method when the one or more programs are executed by the one or more processors.

[0009] An image processing method provided by an embodiment of the present disclosure performs image layering on the image to be processed by acquiring the depth data of the image to be processed to obtain a preset number of image layers to be processed; then data repair is performed on each layer of the image to be processed to generate a three-dimensional scene image corresponding to the image to be processed according to the repaired image layers corresponding to the preset number of image layers to be processed. By performing a preset number of layering on the image to be processed and performing data repair on each layer, the number of executions of data repair can be effectively controlled, the process is simple, and the running speed is fast; at the same time, data repair can be performed through a single frame image, avoiding the process of requiring a large amount of data for a large amount of calculation in the related technology, thereby reducing the image repair's requirements for the computing resources of the repair device.

[0010] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0012] Figure 1 A schematic diagram showing an exemplary system architecture to which embodiments of the present disclosure may be applied;

[0013] Figure 2 A schematic diagram showing an electronic device to which the embodiments of the present disclosure can be applied;

[0014] Figure 3 A flowchart schematically illustrates an image processing method in an exemplary embodiment of the present disclosure;

[0015] Figure 4 A schematic diagram of obtaining depth data of an image to be processed in an exemplary embodiment of the present disclosure is schematically shown;

[0016] Figure 5 Schematically showing a comparison diagram before and after a noise reduction process in an exemplary embodiment of the present disclosure;

[0017] Figure 6A comparison diagram before and after edge-preserving filtering in an exemplary embodiment of the present disclosure is schematically shown;

[0018] Figure 7 Schematically showing a comparison diagram before and after a cavity repair process in an exemplary embodiment of the present disclosure;

[0019] Figure 8 Schematically showing a comparison diagram before and after edge clipping processing in an exemplary embodiment of the present disclosure;

[0020] Fig. 9 A schematic diagram schematically illustrates a method of layering an image to be processed to obtain three layers of image to be processed in an exemplary embodiment of the present disclosure;

[0021] Fig.10 A schematic diagram schematically illustrates a data repair process for an image layer to be processed in an exemplary embodiment of the present disclosure;

[0022] Fig.11 A schematic diagram schematically illustrates a camera movement route in a horizontal camera movement mode in an exemplary embodiment of the present disclosure;

[0023] Fig.12 A schematic diagram schematically illustrates a camera movement route in a circular camera movement mode in an exemplary embodiment of the present disclosure;

[0024] Fig.13 The following is a schematic diagram schematically showing the composition of an image processing device in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0026] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0027] Figure 1A schematic diagram showing a system architecture of an exemplary application environment in which an image processing method and apparatus according to an embodiment of the present disclosure can be applied.

[0028] like Figure 1 As shown, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The terminal devices 101, 102, 103 may be various electronic devices with image processing functions, including but not limited to desktop computers, portable computers, smart phones, tablet computers, etc. It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.

[0029] The image processing method provided in the embodiment of the present disclosure can be executed by the terminal devices 101, 102, and 103, and accordingly, the image processing device is generally arranged in the terminal devices 101, 102, and 103. However, it is easy for those skilled in the art to understand that the image processing method provided in the embodiment of the present disclosure can also be executed by the server 105, and accordingly, the image processing device can also be arranged in the server 105, which is not particularly limited in the present exemplary embodiment. For example, in an exemplary embodiment, the user can obtain the image and depth data to be processed through the camera module and depth sensor for collecting image and depth data included in the terminal devices 101, 102, and 103, and then upload the image and depth data to be processed to the server 105. After the server 105 generates a three-dimensional scene image through the image processing method provided in the embodiment of the present disclosure, the three-dimensional scene graph is transmitted to the terminal devices 101, 102, 103, etc.

[0030] An exemplary embodiment of the present disclosure provides an electronic device for implementing an image processing method, which may be Figure 1 The terminal device 101, 102, 103 or the server 105 in the embodiment of the present invention comprises at least a processor and a memory, the memory is used to store executable instructions of the processor, and the processor is configured to execute the image processing method by executing the executable instructions.

[0031] Below Figure 2 Taking the mobile terminal 200 in FIG. 1 as an example, the structure of the electronic device is exemplarily described. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Figure 2The structure in the figure can also be applied to fixed type devices. In other embodiments, the mobile terminal 200 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware. The interface connection relationship between the components is only shown schematically and does not constitute a structural limitation of the mobile terminal 200. In other embodiments, the mobile terminal 200 may also adopt the same Figure 2 Different interface connection methods, or a combination of multiple interface connection methods.

[0032] like Figure 2 As shown, the mobile terminal 200 may specifically include: a processor 210, an internal memory 221, an external memory interface 222, a Universal Serial Bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 271, a receiver 272, a microphone 273, an earphone interface 274, a sensor module 280, a display screen 290, a camera module 291, an indicator 292, a motor 293, a button 294, and a subscriber identification module (SIM) card interface 295, etc. The sensor module 280 may include a depth sensor 2801, a pressure sensor 2802, a gyroscope sensor 2803, etc.

[0033] The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor and / or a neural network processor (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0034] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. The NPU can realize applications such as intelligent cognition of the mobile terminal 200, such as image recognition, face recognition, voice recognition, text understanding, etc. In some embodiments, the NPU unit can realize data repair, scene recognition, execution of segmentation algorithms, etc.

[0035] The mobile terminal 200 implements the display function through a GPU, a display screen 290, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 290 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs that execute program instructions to generate or change display information. In some embodiments, the generation of three-dimensional scene images and the generation of three-dimensional videos can be realized by the GPU.

[0036] The mobile terminal 200 can realize the shooting function through the ISP, the camera module 291, the video codec, the GPU, the display screen 290 and the application processor. Among them, the ISP is used to process the data fed back by the camera module 291; the camera module 291 is used to capture static images or videos; the digital signal processor is used to process digital signals, and in addition to processing digital image signals, it can also process other digital signals; the video codec is used to compress or decompress digital videos, and the mobile terminal 200 can also support one or more video codecs. In some embodiments, multiple camera modules can be set in the mobile terminal to collect binocular images.

[0037] The depth sensor 2801 is used to obtain the depth information of the scene. In some embodiments, the depth sensor can be set in the camera module 291 to simultaneously obtain the image to be processed and the depth data of the image to be processed.

[0038] The pressure sensor 2802 is used to sense the pressure signal and convert the pressure signal into an electrical signal. The gyroscope sensor 2803 can be used to determine the motion posture of the mobile terminal 200. In addition, sensors with other functions can be set in the sensor module 280 according to actual needs, such as an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0039] In the related art, a large number of continuous frame images are usually used to repair the hole areas contained in the image data to improve the quality of the three-dimensional scene image. Specifically, a large number of continuous frame images can be used as input, and through camera calibration, feature point detection, feature point matching and other processes, a three-dimensional point cloud can be obtained to generate a three-dimensional scene image based on the three-dimensional point cloud and texture mapping. However, this method requires a large number of continuous frame images as input, and operations such as camera calibration are required to calculate information such as depth. The operation is relatively complicated and has high requirements on the computing resources of the image processing equipment.

[0040] Based on one or more of the above problems, this exemplary embodiment provides an image processing method. The image processing method can be applied to the above server 105, and can also be applied to one or more of the above terminal devices 101, 102, 103, which is not particularly limited in this exemplary embodiment. Figure 3 As shown, the image processing method may include the following steps S310 to S330:

[0041] In step S310, depth data of the image to be processed is acquired, and the image to be processed is layered according to the depth data to obtain a preset number of image layers to be processed.

[0042] The image to be processed may include a binocular image acquired by a binocular camera module, or a monocular image acquired by a monocular camera module; correspondingly, the depth data of the image to be processed may include absolute depth data acquired by a monocular camera module, or relative depth data acquired by a binocular camera module. For example, for a binocular mobile phone, the relative depth data of the image acquired by the main camera module can be obtained.

[0043] It should be noted that, in an exemplary embodiment, the terminal device that collects the image to be processed may not be equipped with a device for collecting depth data, for example, the mobile phone does not have a depth sensor. Figure 4 As shown, the depth prediction of the collected image to be processed can be performed based on the depth prediction network to predict the depth data corresponding to the image to be processed; the relative depth data of the image collected by the main camera module can be output based on the binocular image based on the binocular matching algorithm and other methods.

[0044] In an exemplary embodiment, after the depth data is obtained, before the image to be processed is layered according to the depth data, the depth data may be pre-processed first, and then the image to be processed may be layered according to the processed depth data.

[0045] In an exemplary embodiment, the preprocessing process may include a combination of one or more of the following processing modes: nonlinear mapping processing, noise reduction processing, edge-preserving filtering processing, hole repairing processing, and edge clipping processing.

[0046] In an exemplary embodiment, nonlinear mapping may be performed on all depth data, and the acquired depth data may be converted into short-distance relative depth data, and then noise reduction may be performed based on the converted relative depth data.

[0047] In an exemplary embodiment, the nonlinear mapping process can be implemented by the following formula (1):

[0048]

[0049] Among them, (d ij ) new represents the depth data after mapping; k represents the preset background depth mapping coefficient; (d ij ) old represents the depth data before mapping; n represents the total number of depth data. The depth of field of the depth data after mapping can be adjusted by the above formula (1).

[0050] In an exemplary embodiment, noise reduction processing can be performed on all depth data. When performing noise reduction processing, the depth data can be denoised by any noise reduction method. For example, the noise of the depth data can be processed by methods such as average depth determination, connected domain detection, and Gaussian filtering denoising. Figure 5 shown.

[0051] In an exemplary embodiment, for edge data in the depth data, edge-preserving filtering can be performed on the depth data. Specifically, the edge-preserving filtering can perform median filtering on the edge area in the depth data only for the area with a larger depth, while retaining the original depth data of the area with a smaller depth, such as Figure 6 As shown in the figure, the edge-preserving filter can achieve local effects and sharpen edges to distinguish objects of different depths in the image to be processed; at the same time, it can reduce the complexity of the median filter and retain the depth data of the complete edges of objects with shallow depths in the image to be processed.

[0052] In an exemplary embodiment, in some areas with strong exposure and weak texture, the depth data obtained by the depth prediction network or the binocular matching algorithm may have prediction errors. Therefore, a hole repair process can be performed on the depth data holes in the image to be processed to optimize the depth data, such as Figure 7 Specifically, a preset depth threshold can be used to obtain connected domains at different depths, and the size of the connected domain can be used to screen areas in the depth data that are obviously correlated with the depth of surrounding objects but have large differences in average depth values. These areas are identified as hole areas with prediction errors, and the expansion strategy is used to find the adjacent depth with the greatest correlation around the hole area to cover the depth data.

[0053] In an exemplary embodiment, for an image to be processed that contains many small objects, edge clipping can also be performed on the depth data. Specifically, an edge image between objects of different depths can be obtained by using a preset depth threshold, and then the size of each edge in the edge image is determined. When the size of the edge is smaller than the preset size threshold, the depth data at the edge location is smoothed to clip the small-sized edge, such as Figure 8 By cropping the small-size edges, the complexity of the image depth data can be reduced, thereby reducing the complexity of the subsequent image restoration process.

[0054] In an exemplary embodiment, after obtaining the depth data of the image to be processed, the image to be processed may be layered according to the depth according to the depth data to obtain a preset number of image layers to be processed. When layering based on the depth data, the pixels in the image to be processed may be first divided into multiple connected regions based on the depth data corresponding to each pixel in the image to be processed, and then the multiple connected regions may be classified based on a segmentation algorithm to obtain multiple types of connected region sets; then the connected region sets may be combined according to preset rules to obtain a preset number of image layers to be processed.

[0055] The segmentation algorithm used may be a semantic segmentation algorithm, a panoramic segmentation algorithm, or other segmentation algorithm that can distinguish different objects in a scene; the preset rules may be set differently according to the type of image to be processed. For example, for an image to be processed that contains a portrait, since the portrait is usually the main area, the preset rules may be set as follows: the connected area set that belongs to the portrait area identified by the segmentation algorithm is taken as one layer; the connected area set of other objects identified by the segmentation algorithm is combined as one layer; the connected area set that belongs to the background identified by the segmentation algorithm is combined as one layer, and a total of three layers of image to be processed are obtained, such as Fig. 9 shown.

[0056] By layering the image to be processed using depth data and semantic segmentation algorithms, the main objects in the image to be processed can be distinguished from other objects. When performing data repair on each layer of the image to be processed later, the depth data between layers can be avoided from influencing each other. At the same time, by presetting the number of layers, the number of executions of the image repair algorithm can be controlled, thereby simplifying the image repair process and improving the running speed.

[0057] In step S320, data restoration is performed on each to-be-processed image layer to obtain a restored image layer corresponding to each to-be-processed image layer.

[0058] In an exemplary embodiment, after obtaining a preset number of image layers to be processed, data restoration may be performed on each image layer to be processed to obtain a restored image layer corresponding to each image layer to be processed.

[0059] Specifically, for each image layer to be processed, the edge data to be processed in the image layer to be processed is first extracted, and the edge data to be processed is repaired, so as to convert the image to be processed into the edge data of the unknown area in the three-dimensional scene image through the known edge prediction in the image layer to be processed. Since the edge data can well reflect the structural data when the image to be processed is converted into the three-dimensional scene image, the repaired edge data can be used as prior data. The depth data of the unknown area in the three-dimensional scene image is converted into the image to be processed by predicting the known depth data in the image layer to be processed, so as to repair the depth data of the image layer to be processed; at the same time, the color data of the unknown area in the three-dimensional scene image is converted into the image to be processed by predicting the known color data in the image layer to be processed, so as to repair the color data of the image layer to be processed; then a complete repaired image layer is generated based on the repaired edge data, repaired depth data and repaired color data.

[0060] For example, in an exemplary embodiment, edge data, depth data, and color data of an image may be restored by using an image restoration network based on deep learning. Fig.10 As shown ( Fig.10 The processing process of the main object layer is drawn in detail, and the processing process of the secondary object layer and the background layer is not drawn in detail, and their processing processes are the same as the processing process of the main object layer). Assuming that the image to be processed is an image containing a portrait, three image layers to be processed are obtained based on the preset rules, namely the main object layer, the secondary object layer, and the background layer. For each of the above three layers, the following processing is required: the edge data contained in the layer can be extracted first (since the image layer to be processed is actually a part of the image to be processed, the edge data obtained is actually a local edge), and the edge data is repaired through the edge repair model to obtain the repaired edge data corresponding to the layer; then the depth data of the layer is extracted, and the repaired edge data and depth data of the layer are input into the depth repair model together to perform data repair on the depth data of the layer; at the same time, the color data of the layer can be extracted, and the repaired edge data and color data of the layer are input into the color repair model together to perform data repair on the color data of the layer. For example, when performing color repair on the main object layer, the missing part of the known image in the main object layer (such as Fig.10 The repaired area in the image is repaired; and then a repaired image layer is generated by jointly generating the repaired edge data, the repaired depth data, and the repaired color data.

[0061] In step S330, a three-dimensional scene image corresponding to the image to be processed is generated based on a preset number of repaired image layers.

[0062] In an exemplary embodiment, after obtaining a preset number of repaired image layers corresponding to a preset number of image layers to be processed, the data of each repaired image layer can be integrated, and the integrated repaired image layer data can be rendered by an image rendering device such as a GPU to obtain a three-dimensional scene image corresponding to the image to be processed.

[0063] In addition, in an exemplary embodiment, after obtaining the 3D scene image, a 3D video can also be generated according to the 3D scene image. Specifically, scene recognition can be performed on the 3D scene image to determine the scene type corresponding to the 3D scene image, and then the camera movement route corresponding to the 3D scene can be determined according to different scene types, and the corresponding 3D video can be generated based on the camera movement route and the 3D scene image.

[0064] In an exemplary embodiment, a segmentation algorithm can be used to identify the categories of objects contained in a three-dimensional scene image, and then the scene is divided according to the categories of the objects in the segmentation results to obtain the scene type; then, based on the corresponding relationship between the pre-defined scene type and the camera movement route, the camera movement route corresponding to the three-dimensional scene is determined, and then the corresponding three-dimensional video is generated based on the camera movement route and the three-dimensional scene image.

[0065] The segmentation algorithm used may be a semantic segmentation algorithm, a panoramic segmentation algorithm, or other segmentation algorithm that can distinguish different objects in a scene.

[0066] For example, when objects that obviously only appear in indoor scenes (such as sofas, televisions, dining tables, etc.) appear, the scene type of the three-dimensional scene image can be determined to be an indoor scene. When objects that obviously only appear in outdoor scenes (such as airplanes, bicycles, ships, etc.) appear, the scene type of the three-dimensional scene image can be determined to be an outdoor scene. When some objects (such as potted plants, cats, people, etc.) appear in the scene and there are no obvious indoor and outdoor objects mentioned above, the scene type of the three-dimensional scene image can be determined to be an uncertain scene. Among them, for indoor scenes, since the depth of details is relatively clear, the camera movement route can be determined in the three-dimensional scene image in a horizontal camera movement manner (such as Fig.11 For outdoor scenes, the camera movement route can be determined in the 3D scene image by using a zooming method (to achieve the effect of keeping the foreground stationary and the background FOV larger) to reduce problems such as foreground boundary breakage caused by inaccurate depth images; for uncertain scenes, the corresponding camera movement can be set based on the number of different types of objects contained in the scene. For example, when there are many objects such as potted plants, a circular camera movement method can be used to determine the camera movement route in the 3D scene image (such as Fig.12 shown).

[0067] It should be noted that after the camera movement mode is determined, different camera movement route starting points can be selected in the three-dimensional scene according to different camera movement modes. For example, for horizontal camera movement, the starting point coordinates can be set in advance; for circular camera movement, the center, radius and starting direction of the circle can be set in advance, and the present disclosure does not make special restrictions on this.

[0068] In an exemplary embodiment, after the camera movement route is determined, a three-dimensional scene can be established first according to the three-dimensional scene image, that is, the repaired scene is converted into a triangular mesh through the depth data contained in the three-dimensional scene image, and then the surface color is determined using the color data of the three vertices of each triangle to complete the establishment of the three-dimensional scene; then, the perspective image corresponding to each route point on the camera movement route is obtained in the three-dimensional scene, and then the corresponding perspective images are connected together based on the order of each route point on the camera movement route to generate a video output.

[0069] In summary, in this exemplary embodiment, on the one hand, three-dimensional video can be generated based on images, which greatly increases the fun and playability of camera photography, and the amount of data required for collection is small and easy to collect; on the other hand, through methods such as depth prediction network and binocular matching algorithm, historical images that do not contain depth data can also be converted into three-dimensional videos; on the other hand, through the deep noise reduction processing scheme, the complexity of image depth is reduced, and the distinction between different targets is improved, thereby effectively controlling the number of executions of data repair; in addition, the scene is classified through segmentation technology, and the camera movement route is determined by the adaptive camera movement method, which reduces the complexity of the three-dimensional scene and improves the visual effect of generating three-dimensional video.

[0070] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0071] For further reference, Fig.13 As shown, in the embodiment of this example, an image processing device 1300 is also provided, including an image layering module 1310, an image restoration module 1320 and an image generation module 1330. Among them:

[0072] The image layering module 1310 may be used to obtain depth data of an image to be processed, and perform image layering on the image to be processed according to the depth data to obtain a preset number of image layers to be processed.

[0073] The image restoration module 1320 may be used to perform data restoration on each image layer to be processed, so as to obtain a restored image layer corresponding to each image layer to be processed.

[0074] The image generation module 1330 may be configured to generate a three-dimensional scene image corresponding to the image to be processed based on a preset number of restoration image layers.

[0075] In an exemplary embodiment, the image processing device may also include a video generation module, which can be used to perform scene recognition on the three-dimensional scene image to determine the scene type corresponding to the three-dimensional scene image; determine the camera movement route corresponding to the three-dimensional scene image according to the scene type; and generate a corresponding three-dimensional video based on the camera movement route and the three-dimensional scene image.

[0076] In an exemplary embodiment, the video generation module can also be used to establish a three-dimensional scene based on the three-dimensional scene image, and obtain the perspective image corresponding to each route point on the camera movement route in the three-dimensional scene; and generate a three-dimensional video based on the order of each route point on the camera movement route by connecting each perspective image.

[0077] In an exemplary embodiment, the image layering module 1310 may be used to pre-process the depth data, so as to perform image layering on the image to be processed according to the processed depth data to obtain a preset number of image layers to be processed.

[0078] In an exemplary embodiment, the preprocessing includes at least one of the following processing modes: nonlinear mapping processing, noise reduction processing, edge-preserving filtering processing, hole repairing processing and edge clipping processing.

[0079] In an exemplary embodiment, the image layering module 1310 can be used to divide the pixels in the image to be processed into multiple connected regions based on the depth data corresponding to each pixel in the image to be processed; classify the multiple connected regions based on a segmentation algorithm to obtain multiple types of connected region sets; and combine the connected region sets according to preset rules to obtain a preset number of image layers to be processed.

[0080] In an exemplary embodiment, the image restoration module 1320 can be used to extract edge data to be processed in the image layer to be processed, perform edge restoration on the edge data to be processed, and obtain restored edge data after restoration; perform data restoration on the depth data of the image layer to be processed based on the restored edge data, and obtain restored depth data after restoration; perform color restoration on the color data of the image layer to be processed based on the restored edge data, and obtain restored color data after restoration; generate a restored image layer based on the restored edge data, the restored depth data, and the restored color data.

[0081] The specific details of each module in the above device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0082] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0083] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible implementations, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of the present specification, for example, it can execute Figure 3 Any one or more steps in .

[0084] It should be noted that the computer-readable medium shown in the present disclosure 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.

[0085] 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, apparatus, 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, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A 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 combination 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: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0086] In addition, program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0087] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0088] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An image processing method, characterized in that: include: Acquire depth data of an image to be processed, and perform image layering on the image to be processed according to the depth data to obtain a preset number of image layers to be processed; The step of layering the image to be processed according to the depth data to obtain a preset number of image layers to be processed includes: dividing the pixels in the image to be processed into a plurality of connected regions based on the depth data corresponding to each pixel in the image to be processed; classifying the plurality of connected regions based on a segmentation algorithm to obtain a plurality of types of connected region sets; and combining the connected region sets according to a preset rule to obtain a preset number of image layers to be processed; Performing data repair on each of the image layers to be processed to obtain a repaired image layer corresponding to each of the image layers to be processed; performing data repair on each of the image layers to be processed includes: extracting edge data to be processed in the image layer to be processed, performing edge repair on the edge data to be processed, and obtaining repaired edge data after repair; performing data repair on the depth data of the image layer to be processed based on the repaired edge data, and obtaining repaired depth data after repair; performing color repair on the color data of the image layer to be processed based on the repaired edge data, and obtaining repaired color data after repair; generating the repaired image layer based on the repaired edge data, the repaired depth data and the repaired color data; A three-dimensional scene image corresponding to the image to be processed is generated based on the preset number of repaired image layers.

2. The method according to claim 1, characterized in that The method further comprises: Performing scene recognition on the three-dimensional scene image to determine a scene type corresponding to the three-dimensional scene image; Determining a camera movement route corresponding to the three-dimensional scene image according to the scene type; A corresponding three-dimensional video is generated based on the camera movement route and the three-dimensional scene image.

3. The method according to claim 2, characterized in that The generating a corresponding three-dimensional video based on the camera movement route and the three-dimensional scene image includes: Establishing a three-dimensional scene according to the three-dimensional scene image, and acquiring a perspective image corresponding to each route point on the camera movement route in the three-dimensional scene; The three-dimensional video is generated by sequentially connecting the perspective images based on the route points on the camera movement route.

4. The method according to claim 1, characterized in that: Before performing image layering on the image to be processed according to the depth data to obtain a preset number of image layers to be processed, the method further includes: The depth data is preprocessed to perform image layering on the image to be processed according to the processed depth data to obtain a preset number of image layers to be processed.

5. The method according to claim 4, characterized in that The pre-processing includes at least one of the following processing methods: Non-linear mapping processing, noise reduction processing, edge-preserving filtering processing, hole repair processing and edge clipping processing.

6. An image processing device, characterized in that: include: An image layering module is used to obtain depth data of an image to be processed, and perform image layering on the image to be processed according to the depth data to obtain a preset number of image layers to be processed; the image layering on the image to be processed according to the depth data to obtain a preset number of image layers to be processed is configured to: divide the pixels in the image to be processed into a plurality of connected areas based on the depth data corresponding to each pixel in the image to be processed; Classifying the multiple connected regions based on a segmentation algorithm to obtain multiple types of connected region sets; Combining the connected region sets according to preset rules to obtain a preset number of image layers to be processed; An image restoration module is used to perform data restoration on each of the image layers to be processed to obtain a restoration image layer corresponding to each of the image layers to be processed; the data restoration on each of the image layers to be processed is configured to: extract edge data to be processed in the image layer to be processed, perform edge restoration on the edge data to be processed, and obtain restored edge data after restoration; Performing data repair on the depth data of the image layer to be processed based on the repaired edge data to obtain repaired depth data; Performing color restoration on the color data of the to-be-processed image layer based on the restoration edge data to obtain restored color data; Generate the repaired image layer based on the repaired edge data, the repaired depth data and the repaired color data; An image generation module is used to generate a three-dimensional scene image corresponding to the image to be processed based on the preset number of repaired image layers.

7. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

8. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 5 by executing the executable instructions.