Depth image generation method and apparatus, electronic device, computer readable storage medium, and computer program product

By acquiring and fusing sub-images with depth information and sub-images without depth information, and using the depth prediction model to generate a complete depth image, the problem of performance differences of the depth image generation model in different scenes is solved, and the universality and versatility of the scene are improved.

WO2024222197A1PCT designated stage expired Publication Date: 2024-10-31TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/079637
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-27
Filing Date
2024-03-01
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

In the existing technology, the depth image generation model has poor performance in application scenarios that lack samples, resulting in insufficient scene universality. Moreover, the traditional depth map completion method relies on a large amount of calibration data and professional knowledge, and has weak versatility.

Method used

By obtaining the first sub-depth image with depth information and the second sub-depth image without depth information, the depth prediction model is used to predict the depth information of the pixels in the second color area in the color image, and the two are fused. Generate complete depth images, reduce dependence on application scenarios, and improve scene universality.

Benefits of technology

It significantly improves the scene universality of the depth image generation model, reduces the dependence on training samples and application scenarios, reduces the cost of data calibration and model training, and realizes depth image generation in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024079637_31102024_PF_FP_ABST
    Figure CN2024079637_31102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a depth image generation method and apparatus, an electronic device, a computer readable storage medium, and a computer program product. The method comprises: acquiring a first sub-depth image with depth information and a second sub-depth image without depth information; acquiring a depth prediction model, wherein the depth prediction model is obtained by training by taking pixel points in a first color area in a color image as samples and taking the corresponding depth information in the first sub-depth image as a label; predicting depth information of each pixel point in a second color area in the color image by means of the depth prediction model to obtain a third sub-depth image corresponding to the second color area; and fusing the first sub-depth image and the third sub-depth image to obtain a complete depth image corresponding to the color image. The present application can effectively improve the scenario universality of generating a depth image.
Need to check novelty before this filing date? Find Prior Art

Description

Depth image generation method, device, electronic device, computer-readable storage medium, and computer program product

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on the Chinese patent application with application number 202310477567.7 and application date April 27, 2023, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference. Technical Field

[0003] The present application relates to the field of computer technology, and in particular to a method, device, electronic device, computer-readable storage medium, and computer program product for generating a depth image. Background Art

[0004] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.

[0005] In related technologies, a large number of samples are usually pre-calibrated to train the machine learning model, which is then used to generate depth images. As a result, the machine learning model used to generate depth images is only applicable to sample-related application scenarios. In other application scenarios where samples are scarce, the machine learning model is not effectively trained (missing samples from other application scenarios), resulting in poor performance of the trained machine learning model in other application scenarios, and poor universality of depth image generation scenarios.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a method, apparatus, electronic device, computer-readable storage medium, and computer program product for generating a depth image, which can effectively improve the scene universality of generated depth images.

[0008] The technical solution of the embodiment of the present application is implemented as follows:

[0009] The present invention provides a method for generating a depth image, including:

[0010] Acquire a first sub-depth image having depth information and a second sub-depth image having no depth information;

[0011] The first sub-depth image and the second sub-depth image are obtained by dividing the depth image corresponding to the color image, the first sub-depth image corresponds to a first color area in the color image, and the second sub-depth image corresponds to a second color area in the color image;

[0012] Obtaining a depth prediction model, where the depth prediction model is trained using pixels within a first color region in the color image as samples and corresponding depth information in the first sub-depth image as labels;

[0013] Predicting depth information of each pixel within a second color area in the color image using the depth prediction model to obtain a third sub-depth image corresponding to the second color area;

[0014] The first sub-depth image and the third sub-depth image are fused to obtain a complete depth image corresponding to the color image.

[0015] The present invention provides a device for generating a depth image, including:

[0016] an image acquisition module configured to acquire a first sub-depth image having depth information and a second sub-depth image having no depth information; wherein the first sub-depth image and the second sub-depth image are obtained by dividing a depth image corresponding to a color image, the first sub-depth image corresponding to a first color region in the color image, and the second sub-depth image corresponding to a second color region in the color image;

[0017] a model acquisition module configured to acquire a depth prediction model, wherein the depth prediction model is trained using pixels within a first color region in the color image as samples and corresponding depth information in the first sub-depth image as labels;

[0018] a prediction module configured to predict depth information of each pixel in a second color area in the color image using the depth prediction model to obtain a third sub-depth image corresponding to the second color area;

[0019] A fusion module is configured to fuse the first sub-depth image with the third sub-depth image to obtain a complete depth image corresponding to the color image.

[0020] An embodiment of the present application provides an electronic device, including:

[0021] a memory configured to store computer-executable instructions or computer programs;

[0022] The processor is configured to implement the method for generating a depth image provided in an embodiment of the present application when executing the computer executable instructions or computer program stored in the memory.

[0023] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions configured to cause a processor to execute the instructions to implement the depth image generation method provided in the embodiment of the present application.

[0024] The present invention provides a computer program product comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the depth image generation method described in the present invention.

[0025] The embodiments of the present application have the following beneficial effects:

[0026] By obtaining a first sub-depth image with depth information and a second sub-depth image without depth information, as well as a first color area in the color image corresponding to the first sub-depth image and a second color area in the color image corresponding to the second sub-depth image, the depth information of each pixel in the second color area in the color image is predicted through a depth prediction model to obtain a third sub-depth image, and the first sub-depth image and the third sub-depth image are fused to obtain a complete depth image corresponding to the color image. In this way, since the training process of the depth prediction model is based on the pixels in the first color area of ​​the color image as samples for training, the prediction process of the depth prediction model predicts the depth information of each pixel in the second color area of ​​the color image. The first color area and the second color area are both from the same color image. Regardless of the application scenario of the color image, some areas of the color image lack depth information (that is, the first color area in the color image has depth information, and the second color area in the color image does not have depth information), the depth information of the second sub-depth image without depth information can be predicted through the first sub-depth image with depth information corresponding to the color image. Therefore, in the process of depth image generation, the dependence on the application scenario is significantly reduced, thereby effectively dismantling the strong scene coupling relationship between the training samples and the generated depth image during the training process and the application process, thereby effectively improving the scene universality of the generated depth image. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] FIG1 is a schematic diagram of the architecture of a depth image generation system provided in an embodiment of the present application;

[0028] FIG2 is a schematic diagram of the structure of an electronic device for generating a depth image provided by an embodiment of the present application;

[0029] FIG3 is a flowchart of a method for generating a depth image according to an embodiment of the present application;

[0030] FIG4 is a second flow chart of a method for generating a depth image provided in an embodiment of the present application;

[0031] FIG5 is a third flow chart of a method for generating a depth image provided in an embodiment of the present application;

[0032] FIG6 is a fourth flow chart of a method for generating a depth image provided in an embodiment of the present application;

[0033] FIG7 is a schematic diagram of the structure of a depth prediction model provided in an embodiment of the present application;

[0034] FIG8 is a fifth flow chart of the method for generating a depth image provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0036] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0037] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0039] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0040] 1) Artificial Intelligence (AI): The theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. AI technology is an interdisciplinary discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics.

[0041] 2) Convolutional Neural Networks (CNN): These are a type of feedforward neural network (FNN) that incorporates convolutional computations and possesses a deep structure. They are a representative algorithm for deep learning. CNNs possess representation learning capabilities and can perform shift-invariant classification of input images based on their hierarchical structure.

[0042] 3) Convolutional Layer: Each convolutional layer in a convolutional neural network consists of several convolutional units, whose parameters are optimized through a backpropagation algorithm. The purpose of the convolution operation is to extract different features from the input. The first convolutional layer may only extract low-level features such as edges, lines, and corners. A network with more layers can iteratively extract more complex features from these low-level features.

[0043] 4) Pooling Layer: After feature extraction in the convolutional layer, the output feature map is passed to the pooling layer for feature selection and information filtering. The pooling layer contains a pre-defined pooling function, which replaces the result of a single point in the feature map with the feature map statistics of its adjacent area. The pooling layer selects the pooling area in the same way as the convolution kernel scans the feature map, and is controlled by the pooling size, stride, and padding.

[0044] 5) Fully-Connected Layer: A fully-connected layer in a convolutional neural network is equivalent to a hidden layer in a traditional feedforward neural network. It is located at the end of the hidden layer of a convolutional neural network and only transmits signals to other fully-connected layers. Feature maps lose their spatial topology in fully-connected layers, becoming flattened into vectors and passing through activation functions.

[0045] 6) Game Program: A game program may be any of a massively multiplayer online role-playing game (MMORPG), a first-person shooter (FPS), a third-person shooter, a multiplayer online battle arena (MOBA), a virtual reality application, a three-dimensional mapping program, a simulation program, or a multiplayer shootout survival game.

[0046] 7) Depth Image: Also known as a depth map, the pixel value of each pixel in a depth image indicates the pixel depth, or the distance between the camera and the physical point corresponding to that pixel in the physical scene. Pixel depth refers to the number of bits used to store each pixel and is also used to measure image resolution. Pixel depth determines the number of possible colors per pixel in a color image or the number of possible grayscale levels per pixel in a grayscale image. For example, if each pixel in a color image is represented by three components (R, G, and B), and each component uses 8 bits, then a pixel is represented using 24 bits. This means that the pixel depth is 24, and each pixel can be one of 16,777,216 (2 to the power of 24) colors. In this sense, pixel depth is often referred to as image depth. The more bits used to represent a pixel, the more colors it can express, and the greater its depth.

[0047] 8) The color image can be an image in RGB color mode. RGB color mode is a color standard in the industry. It obtains various colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. RGB represents the colors of the three channels of red, green, and blue. This standard covers almost all colors that can be perceived by human vision and is one of the most widely used color systems.

[0048] During the implementation of the embodiments of this application, the applicant discovered that the related technology has the following problems:

[0049] In related technologies, a large number of samples are usually pre-calibrated to train the machine learning model, which is then used to generate depth images. As a result, the machine learning model used to generate depth images is only applicable to sample-related application scenarios. In other application scenarios lacking samples, the machine learning model is not effectively trained (missing samples from other application scenarios), resulting in poor performance of the trained machine learning model in other application scenarios, resulting in poor universality of depth image generation scenarios.

[0050] In the related technologies, traditional depth map completion relies heavily on the prior knowledge of professional technicians, scene characteristics, and data acquisition equipment characteristics. When the above characteristics change, it is often impossible to obtain reasonable and ideal depth completion results, and the method's versatility is relatively weak. Depth map completion methods based on supervised learning: This type of method requires a large amount of depth-calibrated data for training, and the data collection and calibration costs are very high; moreover, this type of method can only be applied to scenes similar to the training data. When the scene changes significantly, the depth completion performance usually drops significantly, and the method's versatility is also poor. Depth map completion based on unsupervised learning requires high accuracy of the camera parameters of the incomplete depth map it relies on, and it is very difficult to obtain camera parameter information. In addition, this type of method is also highly dependent on training data and cannot be directly applied to scenes that are significantly different from the training data. The method's versatility is also poor. In response to the above-mentioned shortcomings of the related technology, the embodiments of the present application improve the scene universality of the generated depth image by utilizing a self-supervised learning strategy. The embodiments of the present application propose a method of training a depth prediction model relying only on an incomplete depth map, and using the trained depth prediction model to complete the depth of the incomplete depth map. The embodiments of the present application do not require large-scale calibration data for training. It only needs to understand and encode the known scene areas in the incomplete depth map to infer the depth information of the unknown depth area, thereby greatly reducing the dependence on data and scenes, and greatly improving the scene universality of the generated depth image.

[0051] The embodiments of the present application provide a method, apparatus, electronic device, computer-readable storage medium, and computer program product for generating a depth image, which can effectively improve the scene universality of generated depth images. The following describes an exemplary application of the depth image generation system provided by the embodiments of the present application.

[0052] See Figure 1, which is a schematic diagram of the architecture of a depth image generation system 100 provided in an embodiment of the present application. The terminal (terminal 400 is shown as an example) is connected to the server 200 through a network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0053] The terminal 400 is configured to display a complete depth image on a graphical interface 410 - 1 (graphic interface 410 - 1 is shown as an example) for a user to use a client 410. The terminal 400 and the server 200 are connected to each other via a wired or wireless network.

[0054] In some embodiments, the server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal 400 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart TV, a smart watch, a car terminal, an augmented reality device, a gaming device, etc., but is not limited to this. The electronic device provided in the embodiment of the present application can be implemented as a terminal or as a server. The terminal and the server can be directly or indirectly connected by wired or wireless communication, which is not limited in the embodiment of the present application.

[0055] In some embodiments, the terminal 400 obtains a first sub-depth image and a second sub-depth image, and obtains a depth prediction model. Through the depth prediction model, the depth information of each pixel in the second color area in the color image is predicted to obtain a third sub-depth image, and the third sub-depth image and the first sub-depth image are fused to obtain a complete depth image, and the complete depth image is sent to the server 200.

[0056] In other embodiments, the server 200 obtains a first sub-depth image and a second sub-depth image, and obtains a depth prediction model. Through the depth prediction model, the server 200 predicts the depth information of each pixel in the second color area in the color image to obtain a third sub-depth image, and fuses the third sub-depth image with the first sub-depth image to obtain a complete depth image, and sends the complete depth image to the terminal 400.

[0057] In other embodiments, the embodiments of the present application can be implemented with the help of cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or local area network to realize data calculation, storage, processing, and sharing.

[0058] Cloud technology is a general term for network, information, integration, management platform, and application technologies used in the cloud computing business model. It can form a resource pool that can be used flexibly and conveniently on demand. Cloud computing technology will become a key support. The backend services of technical network systems require a large amount of computing and storage resources.

[0059] Referring to Figure 2, Figure 2 is a structural diagram of an electronic device 500 for generating a depth image provided by an embodiment of the present application, wherein the electronic device 500 shown in Figure 2 can be the server 200 or the terminal 400 in Figure 1, and the electronic device 500 shown in Figure 2 includes: at least one processor 430, a memory 450, and at least one network interface 420. The various components in the electronic device 500 are coupled together through a bus system 440. It can be understood that the bus system 440 is configured to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as bus systems 440 in Figure 2.

[0060] The processor 430 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0061] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 430.

[0062] The memory 450 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0063] In some embodiments, the memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.

[0064] Operating system 451, including system programs configured to handle various basic system services and perform hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., configured to implement various basic services and handle hardware-based tasks;

[0065] The network communication module 452 is configured to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB).

[0066] In some embodiments, the depth image generation device provided in the embodiments of the present application can be implemented in software. FIG2 shows a depth image generation device 455 stored in the memory 450. The depth image generation device 455 can be software in the form of a program or plug-in, and includes the following software modules: image acquisition module 4551, model acquisition module 4552, prediction module 4553, and fusion module 4554. These modules are logical and can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.

[0067] In other embodiments, the depth image generation device provided in the embodiments of the present application can be implemented in hardware. As an example, the depth image generation device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the depth image generation method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0068] In some embodiments, the terminal or server can implement the depth image generation method provided in the embodiments of the present application by running a computer program or computer executable instructions. For example, the computer program can be a native program in the operating system (for example, a dedicated depth image generation program) or a software module, for example, a depth image generation module that can be embedded in any program (such as an instant messaging client, a photo album program, an electronic map client, a navigation client); for example, it can be a native application (APP, Application), that is, a program that needs to be installed in the operating system to run. In short, the above-mentioned computer program can be any form of application, module or plug-in.

[0069] The method for generating a depth image provided in the embodiment of the present application will be described in conjunction with the exemplary application and implementation of the server or terminal provided in the embodiment of the present application.

[0070] Refer to Figure 3, which is a flow chart of the depth image generation method provided in an embodiment of the present application. It will be explained in conjunction with steps 101 to 104 shown in Figure 3. The depth image generation method provided in an embodiment of the present application can be implemented separately by the server or the terminal, or jointly by the server and the terminal. The following will be explained using the server alone as an example.

[0071] In step 101 , a first sub-depth image with depth information and a second sub-depth image without depth information are acquired.

[0072] In some embodiments, the first sub-depth image and the second sub-depth image are obtained by dividing the depth image corresponding to the color image, the first sub-depth image corresponds to the first color area in the color image, and the second sub-depth image corresponds to the second color area in the color image.

[0073] As an example, for color image A, color image A includes a first color area A1 and a second color area A2. The image corresponding to the first color area A1 in the depth image corresponding to color image A is the first sub-depth image, and the image corresponding to the second color area A2 in the depth image corresponding to color image A is the second sub-depth image.

[0074] In some embodiments, the color image may be an image in RGB color mode. RGB color mode is a color standard in the industry. Various colors are obtained by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. RGB represents the colors of the three channels of red, green, and blue. This standard covers almost all colors that can be perceived by human vision and is one of the most widely used color systems.

[0075] In some embodiments, the pixels in the first sub-depth image correspond one-to-one to the pixels in the first color area of ​​the color image, and the pixels in the second sub-depth image correspond one-to-one to the pixels in the second color area of ​​the color image. The pixels in the first sub-depth image are used to indicate the depth information of the pixels, and the pixels in the first color area are used to indicate the color information of the pixels. The image content indicated by the pixels in the first sub-depth image and the pixels in the first color area are the same.

[0076] In some embodiments, referring to FIG. 4 , FIG. 4 is a second flow chart of a method for generating a depth image provided in an embodiment of the present application. Step 101 shown in FIG. 3 can be implemented by executing steps 1011 to 1014 shown in FIG. 4 .

[0077] In step 1011, a depth image corresponding to the color image is obtained.

[0078] As an example, the expression of the image information of each pixel in the color image can be: p =[u p ,v p ,r p ,g p ,b p ] (1)

[0079] Among them, V p Used to indicate the image information of pixel p, u p Used to indicate the horizontal coordinate of pixel point p in the color image, v p Used to indicate the vertical coordinate of pixel point p in the color image, r p ,g p ,b p Indicates the color values ​​of the three color channels of pixel p respectively.

[0080] As an example, the expression of the image information of the corresponding pixel in the depth image corresponding to the color image can be:

[0081] Among them, U p Used to indicate the image information of pixel p, u p Used to indicate the horizontal coordinate of the pixel point p in the depth image, v p Used to indicate the vertical coordinate of pixel point p in the depth image, Used to indicate the depth information of pixel point p. When pixel point p is in the first sub-depth image, When the pixel point p is in the second sub-depth image,

[0082] In some embodiments, since the depth image corresponding to the color image and the color image have the same image size and the pixels correspond one to one, the reference coordinate system of the color image is a coordinate system with the origin pixel of the color image as the origin, and the depth image corresponding to the color image is a coordinate system with the origin pixel of the depth image corresponding to the color image as the origin. Therefore, the reference coordinate system of the color image completely overlaps with the reference coordinate system of the depth image corresponding to the color image. Therefore, the pixels in the depth image corresponding to the color image have the same coordinates as the corresponding pixels in the color image.

[0083] In step 1012 , the following processing is performed on each pixel of the depth image: when the pixel has depth information, the pixel is determined as a first pixel; when the pixel does not have depth information, the pixel is determined as a second pixel.

[0084] In some embodiments, before executing the above step 1012, whether the pixel point has depth information can be determined in the following manner: the following processing is performed on each pixel point of the depth image: the value of the depth information of the pixel point is compared with zero, and when the comparison result indicates that the value of the depth information of the pixel point is greater than zero, it is determined that the pixel point has depth information; when the value of the depth information of the pixel point is equal to zero, it is determined that the pixel point does not have depth information.

[0085] As an example, pixel A in the depth image has depth information, and pixel A is determined as the first pixel. Pixel B in the depth image does not have depth information, and pixel B is determined as the second pixel.

[0086] In step 1013 , the area formed by each first pixel point in the depth image is divided into a first sub-depth image.

[0087] As an example, the first pixel points in the depth image include pixel point A, pixel point C, and pixel point D, and the area formed by pixel point A, pixel point C, and pixel point D is divided into a first sub-depth image.

[0088] In step 1014 , the area formed by each second pixel point in the depth image is divided into a second sub-depth image.

[0089] As an example, the first pixel points in the depth image include pixel point B, pixel point E, and pixel point F, and the area formed by pixel point B, pixel point E, and pixel point F is divided into the second sub-depth image.

[0090] In this way, by dividing the depth image with incomplete depth information (the depth image corresponding to the color image) into a first sub-depth image and a second sub-depth image according to whether it has depth information, it is convenient to subsequently train the initial depth prediction model based on the first color area in the color image corresponding to the first sub-depth image with depth information. The depth information of the second sub-depth image is predicted by the trained depth prediction model. Since the training sample (first sub-depth image) and the image to be predicted (second sub-depth image) are both from the depth image corresponding to the color image, the trained depth prediction model is more sensitive to the second sub-depth image. By training the depth prediction model in real time during the prediction process, the universality of the trained depth prediction model is effectively improved.

[0091] In step 102, a depth prediction model is obtained.

[0092] In some embodiments, the depth prediction model is trained using pixels in a first color region in a color image as samples and corresponding depth information in a first sub-depth image as labels.

[0093] In some embodiments, referring to FIG5 , FIG5 is a flowchart diagram three of a method for generating a depth image provided in an embodiment of the present application. Step 102 shown in FIG3 can be implemented by executing steps 1021 to 1024 shown in FIG5 .

[0094] In step 1021, an initial depth prediction model is obtained.

[0095] In some embodiments, the initial depth prediction model can be any type of artificial intelligence prediction model, and the model structure of the initial depth prediction model does not constitute a limitation on the embodiments of the present application. For example, the initial depth prediction model includes a coding layer and a decoding layer, wherein the coding layer extracts features of the image to obtain image features, and the decoding layer predicts based on the image features to obtain the predicted depth of the image.

[0096] In step 1022, each pixel point in the first color area is determined as a first associated pixel point.

[0097] As an example, the first color area includes pixel A, pixel B, and pixel C, and pixel A, pixel B, and pixel C are all determined as first associated pixels.

[0098] In step 1023, the following processing is performed for each first-associated pixel point: the position coordinates of the first-associated pixel point within the first color area and the color value of the first-associated pixel point are obtained; the initial depth prediction model is called to predict the depth information of the first-associated pixel point based on the position coordinates and the color value to obtain the predicted depth information of the first-associated pixel point.

[0099] As an example, the position coordinates of the first associated pixel point m within the first color area may be expressed as: m =(u m ,v m ) (3)

[0100] Among them, W p is used to indicate the position coordinates of the first associated pixel point p within the first color area, u m is used to indicate the horizontal coordinate of the first associated pixel point m in the first color area, v m Used to indicate the vertical coordinate of the first associated pixel point m in the first color area.

[0101] As an example, the color value of the first associated pixel point p can be expressed as: m =(r m ,g m ,b m ) (4)

[0102] Among them, Y pUsed to indicate the color value of the first associated pixel m, r m ,g m ,b m Indicates the color values ​​of the three color channels of pixel m respectively.

[0103] In some embodiments, the above-mentioned calling of the initial depth prediction model, predicting the depth information of the first associated pixel point based on the position coordinates and the color value, and obtaining the predicted depth information of the first associated pixel point can be achieved in the following ways: standardizing the position coordinates to obtain standard position coordinates; standardizing the color value to obtain the standard color value; calling the initial depth prediction model, predicting the depth information of the first associated pixel point based on the standard position coordinates and the standard color value, and obtaining the predicted depth information of the first associated pixel point.

[0104] In some embodiments, by standardizing the position coordinates and color values ​​respectively, standard position coordinates and standard color values ​​are obtained, and by training the initial depth prediction model based on the standard position coordinates and standard color values, the initial depth prediction model can be more sensitive to standard data, thereby effectively improving the training effectiveness of the initial depth prediction model.

[0105] In some embodiments, the above-mentioned standardization refers to a process of converting data (position coordinates, color values, etc.) into corresponding standard data according to a unified standard.

[0106] In some embodiments, the above-mentioned position coordinates include horizontal coordinates and vertical coordinates. The above-mentioned standardization of the position coordinates to obtain standard position coordinates can be achieved in the following manner: obtain the first number of pixels in the horizontal axis direction of the color image, and the second number of pixels in the vertical axis direction; subtract 1 from the first number of pixels to obtain a first reference number, and subtract 1 from the second number of pixels to obtain a second reference number; determine the ratio between the horizontal coordinate and the first reference number as the standard horizontal coordinate; determine the ratio between the vertical coordinate and the second reference number as the standard vertical coordinate; and combine the standard horizontal coordinate and the standard vertical coordinate into the standard position coordinate.

[0107] In some embodiments, the above-mentioned color values ​​include channel color values ​​of each color channel. Standardizing the color values ​​to obtain standard color values ​​can be achieved as follows: performing the following processing on the channel color values ​​of each color channel respectively: obtaining the mean and variance of the channel color values ​​of the color channel; subtracting the mean from the channel color value to obtain a reference value; determining the ratio of the reference value to the variance as the standard channel color value corresponding to the channel color value; and combining the standard channel color values ​​of each color channel into a standard color value.

[0108] In this way, by standardizing the position coordinates and color values ​​respectively, standard position coordinates and standard color values ​​are obtained. By training the initial depth prediction model based on the standard position coordinates and standard color values, the initial depth prediction model can be more sensitive to standard data, effectively improving the training effectiveness of the initial depth prediction model.

[0109] In step 1024, the initial depth prediction model is trained based on the predicted depth information of each first associated pixel point and the corresponding depth information in the first sub-depth image to obtain a depth prediction model.

[0110] In some embodiments, the number of training times of the initial depth prediction model is equal to the number of first associated pixels, that is, the predicted depth information of a first associated pixel and the corresponding depth information in the first sub-depth image, so as to realize one training of the initial depth prediction model. After the initial depth prediction model is trained respectively through the predicted depth information of each first associated pixel, a depth prediction model is obtained.

[0111] In some embodiments, the above step 1024 can be implemented as follows: standardize the depth information of each pixel in the first sub-depth image to obtain standard depth information; train the initial depth prediction model based on the predicted depth information of each first associated pixel and the corresponding standard depth information in the first sub-depth image to obtain a depth prediction model.

[0112] As an example, the expression of standard depth information can be:

[0113] in, Used to indicate standard depth information, Used to indicate predicted depth information, For the first reference depth information, Used to indicate the second reference depth information.

[0114] As an example, the expression of the first reference depth information may be:

[0115] in, Used to indicate the first reference depth information, α max Used to indicate the first depth scaling factor, d max Used to indicate the maximum value in the predicted depth information of each first associated pixel point.

[0116] As an example, the expression of the second reference depth information may be:

[0117] in, Used to indicate the second reference depth information, αmin Used to indicate the second depth scaling factor, d min Used to indicate the minimum value in the predicted depth information of each first associated pixel point.

[0118] In some embodiments, since the predicted depth information of the first associated pixel point is obtained by prediction based on the standard position coordinates and the standard color value, the predicted depth information of the first associated pixel point has a standardized format. Therefore, the depth information of each pixel point in the first sub-depth image can be standardized to obtain standard depth information, so that the standard depth information and the predicted depth information are in the same standardized format, and then the initial depth prediction model is trained through the predicted depth information of each first associated pixel point in the standardized format and the corresponding standard depth information in the first sub-depth image to obtain a depth prediction model, so that the obtained depth prediction model can be more sensitive to standard data, thereby effectively improving the training effectiveness of the initial depth prediction model.

[0119] In some embodiments, the above-mentioned training of the initial depth prediction model based on the predicted depth information of each first-associated pixel point and the corresponding standard depth information in the first sub-depth image to obtain the depth prediction model can be achieved as follows: the following processing is performed for each first-associated pixel point: in the first sub-depth image, the first pixel point corresponding to the first-associated pixel point is determined, and the standard depth information of the first pixel point is obtained; the difference between the standard depth information of the first pixel point and the predicted depth information of the first-associated pixel point is determined as the first loss value of the first-associated pixel point; the first loss values ​​of each first-associated pixel point are summed to obtain the summed loss value; based on the summed loss value, the initial depth prediction model is trained to obtain a depth prediction model.

[0120] As an example, the expression for the above sum loss value can be:

[0121] Among them, L is used to indicate the sum loss value, d i Used to indicate the standard depth information of the first pixel point i, D i Used to indicate the predicted depth information of the i-th first associated pixel point, d i -D i Used to indicate the first loss value.

[0122] In some embodiments, the above-mentioned training of the initial depth prediction model based on the sum loss value to obtain the depth prediction model can be based on the sum loss value, and the parameters of the initial depth prediction model are updated by gradient updating to obtain the depth prediction model.

[0123] In step 103, the depth information of each pixel in the second color area of ​​the color image is predicted using a depth prediction model to obtain a third sub-depth image corresponding to the second color area.

[0124] In some embodiments, a depth prediction model is called to predict the depth information of each pixel in the second color area in the color image to obtain the depth information of each pixel in each second color area, and the depth information of each pixel in the second color area is assigned to the corresponding pixel in the second sub-depth image to obtain a third sub-depth image.

[0125] In some embodiments, referring to FIG6 , FIG6 is a fourth flow chart of a method for generating a depth image provided in an embodiment of the present application. Step 103 shown in FIG3 can be implemented by executing steps 1031 to 1033 shown in FIG6 .

[0126] In step 1031, each pixel point in the second color area is determined as a second associated pixel point.

[0127] As an example, the pixels in the second color area include pixel A, pixel B, and pixel C. Pixel A, pixel B, and pixel C are respectively determined as second associated pixels.

[0128] In step 1032, the following processing is performed for each second-associated pixel point: the position coordinates of the second-associated pixel point in the second color area and the color value of the second-associated pixel point are obtained; the depth prediction model is called to predict the depth information of the second-associated pixel point based on the position coordinates and the color value to obtain the predicted depth information of the second-associated pixel point.

[0129] Continuing with the above example, for pixel A, obtain the position coordinates of pixel A in the second color area (the position coordinates of pixel A in the coordinate system with the origin of the color image as the coordinate origin), and the color value of pixel A, call the depth prediction model, and predict the depth information of the second associated pixel based on the position coordinates and color value of pixel A to obtain the predicted depth information of pixel A.

[0130] In some embodiments, the above-mentioned calling of the depth prediction model to predict the depth information of the second associated pixel point based on the position coordinates and the color value to obtain the predicted depth information of the second associated pixel point can be achieved in the following way: standardizing the position coordinates to obtain standard position coordinates; standardizing the color value to obtain the standard color value; calling the depth prediction model to predict the depth information of the second associated pixel point based on the standard position coordinates and the standard color value to obtain the initial depth information of the second associated pixel point; denormalizing the initial depth information to obtain the predicted depth information of the second associated pixel point.

[0131] In some embodiments, the position coordinates and color values ​​are respectively standardized to obtain standard position coordinates and standard color values. The initial depth prediction model is trained based on the standard position coordinates and standard color values, so that the initial depth prediction model can be more sensitive to standard data, thereby effectively improving the training effectiveness of the initial depth prediction model. When the trained depth prediction model is called to predict the depth information of the second associated pixel point, since the training is based on standard data, the position coordinates can be standardized to obtain standard position coordinates; the color values ​​can be standardized to obtain standard color values. Based on the standard position coordinates and standard color values, the depth information of the second associated pixel point is predicted, which can efficiently utilize the sensitivity of the depth prediction model to standard data, thereby effectively improving the prediction accuracy of the depth information of the second associated pixel point.

[0132] In some embodiments, the above-mentioned position coordinates include horizontal coordinates and vertical coordinates. The above-mentioned standardization of the position coordinates to obtain standard position coordinates can be achieved in the following manner: obtain the first number of pixels in the horizontal axis direction of the color image, and the second number of pixels in the vertical axis direction; subtract 1 from the first number of pixels to obtain a first reference number, and subtract 1 from the second number of pixels to obtain a second reference number; determine the ratio between the horizontal coordinate and the first reference number as the standard horizontal coordinate; determine the ratio between the vertical coordinate and the second reference number as the standard vertical coordinate; and combine the standard horizontal coordinate and the standard vertical coordinate into the standard position coordinate.

[0133] As an example, the expression for the standard abscissa can be:

[0134] Among them, U p Used to indicate the standard horizontal coordinate, u p is used to indicate the horizontal coordinate, and H is used to indicate the number of first pixels.

[0135] As an example, the expression for the standard ordinate can be:

[0136] Among them, V p Used to indicate the standard vertical coordinate, v p It is used to indicate the vertical coordinate, and W is used to indicate the number of second pixels.

[0137] As an example, the expression of the standard position coordinate can be: UV=(U p , V p ) (11)

[0138] Among them, UV is used to indicate the standard position coordinates, U p Used to indicate the standard horizontal coordinate, V pUsed to indicate the standard vertical coordinate.

[0139] In some embodiments, the above-mentioned color values ​​include channel color values ​​of each color channel. Standardizing the color values ​​to obtain standard color values ​​can be achieved as follows: obtaining the mean and variance of the channel color values ​​of each color channel of the color image; performing the following processing on the channel color values ​​of each color channel: subtracting the corresponding mean from the channel color value to obtain a reference value; determining the ratio of the reference value to the corresponding variance as the standard channel color value corresponding to the channel color value; and combining the standard channel color values ​​of each color channel into a standard color value.

[0140] As an example, the expression for the mean of the channel color values ​​of each color channel of a color image can be: [μ r ,μ g ,μ b ] (12)

[0141] Among them, μ r Used to indicate the mean of the channel color values ​​of the R color channel, μ g Used to indicate the mean of the channel color values ​​of the G color channel, μ b Indicates the mean of the channel color values ​​for the B color channel.

[0142] As an example, the expression for the variance of the channel color values ​​of each color channel of a color image can be: [σ r ,σ g ,σ b ] (13)

[0143] Among them, σ r Used to indicate the variance of the channel color values ​​of the R color channel, σ g Used to indicate the variance of the channel color value of the G color channel, σ b Indicates the variance of the channel color values ​​for the B color channel.

[0144] As an example, the expression for the standard channel color value of the R color channel can be:

[0145] Among them, R p Used to indicate the standard channel color value of the R color channel, r p Used to indicate the channel color value of the R color channel, μ r Used to indicate the mean of the channel color values ​​of the R color channel, σ r Indicates the variance of the channel color values ​​for the R color channel.

[0146] As an example, the expression for the standard channel color value of the G color channel can be:

[0147] Among them, G p Used to indicate the standard channel color value of the G color channel, g p Used to indicate the channel color value of the G color channel, μ g Used to indicate the mean of the channel color values ​​of the G color channel, σ g Indicates the variance of the channel color values ​​for the G color channel.

[0148] As an example, the expression for the standard channel color value of the B color channel can be:

[0149] Among them, B p Used to indicate the standard channel color value of the B color channel, b p Used to indicate the channel color value of the B color channel, σ b Used to indicate the variance of the channel color value of the B color channel, μ b Indicates the mean of the channel color values ​​for the B color channel.

[0150] In this way, by standardizing the position coordinates and color values ​​respectively, standard position coordinates and standard color values ​​are obtained, and by training the initial depth prediction model based on the standard position coordinates and standard color values, the initial depth prediction model can be more sensitive to standard data, thereby effectively improving the training effectiveness of the initial depth prediction model. When calling the trained depth prediction model to predict the depth information of the second associated pixel point, since the training is based on standard data, when applied, the position coordinates can be standardized to obtain standard position coordinates; the color values ​​can be standardized to obtain standard color values, and based on the standard position coordinates and standard color values, the depth information of the second associated pixel point is predicted, which can efficiently utilize the sensitivity of the depth prediction model to standard data, thereby effectively improving the prediction accuracy of the depth information of the second associated pixel point.

[0151] In some embodiments, the depth prediction model includes a parameter conversion layer, a feature extraction layer, a feature fusion layer, and a depth prediction layer.

[0152] As an example, see Figure 7, which is a schematic diagram of the structure of a depth prediction model provided in an embodiment of the present application. The depth prediction model includes a parameter conversion layer 1, a feature extraction layer 2, a feature fusion layer 3, and a depth prediction layer 4. The feature extraction layer 2 includes a convolution layer, a pooling layer, and an activation layer, and the depth prediction layer includes a convolution layer, a pooling layer, an activation layer, and a normalization layer.

[0153] In some embodiments, the above-mentioned calling of the depth prediction model, predicting the depth information of the second associated pixel point based on the standard position coordinates and the standard color value, and obtaining the initial depth information of the second associated pixel point, can be achieved in the following way: calling the parameter conversion layer to perform parameter conversion on the standard position coordinates and the standard color value respectively to obtain the converted position coordinates and the converted color value; calling the feature extraction layer to perform feature extraction on the converted position coordinates and the converted color value respectively to obtain position features and color features; calling the feature fusion layer to fuse the position features and color features to obtain fused features; calling the depth prediction layer to predict the depth information of the second associated pixel point based on the fused features to obtain the initial depth information of the second associated pixel point.

[0154] In some embodiments, the feature extraction layer may convert the converted position coordinates into corresponding position features in vector form, and convert the converted color values ​​into corresponding color features in vector form.

[0155] As an example, referring to FIG7 , referring to FIG7 , the parameter conversion layer 1 is called to perform parameter conversion on the standard position coordinates and the standard color value, respectively, to obtain the converted position coordinates and the converted color value; the feature extraction layer 2 is called to perform feature extraction on the converted position coordinates and the converted color value, respectively, to obtain the position features (A0A1…A N ) and color characteristics (B0B1…B N ); call feature fusion layer 3 to fuse the position feature and color feature to obtain the fusion feature (A0B0A1B1…A N B N ); calling the depth prediction layer 4 to predict the depth information of the second associated pixel based on the fusion feature to obtain the initial depth information of the second associated pixel.

[0156] As an example, in order to better fit the pixel position information and better encode the position high-frequency information, the standard position coordinates can be parameterized. The above-mentioned transformed position coordinates include the transformed position abscissa and the transformed position ordinate. The expression of the transformed position abscissa can be: γ(u p )=[sin(2 0 πu p ),cos(2 0 πu p ),…,sin(2 L-1 πu p ),cos(2 L-1 πu p )] (17)

[0157] Among them, u p Used to indicate the standard position horizontal coordinate, γ(u p ) is used to indicate the horizontal coordinate of the conversion position.

[0158] As an example, the expression for transforming the vertical coordinate of the position can be: γ(v p )=[sin(2 0 πv p ),cos(2 0 πv p ),…,sin(2 L-1 πv p ),cos(2 L-1 πv p )] (18)

[0159] Among them, γ(v p ) is used to indicate the vertical coordinate of the conversion position, v p Used to indicate the standard position vertical coordinate.

[0160] As an example, the expression for the converted color value of the R color channel may be:

[0161] in, Used to indicate the converted color value of the R color channel, r p Used to indicate the standard color value of the R color channel, g p Used to indicate the standard color value of the G color channel, b p Used to indicate the standard color value of the B color channel.

[0162] As an example, the expression for the converted color value of the G color channel may be:

[0163] in, Used to indicate the converted color value of the G color channel, r p Used to indicate the standard color value of the R color channel, g p Used to indicate the standard color value of the G color channel, b p Used to indicate the standard color value of the B color channel.

[0164] As an example, the expression for the converted color value of the B color channel can be:

[0165] in, Used to indicate the converted color value of the B color channel, r p Used to indicate the standard color value of the R color channel, g p Used to indicate the standard color value of the G color channel, b p Used to indicate the standard color value of the B color channel.

[0166] In some embodiments, the above-mentioned denormalization of the initial depth information to obtain the predicted depth information of the second associated pixel point can be achieved as follows: determining the maximum depth information and the minimum depth information from the depth information of each pixel point of the first sub-depth image; obtaining the first depth scaling factor corresponding to the maximum depth information, and the second depth scaling factor corresponding to the minimum depth information; determining the product of the first depth scaling factor and the maximum depth information as the first reference depth information; determining the product of the second depth scaling factor and the minimum depth information as the second reference depth information; subtracting the second reference depth information from the first reference depth information to obtain a subtraction result; and determining the product of the initial depth information and the subtraction result as the predicted depth information of the second associated pixel point.

[0167] In some embodiments, the maximum depth information refers to the maximum depth information of the depth information of each pixel point in the first sub-depth image, and the minimum depth information refers to the minimum depth information of the depth information of each pixel point in the first sub-depth image.

[0168] As an example, the expression for the predicted depth information of the second associated pixel point may be:

[0169] in, Used to indicate the first reference depth information, Used to indicate the second reference depth information, d p Used to indicate the initial depth information, Used to indicate predicted depth information of the second associated pixel point.

[0170] As an example, the expression of the first reference depth information may be:

[0171] in, Used to indicate the first reference depth information, α max Used to indicate the first depth scaling factor, d max Used to indicate the maximum value in the predicted depth information of each first associated pixel point.

[0172] As an example, the expression of the second reference depth information may be:

[0173] in, Used to indicate the second reference depth information, α min Used to indicate the second depth scaling factor, d min Used to indicate the minimum value in the predicted depth information of each first associated pixel point.

[0174] In step 1033 , based on the predicted depth information of each second associated pixel, the corresponding second pixel in the second sub-depth image is assigned a value, and the assigned second sub-depth image is determined as the third sub-depth image.

[0175] In some embodiments, the second associated pixel points correspond one-to-one to the second pixel points in the second sub-depth image. By assigning the predicted depth information of the corresponding second associated pixel points to each second pixel point in the second sub-depth image, the assigned second sub-depth image is determined as the third sub-depth image, so that the third sub-depth image has depth information and is consistent with the image content of the second sub-depth image.

[0176] In step 104 , the first sub-depth image and the third sub-depth image are fused to obtain a complete depth image corresponding to the color image.

[0177] In some embodiments, step 104 may be implemented by stitching the first sub-depth image and the third sub-depth image according to the positional relationship between the first sub-depth image and the second sub-depth image in the depth image to obtain a complete depth image corresponding to the color image.

[0178] In this manner, a first sub-depth image with depth information and a second sub-depth image without depth information are obtained, and the first sub-depth image corresponds to a first color region in the color image, and the second sub-depth image corresponds to a second color region in the color image. A depth prediction model is used to predict the depth information of each pixel in the second color region of the color image to obtain a third sub-depth image. The first and third sub-depth images are then fused to obtain a complete depth image corresponding to the color image. In this manner, since the depth prediction model is trained using pixels in the first color region of the color image as samples and predicts depth information for each pixel in the second color region of the color image, and the first and second color regions are both derived from the same color image, the depth information of the second sub-depth image without depth information can be predicted using the first sub-depth image with depth information corresponding to the color image, regardless of the application scenario of the color image. This significantly reduces the dependency on the application scenario during depth image generation, effectively decoupling the strong scenario coupling between the training samples and the generated depth image during both the training and application processes, and effectively improving the scenario universality of the generated depth image.

[0179] Below, an exemplary application of the embodiment of the present application in an actual application scenario of depth image generation will be described.

[0180] The incomplete area of ​​the incomplete depth map is completed based on the incomplete depth map and the associated reference image to ensure that each pixel on the reference image has scene depth information. The method for generating a depth image provided by the embodiment of the present application first divides the incomplete depth map and the reference image into regions of known scene and regions to be completed; then a lightweight multi-layer neural network model is trained to encode the known scene region. The model takes the color and two-dimensional pixel coordinates of the known scene region as input and outputs the predicted depth information of the known scene region; after the model training is completed, the color and two-dimensional pixel coordinates of the region to be completed are used as input to obtain the depth information of the region to be completed, thereby forming a complete completed depth map.

[0181] In some embodiments, referring to FIG8 , FIG8 is a flowchart diagram 5 of the depth image generation method provided in an embodiment of the present application. The depth image generation method provided in an embodiment of the present application can be implemented through steps 201 to 206 shown in FIG8 .

[0182] In step 201, a defective depth map is obtained.

[0183] In some embodiments, the incomplete depth map may be a depth image corresponding to the color image described above, and the incomplete depth map includes a first sub-depth image and a second sub-depth image. The first sub-depth image and the second sub-depth image are obtained by dividing the depth image corresponding to the color image. The first sub-depth image corresponds to the first color area in the color image, and the second sub-depth image corresponds to the second color area in the color image.

[0184] In step 202, a scene image is acquired.

[0185] In some embodiments, the scene image may be the color image described above, and the color image may be an image in RGB color mode. RGB color mode is a color standard in the industry. Various colors are obtained by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. RGB represents the colors of the three channels of red, green, and blue. This standard covers almost all colors that can be perceived by human vision and is one of the most widely used color systems.

[0186] In step 203, the scene image and the incomplete depth map are divided into regions.

[0187] In some embodiments, the above-mentioned region division of the scene image (i.e., the color image mentioned above) refers to the above-mentioned process of dividing the color area of ​​the color image into a first color area and a second color area, the first color area in the color image corresponds to the first sub-depth image, and the second color area in the color image corresponds to the second sub-depth image.

[0188] The above-mentioned regional division of the incomplete depth map refers to the process of dividing the incomplete depth map into a first sub-depth image and a second sub-depth image, and the following processing can be performed on each pixel of the depth image: when the pixel has depth information, the pixel is determined as a first pixel; when the pixel does not have depth information, the pixel is determined as a second pixel; the area formed by each first pixel in the depth image is divided into a first sub-depth image; and the area formed by each second pixel in the depth image is divided into a second sub-depth image.

[0189] In step 204, the depth prediction model is trained.

[0190] In some embodiments, the depth prediction model is trained using pixels in a first color region in a color image as samples and corresponding depth information in a first sub-depth image as labels.

[0191] In step 205, the depth prediction model predicts.

[0192] In some embodiments, depth prediction model prediction can be performed in the following manner: obtain a first sub-depth image with depth information and a second sub-depth image without depth information; wherein, the first sub-depth image and the second sub-depth image are obtained by dividing the depth image corresponding to the color image, the first sub-depth image corresponds to the first color area in the color image, and the second sub-depth image corresponds to the second color area in the color image; through the depth prediction model, the depth information of each pixel point in the second color area in the color image is predicted to obtain a third sub-depth image corresponding to the second color area; the first sub-depth image and the third sub-depth image are fused to obtain a complete depth image corresponding to the color image.

[0193] In step 206, a complete depth map is obtained.

[0194] In some embodiments, assuming that a given incomplete depth map is D0, the corresponding equal-resolution scene image I0 (also referred to as a reference image) is first divided into regions based on whether the depth information of each pixel of D0 is known, forming a known scene region and a to-be-completed region. The known scene region information is then used to drive the scene coding network (depth prediction model) for scene coding, fully understanding the scene information of the known scene region. The scene coding network is then used to predict the scene depth corresponding to each pixel in the to-be-completed region based on the trained scene coding network, and then fused with the known scene region information to form a complete depth map.

[0195] In some embodiments, the region is first divided, assuming that the position in D0 is (u p ,v p) pixel p, the corresponding color value on the scene image is, if the corresponding scene depth is known The above information is combined into a known scene sample If the scene depth of pixel p is unknown, that is, incomplete, the above information is combined into a sample to be completed [u p ,v p ,r p ,g p ,b p After the above process, all pixels of D0 and I0 are divided into known scene samples or samples to be completed.

[0196] In some embodiments, the samples are then normalized: After the sample division is completed, all samples need to be normalized. The normalization consists of the following pixel position normalization, pixel color normalization, and depth normalization. All samples need to be normalized for pixel position and pixel color. For known scene samples, depth normalization is also required. Assuming that the image resolutions of D0 and I0 are both H×W, for the position information [u p ,v p ], the positions are normalized as follows:

[0197] Among them, u pb Used to indicate the normalized horizontal coordinate position information of sample p, v pb Used to indicate the normalized vertical coordinate position information of sample p, u p Used to indicate the horizontal coordinate position information of sample p, v p It is used to indicate the vertical coordinate position information of sample p, H is used to indicate the horizontal coordinate normalization parameter, and W is used to indicate the vertical coordinate normalization parameter.

[0198] Assume that the mean and variance of the colors of all pixels in I0 are [μ r ,μ g ,μ b ] and [σ r ,σ g ,σ b ], for any color information [r p ,g p ,b p ], the colors are normalized as follows:

[0199] Among them, r pb Used to indicate the color information after R channel color standardization, g pb Used to indicate the color information after G channel color standardization, bpbrpb is used to indicate the color information after G channel color standardization, r pUsed to indicate the color information of the R channel, g p It is used to indicate the color information of the G channel, bp is used to indicate the color information of the B channel, μ r and σ r Used to indicate the color normalization parameters of the R channel, gp and σ g Used to indicate the color normalization parameter of the G channel, σ b and bp are used to indicate the color normalization parameters for the B channel.

[0200] Assume that the minimum and maximum known depths in D0 are d min and d max , then for the depth information of the known scene sample The standardization is as follows:

[0201] Among them, α max With α min They are scene depth scaling factors, which can be selected according to actual conditions. Generally, they are set to α max =0.1 and α min =0.2.

[0202] In some embodiments, for coding scenes, after standardizing known scene samples, the depth prediction model can be used to understand the scene coding. The coding scene process can be understood as the training process of the depth prediction model. Assume that for known scene samples The input of the depth prediction model is [u p ,v p ,r p ,g p ,b p ], the output is the predicted depth value d p , the loss function is defined as follows:

[0203] Where Φ is a standardized sample set. The training can be completed using the standard gradient descent method, and a scene encoding network that can be used for depth prediction is obtained.

[0204] In some embodiments, for depth completion, the depth prediction model that has completed scene coding is marked as T, then for any to-be-completed sample [u q ,v q ,r q ,g q ,b q ], the standardized depth value d can be calculated q : d p =T(u q ,vq ,r q ,g q ,b q ) (31)

[0205] Then perform depth denormalization to obtain the scene depth truth value of the area to be completed

[0206] In some embodiments, depth fusion is performed by obtaining the true depth values ​​of all pixels in the area to be completed and then directly merging them with the known scene depth to obtain a complete depth map. The resulting complete depth map is then median filtered to improve the continuity of the completed depth information with the original known depth, resulting in a higher quality completed depth map.

[0207] In some embodiments, referring to FIG. 7 , the structure of the depth prediction model shown in FIG. 7 , the network input is the coordinate value of the pixel p to be calculated [u p ,v p ] and color value [r p ,g p ,b p ], and the output is the scene depth value corresponding to pixel p. First, the input coordinate values ​​and color values ​​are encoded separately; then, the coordinate features and color features are extracted through the corresponding feature extraction network. The extracted coordinate features and color features are then concatenated to form a new feature vector, which is used as input to a 9-layer neural network to calculate the corresponding depth value.

[0208] In some embodiments, for position coding, in order to better fit the pixel position information and better encode the position high frequency information, the pixel coordinate value [u p ,v p ] is encoded as follows: γ(u p )=[sin(2 0 πu p ),cos(2 0 πu p ),…,sin(2 L-1 πu p ),cos(2 L-1 πu p )] (33) γ(v p )=[sin(2 0 πv p ),cos(2 0 πv p ),…,sin(2 L-1 πv p ),cos(2 L-1 πv p)] (34)

[0209] Then we get the 4L-dimensional position encoding vector [γ(u p ),γ(v p )], usually L=10.

[0210] In some embodiments, for color coding, in order to reduce the impact of scene lighting and image shadows on the scene image, the color value [r p ,g p ,b p ] is encoded as follows:

[0211] Then we get a new three-dimensional color code

[0212] In some embodiments, for position feature extraction: the position feature extraction module is a 3-layer one-dimensional convolutional network, and the input is a 4L-dimensional position encoding vector [γ(u p ),γ(v p )], and the output is a 128-dimensional position feature vector. The input feature dimensions of the three one-dimensional convolutional layers are 4L, 128, and 128, respectively, and all are configured with instance normalization layers and ReLU activation functions.

[0213] In some embodiments, for color feature extraction: the color feature extraction module is a 3-layer one-dimensional convolutional network, and the input is a 3-dimensional color coding vector The output dimension is a 128-dimensional color feature vector. The input feature dimensions of the three one-dimensional convolutional layers are 3, 64, and 128, respectively, and all are configured with a ReLU activation function.

[0214] In some embodiments, for scene depth calculation, the scene depth calculation is the responsibility of the scene depth module, which takes position features and color features as input and outputs the scene depth of the corresponding position. The module consists of 9 layers of one-dimensional convolutional layers, and the input feature dimension of each layer is 256. The first 8 layers are configured with instance normalization layers (Instance Normalization) and ReLU activation functions, and the last layer activation function is a sigmoid function. In addition, the calculation results of the second layer are added to the results of the third and seventh layers as the inputs of the fourth and eighth layers, and the calculation results of the third layer are added to the results of the fourth and sixth layers as the inputs of the fifth and seventh layers, and the calculation results of the fourth layer are added to the results of the fifth layer as the inputs of the sixth layer. Assuming that the sample The feature vectors obtained by the position feature extraction module and the color feature extraction module are Ap With B p , the module will first splice A p With B p , and then sent to the convolutional network for calculation to get the corresponding depth value.

[0215] Thus, the depth image generation method provided by the embodiment of the present application can greatly improve the versatility of depth completion technology. The embodiment of the present application only needs a single incomplete depth map and the corresponding scene image to complete the depth completion task. Therefore, it can be applied to depth map completion tasks in any scene and collected by any device, greatly improving the applicability of the algorithm. Reduced algorithm cost: The embodiment of the present application does not need to collect large-scale calibration data in advance for neural network model training, avoiding a large amount of data calibration cost and model training cost.

[0216] In this manner, a first sub-depth image with depth information and a second sub-depth image without depth information are obtained, and the first sub-depth image corresponds to a first color region in the color image, and the second sub-depth image corresponds to a second color region in the color image. A depth prediction model is used to predict the depth information of each pixel in the second color region of the color image to obtain a third sub-depth image. The first and third sub-depth images are then fused to obtain a complete depth image corresponding to the color image. In this manner, since the depth prediction model is trained using pixels in the first color region of the color image as samples and predicts depth information for each pixel in the second color region of the color image, and the first and second color regions are both derived from the same color image, the depth information of the second sub-depth image without depth information can be predicted using the first sub-depth image with depth information corresponding to the color image, regardless of the application scenario of the color image. This significantly reduces the dependency on the application scenario during depth image generation, effectively decoupling the strong scenario coupling between the training samples and the generated depth image during both the training and application processes, and effectively improving the scenario universality of the generated depth image.

[0217] It is understandable that in the embodiments of the present application, when depth images and other related data are involved, when the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0218] The following continues to describe an exemplary structure of a depth image generation device 455 provided in an embodiment of the present application implemented as a software module. In some embodiments, as shown in Figure 2, the software modules stored in the depth image generation device 455 of the memory 450 may include: an image acquisition module 4551, configured to acquire a first sub-depth image with depth information and a second sub-depth image without depth information; wherein the first sub-depth image and the second sub-depth image are obtained by dividing the depth image corresponding to the color image, the first sub-depth image corresponds to the first color area in the color image, and the second sub-depth image corresponds to the color a second color area in the image; a model acquisition module 4552 is configured to obtain a depth prediction model, wherein the depth prediction model is trained using the pixels in the first color area in the color image as samples and the corresponding depth information in the first sub-depth image as labels; a prediction module 4553 is configured to predict the depth information of each pixel in the second color area in the color image through the depth prediction model to obtain a third sub-depth image corresponding to the second color area; a fusion module 4554 is configured to fuse the first sub-depth image with the third sub-depth image to obtain a complete depth image corresponding to the color image.

[0219] In some embodiments, the above-mentioned image acquisition module 4551 is also configured to obtain a depth image corresponding to the color image, and perform the following processing on each pixel point of the depth image: when the pixel point has the depth information, the pixel point is determined as a first pixel point; when the pixel point does not have the depth information, the pixel point is determined as a second pixel point; the area constituted by each of the first pixel points in the depth image is divided into the first sub-depth image; the area constituted by each of the second pixel points in the depth image is divided into the second sub-depth image.

[0220] In some embodiments, the above-mentioned model acquisition module 4552 is also configured to obtain an initial depth prediction model; determine each pixel point within the first color area as a first associated pixel point; and perform the following processing for each first associated pixel point: obtain the position coordinates of the first associated pixel point within the first color area, and the color value of the first associated pixel point; call the initial depth prediction model, and predict the depth information of the first associated pixel point based on the position coordinates and the color value to obtain the predicted depth information of the first associated pixel point; train the initial depth prediction model based on the predicted depth information of each first associated pixel point and the corresponding depth information in the first sub-depth image to obtain the depth prediction model.

[0221] In some embodiments, the above-mentioned model acquisition module 4552 is also configured to standardize the position coordinates to obtain standard position coordinates; standardize the color values ​​to obtain standard color values; call the initial depth prediction model, and predict the depth information of the first associated pixel points based on the standard position coordinates and standard color values ​​to obtain the predicted depth information of the first associated pixel points; the above-mentioned model acquisition module is also configured to standardize the depth information of each pixel point in the first sub-depth image to obtain standard depth information; based on the predicted depth information of each first associated pixel point and the corresponding standard depth information in the first sub-depth image, the initial depth prediction model is trained to obtain the depth prediction model.

[0222] In some embodiments, the above-mentioned model acquisition module 4552 is also configured to perform the following processing for each of the first associated pixel points: in the first sub-depth image, determine the first pixel point corresponding to the first associated pixel point, and obtain the standard depth information of the first pixel point; determine the difference between the standard depth information of the first pixel point and the predicted depth information of the first associated pixel point as the first loss value of the first associated pixel point; sum the first loss values ​​of each of the first associated pixel points to obtain a summed loss value; based on the summed loss value, train the initial depth prediction model to obtain the depth prediction model.

[0223] In some embodiments, the above-mentioned prediction module 4553 is also configured to determine each pixel point in the second color area as a second associated pixel point; perform the following processing for each second associated pixel point: obtain the position coordinates of the second associated pixel point in the second color area, and the color value of the second associated pixel point; call the depth prediction model, and predict the depth information of the second associated pixel point based on the position coordinates and the color value to obtain the predicted depth information of the second associated pixel point; based on the predicted depth information of each second associated pixel point, assign values ​​to the corresponding second pixel points in the second sub-depth image, and determine the assigned second sub-depth image as the third sub-depth image.

[0224] In some embodiments, the above-mentioned prediction module 4553 is also configured to standardize the position coordinates to obtain standard position coordinates; standardize the color values ​​to obtain standard color values; call the depth prediction model to predict the depth information of the second associated pixel points based on the standard position coordinates and the standard color values ​​to obtain the initial depth information of the second associated pixel points; denormalize the initial depth information to obtain the predicted depth information of the second associated pixel points.

[0225] In some embodiments, the above-mentioned prediction module 4553 is also configured to obtain the first number of pixels in the horizontal axis direction of the color image and the second number of pixels in the vertical axis direction; subtract 1 from the first number of pixels to obtain a first reference number, and subtract 1 from the second number of pixels to obtain a second reference number; determine the ratio between the horizontal coordinate and the first reference number as the standard horizontal coordinate; determine the ratio between the vertical coordinate and the second reference number as the standard vertical coordinate; and combine the standard horizontal coordinate and the standard vertical coordinate into the standard position coordinate.

[0226] In some embodiments, the above-mentioned prediction module 4553 is also configured to obtain the mean and variance of the channel color values ​​of each color channel of the color image; perform the following processing on the channel color value of each color channel: subtract the corresponding mean from the channel color value to obtain a reference value; determine the ratio of the reference value to the corresponding variance as the standard channel color value corresponding to the channel color value; and combine the standard channel color values ​​of each color channel into the standard color value.

[0227] In some embodiments, the above-mentioned depth prediction model includes a parameter conversion layer, a feature extraction layer, a feature fusion layer and a depth prediction layer; the above-mentioned prediction module 4553 is also configured to call the parameter conversion layer to perform parameter conversion on the standard position coordinates and the standard color values ​​respectively to obtain converted position coordinates and converted color values; call the feature extraction layer to perform feature extraction on the converted position coordinates and the converted color values ​​respectively to obtain position features and color features; call the feature fusion layer to fuse the position features and the color features to obtain fused features; call the depth prediction layer to predict the depth information of the second associated pixel points based on the fused features to obtain the initial depth information of the second associated pixel points.

[0228] In some embodiments, the above-mentioned prediction module 4553 is also configured to determine the maximum depth information and the minimum depth information from the depth information of each pixel point of the first sub-depth image; obtain a first depth scaling factor corresponding to the maximum depth information, and a second depth scaling factor corresponding to the minimum depth information; determine the product of the first depth scaling factor and the maximum depth information as the first reference depth information; determine the product of the second depth scaling factor and the minimum depth information as the second reference depth information; subtract the second reference depth information from the first reference depth information to obtain a subtraction result; and determine the product of the initial depth information and the subtraction result as the predicted depth information of the second associated pixel point.

[0229] The present invention provides a computer program product comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the depth image generation method described in the present invention.

[0230] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will execute the depth image generation method provided in the embodiment of the present application, for example, the depth image generation method shown in Figure 3.

[0231] In some embodiments, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disk, or a CD-ROM; or it may be various electronic devices including one or any combination of the above memories.

[0232] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0233] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0234] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.

[0235] In summary, the embodiments of the present application have the following beneficial effects:

[0236] (1) By obtaining a first sub-depth image with depth information and a second sub-depth image without depth information, and the first color region in the color image corresponding to the first sub-depth image and the second color region in the color image corresponding to the second sub-depth image, the depth information of each pixel in the second color region of the color image is predicted by the depth prediction model to obtain a third sub-depth image, and the first sub-depth image and the third sub-depth image are fused to obtain a complete depth image corresponding to the color image. In this way, since the depth prediction model is trained with the pixels in the first color region in the color image as samples, the depth prediction model predicts the depth information of each pixel in the second color region in the color image, and the first color region and the second color region are both from the same color image, no matter what application scene the color image is, the depth information of the second sub-depth image without depth information can be predicted by the first sub-depth image with depth information corresponding to the color image, thereby significantly reducing the dependence on the application scene in the depth image generation process, thereby effectively dismantling the scene strong coupling relationship between the training sample and the generated depth image in the training process and the application process, and effectively improving the scene universality of the generated depth image.

[0237] (2) By dividing the depth image with incomplete depth information (the depth image corresponding to the color image) into a first sub-depth image and a second sub-depth image according to whether it has depth information, it is convenient to subsequently train the initial depth prediction model based on the first color area in the color image corresponding to the first sub-depth image with depth information. The depth information of the second sub-depth image is predicted by the trained depth prediction model. Since the training sample (the first sub-depth image) and the image to be predicted (the second sub-depth image) are both from the depth image corresponding to the color image, the trained depth prediction model is more sensitive to the second sub-depth image. By training the depth prediction model in real time during the prediction process, the universality of the trained depth prediction model is effectively improved.

[0238] (3) By standardizing the position coordinates and color values ​​respectively, standard position coordinates and standard color values ​​are obtained. By training the initial depth prediction model based on the standard position coordinates and standard color values, the initial depth prediction model can be more sensitive to the standard data, which effectively improves the training effectiveness of the initial depth prediction model.

[0239] (4) By standardizing the position coordinates and color values ​​respectively, standard position coordinates and standard color values ​​are obtained. By training the initial depth prediction model based on the standard position coordinates and standard color values, the initial depth prediction model can be more sensitive to the standard data, which effectively improves the training effectiveness of the initial depth prediction model. When calling the trained depth prediction model to predict the depth information of the second associated pixel point, since the training is based on the standard data, the position coordinates can be standardized to obtain the standard position coordinates; the color values ​​can be standardized to obtain the standard color values. Based on the standard position coordinates and standard color values, the depth information of the second associated pixel point is predicted, which can effectively utilize the sensitivity of the depth prediction model to the standard data, thereby effectively improving the prediction accuracy of the depth information of the second associated pixel point.

[0240] (5) The depth image generation method provided by the embodiment of the present application can greatly improve the versatility of depth completion technology. The embodiment of the present application only requires a single incomplete depth map and the corresponding scene image to complete the depth completion task. Therefore, it can be applied to depth map completion tasks in any scene and collected by any device, greatly improving the applicability of the algorithm. Reduced algorithm cost: The embodiment of the present application does not require the collection of large-scale calibration data in advance for neural network model training, avoiding a large amount of data calibration costs and model training costs.

[0241] (6) Since the predicted depth information of the first associated pixel point is obtained by prediction based on the standard position coordinates and the standard color value, the predicted depth information of the first associated pixel point has a standardized format. Therefore, the depth information of each pixel point in the first sub-depth image can be standardized to obtain standard depth information, so that the standard depth information and the predicted depth information are in the same standardized format. Then, the initial depth prediction model is trained by the predicted depth information of each first associated pixel point in the standardized format and the corresponding standard depth information in the first sub-depth image to obtain a depth prediction model, so that the obtained depth prediction model can be more sensitive to standard data, thereby effectively improving the training effectiveness of the initial depth prediction model.

[0242] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.

Claims

1. A method for generating a depth image, the method comprising: Acquire a first sub-depth image having depth information and a second sub-depth image having no depth information; The first sub-depth image and the second sub-depth image are obtained by dividing the depth image corresponding to the color image, the first sub-depth image corresponds to a first color area in the color image, and the second sub-depth image corresponds to a second color area in the color image; Acquire a depth prediction model, where the depth prediction model is trained using pixels in a first color region in the color image as samples and corresponding depth information in the first sub-depth image as labels; Predicting the depth information of each pixel in the second color area in the color image by using the depth prediction model to obtain a third sub-depth image corresponding to the second color area; The first sub-depth image is fused with the third sub-depth image to obtain a complete depth image corresponding to the color image.

2. The method according to claim 1, wherein: The acquiring of a first sub-depth image having depth information and a second sub-depth image having no depth information includes: Acquire a depth image corresponding to the color image, and perform the following processing on each pixel of the depth image: when the pixel has the depth information, determine the pixel as a first pixel; when the pixel does not have the depth information, determine the pixel as a second pixel; Dividing an area formed by each of the first pixels in the depth image into a first sub-depth image; An area formed by each of the second pixel points in the depth image is divided into the second sub-depth image.

3. The method according to claim 1, wherein: The obtaining of the depth prediction model comprises: Obtain an initial depth prediction model; Determine each pixel point in the first color area as a first associated pixel point; The following processing is performed for each of the first associated pixels: obtaining the position coordinates of the first associated pixel in the first color area and the color value of the first associated pixel; calling the initial depth prediction model to predict the depth information of the first associated pixel based on the position coordinates and the color value to obtain the predicted depth information of the first associated pixel; The initial depth prediction model is trained based on the predicted depth information of each of the first associated pixels and the corresponding depth information in the first sub-depth image to obtain the depth prediction model.

4. The method according to any one of claims 1 to 3, wherein: The calling the initial depth prediction model to predict the depth information of the first associated pixel based on the position coordinates and the color value to obtain the predicted depth information of the first associated pixel includes: The position coordinates are standardized to obtain standard position coordinates; the color values ​​are standardized to obtain standard color values; Calling the initial depth prediction model, predicting the depth information of the first associated pixel based on the standard position coordinates and the standard color value, to obtain the predicted depth information of the first associated pixel; The training of the initial depth prediction model based on the predicted depth information of each of the first associated pixels and the corresponding depth information in the first sub-depth image to obtain the depth prediction model includes: Normalizing the depth information of each pixel in the first sub-depth image to obtain standard depth information; The initial depth prediction model is trained based on the predicted depth information of each of the first associated pixels and the corresponding standard depth information in the first sub-depth image to obtain the depth prediction model.

5. The method according to claim 4, wherein: The training of the initial depth prediction model based on the predicted depth information of each of the first associated pixels and the corresponding standard depth information in the first sub-depth image to obtain the depth prediction model includes: The following processing is performed for each of the first associated pixel points: in the first sub-depth image, a first pixel point corresponding to the first associated pixel point is determined, and standard depth information of the first pixel point is obtained; the first image The difference between the standard depth information of the pixel point and the predicted depth information of the first associated pixel point is determined as a first loss value of the first associated pixel point; Sum the first loss values ​​of the first associated pixels to obtain a summed loss value; Based on the summed loss value, the initial depth prediction model is trained to obtain the depth prediction model.

6. The method according to claim 1, wherein: The method of predicting the depth information of each pixel in the second color area in the color image by using the depth prediction model to obtain a third sub-depth image corresponding to the second color area includes: Determine each pixel point in the second color area as a second associated pixel point; The following processing is performed for each of the second associated pixels: obtaining the position coordinates of the second associated pixel in the second color area and the color value of the second associated pixel; calling the depth prediction model to predict the depth information of the second associated pixel based on the position coordinates and the color value to obtain the predicted depth information of the second associated pixel; Based on the predicted depth information of each of the second associated pixels, values ​​are respectively assigned to the corresponding second pixels in the second sub-depth image, and the second sub-depth image after the assignment is determined as the third sub-depth image.

7. The method according to claim 6, wherein: The calling the depth prediction model to predict the depth information of the second associated pixel based on the position coordinates and the color value to obtain the predicted depth information of the second associated pixel includes: The position coordinates are standardized to obtain standard position coordinates; the color values ​​are standardized to obtain standard color values; Calling the depth prediction model to predict the depth information of the second associated pixel based on the standard position coordinates and the standard color value to obtain initial depth information of the second associated pixel; Denormalize the initial depth information to obtain predicted depth information of the second associated pixel point.

8. The method according to any one of claims 1 to 7, wherein: The position coordinates include a horizontal coordinate and a vertical coordinate; the step of standardizing the position coordinates to obtain standard position coordinates includes: Obtaining the number of first pixels in the horizontal axis direction and the number of second pixels in the vertical axis direction of the color image; Subtract 1 from the first number of pixels to obtain a first reference number, and subtract 1 from the second number of pixels to obtain a second reference number; The ratio between the horizontal coordinate and the first reference quantity is determined as the standard horizontal coordinate; the ratio between the vertical coordinate and the second reference quantity is determined as the standard vertical coordinate; The standard horizontal coordinate and the standard vertical coordinate are combined into the standard position coordinate.

9. The method according to any one of claims 1 to 7, wherein: The color value includes the channel color value of each color channel, and the color value is standardized to obtain a standard color value, including: The following processing is performed for the channel color value of each color channel: obtaining the mean and variance of the channel color value of the color channel; subtracting the mean from the channel color value to obtain a reference value; determining the ratio of the reference value to the variance as the standard channel color value corresponding to the channel color value; The standard channel color values ​​of the color channels are combined into the standard color value.

10. The method according to any one of claims 1 to 7, wherein: The depth prediction model includes a parameter conversion layer, a feature extraction layer, a feature fusion layer and a depth prediction layer; The calling the depth prediction model to predict the depth information of the second associated pixel based on the standard position coordinates and the standard color value to obtain the initial depth information of the second associated pixel includes: Calling the parameter conversion layer to perform parameter conversion on the standard position coordinates and the standard color values ​​respectively to obtain conversion position coordinates and conversion color values; Calling the feature extraction layer to perform feature extraction on the conversion position coordinates and the conversion color values ​​respectively to obtain position features and color features; Calling the feature fusion layer to fuse the position feature and the color feature to obtain a fused feature; The depth prediction layer is called to predict the depth information of the second associated pixel based on the fusion feature. Initial depth information of the second associated pixel is obtained.

11. The method according to any one of claims 1 to 7, wherein: The denormalizing the initial depth information to obtain the predicted depth information of the second associated pixel point includes: Determining maximum depth information and minimum depth information from depth information of each pixel of the first sub-depth image; Acquire a first depth scaling factor corresponding to the maximum depth information and a second depth scaling factor corresponding to the minimum depth information; Determine the product of the first depth scaling factor and the maximum depth information as first reference depth information; determine the product of the second depth scaling factor and the minimum depth information as second reference depth information; Subtracting the second reference depth information from the first reference depth information to obtain a subtraction result; The product of the initial depth information and the subtraction result is determined as the predicted depth information of the second associated pixel point.

12. A device for generating a depth image, the device comprising: An image acquisition module is configured to acquire a first sub-depth image having depth information and a second sub-depth image having no depth information; wherein the first sub-depth image and the second sub-depth image are obtained by dividing a depth image corresponding to a color image, the first sub-depth image corresponds to a first color region in the color image, and the second sub-depth image corresponds to a second color region in the color image; A model acquisition module is configured to acquire a depth prediction model, wherein the depth prediction model is trained by taking pixels in a first color region in the color image as samples and corresponding depth information in the first sub-depth image as labels; A prediction module configured to predict the depth information of each pixel in the second color area in the color image by using the depth prediction model to obtain a third sub-depth image corresponding to the second color area; A fusion module is configured to fuse the first sub-depth image with the third sub-depth image to obtain a complete depth image corresponding to the color image.

13. An electronic device, comprising: a memory configured to store computer executable instructions or computer programs; The processor is configured to implement the method for generating a depth image as described in any one of claims 1 to 11 when executing the computer executable instructions or computer program stored in the memory.

14. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the method for generating a depth image according to any one of claims 1 to 11.

15. A computer program product, comprising a computer program or a computer executable instruction, wherein when the computer program or the computer executable instruction is executed by a processor, the method for generating a depth image according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Target area determination method and device, equipment and storage medium

    CN113705562A

  • Image processing method and device

    CN114511778A

  • Self-supervised depth estimation framework for indoor environment

    CN116745813A

  • Depth image generation method and device, equipment, storage medium and program product

    CN116977395A

  • Generation of semantic depth of field effect

    US10217195B1