Depth image confidence coefficient information generation method and device, medium and terminal equipment

By combining optical flow and parallax models for three-dimensional images, the confidence information of the depth image is generated, which solves the problem of inaccurate depth images generated by the optical flow model and improves the application effect and trust of the depth image.

CN118823091APending Publication Date: 2024-10-22SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410867307.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-22

AI Technical Summary

Technical Problem

When an optical flow model is used to generate a depth image in the prior art, there is no basis for estimating the optical flow of pixels that exist in the left-eye image but are occluded in the right-eye image, resulting in insufficient accuracy of the generated depth image, which in turn affects subsequent application effects.

Method used

By obtaining the target three-dimensional image pair, the optical flow is estimated from the left eye image to the right eye image and the right eye image to the left eye image based on the trained optical flow model, and the first depth image and the second depth image are obtained respectively, and consistent The first confidence level information is generated through the sex verification; combined with the binocular disparity model, the target three-dimensional image is processed, the third depth image is generated, the confidence level verification is performed, and the confidence level information of the depth image is finally determined.

Benefits of technology

In the absence of absolutely correct depth images, the confidence information of depth images can be generated conveniently and efficiently, improving the application effect of depth images and enhancing the trust and reliability of depth images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118823091A_ABST
    Figure CN118823091A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image processing, and particularly relates to a depth image confidence degree information generation method and device, a computer readable storage medium and terminal equipment. The method comprises the following steps: acquiring a target three-dimensional image pair; wherein the target three-dimensional image pair comprises a left eye image and a right eye image at the same moment; performing optical flow estimation from the left eye image to the right eye image based on a trained optical flow model to obtain a first depth image; performing optical flow estimation from the right eye image to the left eye image based on the optical flow model to obtain a second depth image; performing consistency verification on the first depth image and the second depth image to obtain first confidence information; wherein the first confidence degree information is used for representing the difference degree between the first depth image and the second depth image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and in particular, relates to a method, device, computer-readable storage medium and terminal device for generating confidence information of a depth image. Background Art

[0002] In many engineering applications, such as training a monocular depth estimation model, a depth dataset is usually required. The most direct way to obtain a depth dataset is to use a depth camera to collect depth images, but this method is too expensive due to the high price of depth cameras. Therefore, in the prior art, an optical flow model is usually used to process three-dimensional image pairs to obtain depth images, and the depth images are used for subsequent model training and other applications.

[0003] However, when using the optical flow model to generate a depth image, the optical flow model estimates the optical flow of pixels that exist in the left eye image but are blocked in the right eye image based on speculation and lacks a basis, resulting in inaccurate depth images. In subsequent applications of depth images, the depth images generated by the optical flow model, which may have low accuracy, are usually used directly, resulting in poor results in subsequent applications of depth images. Therefore, a method that can generate confidence information for depth images is urgently needed. Summary of the invention

[0004] In view of this, embodiments of the present application provide a method, apparatus, computer-readable storage medium, and terminal device for generating confidence information of a depth image to solve the problem of poor application effect of depth images in the prior art.

[0005] A first aspect of an embodiment of the present application provides a method for generating confidence information of a depth image, which may include:

[0006] Acquire a target three-dimensional image pair; wherein the target three-dimensional image pair includes a left-eye image and a right-eye image at the same moment;

[0007] Performing optical flow estimation from the left-eye image to the right-eye image based on a trained optical flow model to obtain a first depth image;

[0008] Performing optical flow estimation from the right-eye image to the left-eye image based on the optical flow model to obtain a second depth image;

[0009] A consistency check is performed on the first depth image and the second depth image to obtain first confidence information; wherein the first confidence information is used to characterize the degree of difference between the first depth image and the second depth image.

[0010] In a specific implementation of the first aspect, performing consistency check on the first depth image and the second depth image to obtain first confidence information includes:

[0011] Performing optical flow transformation on the left-eye image based on the first depth image to obtain a transformed right-eye image;

[0012] Performing optical flow transformation on the transformed right-eye image based on the second depth image to obtain a transformed left-eye image;

[0013] A consistency check is performed on the left-eye image and the transformed left-eye image to obtain the first confidence information.

[0014] In a specific implementation of the first aspect, before performing consistency check on the first depth image and the second depth image to obtain first confidence information, the method further includes:

[0015] Performing horizontal component filtering on the first depth image and the second depth image respectively to obtain the filtered first depth image and the second depth image;

[0016] The performing consistency check on the first depth image and the second depth image to obtain the first confidence information is: performing consistency check on the filtered first depth image and the filtered second depth image to obtain the first confidence information.

[0017] In a specific implementation of the first aspect, after performing consistency check on the first depth image and the second depth image to obtain first confidence information, the method further includes:

[0018] Performing binocular disparity processing on the target three-dimensional image pair based on a trained binocular disparity model to obtain a third depth image;

[0019] Performing a confidence check on the first depth image and the third depth image to obtain second confidence information; wherein the second confidence information is used to characterize the degree of difference between the first depth image and the third depth image;

[0020] Based on the first confidence information and the second confidence information, third confidence information is determined.

[0021] In a specific implementation manner of the first aspect, the performing confidence verification on the first depth image and the third depth image to obtain second confidence information includes:

[0022] Subtracting the first depth image from the third depth image to obtain a difference between the first depth image and the third depth image;

[0023] The second confidence information is determined based on a degree of difference between the first depth image and the third depth image.

[0024] In a specific implementation manner of the first aspect, determining third confidence information based on the first confidence information and the second confidence information includes:

[0025] Determining the third confidence information based on the minimum confidence value of the first confidence information and the second confidence information;

[0026] or,

[0027] Determining the third confidence information based on the maximum confidence value of the first confidence information and the second confidence information;

[0028] or,

[0029] The third confidence information is determined based on the first confidence information, the second confidence information and a preset confidence weight.

[0030] In a specific implementation of the first aspect, after performing optical flow estimation from the left-eye image to the right-eye image based on the trained optical flow model to obtain the first depth image, the method further includes:

[0031] Counting the number of invalid pixels in the first depth image; wherein the invalid pixels are pixels whose displacement range is greater than a preset valid displacement range;

[0032] If the number of invalid pixels is less than or equal to a preset invalid pixel number threshold, the step of estimating the optical flow from the right eye image to the left eye image based on the optical flow model to obtain a second depth image and its subsequent steps are performed.

[0033] A second aspect of an embodiment of the present application provides a device for generating confidence information of a depth image, which may include:

[0034] A three-dimensional image pair acquisition module, used to acquire a target three-dimensional image pair; wherein the target three-dimensional image pair includes a left-eye image and a right-eye image at the same moment;

[0035] A first optical flow estimation module, configured to perform optical flow estimation from the left-eye image to the right-eye image based on a trained optical flow model to obtain a first depth image;

[0036] A second optical flow estimation module, configured to perform optical flow estimation from the right-eye image to the left-eye image based on the optical flow model to obtain a second depth image;

[0037] A consistency check module is used to perform a consistency check on the first depth image and the second depth image to obtain first confidence information; wherein the first confidence information is used to characterize the degree of difference between the first depth image and the second depth image.

[0038] In a specific implementation of the second aspect, the consistency check module includes:

[0039] A first optical flow transformation submodule, configured to perform optical flow transformation on the left-eye image based on the first depth image to obtain a transformed right-eye image;

[0040] A second optical flow transformation submodule, configured to perform optical flow transformation on the transformed right-eye image based on the second depth image to obtain a transformed left-eye image;

[0041] The consistency check submodule is used to perform a consistency check on the left-eye image and the transformed left-eye image to obtain the first confidence information.

[0042] In a specific implementation of the second aspect, the device for generating confidence information of the depth image further includes:

[0043] a horizontal component screening module, configured to perform horizontal component screening on the first depth image and the second depth image respectively to obtain the first depth image and the second depth image after screening;

[0044] Furthermore, the consistency check submodule is further used to perform a consistency check on the first depth image after screening and the second depth image after screening to obtain first confidence information.

[0045] In a specific implementation of the second aspect, the device for generating confidence information of the depth image further includes:

[0046] A binocular disparity processing module, configured to perform binocular disparity processing on the target three-dimensional image pair based on a trained binocular disparity model to obtain a third depth image;

[0047] A confidence verification module, configured to perform confidence verification on the first depth image and the third depth image to obtain second confidence information; wherein the second confidence information is used to characterize the degree of difference between the first depth image and the third depth image;

[0048] A third confidence information determination module is used to determine third confidence information based on the first confidence information and the second confidence information.

[0049] In a specific implementation of the second aspect, the confidence verification module includes:

[0050] a difference degree calculation submodule, configured to perform a difference calculation on the first depth image and the third depth image to obtain a difference degree between the first depth image and the third depth image;

[0051] The second confidence information determination submodule is configured to determine the second confidence information based on a difference between the first depth image and the third depth image.

[0052] In a specific implementation of the second aspect, the third confidence information determination module includes:

[0053] A third confidence information determining first submodule, configured to determine the third confidence information based on a minimum confidence value of the first confidence information and the second confidence information;

[0054] or,

[0055] A third confidence information determining second submodule, configured to determine the third confidence information based on a maximum confidence value of the first confidence information and the second confidence information;

[0056] or,

[0057] The third confidence information determines a third submodule, which is used to determine the third confidence information based on the first confidence information, the second confidence information and a preset confidence weight.

[0058] In a specific implementation of the second aspect, the device for generating confidence information of the depth image further includes:

[0059] An invalid pixel counting module, used to count the number of invalid pixels in the first depth image; wherein the invalid pixels are pixels whose displacement range is greater than a preset valid displacement range;

[0060] A step execution module is used to execute the step of estimating the optical flow from the right eye image to the left eye image based on the optical flow model to obtain a second depth image and its subsequent steps if the number of invalid pixels is less than or equal to a preset invalid pixel number threshold.

[0061] A third aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods for generating confidence information of a depth image are implemented.

[0062] A fourth aspect of an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned methods for generating confidence information of a depth image when executing the computer program.

[0063] A fifth aspect of an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the steps of any of the above-mentioned methods for generating confidence information of a depth image.

[0064] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the embodiments of the present application obtain a target three-dimensional image pair; wherein the target three-dimensional image pair includes a left eye image and a right eye image at the same time; based on the trained optical flow model, optical flow estimation is performed from the left eye image to the right eye image to obtain a first depth image; based on the optical flow model, optical flow estimation is performed from the right eye image to the left eye image to obtain a second depth image; the first depth image and the second depth image are checked for consistency to obtain first confidence information; wherein the first confidence information is used to characterize the degree of difference between the first depth image and the second depth image. In the embodiments of the present application, the first depth image from the left eye to the right eye and the second depth image from the right eye to the left eye can be checked for consistency to obtain first confidence information, and accordingly, the confidence information of the depth image can be generated conveniently and efficiently in the absence of an absolutely correct depth image as a reference, so that the depth image can be more reasonably applied later based on the confidence information, which helps to improve the application effect of the depth image. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0066] Figure 1 is a schematic diagram of depth data;

[0067] Figure 2 A flowchart of an embodiment of a method for generating confidence information of a depth image in an embodiment of the present application;

[0068] Figure 3 Schematic diagram of the confidence information generation process of the depth image;

[0069] Figure 4This is a structural diagram of an embodiment of a device for generating confidence information of a depth image in an embodiment of the present application;

[0070] Figure 5 This is a schematic block diagram of a terminal device in an embodiment of the present application. DETAILED DESCRIPTION

[0071] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described below are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0072] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0073] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0074] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0075] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0076] In addition, in the description of the present application, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0077] In many engineering applications, such as training a monocular depth estimation model, a depth dataset is usually required. A depth dataset can include individual depth data, each of which can include a three-channel color image and a corresponding single-channel depth image, such as Figure 1 As shown; wherein, the resolution of the color image and the depth image are the same, and the value of each pixel in the depth image represents the distance of the object where the corresponding pixel in the color image is located from the camera sensor in the three-dimensional space. Specifically, the larger the value of the pixel in the depth image (the closer to white), the farther the object where the pixel is located is from the camera in the three-dimensional space; conversely, it means that the object where the pixel is located is closer to the camera in the three-dimensional space.

[0078] The most direct way to obtain a depth data set is to use a depth camera to collect depth images. However, due to the high price of depth cameras, this method is too costly. Therefore, in the prior art, an optical flow model is usually used to process three-dimensional image pairs to obtain depth images, and the depth images are used for subsequent model training and other applications.

[0079] After training, the optical flow model can output optical flow images corresponding to adjacent images (for example, the image presented in the left eye (referred to as the left eye image) and the image presented in the right eye (referred to as the right eye image) in the three-dimensional video data). The optical flow image can represent the movement of pixels in adjacent images, so the data of the optical flow image is similar to the disparity data; for the same object, the closer the object is to the camera, the larger the disparity will be; the farther the object is from the camera, the smaller the disparity will be; and the variation law of the depth data after taking the inverse is close to the variation law of the disparity data, therefore, in the prior art, the disparity data is usually collectively referred to as depth data or inverse depth data. In the scheme of using the optical flow model to generate a depth image, since the optical flow model estimates the optical flow of pixels that exist in the left eye image but are blocked in the right eye image based on speculation, there is a lack of basis, which will cause the generated depth image to be inaccurate.

[0080] In subsequent applications of depth images, the depth images generated by the optical flow model may have low accuracy, which leads to poor subsequent application effects of the depth images. Therefore, a method for generating confidence information of depth images is urgently needed.

[0081] In view of this, embodiments of the present application provide a method, apparatus, computer-readable storage medium, and terminal device for generating confidence information of a depth image to solve the problem of poor application effect of depth images in the prior art.

[0082] It should be noted that the execution subject of the method of the present application is a terminal device, specifically, it can be a common computing device such as a desktop computer, a notebook, a PDA, a smart phone, a tablet, etc., or it can be other computing devices.

[0083] See also Figure 2 In an embodiment of the present application, an embodiment of a method for generating confidence information of a depth image may include:

[0084] Step S201: Acquire a target three-dimensional image pair.

[0085] Since the amount of 3D video data (e.g., 3D movies) is huge and the acquisition cost is low, the 3D video data can be used to efficiently generate each depth image and construct a depth data set. In an embodiment of the present application, the 3D video data can be used to construct a depth image and generate confidence information of the depth image.

[0086] Specifically, each 3D image pair can be obtained from the preset 3D video data, and corresponding depth images can be constructed according to each obtained 3D image pair, wherein each 3D image pair includes a left eye image and a right eye image at the same time.

[0087] In a specific implementation of the embodiment of the present application, a 3D image pair may be acquired frame by frame from the 3D video data, and a depth image may be constructed based on the acquired 3D image pair, thereby making full use of the 3D video data.

[0088] In another specific implementation of the embodiment of the present application, a specific three-dimensional image pair can be obtained from the three-dimensional video data according to a preset image pair selection strategy, and a depth image can be constructed based on the obtained three-dimensional image pair, so that a depth image that meets the requirements can be better generated; wherein, the image pair selection strategy can be set according to actual needs, and the present application does not specifically limit this. For example, the image pair selection strategy can be to obtain three-dimensional image pairs under multiple different lenses, and obtain a preset number of three-dimensional image pairs under each lens; specifically, the FFMPEG tool can be used to identify each moment of lens switching in the three-dimensional video data, and a preset number of three-dimensional image pairs can be obtained after each lens switching, so that three-dimensional image pairs containing different scenes and contents can be obtained, which helps to improve the richness of the depth image generated subsequently. At the same time, since only a preset number of three-dimensional image pairs are obtained under each lens, the redundancy of the depth image generated subsequently can be reduced. For another example, the image pair selection strategy can be to sample and obtain three-dimensional image pairs from the three-dimensional video data at a preset time interval, thereby efficiently obtaining three-dimensional image pairs containing different scenes and contents.

[0089] After acquiring each 3D image pair, a depth image can be constructed and confidence information of the depth image can be generated for each 3D image pair. For the sake of ease of description, the method for generating confidence information of the depth image of an embodiment of the present application will be described below by taking any one of the 3D image pairs (referred to as the target 3D image pair) as an example.

[0090] Step S202: performing optical flow estimation from the left-eye image to the right-eye image based on the trained optical flow model to obtain a first depth image.

[0091] Among them, the optical flow model in the embodiment of the present application can be any common deep learning-based optical flow model in the prior art, which can specifically include but is not limited to FlowNet model, FlowNet2.0 model, SpyNet model, PWC-Net model, and RAFT model.

[0092] In an embodiment of the present application, the target three-dimensional image pair includes a left-eye image and a right-eye image at the same moment. Specifically, the left-eye image can be input into the optical flow model, and then the right-eye image can be input into the optical flow model. Based on this, the optical flow model can be used to estimate the optical flow from the left-eye image to the right-eye image, and the displacement data of each pixel in the left-eye image moving from the left-eye image to the right-eye image can be predicted to obtain a first depth image.

[0093] The resolution of the first depth image is consistent with that of the left eye image, but the first depth image includes two channels, which respectively represent the displacement of pixels in the horizontal direction (X-axis direction) and in the vertical direction (Y-axis direction).

[0094] Normally, there is only horizontal displacement between the left-eye image and the right-eye image in a 3D image pair. If there is vertical displacement between the left-eye image and the right-eye image, the 3D image pair may have been processed with special effects. However, it is often difficult to generate an accurate depth image for a 3D image pair processed with special effects.

[0095] Therefore, in the embodiment of the present application, after obtaining the first depth image, it is also possible to determine whether the first depth image is a valid image; specifically, the number of invalid pixels in the first depth image can be counted; wherein, the invalid pixels are pixels whose displacement range is greater than the preset valid displacement range; if the number of invalid pixels is less than or equal to the preset invalid pixel number threshold, step S203 and its subsequent steps can be continued to be executed; if the data of the invalid pixels is greater than the invalid pixel number threshold, it can be determined that the first depth image is an invalid image, at this time, it is possible to return to execute step S201 and its subsequent steps, reacquire the target three-dimensional image pair, and generate the confidence information of the depth image; wherein, the valid displacement range and the invalid pixel number threshold can be specific and situationally set according to actual needs, and the present application does not limit this. In the embodiment of the present application, it is preferred to set the valid displacement range to within 10 pixels in the horizontal direction and within 2 pixels in the vertical direction, and set the invalid pixel number threshold to 10% of the number of pixels in the first depth image. Accordingly, the three-dimensional image pairs can be effectively screened to obtain three-dimensional image pairs that have not been processed with special effects, and a higher quality depth image can be generated.

[0096] Since the scenes and objects in the training data set of the optical flow model are usually diverse, it is able to generate depth images of various objects well. However, the displacement of pixels that only exist in the left eye image but not in the right eye image comes from model speculation and lacks basis. In addition, since the optical flow model outputs two-dimensional motion information for each pixel, the obtained depth data will be more focused on the local rather than the overall. For objects with smooth surfaces but rich textures, the output depth may not be smooth enough. In other words, the first depth image processed by the optical flow model may not be ideal. Therefore, in an embodiment of the present application, a depth image that is opposite to the first depth image can be used to generate confidence information of the first depth image.

[0097] Step S203: estimate the optical flow from the right-eye image to the left-eye image based on the optical flow model to obtain a second depth image.

[0098] Specifically, the order in which the left eye image and the right eye image are input into the optical flow model can be switched. The right eye image is first input into the optical flow model, and then the left eye image is input into the optical flow model. Based on this, the optical flow model can be used to estimate the optical flow from the right eye image to the left eye image to obtain a second depth image.

[0099] Since the left-eye image and the right-eye image in the embodiment of the present application only have horizontal displacement, in order to reduce the amount of calculation, the first depth image and the second depth image can be respectively filtered for horizontal components, and only the horizontal displacement in the first depth image and the third depth image is retained, and the vertical displacement is ignored to obtain the filtered first depth image and the second depth image; unless otherwise specified, the first depth image hereinafter is the filtered first depth image, and the second depth image is the filtered second depth image.

[0100] Step S204: Perform a consistency check on the first depth image and the second depth image to obtain first confidence information.

[0101] Here, a consistency check may be performed on the filtered first depth image and the filtered second depth image to obtain first confidence information; wherein the first confidence information may be used to characterize the degree of difference between the first depth image and the second depth image.

[0102] In an embodiment of the present application, the left eye image can be optically transformed according to the first depth image to obtain a transformed right eye image; wherein the position of each pixel in the transformed right eye image is the estimated position of the corresponding pixel in the left eye image in the right eye image; then, the transformed right eye image can be optically transformed according to the second depth image to obtain a transformed left eye image; wherein the position of each pixel in the transformed left eye image is the estimated position of the corresponding pixel in the transformed right eye image in the left eye image.

[0103] In a specific implementation, since the depth data in the first depth image is the estimated displacement data of each pixel in the left eye image from the left eye image to the right eye image, therefore, interpolation calculation can be performed on each pixel in the left eye image according to the first depth image to obtain the transformed right eye image; and since the depth data in the second depth image is the estimated displacement data of each pixel in the right eye image from the right eye image to the left eye image; therefore, interpolation calculation can be performed on each pixel in the transformed right eye image according to the second depth image to obtain the transformed left eye image.

[0104] Afterwards, the left eye image and the transformed left eye image may be subjected to consistency check to obtain first confidence information, wherein the first confidence information may be in the form of an image or in other forms such as an array; the confidence of each depth data in the first confidence information is the optical flow confidence of the corresponding depth data in the first depth image.

[0105] In a specific implementation, the first confidence information can be obtained based on the degree of difference between each pixel in the left eye image and the transformed left eye image; specifically, if the degree of difference between a certain pixel in the left eye image and the transformed left eye image is large, it can be considered that the accuracy of the depth data corresponding to the pixel is low, and therefore, the confidence of the depth data corresponding to the pixel in the first confidence information can be taken as a smaller value; if the degree of difference between the pixel in the left eye image and the transformed left eye image is small, it can be considered that the accuracy of the depth data corresponding to the pixel is high, and therefore, the confidence of the depth data corresponding to the pixel in the first confidence information can be taken as a larger value.

[0106] Based on this, the depth data in the first depth image and the second depth image can be fully utilized, and the confidence of the depth data in the depth image can be adaptively generated in the scenario where there is a lack of absolutely correct depth images, which helps to improve the scene adaptability of the depth image confidence information generation method.

[0107] In a specific implementation of the embodiment of the present application, after obtaining the first confidence information, a second confidence can be generated using a binocular disparity model to further evaluate the reliability of the first depth image. In this implementation, the following steps can be specifically included:

[0108] Step S205 : performing binocular disparity processing on the target three-dimensional image pair based on the trained binocular disparity model to obtain a third depth image.

[0109] The binocular disparity model can process images taken by a binocular camera and output a depth image corresponding to the left eye image. There is a certain distance between the left camera and the right camera in the binocular camera system, so there will be a certain disparity in the captured images. The binocular disparity model trained with the binocular data set can identify the disparity of binocular images.

[0110] Among them, the binocular disparity model in the embodiment of the present application can be any common binocular disparity model in the prior art, and can specifically include but is not limited to a PatchMatchNet model, a GC-Net model, and a PSM-Net model.

[0111] In an embodiment of the present application, the left eye image and the right eye image in the target three-dimensional image can be input into a binocular disparity model, and the binocular disparity model can identify the disparity in the left eye image and the right eye image to obtain a corresponding third depth image.

[0112] It should be noted that the embodiment of the present application does not specifically limit the execution order of step S202 of generating the first depth image using the optical flow model and step S205 of generating the third depth image using the binocular disparity model. The two steps can be executed in parallel, or step S202 can be executed first and then step S205, or step S202 can be executed first and then step S205.

[0113] Step S206: Perform confidence verification on the first depth image and the third depth image to obtain second confidence information.

[0114] Since the training data set of the binocular disparity model is usually positive disparity images, the binocular disparity model has low accuracy when processing zero disparity images and negative disparity images. In addition, the training data set of the binocular disparity model usually does not contain motion blur, and the types of scene objects are limited. Therefore, the binocular disparity model is not accurate when processing images with motion blurred objects and images of objects that have not appeared in the training set.

[0115] Considering that the optical flow model and the binocular disparity model each have their own advantages and disadvantages, the corresponding generated depth images may also have a certain degree of inaccuracy. Therefore, in an embodiment of the present application, the first depth image and the third depth image may be confidence-checked to obtain second confidence information; wherein, the second confidence information may be in the same form as the first confidence information; the second confidence information may include the disparity confidence of each depth data in the first depth image, which may be used to characterize the degree of difference between the first depth image and the third depth image. Specifically, the first depth image and the third depth image may be subtracted to obtain the degree of difference between the first depth image and the third depth image, and the second confidence information may be determined based on the degree of difference.

[0116] Specifically, for a certain pixel, if the difference between the depth data of the pixel in the two depth images is small, it can be considered that the depth data corresponding to the pixel is more accurate, and the confidence of the depth data corresponding to the pixel in the second confidence information can be set to a larger value; if the difference between the depth data of the pixel in the two depth images is large, it can be considered that the depth data corresponding to the pixel is relatively inaccurate, and the confidence of the depth data corresponding to the pixel in the second confidence information can be set to a smaller value.

[0117] Based on this, the depth image generated by the optical flow model can be combined with the depth image generated by the binocular disparity model to evaluate the accuracy, and the depth images generated by the two models can be cross-validated to generate more comprehensive confidence information of the first depth image.

[0118] Step S207: Determine third confidence information based on the first confidence information and the second confidence information.

[0119] In the embodiment of the present application, the first confidence information and the second confidence information may be combined to finally determine the third confidence information, wherein the third confidence information may be in the same form as the first confidence information, and the third confidence information may be used to characterize the credibility of the first depth image.

[0120] In a specific implementation of an embodiment of the present application, the third confidence information can be determined based on the minimum confidence value in the first confidence information and the second confidence information. Specifically, for the depth data corresponding to a certain pixel point, if the confidence of the depth data in the first confidence information is less than or equal to the confidence in the second confidence information, the confidence of the depth data in the first confidence information can be determined as the confidence of the depth data in the third confidence information. Conversely, if the confidence of the depth data in the first confidence information is greater than the confidence in the second confidence information, the confidence of the depth data in the second confidence information can be determined as the confidence of the depth data in the third confidence information.

[0121] In another specific implementation of the embodiment of the present application, the third confidence information can be determined based on the maximum confidence value in the first confidence information and the second confidence information. Specifically, for the depth data corresponding to a certain pixel point, if the confidence of the depth data in the first confidence information is greater than or equal to the confidence in the second confidence information, the confidence of the depth data in the first confidence information can be determined as the confidence of the depth data in the third confidence information. Conversely, if the confidence of the depth data in the first confidence information is less than the confidence in the second confidence information, the confidence of the depth data in the second confidence information can be determined as the confidence of the depth data in the third confidence information.

[0122] In another specific implementation of the embodiment of the present application, the third confidence information can be determined based on the first confidence information, the second confidence information and the preset confidence weight. Specifically, the corresponding first confidence weight can be set in advance for the confidence in the first confidence information, and the corresponding second confidence weight can be set for the confidence in the second confidence information. For the depth data corresponding to a certain pixel point, the first confidence component corresponding to the depth data can be calculated based on the first confidence weight and the confidence of the depth data in the first confidence information; the second confidence component corresponding to the depth data can also be calculated based on the second confidence weight and the confidence of the depth data in the second confidence information. After that, the first confidence component and the second confidence component can be added to obtain the confidence of the depth data in the third confidence information.

[0123] Based on this, the confidence of the depth data in the first depth image can be determined more comprehensively, reducing the impact of the error of a single model on the confidence of the depth data, which helps to improve the accuracy and reliability of the confidence image.

[0124] In a specific implementation of the embodiment of the present application, the accuracy of each depth data in the first depth image can also be determined based on the third confidence information. If the confidence of a certain depth data in the third confidence information is relatively high, it can be determined that the accuracy evaluation result of the depth data is relatively high; if the confidence of a certain depth data in the third confidence information is relatively low, it can be determined that the accuracy evaluation result of the depth data is relatively low.

[0125] In another specific implementation of the embodiment of the present application, since the accuracy evaluation result of the first depth image provides a priori information about the accuracy of the depth data, the first depth image can also be subsequently applied according to the accuracy evaluation result of the first depth image. For example, each three-dimensional image pair can be obtained from the three-dimensional video data, and each first depth image and the accuracy evaluation result corresponding to each first depth image can be determined according to the above method; then, a depth image data set can be constructed according to each first depth image and the accuracy evaluation result corresponding to each first depth image; and the depth image data set can be used to train related models (such as a monocular depth estimation model). Therefore, the first depth image and its accuracy evaluation result can effectively enable the training of other models and bring more possibilities for subsequent use.

[0126] For ease of understanding, the method for generating confidence information of a depth image according to an embodiment of the present application will be introduced below with reference to the accompanying drawings.

[0127] See also Figure 3, the confidence information generation method of the depth image of the embodiment of the present application can obtain each three-dimensional image pair from three-dimensional video data (such as a three-dimensional movie), taking any one of the three-dimensional image pairs (target three-dimensional image pair) as an example, which includes a left eye image and a right eye image at the same time; then, the optical flow model can be used to estimate the optical flow from the left eye image to the right eye image to obtain a first depth image containing the depth data of the left eye image; since the first depth image estimated by the optical flow model is not absolutely accurate, therefore, in the absence of an absolutely accurate depth image, a depth image that is opposite to the depth data of the first depth image can be generated, and the two depth images can be checked for consistency; specifically, the optical flow model can be used to estimate the optical flow from the right eye image to the left eye image to obtain a second depth image containing the depth data of the right eye image; then, a consistency check can be performed based on the first depth image and the second depth image to obtain the first confidence information; wherein the first confidence information can be used to characterize the degree of difference between the first depth image and the second depth image.

[0128] In addition, the binocular disparity model can be used to perform disparity processing on the target three-dimensional image pair to obtain a third depth image containing the depth data of the left eye image, and then the confidence check can be performed on the first depth image and the third depth image, that is, the difference between the first depth image and the third depth image can be calculated, and the second confidence information can be determined according to the difference. The second confidence information includes the disparity confidence of each depth data in the first depth image.

[0129] Afterwards, the first confidence information and the second confidence information may be fused, and the optical flow confidence and the parallax confidence may be comprehensively considered to obtain the third confidence information.

[0130] Optionally, the accuracy assessment result of the first depth image may also be determined according to the third confidence information.

[0131] Optionally, reasonable subsequent application may be performed on the first depth image according to the third confidence information and the first depth image.

[0132] In summary, the embodiment of the present application obtains a target three-dimensional image pair; wherein, the target three-dimensional image pair includes a left eye image and a right eye image at the same moment; based on the trained optical flow model, optical flow estimation is performed from the left eye image to the right eye image to obtain a first depth image; based on the optical flow model, optical flow estimation is performed from the right eye image to the left eye image to obtain a second depth image; the first depth image and the second depth image are checked for consistency to obtain first confidence information; wherein, the first confidence information is used to characterize the degree of difference between the first depth image and the second depth image. In the embodiment of the present application, the first depth image from the left eye to the right eye and the second depth image from the right eye to the left eye can be checked for consistency to obtain first confidence information, and accordingly, the confidence information of the depth image can be generated conveniently and efficiently in the absence of an absolutely correct depth image as a reference, so that the depth image can be more reasonably applied later based on the confidence information, which helps to improve the application effect of the depth image.

[0133] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0134] Corresponding to the method for generating confidence information of a depth image described in the above embodiment, Figure 4 A structural diagram of an embodiment of a device for generating confidence information of a depth image provided in an embodiment of the present application is shown.

[0135] In an embodiment of the present application, a device for generating confidence information of a depth image may include:

[0136] The 3D image pair acquisition module 401 is used to acquire a target 3D image pair; wherein the target 3D image pair includes a left-eye image and a right-eye image at the same moment;

[0137] A first optical flow estimation module 402, configured to perform optical flow estimation from the left-eye image to the right-eye image based on a trained optical flow model to obtain a first depth image;

[0138] A second optical flow estimation module 403, configured to perform optical flow estimation from the right-eye image to the left-eye image based on the optical flow model to obtain a second depth image;

[0139] The consistency check module 404 is used to perform a consistency check on the first depth image and the second depth image to obtain first confidence information; wherein the first confidence information is used to characterize the degree of difference between the first depth image and the second depth image.

[0140] In a specific implementation of the embodiment of the present application, the consistency check module includes:

[0141] A first optical flow transformation submodule, configured to perform optical flow transformation on the left-eye image based on the first depth image to obtain a transformed right-eye image;

[0142] A second optical flow transformation submodule, configured to perform optical flow transformation on the transformed right-eye image based on the second depth image to obtain a transformed left-eye image;

[0143] The consistency check submodule is used to perform a consistency check on the left-eye image and the transformed left-eye image to obtain the first confidence information.

[0144] In a specific implementation of the embodiment of the present application, the device for generating confidence information of the depth image further includes:

[0145] a horizontal component screening module, configured to perform horizontal component screening on the first depth image and the second depth image respectively to obtain the first depth image and the second depth image after screening;

[0146] Furthermore, the consistency check submodule is further used to perform a consistency check on the first depth image after screening and the second depth image after screening to obtain first confidence information.

[0147] In a specific implementation of the embodiment of the present application, the device for generating confidence information of the depth image further includes:

[0148] A binocular disparity processing module, configured to perform binocular disparity processing on the target three-dimensional image pair based on a trained binocular disparity model to obtain a third depth image;

[0149] A confidence verification module, configured to perform confidence verification on the first depth image and the third depth image to obtain second confidence information; wherein the second confidence information is used to characterize the degree of difference between the first depth image and the third depth image;

[0150] A third confidence information determination module is used to determine third confidence information based on the first confidence information and the second confidence information.

[0151] In a specific implementation of the embodiment of the present application, the confidence verification module includes:

[0152] a difference degree calculation submodule, configured to perform a difference calculation on the first depth image and the third depth image to obtain a difference degree between the first depth image and the third depth image;

[0153] The second confidence information determination submodule is configured to determine the second confidence information based on a difference between the first depth image and the third depth image.

[0154] In a specific implementation of the embodiment of the present application, the third confidence information determination module includes:

[0155] A third confidence information determining first submodule, configured to determine the third confidence information based on a minimum confidence value of the first confidence information and the second confidence information;

[0156] or,

[0157] A third confidence information determining second submodule, configured to determine the third confidence information based on a maximum confidence value of the first confidence information and the second confidence information;

[0158] or,

[0159] The third confidence information determines a third submodule, which is used to determine the third confidence information based on the first confidence information, the second confidence information and a preset confidence weight.

[0160] In a specific implementation of the embodiment of the present application, the device for generating confidence information of the depth image further includes:

[0161] An invalid pixel counting module, used to count the number of invalid pixels in the first depth image; wherein the invalid pixels are pixels whose displacement range is greater than a preset valid displacement range;

[0162] A step execution module is used to execute the step of estimating the optical flow from the right eye image to the left eye image based on the optical flow model to obtain a second depth image and its subsequent steps if the number of invalid pixels is less than or equal to a preset invalid pixel number threshold.

[0163] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0164] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0165] Figure 5 A schematic block diagram of a terminal device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0166] like Figure 5As shown, the terminal device 5 of this embodiment includes: a processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50. When the processor 50 executes the computer program 52, the steps in the above-mentioned embodiments of the method for generating confidence information of each depth image are implemented, for example Figure 2 Alternatively, when the processor 50 executes the computer program 52, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 4 Functions of modules 401 to 404 are shown.

[0167] Exemplarily, the computer program 52 may be divided into one or more modules / units, which are stored in the memory 51 and executed by the processor 50 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 52 in the terminal device 5.

[0168] The terminal device 5 may be a computing device such as a desktop computer, a notebook, a PDA, a smart phone, a smart TV, etc. Those skilled in the art will appreciate that Figure 5 It is only an example of the terminal device 5 and does not constitute a limitation of the terminal device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device 5 may also include input and output devices, network access devices, buses, etc.

[0169] The processor 50 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 50 may be the nerve center and command center of the terminal device 5. The processor 50 may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0170] The memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or memory of the terminal device 5. The memory 51 may also be an external storage device of the terminal device 5, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 5. Further, the memory 51 may also include both an internal storage unit of the terminal device 5 and an external storage device. The memory 51 is used to store the computer program and other programs and data required by the terminal device 5. The memory 51 may also be used to temporarily store data that has been output or is to be output.

[0171] The terminal device 5 may also include a communication module, which may provide communication solutions including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth, Zigbee, mobile communication networks, global navigation satellite systems (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to network devices. The communication module may be one or more devices integrating at least one communication processing module. The communication module may include an antenna, which may have only one array element or an antenna array including multiple array elements. The communication module may receive electromagnetic waves through the antenna, frequency modulate and filter the electromagnetic wave signals, and send the processed signals to the processor. The communication module may also receive the signal to be sent from the processor, frequency modulate and amplify it, and convert it into electromagnetic waves for radiation through the antenna.

[0172] The terminal device 5 may further include a power management module, which may receive input from an external power source, a battery and / or a charger to power the processor, the memory, the communication module, and the like.

[0173] The terminal device 5 may also include a display module, which may be used to display information input by a user or information provided to a user. The display module may include a display panel, and optionally, the display panel may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel may cover the display panel, and when the touch panel detects a touch operation on or near it, it is transmitted to the processor to determine the type of the touch event, and then the processor provides a corresponding visual output on the display panel according to the type of the touch event.

[0174] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0175] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0176] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0177] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0178] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0179] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0180] An embodiment of the present application provides a computer program product. When the computer program product runs on the terminal device, the terminal device can implement the steps in the above-mentioned various method embodiments.

[0181] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.

[0182] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for generating confidence information of a depth image, characterized in that: include: Acquire a target three-dimensional image pair; wherein the target three-dimensional image pair includes a left-eye image and a right-eye image at the same moment; Performing optical flow estimation from the left-eye image to the right-eye image based on a trained optical flow model to obtain a first depth image; Performing optical flow estimation from the right-eye image to the left-eye image based on the optical flow model to obtain a second depth image; A consistency check is performed on the first depth image and the second depth image to obtain first confidence information; wherein the first confidence information is used to characterize the degree of difference between the first depth image and the second depth image.

2. The method for generating confidence information of a depth image according to claim 1, characterized in that: The performing consistency check on the first depth image and the second depth image to obtain first confidence information includes: Performing optical flow transformation on the left-eye image based on the first depth image to obtain a transformed right-eye image; Performing optical flow transformation on the transformed right-eye image based on the second depth image to obtain a transformed left-eye image; A consistency check is performed on the left-eye image and the transformed left-eye image to obtain the first confidence information.

3. The method for generating confidence information of a depth image according to claim 1, characterized in that: Before performing consistency check on the first depth image and the second depth image to obtain first confidence information, the method further includes: Performing horizontal component filtering on the first depth image and the second depth image respectively to obtain the filtered first depth image and the second depth image; The performing consistency check on the first depth image and the second depth image to obtain the first confidence information is: performing consistency check on the filtered first depth image and the filtered second depth image to obtain the first confidence information.

4. The method for generating confidence information of a depth image according to claim 1, characterized in that: After performing consistency check on the first depth image and the second depth image to obtain first confidence information, the method further includes: Performing binocular disparity processing on the target three-dimensional image pair based on a trained binocular disparity model to obtain a third depth image; Performing a confidence check on the first depth image and the third depth image to obtain second confidence information; wherein the second confidence information is used to characterize the degree of difference between the first depth image and the third depth image; Based on the first confidence information and the second confidence information, third confidence information is determined.

5. The method for generating confidence information of a depth image according to claim 4, characterized in that: The performing confidence check on the first depth image and the third depth image to obtain second confidence information includes: Subtracting the first depth image from the third depth image to obtain a difference between the first depth image and the third depth image; The second confidence information is determined based on a degree of difference between the first depth image and the third depth image.

6. The method for generating confidence information of a depth image according to claim 4, characterized in that: The determining, based on the first confidence information and the second confidence information, third confidence information includes: Determining the third confidence information based on the minimum confidence value of the first confidence information and the second confidence information; or, Determining the third confidence information based on the maximum confidence value of the first confidence information and the second confidence information; or, The third confidence information is determined based on the first confidence information, the second confidence information and a preset confidence weight.

7. The method for generating confidence information of a depth image according to any one of claims 1 to 6, characterized in that: After performing optical flow estimation from the left-eye image to the right-eye image based on the trained optical flow model to obtain the first depth image, the method further includes: Counting the number of invalid pixels in the first depth image; wherein the invalid pixels are pixels whose displacement range is greater than a preset valid displacement range; If the number of invalid pixels is less than or equal to a preset invalid pixel number threshold, the step of estimating the optical flow from the right eye image to the left eye image based on the optical flow model to obtain a second depth image and its subsequent steps are performed.

8. A device for generating confidence information of a depth image, characterized in that: include: A three-dimensional image pair acquisition module, used to acquire a target three-dimensional image pair; wherein the target three-dimensional image pair includes a left-eye image and a right-eye image at the same moment; A first optical flow estimation module, configured to perform optical flow estimation from the left-eye image to the right-eye image based on a trained optical flow model to obtain a first depth image; A second optical flow estimation module, configured to perform optical flow estimation from the right-eye image to the left-eye image based on the optical flow model to obtain a second depth image; A consistency check module is used to perform a consistency check on the first depth image and the second depth image to obtain first confidence information; wherein the first confidence information is used to characterize the degree of difference between the first depth image and the second depth image.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for generating confidence information of a depth image according to any one of claims 1 to 7 are implemented.

10. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for generating confidence information of a depth image according to any one of claims 1 to 7 are implemented.