(19)
(11)EP 3 644 271 A1

(12)EUROPEAN PATENT APPLICATION

(43)Date of publication:
29.04.2020 Bulletin 2020/18

(21)Application number: 19205000.3

(22)Date of filing:  24.10.2019
(51)International Patent Classification (IPC): 
G06T 3/40(2006.01)
(84)Designated Contracting States:
AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR
Designated Extension States:
BA ME
Designated Validation States:
KH MA MD TN

(30)Priority: 24.10.2018 CN 201811244125

(71)Applicant: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., LTD.
Wusha, Chang'an Dongguan, Guangdong 523860 (CN)

(72)Inventor:
  • CHEN, Yan
    Dongguan, Guangdong 523860 (CN)

(74)Representative: Manitz Finsterwald Patent- und Rechtsanwaltspartnerschaft mbB 
Martin-Greif-Strasse 1
80336 München
80336 München (DE)

  


(54)METHOD, APPARATUS, AND STORAGE MEDIUM FOR OBTAINING DEPTH IMAGE


(57) The present disclosure provides a method, an electronic device, and a storage medium for obtaining a depth image. The method includes: mapping a depth image having a first resolution into a color image having a second resolution to obtain a processed image, the first resolution being smaller than the second resolution; establishing an objective function with respect to the processed image and a depth image having the second resolution, pixels in the processed image having one-to-one correspondence with pixels in the depth image having the second resolution, the objective function aiming to minimize an error with respect to the processed image and the depth image having the second resolution; and solving the objective function to obtain the depth image having the second resolution.


Description

TECHNICAL FIELD



[0001] The present disclosure relates to image processing technologies, and more particularly, to a method, an apparatus, an electronic device, and a computer readable storage medium for obtaining a depth image.

BACKGROUND



[0002] In the related art, due to an area of a chip and power consumption, a depth image formed by a depth acquisition component has a low resolution. It is difficult to satisfy a user's requirements by employing a depth image with a lower resolution, for example, an absence of surface texture details of a generated three-dimensional model, a reduction in an accuracy of face recognition, etc.

SUMMARY



[0003] A method for obtaining a depth image according to an embodiment of the present disclosure includes: mapping a depth image having a first resolution into a color image having a second resolution to obtain a processed image, the first resolution being smaller than the second resolution; establishing an objective function with respect to the processed image and a depth image having the second resolution, pixels in the processed image having one-to-one correspondence with pixels in the depth image having the second resolution, the objective function aiming to minimize an error with respect to the processed image and the depth image having the second resolution; and solving the objective function to obtain the depth image having the second resolution.

[0004] An apparatus for obtaining a depth image according to an embodiment of the present disclosure includes: a mapping module configured to map a depth image having a first resolution into a color image having a second resolution to obtain a processed image, the first resolution being smaller than the second resolution; an establishing module configured to establish an objective function with respect to the processed image and a depth image having the second resolution, pixels in the processed image having one-to-one correspondence with pixels in the depth image having the second resolution, the objective function aiming to minimize an error with respect to the processed image and the depth image having the second resolution; and a calculation module configured to solve the objective function to obtain the depth image having the second resolution.

[0005] A computer readable storage medium according to an embodiment of the present disclosure includes a computer program used in combination with the electronic device. The computer program may be executed by a processor of the electronic device to perform the method described above.

[0006] Additional aspects and advantages of embodiments of the present disclosure will be given in part in the following descriptions, become apparent in part from the following descriptions, or be learned from the practice of the embodiments of the present disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS



[0007] These and other aspects and advantages of embodiments of the present disclosure will become apparent and more readily appreciated from the following descriptions made with reference to the accompanying drawings.

FIG. 1A is a flowchart of a method for obtaining a depth image according to some embodiments of the present disclosure.

FIG. 1B is a block diagram of an apparatus for obtaining a depth image according to some embodiments of the present disclosure.

FIG. 2 is a flowchart of a method for obtaining a depth image according to some embodiments of the present disclosure.

FIG. 3 is a block diagram of an apparatus for obtaining a depth image according to some embodiments of the present disclosure.

FIG. 4 is a schematic diagram of an electronic device according to some embodiments of the present disclosure.

FIG. 5 is a schematic diagram of a depth image having a first resolution, a color image, a processed image, and a depth image having a second resolution according to some embodiments of the present disclosure.

FIG. 6 is a flowchart of a method for obtaining a depth image according to some embodiments of the present disclosure.

FIG. 7 is a block diagram of an apparatus for obtaining a depth image according to some embodiments of the present disclosure.

FIG. 8 is a flowchart of a method for obtaining a depth image according to some embodiments of the present disclosure.

FIG. 9 is a block diagram of an apparatus for obtaining a depth image according to some embodiments of the present disclosure.

FIG. 10 is a flowchart of a method for obtaining a depth image according to some embodiments of the present disclosure.

FIG. 11 is a block diagram of an apparatus for obtaining a depth image according to some embodiments of the present disclosure.

FIG. 12 is a flowchart of a method for obtaining a depth image according to some embodiments of the present disclosure.

FIG. 13 is a schematic diagram of a connection of a computer readable storage medium and an electronic device according to some embodiments of the present disclosure.


DETAILED DESCRIPTION



[0008] Embodiments of the present disclosure are described below in detail, examples of the embodiments are shown in accompanying drawings, and reference signs that are the same or similar from beginning to end represent the same or similar components or components that have the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary, are merely used to explain the present disclosure, and cannot be construed as a limit to the present disclosure.

[0009] Referring to FIG. 1A, a method for obtaining a depth image according to embodiments of the present disclosure includes acts in the following blocks.

[0010] At block 012', a depth image having a first resolution is mapped into a color image having a second resolution to obtain a processed image. The first resolution is smaller than the second resolution.

[0011] At block 014', an objective function with respect to the processed image and a depth image having the second resolution is established. Pixels in the processed image have one-to-one correspondence with pixels in the depth image having the second resolution. The objective function aims to minimize an error with respect to the processed image and the depth image having the second resolution.

[0012] At block 016', the objective function is solved to obtain the depth image having the second resolution.

[0013] Referring to FIG. 1B, an apparatus for obtaining a depth image according to embodiments of the present disclosure includes a mapping module 112, an establishing module 110 and a calculation module 122.

[0014] The mapping module 112 is configured to map a depth image having a first resolution into a color image having a second resolution to obtain a processed image. The first resolution is smaller than the second resolution.

[0015] The establishing module 110 is configured to establish an objective function with respect to the processed image and a depth image having the second resolution. Pixels in the processed image have one-to-one correspondence with pixels in the depth image having the second resolution. The objective function aims to minimize an error with respect to the processed image and the depth image having the second resolution.

[0016] The calculation module 122 is configured to solve the objective function to obtain the depth image having the second resolution.

[0017] The embodiments of the present disclosure are described in detail below. Referring to FIG. 2, a method for obtaining a depth image according to embodiments of the present disclosure includes acts in the following blocks.

[0018] At block 012, a depth image having a first resolution is mapped into a color image having a second resolution to obtain a processed image. The depth image and the color image correspond to the same scene. The first resolution is smaller than the second resolution. The processed image includes a plurality of first pixels and a plurality of second pixels. Each of the plurality of first pixels includes color information and depth information, and each of the plurality of second pixels includes color information. The depth information corresponds to the depth image having the first resolution. The color information corresponds to the color image.

[0019] At block 014, a data item of an objective function is determined based on the depth information of the plurality of first pixels in the processed image and depth information of a plurality of pixels corresponding to the plurality of first pixels in the depth image having the second resolution. The depth image having the second resolution includes depth information.

[0020] At block 016, a neighborhood smoothing item of the objective function is determined based on depth information of the plurality of first pixels in the processed image, and depth information of pixels in a first neighborhood corresponding to each of the plurality of first pixels in the depth image having the second resolution.

[0021] In an embodiment, the neighborhood smoothing item may be multiplied by a first weight. The first weight is determined based on the color information of the plurality of first pixels in the processed image and color information of pixels in the first neighborhood of each of the plurality of first pixels in the processed image.

[0022] At block 018, a non-local average regularization item of the objective function is determined based on depth information of the plurality of first pixels in the processed image, and depth information of pixels in a second neighborhood corresponding to each of the plurality of first pixels in the depth image having the second resolution.

[0023] At block 022, the objective function is solved to obtain the depth image having the second resolution.

[0024] Referring to FIG. 3, an apparatus 100 for obtaining a depth image according to embodiments of the present disclosure includes a mapping module 112, a first acquisition module 114, a second acquisition module 116, a third acquisition module 118, and a calculation module 122. The establishing module 110 may include the first acquisition module 114, the second acquisition module 116 and the third acquisition module 118. The method for obtaining a depth image according to embodiments of the present disclosure may be implemented by the apparatus 100 according to embodiments of the present disclosure. The act in block 012 may be realized by the mapping module 112. The act in block 014 may be realized by the first acquisition module 114. The act in block 016 may be realized by the second acquisition module 116. The act in block 018 may be realized by the third acquisition module 118. The act in block 022 may be realized by the calculation module 122. That is, the mapping module 112 is configured to map a depth image having a first resolution into a color image having a second resolution to obtain a processed image. The depth image and the color image correspond to the same scene. The first resolution is smaller than the second resolution. The processed image includes a plurality of first pixels and a plurality of second pixels. Each of the plurality of first pixels includes color information and depth information, and each of the plurality of second pixels includes color information. The first acquisition module 114 is configured to determine a data item of an objective function based on the depth information of the plurality of first pixels in the processed image and depth information of a plurality of pixels corresponding to the plurality of first pixels in the depth image having the second resolution. The depth image having the second resolution includes depth information. The second acquisition module 116 is configured to determine a neighborhood smoothing item of the objective function based on depth information of the plurality of first pixels in the processed image, and depth information of pixels in a first neighborhood corresponding to each of the plurality of first pixels in the depth image having the second resolution. In an embodiment, the neighborhood smoothing item may be multiplied by a first weight. The first weight is determined based on the color information of the plurality of first pixels in the processed image and color information of pixels in the first neighborhood of each of the plurality of first pixels in the processed image. The third acquisition module 118 is configured to determine a non-local average regularization item of the objective function based on depth information of the plurality of first pixels in the processed image, and depth information of pixels in a second neighborhood corresponding to each of the plurality of first pixels in the depth image having the second resolution. The calculation module 122 is configured to solve the objective function to obtain the depth image having the second resolution.

[0025] Referring to FIG. 4, an electronic device 1000 according to embodiments of the present disclosure includes a processor 200. The method for obtaining a depth image according to embodiments of the present disclosure may be implemented by the electronic device 1000 according to embodiments of the present disclosure. The acts in blocks 012, 014, 016, 018, and 022 may be realized by the processor 200. That is, the processor 200 is configured to: map a depth image having a first resolution into a color image having a second resolution to obtain a processed image, the depth image and the color image corresponding to the same scene, the first resolution being smaller than the second resolution, the processed image including a plurality of first pixels and a plurality of second pixels, each of the plurality of first pixels including color information and depth information, and each of the plurality of second pixels including color information; determine a data item of an objective function based on the depth information of the plurality of first pixels in the processed image and depth information of a plurality of pixels corresponding to the plurality of first pixels in the depth image having the second resolution, the depth image having the second resolution including depth information; determine a neighborhood smoothing item of the objective function based on depth information of the plurality of first pixels in the processed image, and depth information of pixels in a first neighborhood corresponding to each of the plurality of first pixels in the depth image having the second resolution, the first weight being determined based on the color information of the plurality of first pixels in the processed image and color information of pixels in the first neighborhood of each of the plurality of first pixels in the processed image; determine a non-local average regularization item of the objective function based on depth information of the plurality of first pixels in the processed image, and depth information of pixels in a second neighborhood corresponding to each of the plurality of first pixels in the depth image having the second resolution; and solve the objective function to obtain the depth image having the second resolution.

[0026] The method for obtaining a depth image, the apparatus 100 for obtaining a depth image, and the electronic device 1000 according to embodiments of the present disclosure may perform upsampling processing on the depth image having the first resolution to obtain the depth image having the second resolution, thereby increasing the resolution of the depth image, and further satisfying the user's requirements, for example, surface texture details of the generated three-dimensional model are more detailed, the accuracy of face recognition is higher, etc. In addition, the neighborhood smoothing item may improve continuity in depth in the depth image having the second resolution, and the non-local average regularization item may maintain a local structure of the depth image having the second resolution.

[0027] In an embodiment, the first resolution is, for example, 240180, and the second resolution is, for example, 2k resolution (for example, 25601440) or 4k resolution (40962160). Of course, the first resolution and the second resolution may be of other choices, and are not specifically limited herein.

[0028] The electronic device 1000 may be a mobile phone, a tablet computer, a smart wearable device (a smart watch, a smart wristband, smart glasses, a smart helmet, etc.), a drone, and on the like, which is not limited herein.

[0029] In some implementations, the electronic device 1000 further includes a depth acquisition component 300. The depth acquisition component 300 may be configured to acquire a depth image. The depth acquisition component 300 may be, for example, a time-of-flight (TOF) camera component 320 or a structured-light camera component 340.

[0030] The TOF camera component 320 includes a light emitter and a light receiver. The light emitter is configured to emit light to a target object. The light receiver is configured to receive light reflected by the target object and sample repeatedly to obtain a plurality of phase maps. A phase difference

of emitted light and reflected light may be calculated by the plurality of phase maps, where Q1, Q2, Q3 and Q4 are pixel values of corresponding pixels in four phase maps. Consequently, depth information (i.e., a depth value, such as a distance value d) may be obtained by a formals of

to form a depth image, where c represents the speed of light, and f represents the light-emitting frequency of the laser.

[0031] The structured-light camera component 340 includes a structured-light projector and an image sensor. After structured light projected by the structured-light projector is modulated by the target object, the image sensor captures an image of the structured light modulated by the target object, and thus the depth information is obtained by demodulating phase information corresponding to each pixel of the structured-light image to form a depth image.

[0032] In some implementations, the electronic device 1000 includes a visible-light acquisition component 400. The visible-light acquisition component 400 is configured to acquire a color image. The color image includes color information such as RGB information, YUV information, and the like.

[0033] Referring to FIG. 5, the depth image is mapped into the color image. In detail, external parameters from the depth acquisition component 300 to the visible-light acquisition component 400 are calculated based on camera calibration of the depth acquisition component 300 and the visible-light camera component 400, and the external parameters are employed to obtain a depth image and a color image in the same coordinate system. The depth image includes depth information and the color image includes color information. The processed image is obtained through combining the mapped depth image with the mapped color image. Since the first resolution is smaller than the second resolution, only some of the pixels (i.e., the plurality of first pixels) in the processed image include depth information (corresponding to the depth information of the depth image). Both the plurality of first pixels and the plurality of second pixels include color information (corresponding to the color information of the color image).

[0034] Referring to FIG. 6, in some implementations, before the act in block 014, the method for obtaining a depth image further includes the acts in the following blocks.

[0035] At block 024, one or more low-confidence pixels at edges of the depth image having the first resolution are acquired based on a confidence map.

[0036] At block 026, depth information of the one or more low-confidence pixels is removed.

[0037] Referring to FIG. 7, in some implementations, the apparatus 100 further includes a fourth acquisition module 124 and a removing module 126. The act in block 024 may be realized by the fourth acquisition module 124, and the act in block 026 may be realized by the removing module 126. That is, the fourth acquisition module 124 may be configured to obtain one or more low-confidence pixels at edges of the depth image having the first resolution based on the confidence map. The removing module 126 may be configured to remove the depth information of the one or more low-confidence pixels.

[0038] Referring again to FIG. 4, in some implementations, the act in block 024 and the act in block 026 may be realized by the processor 200. That is, the processor 200 may also be configured to: obtain one or more low-confidence pixels at edges of the depth image having the first resolution based on a confidence map; and remove depth information of the one or more low-confidence pixels.

[0039] There is more noise at edges of the depth image, and errors in depth information of the edges are larger. Consequently, low-confidence pixels at edges of the depth image may be filtered out by a confidence map to filter out noise. In detail, the confidence map and the depth image are in a one-to-one correspondence relation, and a confidence threshold may be set. The confidence threshold may be compared with pixel values of edge pixels corresponding to edges of the depth image in the confidence map. When the pixel values of the edge pixels are greater than or equal to the confidence threshold, it is determined that the confidence of the pixels corresponding to the edge pixels in the depth image is relatively high. When the pixel values of the edge pixels are less than the confidence threshold, it is determined that the confidence of the pixels (low-confidence pixels) corresponding to the edge pixels in the depth image is relatively low. Given that pixels with low confidence have higher errors, the depth information of pixels with low confidence may be removed to filter out the noise in the depth image, such that a subsequent process of obtaining the depth image having the second resolution may not be affected by the noise of the low-confidence pixels, making the depth image having the second resolution more accurate.

[0040] An edge of the depth image may be obtained through an edge detection method such as thresholding, a gray-scale image, Sobel operator and canny operator, and no specific limitation is made herein.

[0041] In some implementations, all of the edges of the depth image obtained from detection may be removed, such that noise in the depth image may be filtered out quickly.

[0042] In some implementations, the acts in blocks 024 and 026 may be implemented before the act in block 012. That is, after filtering out the noise in the depth image, the depth image is mapped into the color image to obtain the processed image, thereby preventing the noise in the depth image from being transmitted to the processed image, and then being transmitted to the depth image through the processed image.

[0043] In some implementations, the acts in blocks 0264 and 026 may be implemented after the act in block 012. That is, after the depth image is mapped into the color image to obtain the processed image, the depth information of the first pixel corresponding to the low-confidence pixel in the processed image is removed, and the first pixel with the depth information removed may be regarded as the second pixel. In this manner, the complete depth image may be easily mapped into the color image to obtain the processed image, and then the noise in the processed image is filtered out.

[0044] Referring to FIG. 8, in some implementations, the depth image having the first resolution is obtained by the TOF camera component 320. The TOF camera component 320 is configured to sample repeatedly to obtain a plurality of phase maps. The depth image having the first resolution is obtained by processing the plurality of phase maps. The method for obtaining a depth image includes acts in the following blocks.

[0045] At block 028, an average pixel value of corresponding pixels in the plurality of phase maps is obtained.

[0046] At block 029, an amplitude map is obtained based on a plurality of average pixel values.

[0047] At block 032, the amplitude map is filtered to obtain the confidence map.

[0048] Referring to FIG. 9, in some implementations, the depth image having the first resolution is obtained by the TOF camera component 320. The TOF camera component 320 is configured to sample repeatedly to obtain the plurality of phase maps. The depth image having the first resolution is obtained by processing the plurality of phase maps. The image processing apparatus 100 includes a fifth acquisition module 128, a merging module 129, and a filtering module 132. The act in block 028 may be realized by the fifth acquisition module 128. The act in block 029 may be realized by the merging module 129. The act in block 032 may be realized by the filtering module 132. That is, the fifth acquisition module 128 may be configured to obtain an average pixel value of corresponding pixels in the plurality of phase maps. The merging module 129 may be configured to obtain the amplitude map based on the plurality of average pixel values. The filtering module 132 may be configured to filter the amplitude map to obtain the confidence map.

[0049] Referring again to FIG. 4, in some implementations, the depth image having the first resolution is obtained by the TOF camera component 320. The TOF camera component 320 is configured to sample repeatedly to obtain the plurality of phase maps. The depth image having the first resolution is obtained by processing the plurality of phase maps. The acts in blocks 028, 029 and 032 may be realized by the processor 200. That is, the processor 200 may be configured to: obtain an average pixel value of corresponding pixels in the plurality of phase maps; obtain the amplitude map based on a plurality of average pixel values; and filter the amplitude map to obtain the confidence map.

[0050] In detail, the plurality of phase maps are in a one-to-one correspondence relation with each other. An average value of pixel values of corresponding pixels in four phase maps may be acquired and regarded as the average pixel value. For example, the average pixel value

where Q1, Q2, Q3 and Q4 are pixel values of corresponding pixels in the four phase maps. The amplitude maps and the phase maps are also in a one-to-one correspondence relation. Since the average pixel value is regarded as the pixel value of a corresponding pixel in the amplitude map, the amplitude map may be obtained through obtaining pixel values of all of the pixels in the amplitude map.

[0051] Since there may be noise in the phase map, there may also be noise in the amplitude map obtained from the phase map. Consequently, the amplitude map may be filtered to obtain the confidence map, such that the confidence map is more accurate. A more accurate confidence map may be employed to obtain low-confidence pixels more accurately, and the depth information of the low-confidence pixels may be removed to filter out the noise. Gaussian filtering may be employed to filter the amplitude map to obtain the confidence map.

[0052] In some implementations, after filtering the amplitude map to obtain the confidence map, the maximum-confidence pixel value in the confidence map may further be obtained. And then, an updated confidence map is obtained through comparing each pixel value in the confidence map with the maximum-confidence pixel value. The low-confidence pixels are obtained based on the updated confidence map. The range of each pixel value of the updated confidence map is [0, 1]. Consequently, it is more convenient to set the confidence threshold and to compare the pixel values of the updated confidence map with the confidence threshold, thereby obtaining the low-confidence pixels more accurately and quickly.

[0053] In some implementations, each pixel value of the confidence map may be compared with the maximum-confidence pixel value through dividing each pixel value of the confidence map by the maximum-confidence pixel value.

[0054] Referring to FIG. 10, in some implementations, the depth image having the first resolution is obtained by the structured-light camera component 340. The structured-light camera component 340 is configured to acquire a structured-light image. The depth image having the first resolution is obtained by processing the structured-light image. The method for obtaining a depth image includes acts in the following blocks.

[0055] At block 034, a maximum pixel value in the structured-light image is obtained.

[0056] At block 036, each pixel value in the structured-light image is compared with the maximum pixel value to obtain the confidence map.

[0057] Referring to FIG. 11, in some implementations, the depth image having the first resolution is obtained by the structured-light camera component 340. The structured-light camera component 340 is configured to acquire a structured-light image. The depth image having the first resolution is obtained by processing the structured-light image. The image processing apparatus 100 includes a sixth acquisition module 134 and a comparison module 136. The act in block 034 may be realized by the sixth acquisition module 134, and the act in block 036 may be realized by the comparison module 136. That is, the sixth acquisition module 134 may be configured to obtain a maximum pixel value in the structured-light image. The comparison module 136 may be configured to compare each pixel value in the structured-light image with the maximum pixel value to obtain the confidence map.

[0058] Referring again to FIG. 4, in some implementations, the depth image having the first resolution is obtained by the structured-light camera component 340. The structured-light camera component 340 is configured to acquire a structured-light image. The depth image having the first resolution is obtained by processing the structured-light image. The acts in blocks 034 and 036 may be realized by the processor 200. That is, the processor 200 may be configured to: obtain a maximum pixel value in the structured-light image; and compare each pixel value in the structured-light image with the maximum pixel value to obtain the confidence map.

[0059] In detail, comparing each pixel value of the structured-light image with the maximum pixel value may be performed by dividing each pixel value of the structured-light image by the maximum pixel value. The range of each pixel value of the confidence map obtained from the structured-light image is [0, 1]. Consequently, it is convenient to set the confidence threshold and to compare the pixel value of the confidence map with the confidence threshold, thereby obtaining the low-confidence pixels accurately and quickly.

[0060] In some embodiments, the objective function is denoted by a formal of E(D) = Ed(D) + λsEs(D) + λNENLM(D), where E(D) denotes the objective function, Ed(D) denotes the data item, Es(D) denotes the neighborhood smoothing item, ENLM(D) denotes the non-local average regularization item, λs denotes a preset third weight, and λN denotes a preset fourth weight. λs and λN may be obtained based on experiments and pre-stored in a relevant storage element.

[0061] In some implementations, the data item is denoted by a formal of

where p denotes a current pixel, P denotes a set of the plurality of first pixels, D(p) denotes depth information of the pixel p in the processed image, G(p) denotes depth information of a pixel corresponding to the pixel p in the depth image having the second resolution.

[0062] In some implementations, the neighborhood smoothing item is denoted by a formal of

where p denotes a current pixel, P denotes a set of the plurality of first pixels, D(p) denotes the depth information of the pixel p in the processed image, N(p) denotes a first neighborhood of a pixel corresponding to the pixel p in the depth image having the second resolution, q denotes a pixel in the first neighborhood, wpq denotes the first weight, and D(q) denotes the depth information of the pixel q in the depth image having the second resolution. The first neighborhood is, for example, a 33 neighborhood. Of course, the first neighborhood may also be a 55 neighborhood, a 77 neighborhood, a 99 neighborhood or the like, and no specific limitation is made herein. Es(D) determines differences in color among pixels. The closer the color information of the current pixel and the pixel in the first neighborhood of the current pixel, the smaller the item is; otherwise the greater the item is.

[0063] In some implementations, the first weight is denoted by a formal of wpq = wcwswewd, where wc denotes a color similarity, ws denotes a separation weight, we denotes a salient edge weight, and wd denotes a higher-order linear interpolation weight.

[0064] In some implementations, the color similarity is denoted by a formal of

where I denotes luminance (Y), chromaticity (U) or density (V) of YUV space, I(p) denotes color information of pixel p in the processed image, I(q) denotes color information of the pixel q in the processed image, and σI denotes a preset constant. σI may be obtained based on experiments and pre-stored in a relevant storage element. In this embodiment of the present disclosure, I is the chromaticity of the YUV space, that is, I(p) is the chromaticity of the pixel p, and I(q) is the chromaticity of the pixel q in the processed image. The difference between I(p) and I(q) represents the closeness in colors.

[0065] In some implementations, the separation weight is denoted by a formal of ws = tse, where tse denotes a preset constant. The separation weight indicates whether a pixel in a first neighborhood of a pixel in the depth image is still within the neighborhood of the pixel after upsampling. If so, tse = 1; otherwise a constant within the range [0, 1] is taken as a penalty item. In the process of upsampling, the tse is, for example, 0.7. Of course, tse may also be of another value, and no specific limitation is made herein.

[0066] In some implementations, the salient edge weight is denoted by a formal of

where sx(p) denotes a pixel value corresponding to the pixel p in an image obtained by applying Sobel operator to the color image in an X axis, and sx(q) denotes a pixel value corresponding to the pixel q in an image obtained by applying Sobel operator to the color image in an X axis. we is employed to measure whether a pixel falls on an edge.

[0067] In some implementations, the higher-order linear interpolation weight is denoted by a formal of

where Dg(p) denotes a pixel value corresponding to the pixel p in an image obtained by applying Gaussian interpolation to the depth image having the first resolution, Dg(q) denotes a pixel value corresponding to the pixel q in an image obtained by applying Gaussian interpolation to the depth image having the second resolution, and σg denotes a preset constant. σg may be obtained based on experiments and pre-stored in a relevant storage element.

[0068] In some implementations, the non-local average regularization item is denoted by a formal of

where p denotes a current pixel, P denotes a set of the plurality of first pixels, D(p) denotes depth information of the pixel p in the processed image, A(p) denotes a second neighborhood of a pixel corresponding to the pixel p in the depth image having the second resolution, r denotes a pixel in the second neighborhood, kpr denotes the second weight, and D(r) is depth information of the pixel r in the depth image having the second resolution. kpr may be obtained based on experiments and pre-stored in a relevant storage element. The second neighborhood may be, for example, a 1111 neighborhood. Of course, the second neighborhood may also be a 1313 neighborhood, a 1515 neighborhood, or the like. To maintain a local structure of the pixel and a neighborhood of the pixel, the second neighborhood is normally greater than or equal to the 1111 neighborhood. ENLM(D) determines a structure difference among pixels. The item is relatively small when, for example, the pixels are all on an edge, or in the same smoothing area; otherwise, the item is relatively large.

[0069] It should be noted that in this implementation of the present disclosure, neither of the first neighborhood and the second neighborhood includes a central pixel. For example, when the first neighborhood is the neighborhood of the pixel p, the first neighborhood does not include the pixel p.

[0070] Referring to FIG. 11, in some implementations, the act in block 022 includes an act in the following block.

[0071] At block 0222, a minimum solution to the objective function is found with an optimization-problem solving algorithm to obtain the depth image having the second resolution.

[0072] Referring again to FIG. 3, in some implementations, the act in block 0222 may be realized by the calculation module 122. That is, the calculation module 122 may be configured to find a minimum solution to the objective function with an optimization-problem solving algorithm to obtain the depth image having the second resolution.

[0073] Referring again to FIG. 4, in some implementations, the act in block 0222 may be realized by the processor 200. That is, the processor 200 may be configured to find a minimum solution to the objective function with an optimization-problem solving algorithm to obtain the depth image having the second resolution.

[0074] In detail, the optimization-problem solving algorithm includes, for example, least squares method, first-order gradient, second-order gradient, and on the like. In this embodiment of the present disclosure, the optimization-problem solving algorithm is the least squares method. The operation of the least squares method is fast, so that the process of upsampling the depth image into the depth image having the second resolution takes less time, and further, real-time processing of the depth image may be realized, and thus a requirement of processing at least preset frames (for example, 30 frames) of depth images in one second may be satisfied.

[0075] Referring to FIG. 13, the present disclosure further provides a computer readable storage medium 600. The computer readable storage medium 600 includes a computer program 620 used in combination with the electronic device 1000. The computer program 620 may be executed by the processor 200 to implement the method for obtaining a depth image according to any one of the foregoing embodiments.

[0076] For example, in combination with FIG. 1 and FIG. 13, the computer program 620 may be executed by the processor 200 to perform acts in the following blocks.

[0077] At block 012, a depth image having a first resolution is mapped into a color image having a second resolution to obtain a processed image. The depth image and the color image correspond to the same scene. The first resolution is smaller than the second resolution. The processed image includes a plurality of first pixels and a plurality of second pixels. Each of the plurality of first pixels includes color information and depth information, and each of the plurality of second pixels includes color information. The depth information corresponds to the depth image having the first resolution. The color information corresponds to the color image.

[0078] At block 014, a data item of an objective function is determined based on the depth information of the plurality of first pixels in the processed image and depth information of a plurality of pixels corresponding to the plurality of first pixels in the depth image having the second resolution. The depth image having the second resolution includes depth information.

[0079] At block 016, a neighborhood smoothing item of the objective function is determined based on depth information of the plurality of first pixels in the processed image, and depth information of pixels in a first neighborhood corresponding to each of the plurality of first pixels in the depth image having the second resolution.

[0080] In an embodiment, the neighborhood smoothing item may be multiplied by a first weight. The first weight is determined based on the color information of the plurality of first pixels in the processed image and color information of pixels in the first neighborhood of each of the plurality of first pixels corresponding to each of the plurality of first pixels in the processed image.

[0081] At block 018, a non-local average regularization item of the objective function is determined based on depth information of the plurality of first pixels in the processed image, and depth information of pixels in a second neighborhood corresponding to each of the plurality of first pixels in the depth image having the second resolution.

[0082] At block 022, the objective function is solved to obtain the depth image having the second resolution.

[0083] For another example, in combination with FIG. 6 and FIG. 13, the computer program 620 may further be executed by the processor 200 to perform acts in the following blocks.

[0084] At block 024, one or more low-confidence pixels at edges of the depth image having the first resolution are acquired based on a confidence map.

[0085] At block 026, depth information of the one or more low-confidence pixels is removed.

[0086] Reference throughout this specification to "an embodiment," "some embodiments," "an example," "a specific example," or "some examples," means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. The appearances of the above phrases in various places throughout this specification are not necessarily referring to the same embodiment or example of the present disclosure. Furthermore, the particular features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples. In addition, different embodiments or examples and features of different embodiments or examples described in the specification may be combined by those skilled in the art without mutual contradiction.

[0087] In addition, terms such as "first" and "second" are used herein for purposes of description and are not intended to indicate or imply relative importance or significance. Thus, the feature defined with "first" and "second" may comprise one or more this feature. In the description of the present disclosure, "a plurality of' means at least two, for example, two or three, unless specified otherwise.

[0088] Any process or method described in a flow chart or described herein in other ways may be understood to include one or more modules, segments or portions of codes of executable instructions for achieving specific logical functions or steps in the process, and the scope of a preferred embodiment of the present disclosure includes other implementations, which should be understood by those skilled in the art.

[0089] Although explanatory embodiments have been shown and described, it would be appreciated by those skilled in the art that the above embodiments cannot be construed to limit the present disclosure, and changes, alternatives, and modifications can be made in the embodiments without departing from spirit, principles and scope of the present disclosure.


Claims

1. A method for obtaining a depth image, comprising:

mapping (012'; 012) a depth image having a first resolution into a color image having a second resolution to obtain a processed image, the first resolution being smaller than the second resolution;

establishing (014') an objective function with respect to the processed image and a depth image having the second resolution, pixels in the processed image having one-to-one correspondence with pixels in the depth image having the second resolution, the objective function aiming to minimize an error with respect to the processed image and the depth image having the second resolution; and

solving (016'; 022) the objective function to obtain the depth image having the second resolution.


 
2. The method of claim 1, wherein the processed image comprises a plurality of first pixels and a plurality of second pixels, each of the plurality of first pixels comprises color information and depth information, and each of the plurality of second pixels comprises color information,
wherein establishing (014') the objective function with respect to the processed image and the depth image having the second resolution comprises:

determining (014) a data item of the objective function based on depth information of the plurality of first pixels in the processed image and depth information of a plurality of pixels corresponding to the plurality of first pixels in the depth image having the second resolution;

determining (016) a neighborhood smoothing item of the objective function based on depth information of the plurality of first pixels in the processed image, and depth information of pixels in a first neighborhood corresponding to each of the plurality of first pixels in the depth image having the second resolution; and

determining (018) a non-local average regularization item of the objective function based on depth information of the plurality of first pixels in the processed image, and depth information of pixels in a second neighborhood corresponding to each of the plurality of first pixels in the depth image having the second resolution,

the second neighborhood being greater than the first neighborhood.


 
3. The method of claim 1 or 2, further comprising:

obtaining (024) one or more low-confidence pixels at edges of the depth image having the first resolution based on a confidence map; and

removing (026) depth information of the one or more low-confidence pixels.


 
4. The method of claim 3, wherein the depth image having the first resolution is obtained by a time-of-flight camera component, the time-of-flight camera component is configured to sample repeatedly to obtain a plurality of phase maps, the depth image having the first resolution is obtained by processing the plurality of phase maps, and the method comprises:

obtaining (028) an average pixel value of corresponding pixels in the plurality of phase maps;

obtaining (029) an amplitude map based on a plurality of average pixel values; and

filtering (032) the amplitude map to obtain the confidence map.


 
5. The method of claim 3, wherein the depth image having the first resolution is obtained by a structured-light camera component, the structured-light camera component is configured to acquire a structured-light image, the depth image having the first resolution is obtained by processing the structured-light image, and the method comprises:

obtaining (034) a maximum pixel value in the structured-light image; and

comparing (036) each pixel value in the structured-light image with the maximum pixel value to obtain the confidence map.


 
6. The method of any one of claims 2 to 5, wherein the objective function is denoted by a formal of:

where, E(D) denotes the objective function, Ed(D) denotes the data item, Es(D) denotes the neighborhood smoothing item, ENLM(D) denotes the non-local average regularization item, λs and λN denote weights.
 
7. The method of claim 6, wherein the data item is denoted by a formal of:

where, p denotes a current pixel, P denotes a set of the plurality of first pixels, D(p) denotes depth information of the pixel p in the processed image, G(p) denotes depth information of a pixel corresponding to the pixel p in the depth image having the second resolution.
 
8. The method of claim 6, wherein the neighborhood smoothing item is denoted by a formal of:

where, p denotes a current pixel, P denotes a set of the plurality of first pixels, D(p) denotes depth information of the pixel p in the processed image, N(p) denotes a first neighborhood of a pixel corresponding to the pixel p in the depth image having the second resolution, q denotes a pixel in the first neighborhood, wpq denotes a first weight, and D(q) denotes depth information of the pixel q in the depth image having the second resolution.
 
9. The method of claim 8, wherein the first weight is denoted by a formal of:

where, wc denotes a color similarity, ws denotes a separation weight, we denotes a salient edge weight, and wd denotes a higher-order linear interpolation weight;

the color similarity is denoted by a formal of

where I denotes luminance, chromaticity or density of YUV space, I(p) denotes color information of the pixel p in the processed image, I(q) denotes color information of the pixel q in the processed image, and σI denotes a preset constant;

the separation weight is denoted by a formal of ws = tse, tse denotes a preset constant;

the salient edge weight is denoted by a formal of

where sx(p) denotes a pixel value corresponding to the pixel p in an image obtained by applying Sobel operator to the color image in an X axis, and sx(q) denotes a pixel value corresponding to the pixel q in an image obtained by applying Sobel operator to the color image in an X axis; and

the higher-order linear interpolation weight is denoted by a formal of

where Dg(p) denotes a pixel value corresponding to the pixel p in an image obtained by applying Gaussian interpolation to the depth image having the first resolution, Dg(q) denotes a pixel value corresponding to the pixel q in an image obtained by applying Gaussian interpolation to the depth image having the second resolution, and σg denotes a preset constant.


 
10. The method of claim 6, wherein the non-local average regularization item is denoted by a formal of:

where, p denotes a current pixel, P denotes a set of the plurality of first pixels, D(p) denotes depth information of the pixel p in the processed image, A(p) denotes a second neighborhood of a pixel corresponding to the pixel p in the depth image having the second resolution, r denotes a pixel in the second neighborhood, kpr denotes a second weight, and D(r) is depth information of the pixel r in the depth image having the second resolution.
 
11. The method of any one of claims 1 to 10, wherein solving (016'; 022) the objective function to obtain the depth image having the second resolution comprises:
finding (0222) a minimum solution to the objective function with an optimization-problem solving algorithm to obtain the depth image having the second resolution.
 
12. An apparatus for obtaining a depth image, comprising:

a mapping module (112) configured to map a depth image having a first resolution into a color image having a second resolution to obtain a processed image, the first resolution being smaller than the second resolution;

an establishing module (110) configured to establish an objective function with respect to the processed image and a depth image having the second resolution, pixels in the processed image having one-to-one correspondence with pixels in the depth image having the second resolution, the objective function aiming to minimize an error with respect to the processed image and the depth image having the second resolution; and

a calculation module (122) configured to solve the objective function to obtain the depth image having the second resolution.


 
13. The apparatus of claim 12, wherein the processed image comprises a plurality of first pixels and a plurality of second pixels, each of the plurality of first pixels comprises color information and depth information, and each of the plurality of second pixels comprises color information,
wherein the establishing module (110) comprises:

a first acquisition module (114) configured to determine a data item of the objective function based on depth information of the plurality of first pixels in the processed image and depth information of a plurality of pixels corresponding to the plurality of first pixels in the depth image having the second resolution;

a second acquisition module (116) configured to determine a neighborhood smoothing item of the objective function based on depth information of the plurality of first pixels in the processed image, and depth information of pixels in a first neighborhood corresponding to each of the plurality of first pixels in the depth image having the second resolution; and

a third acquisition module (118) configured to determine a non-local average regularization item of the objective function based on depth information of the plurality of first pixels in the processed image, and depth information of pixels in a second neighborhood corresponding to each of the plurality of first pixels in the depth image having the second resolution,

the second neighborhood being greater than the first neighborhood.


 
14. The apparatus of claim 12 or 13, further comprising:

a fourth acquisition module (124), configured to obtain one or more low-confidence pixels at edges of the depth image having the first resolution based on a confidence map; and

a removing module (126) configured to remove depth information of the one or more low-confidence pixels.


 
15. A computer readable storage medium, comprising a computer program used in combination with an electronic device, the computer program being executable by a processor of the electronic device to implement the method according to any one of claims 1 to 11.
 




Drawing








































Search report









Search report