WO2022188102A1 - Depth image inpainting method and apparatus, camera assembly, and electronic device - Google Patents

Depth image inpainting method and apparatus, camera assembly, and electronic device Download PDF

Info

Publication number
WO2022188102A1
WO2022188102A1 PCT/CN2021/080255 CN2021080255W WO2022188102A1 WO 2022188102 A1 WO2022188102 A1 WO 2022188102A1 CN 2021080255 W CN2021080255 W CN 2021080255W WO 2022188102 A1 WO2022188102 A1 WO 2022188102A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
depth image
pixel
depth
pixel value
Prior art date
Application number
PCT/CN2021/080255
Other languages
French (fr)
Chinese (zh)
Inventor
苏雨曦
罗俊
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to CN202180094623.8A priority Critical patent/CN116897532A/en
Priority to PCT/CN2021/080255 priority patent/WO2022188102A1/en
Publication of WO2022188102A1 publication Critical patent/WO2022188102A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof

Definitions

  • the present application relates to the field of imaging technologies, and in particular, to a depth image restoration method, restoration device, camera assembly, and electronic equipment.
  • depth images may have holes and other abnormalities.
  • Embodiments of the present application provide a depth image restoration method, a restoration device, a camera assembly, and an electronic device.
  • the restoration method of the embodiment of the present application includes: acquiring a current scene image of the depth image, where the current scene image includes a plurality of different object regions, and mapping each of the object regions of the current scene image to different pixel value ranges to obtain a guide image; construct an objective function according to the depth image and the guide image, and perform a global optimization calculation to repair the depth image.
  • a depth image restoration device includes a first acquisition module and a first processing module.
  • the first acquisition module is used to acquire a current scene image of the depth image, the current scene image includes a plurality of different object regions, and each of the object regions of the current scene image is mapped to different pixel value ranges to obtaining a guide image;
  • the first processing module is configured to construct an objective function according to the depth image and the guide image and perform a global optimization calculation to repair the depth image.
  • the camera assembly includes an image sensor, a depth sensor, and a processor, and the processor is configured to acquire a current scene image, where the current scene image includes a plurality of different object regions, and the current scene image is Each of the object regions of the scene image is mapped to different pixel value ranges to obtain a guide image; an objective function is constructed according to the depth image and the guide image, and a global optimization calculation is performed to restore the depth image.
  • the electronic device of the embodiment of the present application includes the camera assembly and the casing of the above-mentioned embodiment, and the camera assembly is disposed on the casing.
  • the above depth image restoration method, restoration device, camera assembly and electronic device obtain a guide image by acquiring the current scene image of the depth image and mapping each object area of the current scene image to different pixel value ranges.
  • the guide image can reflect the difference in depth changes of different object areas in the scene image, and can effectively enhance the edge effect of each different object area.
  • constructing an objective function according to the depth image and the guide image to perform a global optimization calculation to repair the depth image can effectively fill and repair holes of various areas in the depth image.
  • the edge information in the image is enhanced to a certain extent, and the holes at the edge can be effectively filled and repaired when repairing the depth image.
  • the edge information is preserved to a certain extent.
  • FIG. 1 is a schematic flowchart of a repair method according to an embodiment of the present application.
  • FIG. 2 is an exemplary diagram of a repair method according to an embodiment of the present application
  • FIG. 3 is a schematic flowchart of a repair method according to an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a repair method according to an embodiment of the present application.
  • FIG. 5 is an exemplary diagram of a repair method according to an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a repair method according to an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a repair method according to an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of a repair method according to an embodiment of the present application.
  • FIG. 9 is an exemplary diagram of a repair method according to an embodiment of the present application.
  • FIG. 10 is a module diagram of a repair device according to an embodiment of the present application.
  • FIG. 11 is a block diagram of a repair device according to an embodiment of the present application.
  • FIG. 12 is a module diagram of a repair device according to an embodiment of the present application.
  • FIG. 13 is a schematic diagram of a camera assembly according to an embodiment of the present application.
  • FIG. 14 is a schematic diagram of an electronic device according to an embodiment of the present application.
  • the present application provides a method for repairing a depth image, and the repair method includes:
  • S10 obtaining a current scene image of the depth image, where the current scene image includes a plurality of different object regions, and mapping each object region of the current scene image to different pixel value ranges to obtain a guide image;
  • S20 Construct an objective function according to the depth image and the guide image to perform a global optimization calculation to repair the depth image.
  • the depth image includes depth information of objects within the current shooting range.
  • the same sensor can be obtained simultaneously by active ranging sensing methods such as TOF camera components or structured light components with depth sensors, or passive ranging sensing methods such as two camera components with RGB filter arrays separated by a certain distance.
  • Two images of the scene, and then data processing and depth calculation are performed to obtain a depth image.
  • multiple frames of depth images can be stored in the depth map buffer space.
  • two images of the same scene are simultaneously acquired by two camera assemblies having image sensors with RGB filter arrays, please refer to FIG. 2, FIG. (b) is the image captured by the sub-camera assembly, through data processing and depth calculation, the depth image shown in Figure 2(c) is obtained.
  • the current scene image corresponding to the depth image may include scene information of objects within the current shooting range.
  • the current scene image may also be a pre-stored image that needs to be displayed currently, that is, the current scene image may include scene information of objects within the original shooting range.
  • the current scene image can be captured by the camera assembly of the image sensor with the RGB filter array.
  • the depth image is acquired by two camera assemblies of image sensors with RGB filter arrays to simultaneously acquire two images of the same scene. Please refer to FIG. 2 again, FIG. 2(a)
  • the image captured by the main camera assembly , FIG. 2(b) is an image captured by the sub-camera assembly, and the current scene image may include FIG. 2(a) and/or FIG. 2(b).
  • each object area of the current scene image is mapped to different pixel value ranges, thereby enhancing the edges of each object area in the current scene image, and obtaining a guide image.
  • each object area in the current scene image may include single or multiple persons, and/or single or multiple non-personal objects.
  • each object region of the current scene image can be segmented by means of a machine learning algorithm, and each object region can be mapped to different pixel value ranges.
  • the current scene image can also be segmented by means of semantic segmentation, instance segmentation, etc., and then through superposition calculation, so that each object region has different pixel value ranges.
  • step S20 the global optimization calculation of the objective function is performed according to the obtained guide image and the depth image to restore the depth image.
  • the surface of the object is a light-absorbing material, and the surface of the object is very smooth, or the object is in the blind area of the depth camera, For example, in the area that is too close or too far, the data will be lost due to the inability to capture the reflected infrared light, resulting in errors and holes in the depth image.
  • the depth image is used as the input of the objective function
  • the guide image is used as the weighting coefficient of edge enhancement
  • each pixel in the image is maximized to be close to the pixel value of the surrounding neighborhood pixels, so as to construct the objective function and pass the global maximum
  • the optimized solution process obtains the output in the objective function, that is, the repaired depth image, which can effectively fill and repair the holes in the depth image.
  • the above-mentioned depth image restoration method obtains the guide image by acquiring the current scene image of the depth image, and mapping each object region of the current scene image to different pixel value ranges.
  • the guide image can reflect the difference in depth changes of different object areas in the scene image, and can effectively enhance the edge effect of each different object area.
  • depth image restoration methods are mainly based on joint bilateral filtering methods or local spatial filtering methods such as median filtering or Gaussian filtering, but are often used to deal with small-area holes. When there is a hole in the edge, it will cause the problem of blurring or disappearing of the edge.
  • the depth image is used as the input of the objective function
  • the guide image is used as the weighting coefficient for edge enhancement, so that each pixel in the image is at most close to the pixel value of the surrounding neighborhood pixels, so as to construct the objective function through the global optimization solution.
  • the process obtains the output of the objective function, that is, the repaired depth image, which can effectively fill and repair the holes of various areas in the depth image.
  • the guide image is used as a weighting coefficient for edge enhancement, the holes at the edge can be effectively filled and repaired, and the edge information can be preserved to a certain extent.
  • step S10 includes:
  • S11 Perform scene detection on the current scene image to determine the scene type
  • step S11 based on machine learning, data such as pictures of different scene types can be used for pre-training to improve the scene detection ability.
  • data such as pictures of different scene types can be used for pre-training to improve the scene detection ability.
  • the corresponding image of the current scene image can be more accurately determined.
  • Scene type may include human images, non-human images, and human-non-human images, where the human image may include a portrait subject and a background, a non-human image may include an object subject and background, and a human-non-human image may include portrait subject, object subject And background, further, the character subject includes one character or more than one character, and the non-character subject includes one non-character or more than one non-character.
  • when performing scene detection on the current scene image first detect whether there is a portrait subject, then detect whether there is an object subject, and then combine the results of pre-machine learning to determine the scene type corresponding to the current scene image.
  • step S12 portrait segmentation is performed on the current scene image, that is, the portrait subject and the background are segmented.
  • object segmentation is performed on the current scene image, that is, the object subject and the background are segmented.
  • the portrait subject is segmented first, and then the object subject is segmented.
  • each object region can be divided into binary results and multi-valued results according to the actual application.
  • the binary result includes dividing the required single or multiple object regions into main regions, and the rest are background regions. Further, the subject area is mapped to one pixel value range, and the background area is mapped to another pixel value range.
  • the multi-valued result may include multiple characters and/or multiple non-characters to form multiple regions, that is, the current scene image is divided into at least three different object regions, and the at least three different object regions include at least two subject regions and one Background area, multiple areas are mapped to their respective different pixel value ranges.
  • the current scene image is a single person and a background non-person area
  • the single person is divided into the main area according to the binary result
  • the mapped pixel value range is 155-255
  • the background non-person area is the background area
  • the mapped pixel value range is 0 to 100.
  • step S15 after each object region is mapped to different pixel value ranges, the brightness displayed by each object region is different, and the boundary between each object region is clearer, thereby obtaining a guide image.
  • step S15 includes:
  • S151 Determine each object region according to the segmentation result and form a segmented image, and each object region is represented by the same pixel value in the segmented image;
  • S152 Perform weighting processing on the segmented image and the current scene image to obtain a guide image.
  • the pixel value range of each object region in the segmented image is preset, the pixel value range of each object region in the segmented image is different, and the pixel value of the same object region in different current scene images is the same, for example, the characters in different current scene images
  • the pixel value of the portrait subject is uniformly set to (155,255)
  • the pixel value of the background is uniformly set to (0,100)
  • the guide image can be obtained by performing weighting processing on the pixel value of the segmented image and the corresponding pixel value of the current scene image.
  • the pixel value ranges of different object regions are different, and the edges of different object regions in the segmented image are enhanced compared to the current scene image.
  • the weighted weight coefficient can be set according to the actual need to distinguish the degree of each object area.
  • the scene type of the current scene image is a portrait image
  • the portrait is segmented to obtain two object regions, one of which is the portrait subject, and the other object.
  • the area is the background
  • the pixel value of the main body of the portrait is set to (155, 255)
  • the pixel value of the background is set to (0, 100), so as to obtain the segmented image as shown in Figure 5(d).
  • the pixel values of the current scene image shown in Fig. 5(e) are weighted and summed to obtain the guide image shown in Fig. 5(f).
  • the purpose of obtaining the guide image by weighting the segmented image and the current scene image is to enable each object region in the current scene image to be displayed with different pixel value ranges, or to make the distinction of each object region more obvious.
  • the weighting processing is only a mathematical processing method, and there may be other methods such as linear functions. Therefore, the transformation of simple mathematical form for this purpose can be regarded as a simple replacement of this embodiment.
  • the implementation method is simpler and more effective, and the weight coefficient can be adjusted according to actual business requirements, thereby enhancing the edge of each object area in the current scene image.
  • step S15 further includes:
  • the corresponding relationship between the number of object regions, the type of object regions and the range of pixel values mapped by each type of object region in the number is preset, so that when determining the number and type of object regions (for example, the first subject region, the third After two main areas and background areas), according to the corresponding relationship, map each object area to the corresponding pixel value range, and then the edge-enhanced guide image can be obtained.
  • a preset range is spaced between two adjacent pixel value ranges, and the difference between the maximum value of the preset range and the minimum value of the preset range is greater than 1.
  • the range of pixel values includes multiple ranges, and the multiple ranges of pixel values include adjacent first pixel value ranges and second pixel value ranges, and the maximum value of the first pixel value range is smaller than the minimum value of the second pixel value range. , the difference between the minimum value of the second pixel value range and the maximum value of the first pixel value range is greater than 1.
  • the pixel value range of one object region may be [0, 100]
  • the pixel value range of the other object region may be [155, 255]
  • the preset range may be (100, 155).
  • the pixel value ranges of the 5 object regions may be [0,41], [51,92], [102,143], [153,194] and [204,245] respectively.
  • the range can be (41,51), (92,102), (143,153), (194,204), (245,255).
  • different object regions correspond to different pixel value ranges, and two adjacent pixel value ranges are separated by a preset range, so that the brightness of different object regions is different, and the boundaries of different object regions are clearer.
  • the method for repairing the depth image further includes:
  • S30 Acquire a historical frame depth image, where the shooting time of the historical frame depth image is before the shooting time of the depth image;
  • Step S20 includes:
  • S21 Construct an objective function according to the enhanced depth image and the guide image to perform a global optimization calculation to repair the depth image.
  • the depth image can be obtained by an active ranging sensing method, such as a TOF camera assembly or a structured light assembly with a depth sensor, or a passive ranging sensing method, such as two sensors with RGB filter arrays separated by a certain distance.
  • the camera component of the image sensor acquires two images of the same scene at the same time, and then performs data processing and depth calculation.
  • the depth image obtained in this way may be an original depth image, which contains holes, and a set of hole pixels is obtained, wherein the set of hole pixels is a set of all the holes in the original depth image.
  • the historical weighted depth value of the hole point can be calculated by using the depth map buffer to perform preliminary filling and repairing on the hole point set in the original depth image.
  • the historical frame depth image in the depth map buffer is acquired, and the shooting time of the historical frame depth image is before the shooting time of the depth image, including a single frame or multiple frames of depth images. If it is a single-frame historical depth image and has a non-zero pixel value at the corresponding hole position of the original depth image, the pixel value of the corresponding hole pixel in the single-frame historical depth image is selected as the repair pixel set. If it is a multi-frame historical depth image, the historical depth image of the required number of frames can be extracted in chronological order, and the hole pixels in the multi-frame historical depth image can be weighted and summed to obtain a repaired pixel set. For example, the current time is t, and the original depth image at time t, t-1, and t-2 is stored in the buffer. Then the historical weighted value of the hole pixel can be calculated by the following formula:
  • the hole pixel set of the original depth image is replaced with the repair pixel set to obtain an enhanced depth image.
  • the objective function is constructed according to the enhanced depth image and the guide image for global optimization calculation to repair the depth image.
  • the depth map buffer is used to calculate the historical weighted depth value of the hole point to initially fill and repair the hole point in the original depth image, so that the pixel value of the hole pixel point entering the objective function is more optimized, and then the objective function can be optimized. Get better output functions, or better inpainting results for depth images.
  • step S20 further includes:
  • i is the position of the current pixel
  • ui is the pixel value of the current pixel
  • is the total weight coefficient in the frame
  • j is the pixel position of the neighborhood N(i) of i
  • g is the guide image
  • w i ,j (g) is the edge weight coefficient corresponding to the guide image
  • u j is the pixel value of the pixel point in the neighborhood of the current pixel point
  • f i is the pixel value corresponding to the current pixel point in the depth image.
  • the guide image g uses the function wi ,j (g) as a guide item to control the edge weight coefficient of each object region, the coefficient is small when the edge is strong, and the coefficient is large when the edge is weak.
  • the minimum value of the objective function J(u) is solved by mathematical methods, so that the error between the output function and the input function in the function is minimized, and the current pixel point is close to the neighborhood pixel point at the most, and the total smoothing weight in the frame is passed.
  • the coefficient ⁇ and the edge enhancement coefficient w i,j (g) corresponding to the guide image perform edge control.
  • f i may be an enhanced depth image, that is, in the above embodiment, the enhanced depth obtained by initially filling and repairing the hollow points in the original depth image by using the depth map buffer to calculate the historical weighted depth value of the hollow points image. Further, an objective function is constructed according to the enhanced depth image and the guide image to perform a global optimization calculation to repair the depth image.
  • 9(g) is the input depth image of the objective function, in which, the oval box in 9(g) is a hollow example, and 9(h) is the guide image. Minimize the solution, and finally get the repaired depth map 9(i). It can be seen from the figure that the holes are effectively filled and repaired to a certain extent.
  • the holes of various areas in the depth image can be effectively filled and repaired.
  • J(u) minimizes the input and output errors from the global optimization, and the solution process is a linear weighted solution, which is more simple and effective to fill and repair the holes in the depth image.
  • the guide image is used as a weighting coefficient for edge enhancement, the holes at the edge can be effectively filled and repaired, and the edge information can be preserved to a certain extent.
  • the objective function of machine learning can be solved faster, and to a certain extent, high-speed filling and restoration of depth images can be achieved.
  • the neighborhood N(i) is a 4-neighborhood or an 8-neighborhood.
  • the 4 neighborhoods of i that is, a pixel above adjacent to i, a pixel below adjacent to i, and a pixel adjacent to i.
  • the pixel points in the 4-neighborhood or the 8-neighborhood of the current pixel point i of the current frame can be filtered, so as to obtain a repaired depth image corresponding to the depth image of the current frame.
  • the value range of ⁇ is [100, 10000].
  • the value of ⁇ may be 100, 500, 700, 1000, 3000, 5000, 7000, 10000 or other values between 100-10000.
  • the total weight coefficient in the frame can be set as required, so as to obtain a better objective function.
  • g i is the pixel value of the guide image corresponding to the current pixel point
  • g j is the pixel value of the guide image corresponding to the j point in the neighborhood N(i)
  • the value range of ⁇ is [1, 10].
  • the farther the j point is from the current pixel point i the smaller the influence on the pixel value of the current pixel point i, that is, the farther the j point is from the current pixel point i, the smaller the edge enhancement coefficient is.
  • the value of ⁇ may be 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, or other values between 1-10.
  • the present application provides a depth image restoration apparatus 10 .
  • the restoration apparatus 10 includes a first acquisition module 11 and a first processing module 12 .
  • the first acquisition module 11 is configured to acquire a current scene image of the depth image, the current scene image includes a plurality of different object regions, and each object region of the current scene image is mapped to different pixel value ranges to obtain a guide image.
  • the first processing module 12 is configured to construct an objective function according to the depth image and the guide image to perform global optimization calculation to repair the depth image.
  • the depth image includes depth information of objects within the current shooting range.
  • the same sensor can be obtained simultaneously by active ranging sensing methods such as TOF camera components or structured light components with depth sensors, or passive ranging sensing methods such as two camera components with RGB filter arrays separated by a certain distance. Two images of the scene, and then data processing and depth calculation are performed to obtain a depth image. Further, multiple frames of depth images can be stored in the depth map buffer space.
  • the current scene image corresponding to the depth image can be acquired by the first acquisition module 11, including scene information of objects within the current shooting range.
  • the current scene image may also be a pre-stored image acquired by the first acquiring module 11 and currently required to be displayed, that is, the current scene image may include scene information of objects within the original shooting range.
  • the current scene image can be captured by the camera assembly of the image sensor with the RGB filter array.
  • each object area in the current scene image may include single or multiple persons, and/or single or multiple non-personal objects.
  • each object region of the current scene image can be segmented by means of a machine learning algorithm, and each object region can be mapped to different pixel value ranges.
  • the current scene image can also be segmented by means of semantic segmentation, instance segmentation, etc., and then through superposition calculation, so that each object region has different pixel value ranges.
  • the first processing module 12 After the guide image is determined, the first processing module 12 performs a global optimization calculation of the objective function according to the obtained guide image and the depth image to restore the depth image. It is understandable that in the depth image, due to certain factors such as when the illuminated object is a transparent object, the surface of the object is a light-absorbing material, and the surface of the object is very smooth, or the object is in the blind area of the depth camera, For example, in the area that is too close or too far, the data will be lost due to the inability to capture the reflected infrared light, resulting in the problem of holes in the depth image.
  • the depth image is used as the input of the objective function
  • the guide image is used as the weighting coefficient of edge enhancement
  • each pixel in the image is maximized to be close to the pixel value of the surrounding neighborhood pixels, so as to construct the objective function and pass the global maximum
  • the optimized solution process obtains the output in the objective function, that is, the repaired depth image, which can effectively fill and repair the holes in the depth image.
  • the above-mentioned depth image restoration apparatus 10 obtains the current scene image of the depth image through the first obtaining module 11, and maps each object area of the current scene image to different pixel value ranges to obtain the guide image.
  • the guide image can reflect the difference in depth changes of different object areas in the scene image, and can effectively enhance the edge effect of each different object area.
  • the first processing module 12 uses the depth image as the input of the objective function, and the guide image is used as the weighting coefficient of edge enhancement, so that each pixel in the image is at most close to the pixel value of the surrounding neighborhood pixels, so as to construct the objective function.
  • the output of the objective function that is, the repaired depth image, can be effectively filled and repaired for holes of various areas in the depth image through the global optimization solution process.
  • the guide image is used as a weighting coefficient for edge enhancement, the holes at the edge can be effectively filled and repaired, and the edge information can be preserved to a certain extent.
  • the first acquisition module 11 includes a detection unit 111 , a first segmentation unit 112 , a second segmentation unit 113 , a determination unit 114 and a mapping unit 115 .
  • the detection unit 111 is configured to perform scene detection on the current scene image to determine the scene type.
  • the first segmentation unit 112 is configured to perform portrait segmentation when the scene type is a human image.
  • the second segmentation unit 113 is configured to perform object segmentation when the scene type is a non-human image.
  • the determining unit 114 is used for determining each object region according to the segmentation result.
  • the mapping unit 115 is used for mapping each object region to different pixel value ranges to obtain a guide image.
  • the first obtaining module 11 can obtain a relatively accurate guide image, thereby enhancing the edges of each object region in the current scene image.
  • the mapping unit 115 includes a first determination subunit 1151 and a weighting processing subunit 1152 .
  • the first determination subunit 1151 is configured to determine each object region according to the segmentation result and form a segmented image, and each object region is represented by the same pixel value in the segmented image.
  • the weighting processing subunit 1152 is configured to perform weighting processing on the segmented image and the current scene image to obtain the guide image.
  • the mapping unit 115 obtains the guide image by weighting the segmented image and the current scene image, which is simpler and more effective, and can adjust the weight coefficients according to actual business requirements, thereby enhancing the edge of each object area in the current scene image.
  • the mapping unit 115 includes a second determining subunit 1153 and a mapping subunit 1154 .
  • the second determination subunit 1153 is configured to determine the pixel value range mapped by each object region according to the number of object regions.
  • the mapping subunit 1154 is used to map each object region to a corresponding pixel value range to obtain a guide image.
  • the mapping unit 115 obtains a more accurate guide image by mapping each object region to a corresponding pixel value range, thereby enhancing the edge of each object region in the current scene image.
  • a preset range is spaced between two adjacent pixel value ranges, and the difference between the maximum value of the preset range and the minimum value of the preset range is greater than 1.
  • different object regions correspond to different pixel value ranges, and two adjacent pixel value ranges are separated by a preset range, so that the brightness of different object regions is different, and the boundaries of different object regions are clearer.
  • the repairing apparatus 10 further includes a second acquiring module 13 and a second processing module 14 .
  • the second acquisition module 13 is used to acquire the depth image of the historical frame, the shooting time of the depth image of the historical frame is before the shooting time of the depth image, and to acquire the hole pixel set of the depth image.
  • the second processing module 14 is configured to obtain the repaired pixel set according to the depth image of the historical frame, and replace the hole pixel set of the depth image with the repaired pixel set to obtain the enhanced depth image.
  • the first processing module 12 is further configured to construct an objective function according to the enhanced depth image and the guide image to perform global optimization calculation to repair the depth image.
  • the second processing module 14 uses the depth map buffer to calculate the historical weighted depth value of the hole point to perform preliminary filling and repairing on the hole point in the original depth image, so that the pixel value of the hole pixel point entering the objective function is more optimized, which can make
  • the first processing module 12 performs the objective function optimization solution to obtain a better output function, or in other words, obtains a better restoration effect for the depth image.
  • the first processing module 12 includes an optimization unit 210 .
  • the optimization unit 210 is configured to optimize the objective function so that the objective function obtains a minimum value, and outputs the pixel value of the current pixel point of the repaired depth image corresponding to the minimum value, and the objective function is:
  • i is the position of the current pixel
  • ui is the pixel value of the current pixel
  • is the total smoothing weight coefficient in the frame
  • j is the pixel position of the neighborhood N(i) of i
  • g is
  • w i,j (g) is the edge enhancement coefficient corresponding to the guide image
  • u j is the pixel value of the pixel point in the neighborhood of the current pixel point
  • f i is the difference between the depth image and the depth image.
  • the first processing module 12 optimizes the objective function J(u) through the optimization unit 210, and can effectively fill and repair holes of various areas in the depth image.
  • J(u) minimizes the input and output errors from the global optimization, and the solution process is a linear weighted solution, which is more simple and effective to fill and repair the holes in the depth image.
  • the guide image is used as a weighting coefficient for edge enhancement, the holes at the edge can be effectively filled and repaired, and the edge information can be preserved to a certain extent.
  • the objective function of machine learning can be solved faster, and to a certain extent, high-speed filling and restoration of depth images can be achieved.
  • the neighborhood N(i) is a 4-neighborhood or an 8-neighborhood.
  • the pixel points in the 4-neighborhood or the 8-neighborhood of the current pixel point i of the current frame can be filtered, so as to obtain a repaired depth image corresponding to the depth image of the current frame.
  • the value range of ⁇ is [100, 10000].
  • the total weight coefficient in the frame can be set as required, so as to obtain a better objective function.
  • g i is the pixel value of the guide image corresponding to the current pixel point
  • g j is the pixel value of the guide image corresponding to the j point in the neighborhood N(i)
  • the value range of ⁇ is [1, 10].
  • the present application provides a camera assembly 100 .
  • the camera assembly 100 includes an image sensor 101 , a depth sensor 102 and a processor 103 .
  • the image sensor 101 is used to capture the current scene image
  • the processor 103 is used to obtain the current scene image
  • the current scene image includes a plurality of different object regions
  • each object region of the current scene image is mapped to different pixel value ranges to obtain the guide image
  • the above-mentioned camera assembly 100 obtains the current scene image of the depth image through the image sensor 101, and maps each object area of the current scene image to different pixel value ranges to obtain the guide image.
  • the guide image can reflect the difference in depth changes of different object areas in the scene image, and can effectively enhance the edge effect of each different object area.
  • the depth sensor 102 is used to obtain the depth image
  • the processor 103 uses the depth image as the input of the objective function
  • the guide image is used as the weighting coefficient for edge enhancement, so that each pixel in the image is at most close to the pixels of the surrounding neighborhood pixels.
  • the value of the objective function is constructed to obtain the output of the objective function through the global optimization solution process, that is, the repaired depth image, which can effectively fill and repair the holes of various areas in the depth image.
  • the guide image is used as a weighting coefficient for edge enhancement, the holes at the edge can be effectively filled and repaired, and the edge information can be preserved to a certain extent.
  • the objective function of machine learning can be solved faster, and to a certain extent, high-speed filling and restoration of depth images can be achieved.
  • the processor 103 may be configured to implement the depth image restoration method described in any one of the foregoing embodiments, and details are not described herein again.
  • the present application provides an electronic device 1000 .
  • the electronic device 1000 includes the camera assembly 100 and the casing 200 of the above-mentioned embodiments, and the camera assembly 100 is disposed on the casing 200 .
  • the above electronic device 1000 obtains the current scene image of the depth image through the camera assembly 100, and maps each object area of the current scene image to different pixel value ranges to obtain the guide image.
  • the guide image can reflect the difference in depth changes of different object areas in the scene image, and can effectively enhance the edge effect of each different object area.
  • the depth image is used as the input of the objective function
  • the guide image is used as the weighting coefficient of edge enhancement, so that each pixel in the image is at most close to the pixel value of the surrounding neighborhood pixels, so as to construct the objective function through the global optimization.
  • the solution process obtains the output of the objective function, that is, the repaired depth image, which can effectively fill and repair the holes of various areas in the depth image.
  • the holes at the edge can be effectively filled and repaired, and the edge information can be preserved to a certain extent.
  • the objective function of machine learning can be solved faster, and to a certain extent, high-speed filling and restoration of depth images can be achieved.
  • the electronic device 1000 is a smart phone, and in other embodiments, the electronic device can be a camera, a tablet computer, a notebook computer, a smart home appliance, a game console, a head-mounted display device, a wearable device Other devices with camera functions, such as devices.
  • first and second are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implying the number of indicated technical features. Thus, features delimited with “first”, “second” may expressly or implicitly include at least one of said features. In the description of the present application, “plurality” means at least two, such as two, three, unless expressly and specifically defined otherwise.
  • any description of a process or method in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing a specified logical function or step of the process , and the scope of the preferred embodiments of the present application includes alternative implementations in which the functions may be performed out of the order shown or discussed, including performing the functions substantially concurrently or in the reverse order depending upon the functions involved, which should It is understood by those skilled in the art to which the embodiments of the present application belong.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

Abstract

A depth image inpainting method and apparatus (10), a camera assembly (100), and an electronic device (1000). The inpainting method comprises: obtaining a current scene image of a depth image, the current scene image comprising a plurality of different object areas, and mapping the object areas of the current scene image to different pixel value ranges to obtain a guide image; and constructing a target function according to the depth image and the guide image to perform global optimization calculation to inpaint the depth image.

Description

深度图像的修复方法及装置、摄像头组件及电子设备Depth image restoration method and device, camera assembly and electronic device 技术领域technical field
本申请涉及影像技术领域,特别涉及一种深度图像的修复方法、修复装置、摄像头组件及电子设备。The present application relates to the field of imaging technologies, and in particular, to a depth image restoration method, restoration device, camera assembly, and electronic equipment.
背景技术Background technique
为了增强电子设备的功能使得电子设备能够应用于各种应用场景,电子设备配备了深度图像装置来获取深度信息,而由于受遮挡、测量范围限制等因素影响,深度图像会存在空洞等异常情况。In order to enhance the functions of electronic devices and enable them to be applied to various application scenarios, electronic devices are equipped with depth image devices to obtain depth information. However, due to factors such as occlusion and measurement range limitations, depth images may have holes and other abnormalities.
发明内容SUMMARY OF THE INVENTION
本申请实施方式提供一种深度图像的修复方法、修复装置、摄像头组件及电子设备。Embodiments of the present application provide a depth image restoration method, a restoration device, a camera assembly, and an electronic device.
本申请实施方式的修复方法包括:获取所述深度图像的当前场景图像,所述当前场景图像包括多个不同物体区域,将所述当前场景图像的各个所述物体区域映射到不同的像素值范围以获得向导图像;根据所述深度图像和所述向导图像构造目标函数进行全局最优化计算以修复所述深度图像。The restoration method of the embodiment of the present application includes: acquiring a current scene image of the depth image, where the current scene image includes a plurality of different object regions, and mapping each of the object regions of the current scene image to different pixel value ranges to obtain a guide image; construct an objective function according to the depth image and the guide image, and perform a global optimization calculation to repair the depth image.
本申请实施方式的一种深度图像的修复装置,所述修复装置包括第一获取模块和第一处理模块。所述第一获取模块用于获取所述深度图像的当前场景图像,所述当前场景图像包括多个不同物体区域,将所述当前场景图像的各个所述物体区域映射到不同的像素值范围以获得向导图像;所述第一处理模块用于根据所述深度图像和所述向导图像构造目标函数进行全局最优化计算以修复所述深度图像。According to an embodiment of the present application, a depth image restoration device includes a first acquisition module and a first processing module. The first acquisition module is used to acquire a current scene image of the depth image, the current scene image includes a plurality of different object regions, and each of the object regions of the current scene image is mapped to different pixel value ranges to obtaining a guide image; the first processing module is configured to construct an objective function according to the depth image and the guide image and perform a global optimization calculation to repair the depth image.
本申请实施方式的一种摄像头组件,所述摄像头组件包括图像传感器、深度传感器和处理器,所述处理器用于获取当前场景图像,所述当前场景图像包括多个不同物体区域,将所述当前场景图像的各个所述物体区域映射到不同的像素值范围以获得向导图像;根据所述深度图像和所述向导图像构造目标函数进行全局最优化计算以修复所述深度图像。A camera assembly according to an embodiment of the present application, the camera assembly includes an image sensor, a depth sensor, and a processor, and the processor is configured to acquire a current scene image, where the current scene image includes a plurality of different object regions, and the current scene image is Each of the object regions of the scene image is mapped to different pixel value ranges to obtain a guide image; an objective function is constructed according to the depth image and the guide image, and a global optimization calculation is performed to restore the depth image.
本申请实施方式的电子设备包括上述实施方式的摄像头组件及壳体,所述摄像头组件设置在所述壳体上。The electronic device of the embodiment of the present application includes the camera assembly and the casing of the above-mentioned embodiment, and the camera assembly is disposed on the casing.
上述深度图像的修复方法、修复装置、摄像头组件及电子设备,通过获取深度图像的当前场景图像,并将当前场景图像的各个物体区域映射到不同的像素值范围以获得向导图像。向导图像能够体现场景图像各个不同物体区域的深度变化差异,同时可有效地增强各个不同物体区域的边缘效果。进一步地,根据深度图像和向导图像构造目标函数进行全局最优化计算以修复深度图像,可以有效地对深度图像中的各种面积的空洞进行填充修复。同时,因向导图像中的各个物体区域为不同的像素值范围,在一定程度上使得图像中的边缘信息增强,在修复深度图像时可有效地对边缘处的空洞进行平滑填充修复,并在一定程度上保留边缘信息。The above depth image restoration method, restoration device, camera assembly and electronic device obtain a guide image by acquiring the current scene image of the depth image and mapping each object area of the current scene image to different pixel value ranges. The guide image can reflect the difference in depth changes of different object areas in the scene image, and can effectively enhance the edge effect of each different object area. Further, constructing an objective function according to the depth image and the guide image to perform a global optimization calculation to repair the depth image can effectively fill and repair holes of various areas in the depth image. At the same time, because each object area in the guide image has a different pixel value range, the edge information in the image is enhanced to a certain extent, and the holes at the edge can be effectively filled and repaired when repairing the depth image. The edge information is preserved to a certain extent.
本申请实施方式的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实践了解到。Additional aspects and advantages of embodiments of the present application will be set forth, in part, in the following description, and in part will be apparent from the following description, or learned by practice of the present application.
附图说明Description of drawings
本申请的上述和/或附加的方面和优点可以从结合下面附图对实施方式的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present application will become apparent and readily understood from the following description of embodiments in conjunction with the accompanying drawings, wherein:
图1是本申请实施方式的修复方法的流程示意图;1 is a schematic flowchart of a repair method according to an embodiment of the present application;
图2是本申请实施方式的修复方法的示例图;FIG. 2 is an exemplary diagram of a repair method according to an embodiment of the present application;
图3是本申请实施方式的修复方法的流程示意图;3 is a schematic flowchart of a repair method according to an embodiment of the present application;
图4是本申请实施方式的修复方法的流程示意图;4 is a schematic flowchart of a repair method according to an embodiment of the present application;
图5是本申请实施方式的修复方法的示例图;FIG. 5 is an exemplary diagram of a repair method according to an embodiment of the present application;
图6是本申请实施方式的修复方法的流程示意图;6 is a schematic flowchart of a repair method according to an embodiment of the present application;
图7是本申请实施方式的修复方法的流程示意图;7 is a schematic flowchart of a repair method according to an embodiment of the present application;
图8是本申请实施方式的修复方法的流程示意图;8 is a schematic flowchart of a repair method according to an embodiment of the present application;
图9是本申请实施方式的修复方法的示例图;FIG. 9 is an exemplary diagram of a repair method according to an embodiment of the present application;
图10是本申请实施方式的修复装置模块图;FIG. 10 is a module diagram of a repair device according to an embodiment of the present application;
图11是本申请实施方式的修复装置模块图;FIG. 11 is a block diagram of a repair device according to an embodiment of the present application;
图12是本申请实施方式的修复装置模块图;FIG. 12 is a module diagram of a repair device according to an embodiment of the present application;
图13是本申请实施方式的摄像头组件的示意图;13 is a schematic diagram of a camera assembly according to an embodiment of the present application;
图14是本申请实施方式的电子设备的示意图。FIG. 14 is a schematic diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
下面详细描述本申请的实施方式,实施方式的示例在附图中示出,其中,相同或类似的标号自始至终表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施方式是示例性的,仅用于解释本申请,而不能理解为对本申请的限制。Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary, only used to explain the present application, and should not be construed as a limitation on the present application.
请参阅图1,本申请提供一种深度图像的修复方法,修复方法包括:Referring to FIG. 1 , the present application provides a method for repairing a depth image, and the repair method includes:
S10:获取深度图像的当前场景图像,当前场景图像包括多个不同物体区域,将当前场景图像的各个物体区域映射到不同的像素值范围以获得向导图像;S10: obtaining a current scene image of the depth image, where the current scene image includes a plurality of different object regions, and mapping each object region of the current scene image to different pixel value ranges to obtain a guide image;
S20:根据深度图像和向导图像构造目标函数进行全局最优化计算以修复深度图像。S20: Construct an objective function according to the depth image and the guide image to perform a global optimization calculation to repair the depth image.
具体地,在步骤S10中,深度图像包括当前拍摄范围内的物体的深度信息。可通过主动测距传感方式如具有深度传感器的TOF摄像头组件或结构光组件等,或被动测距传感方式如相隔一定距离的两个具有RGB滤波片阵列的图像传感器的摄像头组件同时获取同一场景的两幅图像,然后进行数据处理和深度计算得到深度图像。进一步地,多帧深度图像可存储在深度图缓存空间。在某些实施方式中,通过两个具有RGB滤波片阵列的图像传感器的摄像头组件同时获取同一场景的两幅图像,请结合图2,图2(a)为主摄像头组件拍摄的图像,图2(b)为副摄像头组件拍摄的图像,通过数据处理和深度计算,得到图2(c)所示的深度图像。Specifically, in step S10, the depth image includes depth information of objects within the current shooting range. The same sensor can be obtained simultaneously by active ranging sensing methods such as TOF camera components or structured light components with depth sensors, or passive ranging sensing methods such as two camera components with RGB filter arrays separated by a certain distance. Two images of the scene, and then data processing and depth calculation are performed to obtain a depth image. Further, multiple frames of depth images can be stored in the depth map buffer space. In some embodiments, two images of the same scene are simultaneously acquired by two camera assemblies having image sensors with RGB filter arrays, please refer to FIG. 2, FIG. (b) is the image captured by the sub-camera assembly, through data processing and depth calculation, the depth image shown in Figure 2(c) is obtained.
同时,与深度图像对应的当前场景图像可包括当前拍摄范围内的物体的场景信息。当前场景图像也可为当前需要显示的预先存储的图像,即就是,当前场景图像可包括原拍摄范围内的物体的场景信息。当前场景图像可通过具有RGB滤波片阵列的图像传感器的摄像头组件拍摄获得。在某些实施方式中,深度图像通过两个具有RGB滤波片阵列的图像传感器的摄像头组件同时获取同一场景的两幅图像,请再次结合图2,图2(a)为主摄像头组件拍摄的图像,图2(b)为副摄像头组件拍摄的图像,当前场景图像可包括图2(a)和/或图2(b)。Meanwhile, the current scene image corresponding to the depth image may include scene information of objects within the current shooting range. The current scene image may also be a pre-stored image that needs to be displayed currently, that is, the current scene image may include scene information of objects within the original shooting range. The current scene image can be captured by the camera assembly of the image sensor with the RGB filter array. In some embodiments, the depth image is acquired by two camera assemblies of image sensors with RGB filter arrays to simultaneously acquire two images of the same scene. Please refer to FIG. 2 again, FIG. 2(a) The image captured by the main camera assembly , FIG. 2(b) is an image captured by the sub-camera assembly, and the current scene image may include FIG. 2(a) and/or FIG. 2(b).
进一步地,在获取到当前场景图像之后,将当前场景图像的各个物体区域映射到不同的像素值范围,从而增强当前场景图像中各个物体区域的边缘,获得向导图像。具体地,当前场景图像中的各个物体区域可包括单个或多个人物,和/或单个或多个非人物的物体。在某些实施方式中,可通过机器学习算法等方式分割当前场景图像的各个物体区域,并将各个物体区域映射到不同的像素值范围。在某些实施方式中,还可通过语义分割、实例分割等方式对当前场景图像进行分割,然后通过叠加计算以使得各个物体区域具有不同像素值范围。Further, after the current scene image is acquired, each object area of the current scene image is mapped to different pixel value ranges, thereby enhancing the edges of each object area in the current scene image, and obtaining a guide image. Specifically, each object area in the current scene image may include single or multiple persons, and/or single or multiple non-personal objects. In some embodiments, each object region of the current scene image can be segmented by means of a machine learning algorithm, and each object region can be mapped to different pixel value ranges. In some embodiments, the current scene image can also be segmented by means of semantic segmentation, instance segmentation, etc., and then through superposition calculation, so that each object region has different pixel value ranges.
在步骤S20中,根据得到的向导图像和深度图像进行目标函数全局最优化计算以修复深度图像。可以理解的是,在深度图像中,因某些因素如当被照射的物体是透明物体、物体表面为吸光材料以及物体表面十分光滑等多种情况之下,或者物体处在深度摄像头的盲区,比如过近或者过远的区域内,都会由于无法捕捉到反射的红外光而造成数据的缺损,从而产生深度图像的误差、空洞等问题,为便于描述,以下深度图像的修复以空洞填补修复作为示例展开。In step S20, the global optimization calculation of the objective function is performed according to the obtained guide image and the depth image to restore the depth image. It is understandable that in the depth image, due to certain factors such as when the illuminated object is a transparent object, the surface of the object is a light-absorbing material, and the surface of the object is very smooth, or the object is in the blind area of the depth camera, For example, in the area that is too close or too far, the data will be lost due to the inability to capture the reflected infrared light, resulting in errors and holes in the depth image. Example expansion.
具体地,将深度图像作为目标函数的输入,向导图像作为边缘加强的加权系数,并使得图像中的每个像素点最大接近周围邻域像素点的像素值,以此构造目标函数并通过全局最优化的求解过程得到目标函数中的输出,即修复后的深度图像,可使得深度图像中的空洞得到有效地填补修复。Specifically, the depth image is used as the input of the objective function, and the guide image is used as the weighting coefficient of edge enhancement, and each pixel in the image is maximized to be close to the pixel value of the surrounding neighborhood pixels, so as to construct the objective function and pass the global maximum The optimized solution process obtains the output in the objective function, that is, the repaired depth image, which can effectively fill and repair the holes in the depth image.
如此,上述深度图像的修复方法,通过获取深度图像的当前场景图像,并将当前场景图像的各个物体区域映射到不同的像素值范围以获得向导图像。向导图像能够体现场景图像各个不同物体区域的深度变化差异,同时可有效地增强各个不同物体区域的边缘效果。进一步地,在相关技术中,深度图像的修复方法主要是基于联合双边滤波方法或基于中值滤波或高斯滤波等局部空间滤波方法,但常用于处理小面积空洞,对于大面积空洞,尤其是处于边缘的空洞点时,会造成边缘模糊或消失的问题。本申请将深度图像作为目标函数的输入,向导图像作为边缘加强的加权系数,使得图像中的每个像素点最大接近周围邻域像素点的像素值,以此构造目标函数通过全局最优化的求解过程得到目标函数中的输出,即修复后的深度图像,可以有效地对深度图像中的各种面积的空洞进行填充修复。同时,因向导图像作为边缘 增强的加权系数,可有效地对边缘处的空洞进行平滑填充修复,并在一定程度上保留边缘信息。In this way, the above-mentioned depth image restoration method obtains the guide image by acquiring the current scene image of the depth image, and mapping each object region of the current scene image to different pixel value ranges. The guide image can reflect the difference in depth changes of different object areas in the scene image, and can effectively enhance the edge effect of each different object area. Further, in the related art, depth image restoration methods are mainly based on joint bilateral filtering methods or local spatial filtering methods such as median filtering or Gaussian filtering, but are often used to deal with small-area holes. When there is a hole in the edge, it will cause the problem of blurring or disappearing of the edge. In this application, the depth image is used as the input of the objective function, and the guide image is used as the weighting coefficient for edge enhancement, so that each pixel in the image is at most close to the pixel value of the surrounding neighborhood pixels, so as to construct the objective function through the global optimization solution. The process obtains the output of the objective function, that is, the repaired depth image, which can effectively fill and repair the holes of various areas in the depth image. At the same time, since the guide image is used as a weighting coefficient for edge enhancement, the holes at the edge can be effectively filled and repaired, and the edge information can be preserved to a certain extent.
请参阅图3,在某些实施方式中,步骤S10包括:Referring to FIG. 3, in some embodiments, step S10 includes:
S11:对当前场景图像进行场景检测以确定场景类型;S11: Perform scene detection on the current scene image to determine the scene type;
S12:在场景类型为人物图像时进行人像分割;S12: perform portrait segmentation when the scene type is a human image;
S13:在场景类型为非人物图像时进行物体分割;S13: perform object segmentation when the scene type is a non-person image;
S14:根据分割结果确定各个物体区域;S14: Determine each object area according to the segmentation result;
S15:将各个物体区域映射到不同的像素值范围以获得向导图像。S15: Map each object area to different pixel value ranges to obtain a guide image.
具体地,在步骤S11中,可基于机器学习,使用不同场景类型的图片等数据预先进行训练,以提高场景检测能力,这样,在获取到当前场景图像,能够较为准确地确定当前场景图像对应的场景类型。场景类型可包括人物图像、非人物图像、人物-非人物图像,其中,人物图像可包括人像主体和背景,非人物图像可包括物体主体和背景,人物-非人物图像可包括人像主体、物体主体和背景,进一步地,人物主体包括一个人物或者多于一个人物,非人物主体包括一个非人物或者多于一个非人物。在某些实施方式中,对当前场景图像进行场景检测时,首先检测是否存在人像主体,然后检测是否存在物体主体,再结合预先机器学习的结果,从而确定当前场景图像对应的场景类型。Specifically, in step S11, based on machine learning, data such as pictures of different scene types can be used for pre-training to improve the scene detection ability. In this way, after the current scene image is acquired, the corresponding image of the current scene image can be more accurately determined. Scene type. Scene types may include human images, non-human images, and human-non-human images, where the human image may include a portrait subject and a background, a non-human image may include an object subject and background, and a human-non-human image may include portrait subject, object subject And background, further, the character subject includes one character or more than one character, and the non-character subject includes one non-character or more than one non-character. In some embodiments, when performing scene detection on the current scene image, first detect whether there is a portrait subject, then detect whether there is an object subject, and then combine the results of pre-machine learning to determine the scene type corresponding to the current scene image.
在步骤S12中,对当前场景图像进行人像分割,即就是,分割出人像主体和背景。在步骤S13中,对当前场景图像进行物体分割,即就是,分割出物体主体和背景。在某些实施方式中,在当前场景图像同时包括人像主体和物体主体的情况下,先进行人像主体分割,再进行物体主体分割。In step S12, portrait segmentation is performed on the current scene image, that is, the portrait subject and the background are segmented. In step S13, object segmentation is performed on the current scene image, that is, the object subject and the background are segmented. In some embodiments, when the current scene image includes both a portrait subject and an object subject, the portrait subject is segmented first, and then the object subject is segmented.
在步骤S14中,根据实际应用情况,各个物体区域可划分为二值结果和多值结果。其中,二值结果包括将所需的单个或多个物体区域划分为主体区域,其余为背景区域。进一步地,将主体区域映射到一个像素值范围,背景区域映射到另一个像素值范围。而多值结果可包括多个人物和/或多个非人物组成多个区域,即将当前场景图像分割为至少三个不同的物体区域,至少三个不同的物体区域包括至少两个主体区域和一个背景区域,多个区域映射到各自不同的像素值范围。在一个例子中,当前场景图像为单人物与背景非人物区域,按照二值结果划分单人物为主体区域,映射像素值范围为155~255,背景非人物区域为背景区域,映射像素值范围为0~100。In step S14, each object region can be divided into binary results and multi-valued results according to the actual application. Among them, the binary result includes dividing the required single or multiple object regions into main regions, and the rest are background regions. Further, the subject area is mapped to one pixel value range, and the background area is mapped to another pixel value range. The multi-valued result may include multiple characters and/or multiple non-characters to form multiple regions, that is, the current scene image is divided into at least three different object regions, and the at least three different object regions include at least two subject regions and one Background area, multiple areas are mapped to their respective different pixel value ranges. In an example, the current scene image is a single person and a background non-person area, the single person is divided into the main area according to the binary result, the mapped pixel value range is 155-255, the background non-person area is the background area, and the mapped pixel value range is 0 to 100.
在步骤S15中,将各个物体区域映射到不同的像素值范围之后,各个物体区域显示的亮度不同,各个物体区域之间的边界更加清晰,从而获得向导图像。In step S15, after each object region is mapped to different pixel value ranges, the brightness displayed by each object region is different, and the boundary between each object region is clearer, thereby obtaining a guide image.
如此,可获得较为精准的向导图像,从而增强当前场景图像中各个物体区域的边缘。In this way, a more accurate guide image can be obtained, thereby enhancing the edge of each object area in the current scene image.
请参阅图4,在某些实施方式中,步骤S15包括:Referring to FIG. 4, in some embodiments, step S15 includes:
S151:根据分割结果确定各个物体区域并形成分割图像,每个物体区域在分割图像中用相同像素值表示;S151: Determine each object region according to the segmentation result and form a segmented image, and each object region is represented by the same pixel value in the segmented image;
S152:将分割图像与当前场景图像进行加权处理以获得向导图像。S152: Perform weighting processing on the segmented image and the current scene image to obtain a guide image.
具体地,预先设置分割图像中各个物体区域的像素值范围,分割图像中各个物体区域的像素值范围不同,不同当前场景图像中相同的物体区域的像素值相同,例如在不同当前场景图像的人物图像中,人像主体的像素值统一设置为(155,255),背景的像素值统一设置为(0,100),这样人像主体与背景能够区分开来,形成分割图像。进一步地,将分割图像的像素值与对应的当前场景图像的像素值进行加权处理,即可获得向导图像。在分割图像中,不同的物体区域的像素值范围不同,相比于当前场景图像,分割图像中不同的物体区域的边缘得到增强。其中,加权的权重系数可根据实际需要对各物体区域的区分程度进行设置。Specifically, the pixel value range of each object region in the segmented image is preset, the pixel value range of each object region in the segmented image is different, and the pixel value of the same object region in different current scene images is the same, for example, the characters in different current scene images In the image, the pixel value of the portrait subject is uniformly set to (155,255), and the pixel value of the background is uniformly set to (0,100), so that the portrait subject and the background can be distinguished to form a segmented image. Further, the guide image can be obtained by performing weighting processing on the pixel value of the segmented image and the corresponding pixel value of the current scene image. In the segmented image, the pixel value ranges of different object regions are different, and the edges of different object regions in the segmented image are enhanced compared to the current scene image. Wherein, the weighted weight coefficient can be set according to the actual need to distinguish the degree of each object area.
请结合图5,在一个例子中,通过检测当前场景图像的场景,确定当前场景图像的场景类型为人像图像,对人像进行分割得到两个物体区域,其中一个物体区域为人像主体,另外一个物体区域为背景,将人像主体的像素值设置为(155,255),将背景的像素值设置为(0,100),从而得到如图5(d)所示的分割图像,再将分割图像的像素值与如图5(e)所示的当前场景图像的像素值进行加权求和,得到如图5(f)所示的向导图像。Please refer to Figure 5. In an example, by detecting the scene of the current scene image, it is determined that the scene type of the current scene image is a portrait image, and the portrait is segmented to obtain two object regions, one of which is the portrait subject, and the other object. The area is the background, the pixel value of the main body of the portrait is set to (155, 255), and the pixel value of the background is set to (0, 100), so as to obtain the segmented image as shown in Figure 5(d). The pixel values of the current scene image shown in Fig. 5(e) are weighted and summed to obtain the guide image shown in Fig. 5(f).
需要说明的是,将分割图像与当前场景图像进行加权处理获得向导图像的目的是使得当前场景图像中各物体区域可以不同像素值范围显示,或者说使得各物体区域的区分更明显。可以理解的是,加权处理仅为数学上的一种处理方式,可以有其它如线性函数的方式等。故基于此目的简单数学形式的变换可视为本实施方式的简单替换。It should be noted that the purpose of obtaining the guide image by weighting the segmented image and the current scene image is to enable each object region in the current scene image to be displayed with different pixel value ranges, or to make the distinction of each object region more obvious. It can be understood that the weighting processing is only a mathematical processing method, and there may be other methods such as linear functions. Therefore, the transformation of simple mathematical form for this purpose can be regarded as a simple replacement of this embodiment.
如此,通过将分割图像与当前场景图像进行加权处理得到向导图像,实现方式更为简单有效,且可 根据实际业务需求调整权重系数,从而增强当前场景图像中各个物体区域的边缘。In this way, by weighting the segmented image and the current scene image to obtain the guide image, the implementation method is simpler and more effective, and the weight coefficient can be adjusted according to actual business requirements, thereby enhancing the edge of each object area in the current scene image.
请参阅图6,在某些实施方式中,步骤S15还包括:Referring to FIG. 6, in some embodiments, step S15 further includes:
S153:根据物体区域的数量确定各个物体区域映射的像素值范围;S153: Determine the pixel value range mapped by each object area according to the number of object areas;
S154:将各个物体区域映射到对应的像素值范围以获得向导图像。S154: Map each object area to a corresponding pixel value range to obtain a guide image.
具体地,预先设置物体区域的数量、物体区域的类型与该数量中各个类型的物体区域映射的像素值范围的对应关系,这样,在确定物体区域的数量和类型(例如第一主体区域、第二主体区域、背景区域)之后,根据对应关系,将各个物体区域映射到对应的像素值范围,即可获得边缘增强的向导图像。Specifically, the corresponding relationship between the number of object regions, the type of object regions and the range of pixel values mapped by each type of object region in the number is preset, so that when determining the number and type of object regions (for example, the first subject region, the third After two main areas and background areas), according to the corresponding relationship, map each object area to the corresponding pixel value range, and then the edge-enhanced guide image can be obtained.
如此,通过将各个物体区域映射到对应的像素值范围的方式,获得较为精准的向导图像,从而增强当前场景图像中各个物体区域的边缘。In this way, by mapping each object area to a corresponding pixel value range, a more accurate guide image is obtained, thereby enhancing the edge of each object area in the current scene image.
在某些实施方式中,相邻的两个像素值范围之间间隔预设范围,预设范围的最大值与预设范围的最小值的差值大于1。In some embodiments, a preset range is spaced between two adjacent pixel value ranges, and the difference between the maximum value of the preset range and the minimum value of the preset range is greater than 1.
可以理解的是,像素值范围包括多个,多个像素值范围包括相邻的第一像素值范围和第二像素值范围,第一像素值范围的最大值小于第二像素值范围的最小值,第二像素值范围的最小值与第一像素值范围的最大值的差值大于1。It can be understood that the range of pixel values includes multiple ranges, and the multiple ranges of pixel values include adjacent first pixel value ranges and second pixel value ranges, and the maximum value of the first pixel value range is smaller than the minimum value of the second pixel value range. , the difference between the minimum value of the second pixel value range and the maximum value of the first pixel value range is greater than 1.
在一个例子中,物体区域为2个,则其中一个物体区域的像素值范围可为[0,100],另外一个物体区域的像素值范围可为[155,255],预设范围可为(100,155)。在另一个例子中,物体区域为5个,则5个物体区域的像素值范围可分别为[0,41]、[51,92]、[102,143]、[153,194]和[204,245],预设范围可为(41,51)、(92,102)、(143,153)、(194,204)、(245,255)。In an example, if there are two object regions, the pixel value range of one object region may be [0, 100], the pixel value range of the other object region may be [155, 255], and the preset range may be (100, 155). In another example, if there are 5 object regions, the pixel value ranges of the 5 object regions may be [0,41], [51,92], [102,143], [153,194] and [204,245] respectively. The range can be (41,51), (92,102), (143,153), (194,204), (245,255).
如此,不同的物体区域对应不同的像素值范围,相邻的两个像素值范围之间间隔预设范围,使得不同的物体区域的亮度不同,且不同的物体区域的边界更加清晰。In this way, different object regions correspond to different pixel value ranges, and two adjacent pixel value ranges are separated by a preset range, so that the brightness of different object regions is different, and the boundaries of different object regions are clearer.
请参阅图7,在某些实施方式中,深度图像的修复方法还包括:Referring to FIG. 7, in some embodiments, the method for repairing the depth image further includes:
S30:获取历史帧深度图像,所述历史帧深度图像的拍摄时间在所述深度图像的拍摄时间之前;S30: Acquire a historical frame depth image, where the shooting time of the historical frame depth image is before the shooting time of the depth image;
S40:获取深度图像的空洞像素集;S40: obtain the hole pixel set of the depth image;
S50:根据历史帧深度图像得到修复像素集;S50: Obtain the repaired pixel set according to the depth image of the historical frame;
S60:以修复像素集替换空洞像素集以得到增强深度图像;S60: replace the hole pixel set with the repair pixel set to obtain an enhanced depth image;
步骤S20包括:Step S20 includes:
S21:根据增强深度图像和向导图像构造目标函数进行全局最优化计算以修复深度图像。S21: Construct an objective function according to the enhanced depth image and the guide image to perform a global optimization calculation to repair the depth image.
在上述实施方式中,深度图像可通过主动测距传感方式如具有深度传感器的TOF摄像头组件或结构光组件等,或被动测距传感方式如相隔一定距离的两个具有RGB滤波片阵列的图像传感器的摄像头组件同时获取同一场景的两幅图像,然后进行数据处理和深度计算得到。通过此类方式得到的深度图像可为原始的深度图像,其中包含空洞,获取空洞像素点集,其中空洞像素点集为原始的深度图像中所有的空洞点的集合。In the above-mentioned embodiments, the depth image can be obtained by an active ranging sensing method, such as a TOF camera assembly or a structured light assembly with a depth sensor, or a passive ranging sensing method, such as two sensors with RGB filter arrays separated by a certain distance. The camera component of the image sensor acquires two images of the same scene at the same time, and then performs data processing and depth calculation. The depth image obtained in this way may be an original depth image, which contains holes, and a set of hole pixels is obtained, wherein the set of hole pixels is a set of all the holes in the original depth image.
进一步地,可利用深度图缓冲计算空洞点的历史加权深度值以对原始的深度图像中的空洞点集进行初步填充修复。Further, the historical weighted depth value of the hole point can be calculated by using the depth map buffer to perform preliminary filling and repairing on the hole point set in the original depth image.
具体地,获取深度图缓冲中的历史帧深度图像,历史帧深度图像的拍摄时间在深度图像的拍摄时间之前,包括单帧或多帧深度图像。若为单帧历史深度图像,在原始的深度图像相应空洞位置上具有非0像素值,则选取单帧历史深度图像相应的空洞像素点的像素值作为修复像素集。若为多帧历史深度图像,可按照时间顺序提取所需帧数的历史深度图像,并对此多帧历史深度图像中的空洞像素点进行加权求和得到修复像素集。例如当前时刻为t,缓冲区中存储了t,t-1,t-2时间的原始深度图像。则计算空洞像素点的历史加权值可通过如下公式:Specifically, the historical frame depth image in the depth map buffer is acquired, and the shooting time of the historical frame depth image is before the shooting time of the depth image, including a single frame or multiple frames of depth images. If it is a single-frame historical depth image and has a non-zero pixel value at the corresponding hole position of the original depth image, the pixel value of the corresponding hole pixel in the single-frame historical depth image is selected as the repair pixel set. If it is a multi-frame historical depth image, the historical depth image of the required number of frames can be extracted in chronological order, and the hole pixels in the multi-frame historical depth image can be weighted and summed to obtain a repaired pixel set. For example, the current time is t, and the original depth image at time t, t-1, and t-2 is stored in the buffer. Then the historical weighted value of the hole pixel can be calculated by the following formula:
D t′=w 1*D t+w 2*D t-1+w 3*D t-2 D t ′=w 1 *D t +w 2 *D t-1 +w 3 *D t-2
其中权重w的和为1,即w 1+w 2+w 3=1,时间越接近当前帧,权重越大。 The sum of the weights w is 1, that is, w 1 +w 2 +w 3 =1, and the closer the time is to the current frame, the greater the weight.
进一步地,以修复像素集替换原始的深度图像的空洞像素集以得到增强深度图像。然后根据增强深度图像和向导图像构造目标函数进行全局最优化计算以修复深度图像。具体实现同上述实施方式,此处不再展开。Further, the hole pixel set of the original depth image is replaced with the repair pixel set to obtain an enhanced depth image. Then the objective function is constructed according to the enhanced depth image and the guide image for global optimization calculation to repair the depth image. The specific implementation is the same as that of the above-mentioned embodiment, and is not further expanded here.
如此,利用深度图缓冲计算空洞点的历史加权深度值对原始的深度图像中的空洞点进行初步填充修复,使得进入目标函数的空洞像素点的像素值更优化,进而可使得目标函数最优化求解得到更好的输出函数,或者说得到对深度图像更佳的修复结果。In this way, the depth map buffer is used to calculate the historical weighted depth value of the hole point to initially fill and repair the hole point in the original depth image, so that the pixel value of the hole pixel point entering the objective function is more optimized, and then the objective function can be optimized. Get better output functions, or better inpainting results for depth images.
请参阅图8,在某些实施方式中,步骤S20还包括:Referring to FIG. 8, in some embodiments, step S20 further includes:
S22:优化目标函数以使得目标函数取得最小值,并输出最小值对应的修复后的深度图像的当前像素点的像素值,目标函数:S22: Optimize the objective function so that the objective function achieves the minimum value, and outputs the pixel value of the current pixel of the repaired depth image corresponding to the minimum value. The objective function is:
Figure PCTCN2021080255-appb-000001
Figure PCTCN2021080255-appb-000001
其中,i为当前像素点的位置,u i为当前像素点的像素值,λ为帧内总权重系数,j为i的邻域N(i)的像素点位置,g为向导图像,w i,j(g)为向导图像对应的边缘权重系数,u j为当前像素点的邻域的像素点的像素值,f i为深度图像中与当前像素点对应的像素值。 Among them, i is the position of the current pixel, ui is the pixel value of the current pixel, λ is the total weight coefficient in the frame, j is the pixel position of the neighborhood N(i) of i, g is the guide image, w i ,j (g) is the edge weight coefficient corresponding to the guide image, u j is the pixel value of the pixel point in the neighborhood of the current pixel point, and f i is the pixel value corresponding to the current pixel point in the depth image.
具体地,向导图像g通过函数w i,j(g)作为向导项控制各个物体区域的边缘权重系数,边缘强则系数小,边缘弱则系数大。可以理解的是,利用数学方法对目标函数J(u)进行最小值求解,使得函数中输出函数与输入函数误差达到最小,同时当前像素点最大接近邻域像素点,并通过帧内总平滑权重系数λ及向导图像对应的边缘加强系数w i,j(g)进行边缘控制。 Specifically, the guide image g uses the function wi ,j (g) as a guide item to control the edge weight coefficient of each object region, the coefficient is small when the edge is strong, and the coefficient is large when the edge is weak. It can be understood that the minimum value of the objective function J(u) is solved by mathematical methods, so that the error between the output function and the input function in the function is minimized, and the current pixel point is close to the neighborhood pixel point at the most, and the total smoothing weight in the frame is passed. The coefficient λ and the edge enhancement coefficient w i,j (g) corresponding to the guide image perform edge control.
在某些实施方式中,f i可为增强深度图像,即上述实施例中,利用深度图缓冲计算空洞点的历史加权深度值对原始的深度图像中的空洞点进行初步填充修复得到的增强深度图像。进一步地,根据增强深度图像和向导图像构造目标函数进行全局最优化计算以修复深度图像。 In some embodiments, f i may be an enhanced depth image, that is, in the above embodiment, the enhanced depth obtained by initially filling and repairing the hollow points in the original depth image by using the depth map buffer to calculate the historical weighted depth value of the hollow points image. Further, an objective function is constructed according to the enhanced depth image and the guide image to perform a global optimization calculation to repair the depth image.
请结合图9,在一个例子中,9(g)为目标函数的输入深度图像,其中,9(g)中的椭圆形框内为空洞示例,9(h)为向导图像,对目标函数进行最小化求解,最后得到修复的深度图9(i),图中可看出空洞在一定程度上得到有效地填补修复。Please refer to Fig. 9, in an example, 9(g) is the input depth image of the objective function, in which, the oval box in 9(g) is a hollow example, and 9(h) is the guide image. Minimize the solution, and finally get the repaired depth map 9(i). It can be seen from the figure that the holes are effectively filled and repaired to a certain extent.
如此,通过优化目标函数J(u),可以有效地对深度图像中的各种面积的空洞进行填充修复。相对于其它目标函数,J(u)从全局最优化上对输入输出误差最小化,且求解过程为线性加权求解,更为简单有效地对深度图像中的空洞进行填补修复。同时,因向导图像作为边缘增强的加权系数,可有效地对边缘处的空洞进行平滑填充修复,并在一定程度上保留边缘信息。进一步地,相对于现有技术中如利用高斯滤波方式等修复方法,机器学习的目标函数求解速度更快,在一定程度上可达到高速填充修复深度图像。In this way, by optimizing the objective function J(u), the holes of various areas in the depth image can be effectively filled and repaired. Compared with other objective functions, J(u) minimizes the input and output errors from the global optimization, and the solution process is a linear weighted solution, which is more simple and effective to fill and repair the holes in the depth image. At the same time, since the guide image is used as a weighting coefficient for edge enhancement, the holes at the edge can be effectively filled and repaired, and the edge information can be preserved to a certain extent. Further, compared with the restoration methods in the prior art, such as using Gaussian filtering, the objective function of machine learning can be solved faster, and to a certain extent, high-speed filling and restoration of depth images can be achieved.
在某些实施方式中,邻域N(i)为4邻域或8邻域。In certain embodiments, the neighborhood N(i) is a 4-neighborhood or an 8-neighborhood.
可以理解的是,在当前像素点i处于九宫格的中心时,i的4邻域,即就是,与i相邻的上方的一个像素点、与i相邻的下方的一个像素点、与i相邻的左边的一个像素点、与i相邻的右边的一个像素点;i的8邻域,即就是,在i的4邻域的基础上,增加与i对角相邻的四个像素点。It can be understood that when the current pixel i is in the center of the nine-square grid, the 4 neighborhoods of i, that is, a pixel above adjacent to i, a pixel below adjacent to i, and a pixel adjacent to i. One pixel on the left side of the neighbor, one pixel on the right side adjacent to i; 8 neighbors of i, that is, on the basis of the 4 neighbors of i, add four pixels that are diagonally adjacent to i .
如此,当前帧的当前像素点i的4邻域或8邻域的像素点可以进行滤波处理,从而获得与当前帧深度图像对应的修复后的深度图像。In this way, the pixel points in the 4-neighborhood or the 8-neighborhood of the current pixel point i of the current frame can be filtered, so as to obtain a repaired depth image corresponding to the depth image of the current frame.
在某些实施方式中,λ的取值范围为[100,10000]。In some embodiments, the value range of λ is [100, 10000].
具体地,λ的数值可为100、500、700、1000、3000、5000、7000、10000或者100-10000之间的其他数值。Specifically, the value of λ may be 100, 500, 700, 1000, 3000, 5000, 7000, 10000 or other values between 100-10000.
如此,可以根据需要设置帧内总权重系数,从而获得较佳的目标函数。In this way, the total weight coefficient in the frame can be set as required, so as to obtain a better objective function.
在某些实施方式中,
Figure PCTCN2021080255-appb-000002
g i为向导图像与当前像素点对应的像素值,g j为向导图像与邻域N(i)的j点对应的像素值,σ的取值范围为[1,10]。
In certain embodiments,
Figure PCTCN2021080255-appb-000002
g i is the pixel value of the guide image corresponding to the current pixel point, g j is the pixel value of the guide image corresponding to the j point in the neighborhood N(i), and the value range of σ is [1, 10].
可以理解,与当前像素点i距离越远的j点对当前像素点i的像素值影响越小,即就是,与当前像素点i距离越远的j点的边缘加强系数越小。具体地,σ的数值可为1、2、3、4、5、6、7、8、9、10或者1-10之间的其他数值。It can be understood that the farther the j point is from the current pixel point i, the smaller the influence on the pixel value of the current pixel point i, that is, the farther the j point is from the current pixel point i, the smaller the edge enhancement coefficient is. Specifically, the value of σ may be 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, or other values between 1-10.
请参阅图10,本申请提供一种深度图像的修复装置10,修复装置10包括第一获取模块11和第一处理模块12。第一获取模块11用于获取深度图像的当前场景图像,当前场景图像包括多个不同物体区域,将当前场景图像的各个物体区域映射到不同的像素值范围以获得向导图像。第一处理模块12用于根据深度图像和向导图像构造目标函数进行全局最优化计算以修复深度图像。Referring to FIG. 10 , the present application provides a depth image restoration apparatus 10 . The restoration apparatus 10 includes a first acquisition module 11 and a first processing module 12 . The first acquisition module 11 is configured to acquire a current scene image of the depth image, the current scene image includes a plurality of different object regions, and each object region of the current scene image is mapped to different pixel value ranges to obtain a guide image. The first processing module 12 is configured to construct an objective function according to the depth image and the guide image to perform global optimization calculation to repair the depth image.
具体地,深度图像包括当前拍摄范围内的物体的深度信息。可通过主动测距传感方式如具有深度传感器的TOF摄像头组件或结构光组件等,或被动测距传感方式如相隔一定距离的两个具有RGB滤波片阵列的图像传感器的摄像头组件同时获取同一场景的两幅图像,然后进行数据处理和深度计算得到深度图像。进一步地,多帧深度图像可存储在深度图缓存空间。Specifically, the depth image includes depth information of objects within the current shooting range. The same sensor can be obtained simultaneously by active ranging sensing methods such as TOF camera components or structured light components with depth sensors, or passive ranging sensing methods such as two camera components with RGB filter arrays separated by a certain distance. Two images of the scene, and then data processing and depth calculation are performed to obtain a depth image. Further, multiple frames of depth images can be stored in the depth map buffer space.
同时,与深度图像对应的当前场景图像可通过第一获取模块11获取,包括当前拍摄范围内的物体的 场景信息。当前场景图像也可为第一获取模块11获取的当前需要显示的预先存储的图像,即就是,当前场景图像可包括原拍摄范围内的物体的场景信息。当前场景图像可通过具有RGB滤波片阵列的图像传感器的摄像头组件拍摄获得。At the same time, the current scene image corresponding to the depth image can be acquired by the first acquisition module 11, including scene information of objects within the current shooting range. The current scene image may also be a pre-stored image acquired by the first acquiring module 11 and currently required to be displayed, that is, the current scene image may include scene information of objects within the original shooting range. The current scene image can be captured by the camera assembly of the image sensor with the RGB filter array.
进一步地,在获取到当前场景图像之后,第一获取模块11将当前场景图像的各个物体区域映射到不同的像素值范围,从而增强当前场景图像中各个物体区域的边缘,获得向导图像。具体地,当前场景图像中的各个物体区域可包括单个或多个人物,和/或单个或多个非人物的物体。在某些实施方式中,可通过机器学习算法等方式分割当前场景图像的各个物体区域,并将各个物体区域映射到不同的像素值范围。在某些实施方式中,还可通过语义分割、实例分割等方式对当前场景图像进行分割,然后通过叠加计算以使得各个物体区域具有不同像素值范围。Further, after acquiring the current scene image, the first acquisition module 11 maps each object area of the current scene image to different pixel value ranges, thereby enhancing the edges of each object area in the current scene image to obtain a guide image. Specifically, each object area in the current scene image may include single or multiple persons, and/or single or multiple non-personal objects. In some embodiments, each object region of the current scene image can be segmented by means of a machine learning algorithm, and each object region can be mapped to different pixel value ranges. In some embodiments, the current scene image can also be segmented by means of semantic segmentation, instance segmentation, etc., and then through superposition calculation, so that each object region has different pixel value ranges.
当确定向导图像后,第一处理模块12根据得到的向导图像和深度图像进行目标函数全局最优化计算以修复深度图像。可以理解的是,在深度图像中,因某些因素如当被照射的物体是透明物体、物体表面为吸光材料以及物体表面十分光滑等多种情况之下,或者物体处在深度摄像头的盲区,比如过近或者过远的区域内,都会由于无法捕捉到反射的红外光而造成数据的缺损,从而产生深度图像的空洞问题。After the guide image is determined, the first processing module 12 performs a global optimization calculation of the objective function according to the obtained guide image and the depth image to restore the depth image. It is understandable that in the depth image, due to certain factors such as when the illuminated object is a transparent object, the surface of the object is a light-absorbing material, and the surface of the object is very smooth, or the object is in the blind area of the depth camera, For example, in the area that is too close or too far, the data will be lost due to the inability to capture the reflected infrared light, resulting in the problem of holes in the depth image.
具体地,将深度图像作为目标函数的输入,向导图像作为边缘加强的加权系数,并使得图像中的每个像素点最大接近周围邻域像素点的像素值,以此构造目标函数并通过全局最优化的求解过程得到目标函数中的输出,即修复后的深度图像,可使得深度图像中的空洞得到有效地填补修复。Specifically, the depth image is used as the input of the objective function, and the guide image is used as the weighting coefficient of edge enhancement, and each pixel in the image is maximized to be close to the pixel value of the surrounding neighborhood pixels, so as to construct the objective function and pass the global maximum The optimized solution process obtains the output in the objective function, that is, the repaired depth image, which can effectively fill and repair the holes in the depth image.
如此,上述深度图像的修复装置10,通过第一获取模块11获取深度图像的当前场景图像,并将当前场景图像的各个物体区域映射到不同的像素值范围以获得向导图像。向导图像能够体现场景图像各个不同物体区域的深度变化差异,同时可有效地增强各个不同物体区域的边缘效果。进一步地,第一处理模块12将深度图像作为目标函数的输入,向导图像作为边缘加强的加权系数,使得图像中的每个像素点最大接近周围邻域像素点的像素值,以此构造目标函数通过全局最优化的求解过程得到目标函数中的输出,即修复后的深度图像,可以有效地对深度图像中的各种面积的空洞进行填充修复。同时,因向导图像作为边缘增强的加权系数,可有效地对边缘处的空洞进行平滑填充修复,并在一定程度上保留边缘信息。In this way, the above-mentioned depth image restoration apparatus 10 obtains the current scene image of the depth image through the first obtaining module 11, and maps each object area of the current scene image to different pixel value ranges to obtain the guide image. The guide image can reflect the difference in depth changes of different object areas in the scene image, and can effectively enhance the edge effect of each different object area. Further, the first processing module 12 uses the depth image as the input of the objective function, and the guide image is used as the weighting coefficient of edge enhancement, so that each pixel in the image is at most close to the pixel value of the surrounding neighborhood pixels, so as to construct the objective function. The output of the objective function, that is, the repaired depth image, can be effectively filled and repaired for holes of various areas in the depth image through the global optimization solution process. At the same time, since the guide image is used as a weighting coefficient for edge enhancement, the holes at the edge can be effectively filled and repaired, and the edge information can be preserved to a certain extent.
需要指出的是,上述对深度图像的修复方法的实施方式和有益效果的解释说明,也适应本实施方式的深度图像的修复装置10和以下实施方式所述的摄像头组件及电子设备,为避免冗余,在此不作详细展开。It should be pointed out that the above-mentioned explanations of the embodiments and beneficial effects of the depth image restoration method are also applicable to the depth image restoration apparatus 10 of this embodiment and the camera assembly and electronic equipment described in the following embodiments, in order to avoid redundant I will not expand it in detail here.
请再次参阅图10,在某些实施方式中,第一获取模块11包括检测单元111、第一分割单元112、第二分割单元113、确定单元114和映射单元115。检测单元111用于对当前场景图像进行场景检测以确定场景类型。第一分割单元112用于在场景类型为人物图像时进行人像分割。第二分割单元113用于在场景类型为非人物图像时进行物体分割。确定单元114用于根据分割结果确定各个物体区域。映射单元115用于将各个物体区域映射到不同的像素值范围以获得向导图像。Referring to FIG. 10 again, in some embodiments, the first acquisition module 11 includes a detection unit 111 , a first segmentation unit 112 , a second segmentation unit 113 , a determination unit 114 and a mapping unit 115 . The detection unit 111 is configured to perform scene detection on the current scene image to determine the scene type. The first segmentation unit 112 is configured to perform portrait segmentation when the scene type is a human image. The second segmentation unit 113 is configured to perform object segmentation when the scene type is a non-human image. The determining unit 114 is used for determining each object region according to the segmentation result. The mapping unit 115 is used for mapping each object region to different pixel value ranges to obtain a guide image.
如此,第一获取模块11可获得较为精准的向导图像,从而增强当前场景图像中各个物体区域的边缘。In this way, the first obtaining module 11 can obtain a relatively accurate guide image, thereby enhancing the edges of each object region in the current scene image.
请再次参阅图10,在某些实施方式中,映射单元115包括第一确定子单元1151和加权处理子单元1152。第一确定子单元1151用于根据分割结果确定各个物体区域并形成分割图像,每个物体区域在分割图像中用相同像素值表示。加权处理子单元1152用于将分割图像与当前场景图像进行加权处理以获得向导图像。Referring to FIG. 10 again, in some embodiments, the mapping unit 115 includes a first determination subunit 1151 and a weighting processing subunit 1152 . The first determination subunit 1151 is configured to determine each object region according to the segmentation result and form a segmented image, and each object region is represented by the same pixel value in the segmented image. The weighting processing subunit 1152 is configured to perform weighting processing on the segmented image and the current scene image to obtain the guide image.
如此,映射单元115通过将分割图像与当前场景图像进行加权处理得到向导图像,实现方式更为简单有效,可根据实际业务需求调整权重系数,从而增强当前场景图像中各个物体区域的边缘。In this way, the mapping unit 115 obtains the guide image by weighting the segmented image and the current scene image, which is simpler and more effective, and can adjust the weight coefficients according to actual business requirements, thereby enhancing the edge of each object area in the current scene image.
请参阅图11,在某些实施方式中,映射单元115包括第二确定子单元1153和映射子单元1154。第二确定子单元1153用于根据物体区域的数量确定各个物体区域映射的像素值范围。映射子单元1154用于将各个物体区域映射到对应的像素值范围以获得向导图像。Referring to FIG. 11 , in some embodiments, the mapping unit 115 includes a second determining subunit 1153 and a mapping subunit 1154 . The second determination subunit 1153 is configured to determine the pixel value range mapped by each object region according to the number of object regions. The mapping subunit 1154 is used to map each object region to a corresponding pixel value range to obtain a guide image.
如此,映射单元115通过将各个物体区域映射到对应的像素值范围的方式,获得较为精准的向导图像,从而增强当前场景图像中各个物体区域的边缘。In this way, the mapping unit 115 obtains a more accurate guide image by mapping each object region to a corresponding pixel value range, thereby enhancing the edge of each object region in the current scene image.
在某些实施方式中,相邻的两个像素值范围之间间隔预设范围,预设范围的最大值与预设范围的最小值的差值大于1。In some embodiments, a preset range is spaced between two adjacent pixel value ranges, and the difference between the maximum value of the preset range and the minimum value of the preset range is greater than 1.
如此,不同的物体区域对应不同的像素值范围,相邻的两个像素值范围之间间隔预设范围,使得不同的物体区域的亮度不同,且不同的物体区域的边界更加清晰。In this way, different object regions correspond to different pixel value ranges, and two adjacent pixel value ranges are separated by a preset range, so that the brightness of different object regions is different, and the boundaries of different object regions are clearer.
请参阅图12,在某些实施方式中,修复装置10还包括第二获取模块13和第二处理模块14。第二获 取模块13用于获取历史帧深度图像,历史帧深度图像的拍摄时间在深度图像的拍摄时间之前,及获取深度图像的空洞像素集。第二处理模块14用于根据历史帧深度图像得到修复像素集,及以修复像素集替换深度图像的空洞像素集以得到增强深度图像。同时,第一处理模块12还用于根据增强深度图像和向导图像构造目标函数进行全局最优化计算以修复深度图像。Referring to FIG. 12 , in some embodiments, the repairing apparatus 10 further includes a second acquiring module 13 and a second processing module 14 . The second acquisition module 13 is used to acquire the depth image of the historical frame, the shooting time of the depth image of the historical frame is before the shooting time of the depth image, and to acquire the hole pixel set of the depth image. The second processing module 14 is configured to obtain the repaired pixel set according to the depth image of the historical frame, and replace the hole pixel set of the depth image with the repaired pixel set to obtain the enhanced depth image. At the same time, the first processing module 12 is further configured to construct an objective function according to the enhanced depth image and the guide image to perform global optimization calculation to repair the depth image.
如此,第二处理模块14利用深度图缓冲计算空洞点的历史加权深度值对原始的深度图像中的空洞点进行初步填充修复,使得进入目标函数的空洞像素点的像素值更优化,进而可使得第一处理模块12执行目标函数最优化求解得到更好的输出函数,或者说得到对深度图像更佳的修复效果。In this way, the second processing module 14 uses the depth map buffer to calculate the historical weighted depth value of the hole point to perform preliminary filling and repairing on the hole point in the original depth image, so that the pixel value of the hole pixel point entering the objective function is more optimized, which can make The first processing module 12 performs the objective function optimization solution to obtain a better output function, or in other words, obtains a better restoration effect for the depth image.
请再次参阅图10或图11,在某些实施方式中,第一处理模块12包括优化单元210。优化单元210用于优化所述目标函数以使得所述目标函数取得最小值,并输出所述最小值对应的修复后的深度图像的当前像素点的像素值,目标函数:Referring again to FIG. 10 or FIG. 11 , in some embodiments, the first processing module 12 includes an optimization unit 210 . The optimization unit 210 is configured to optimize the objective function so that the objective function obtains a minimum value, and outputs the pixel value of the current pixel point of the repaired depth image corresponding to the minimum value, and the objective function is:
Figure PCTCN2021080255-appb-000003
Figure PCTCN2021080255-appb-000003
其中,i为所述当前像素点的位置,u i为所述当前像素点的像素值,λ为帧内总平滑权重系数,j为i的邻域N(i)的像素点位置,g为所述向导图像,w i,j(g)为所述向导图像对应的边缘加强系数,u j为所述当前像素点的邻域的像素点的像素值,f i为所述深度图像中与所述当前像素点对应的像素值。 Among them, i is the position of the current pixel, ui is the pixel value of the current pixel, λ is the total smoothing weight coefficient in the frame, j is the pixel position of the neighborhood N(i) of i, and g is For the guide image, w i,j (g) is the edge enhancement coefficient corresponding to the guide image, u j is the pixel value of the pixel point in the neighborhood of the current pixel point, and f i is the difference between the depth image and the depth image. The pixel value corresponding to the current pixel point.
如此,第一处理模块12通过优化单元210优化目标函数J(u),可以有效地对深度图像中的各种面积的空洞进行填充修复。相对于其它目标函数,J(u)从全局最优化上对输入输出误差最小化,且求解过程为线性加权求解,更为简单有效地对深度图像中的空洞进行填补修复。同时,因向导图像作为边缘增强的加权系数,可有效地对边缘处的空洞进行平滑填充修复,并在一定程度上保留边缘信息。进一步地,相对于现有技术中如利用高斯滤波方式等修复方法,机器学习的目标函数求解速度更快,在一定程度上可达到高速填充修复深度图像。In this way, the first processing module 12 optimizes the objective function J(u) through the optimization unit 210, and can effectively fill and repair holes of various areas in the depth image. Compared with other objective functions, J(u) minimizes the input and output errors from the global optimization, and the solution process is a linear weighted solution, which is more simple and effective to fill and repair the holes in the depth image. At the same time, since the guide image is used as a weighting coefficient for edge enhancement, the holes at the edge can be effectively filled and repaired, and the edge information can be preserved to a certain extent. Further, compared with the restoration methods in the prior art, such as using Gaussian filtering, the objective function of machine learning can be solved faster, and to a certain extent, high-speed filling and restoration of depth images can be achieved.
在某些实施方式中,邻域N(i)为4邻域或8邻域。In certain embodiments, the neighborhood N(i) is a 4-neighborhood or an 8-neighborhood.
如此,当前帧的当前像素点i的4邻域或8邻域的像素点可以进行滤波处理,从而获得与当前帧深度图像对应的修复后的深度图像。In this way, the pixel points in the 4-neighborhood or the 8-neighborhood of the current pixel point i of the current frame can be filtered, so as to obtain a repaired depth image corresponding to the depth image of the current frame.
在某些实施方式中,λ的取值范围为[100,10000]。In some embodiments, the value range of λ is [100, 10000].
如此,可以根据需要设置帧内总权重系数,从而获得较佳的目标函数。In this way, the total weight coefficient in the frame can be set as required, so as to obtain a better objective function.
在某些实施方式中,
Figure PCTCN2021080255-appb-000004
g i为向导图像与当前像素点对应的像素值,g j为向导图像与邻域N(i)的j点对应的像素值,σ的取值范围为[1,10]。
In certain embodiments,
Figure PCTCN2021080255-appb-000004
g i is the pixel value of the guide image corresponding to the current pixel point, g j is the pixel value of the guide image corresponding to the j point in the neighborhood N(i), and the value range of σ is [1, 10].
请参阅图13,本申请提供一种摄像头组件100,摄像头组件100包括图像传感器101、深度传感器102和处理器103。图像传感器101用于拍摄当前场景图像,处理器103用于获取当前场景图像,当前场景图像包括多个不同物体区域,将当前场景图像的各个物体区域映射到不同的像素值范围以获得向导图像,并根据深度图像和向导图像构造目标函数进行全局最优化计算以修复深度图像。Referring to FIG. 13 , the present application provides a camera assembly 100 . The camera assembly 100 includes an image sensor 101 , a depth sensor 102 and a processor 103 . The image sensor 101 is used to capture the current scene image, the processor 103 is used to obtain the current scene image, the current scene image includes a plurality of different object regions, and each object region of the current scene image is mapped to different pixel value ranges to obtain the guide image, And construct the objective function according to the depth image and guide image for global optimization calculation to repair the depth image.
上述摄像头组件100,通过图像传感器101获取深度图像的当前场景图像,并将当前场景图像的各个物体区域映射到不同的像素值范围以获得向导图像。向导图像能够体现场景图像各个不同物体区域的深度变化差异,同时可有效地增强各个不同物体区域的边缘效果。进一步地,深度传感器102用于获取深度图像,处理器103将深度图像作为目标函数的输入,向导图像作为边缘加强的加权系数,使得图像中的每个像素点最大接近周围邻域像素点的像素值,以此构造目标函数通过全局最优化的求解过程得到目标函数中的输出,即修复后的深度图像,可以有效地对深度图像中的各种面积的空洞进行填充修复。同时,因向导图像作为边缘增强的加权系数,可有效地对边缘处的空洞进行平滑填充修复,并在一定程度上保留边缘信息。进一步地,相对于现有技术中如利用高斯滤波方式等修复方法,机器学习的目标函数求解速度更快,在一定程度上可达到高速填充修复深度图像。The above-mentioned camera assembly 100 obtains the current scene image of the depth image through the image sensor 101, and maps each object area of the current scene image to different pixel value ranges to obtain the guide image. The guide image can reflect the difference in depth changes of different object areas in the scene image, and can effectively enhance the edge effect of each different object area. Further, the depth sensor 102 is used to obtain the depth image, the processor 103 uses the depth image as the input of the objective function, and the guide image is used as the weighting coefficient for edge enhancement, so that each pixel in the image is at most close to the pixels of the surrounding neighborhood pixels. The value of the objective function is constructed to obtain the output of the objective function through the global optimization solution process, that is, the repaired depth image, which can effectively fill and repair the holes of various areas in the depth image. At the same time, since the guide image is used as a weighting coefficient for edge enhancement, the holes at the edge can be effectively filled and repaired, and the edge information can be preserved to a certain extent. Further, compared with the restoration methods in the prior art, such as using Gaussian filtering, the objective function of machine learning can be solved faster, and to a certain extent, high-speed filling and restoration of depth images can be achieved.
处理器103可以用于实现上述任意一种实施方式所述的深度图像的修复方法,在此不再赘述。The processor 103 may be configured to implement the depth image restoration method described in any one of the foregoing embodiments, and details are not described herein again.
请参阅图14,本申请提供一种电子设备1000,电子设备1000包括上述实施方式的摄像头组件100及壳体200,摄像头组件100设置在壳体200上。Referring to FIG. 14 , the present application provides an electronic device 1000 . The electronic device 1000 includes the camera assembly 100 and the casing 200 of the above-mentioned embodiments, and the camera assembly 100 is disposed on the casing 200 .
上述电子设备1000,通过摄像头组件100获取深度图像的当前场景图像,并将当前场景图像的各个物体区域映射到不同的像素值范围以获得向导图像。向导图像能够体现场景图像各个不同物体区域的深度变化差异,同时可有效地增强各个不同物体区域的边缘效果。进一步地,将深度图像作为目标函数的 输入,向导图像作为边缘加强的加权系数,使得图像中的每个像素点最大接近周围邻域像素点的像素值,以此构造目标函数通过全局最优化的求解过程得到目标函数中的输出,即修复后的深度图像,可以有效地对深度图像中的各种面积的空洞进行填充修复。同时,因向导图像作为边缘增强的加权系数,可有效地对边缘处的空洞进行平滑填充修复,并在一定程度上保留边缘信息。进一步地,相对于现有技术中如利用高斯滤波方式等修复方法,机器学习的目标函数求解速度更快,在一定程度上可达到高速填充修复深度图像。The above electronic device 1000 obtains the current scene image of the depth image through the camera assembly 100, and maps each object area of the current scene image to different pixel value ranges to obtain the guide image. The guide image can reflect the difference in depth changes of different object areas in the scene image, and can effectively enhance the edge effect of each different object area. Further, the depth image is used as the input of the objective function, and the guide image is used as the weighting coefficient of edge enhancement, so that each pixel in the image is at most close to the pixel value of the surrounding neighborhood pixels, so as to construct the objective function through the global optimization. The solution process obtains the output of the objective function, that is, the repaired depth image, which can effectively fill and repair the holes of various areas in the depth image. At the same time, since the guide image is used as a weighting coefficient for edge enhancement, the holes at the edge can be effectively filled and repaired, and the edge information can be preserved to a certain extent. Further, compared with the restoration methods in the prior art, such as using Gaussian filtering, the objective function of machine learning can be solved faster, and to a certain extent, high-speed filling and restoration of depth images can be achieved.
具体地,在图14所示的实施方式中,电子设备1000为智能手机,在其它实施方式中,电子设备可为相机、平板电脑、笔记本电脑、智能家电、游戏机、头显设备、可穿戴设备等具有拍照功能的其它设备。Specifically, in the embodiment shown in FIG. 14 , the electronic device 1000 is a smart phone, and in other embodiments, the electronic device can be a camera, a tablet computer, a notebook computer, a smart home appliance, a game console, a head-mounted display device, a wearable device Other devices with camera functions, such as devices.
在本说明书的描述中,参考术语“一个实施方式”、“一些实施方式”、“示意性实施方式”、“示例”、“具体示例”或“一些示例”等的描述意指结合所述实施方式或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施方式或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施方式或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施方式或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, reference to the terms "one embodiment," "some embodiments," "exemplary embodiment," "example," "specific example," or "some examples" or the like is meant to be used in conjunction with the described embodiments. A particular feature, structure, material, or characteristic described in a manner or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine the different embodiments or examples described in this specification, as well as the features of the different embodiments or examples, without conflicting each other.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个所述特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个,除非另有明确具体的限定。In addition, the terms "first" and "second" are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implying the number of indicated technical features. Thus, features delimited with "first", "second" may expressly or implicitly include at least one of said features. In the description of the present application, "plurality" means at least two, such as two, three, unless expressly and specifically defined otherwise.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。Any description of a process or method in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing a specified logical function or step of the process , and the scope of the preferred embodiments of the present application includes alternative implementations in which the functions may be performed out of the order shown or discussed, including performing the functions substantially concurrently or in the reverse order depending upon the functions involved, which should It is understood by those skilled in the art to which the embodiments of the present application belong.
尽管上面已经示出和描述了本申请的实施方式,可以理解的是,上述实施方式是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施方式进行变化、修改、替换和变型。Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limitations to the present application. Embodiments are subject to variations, modifications, substitutions and alterations.

Claims (22)

  1. 一种深度图像的修复方法,其特征在于,所述修复方法包括:A depth image repair method, characterized in that the repair method includes:
    获取所述深度图像的当前场景图像,所述当前场景图像包括多个不同物体区域,将所述当前场景图像的各个所述物体区域映射到不同的像素值范围以获得向导图像;Acquiring a current scene image of the depth image, where the current scene image includes a plurality of different object regions, and mapping each of the object regions of the current scene image to different pixel value ranges to obtain a guide image;
    根据所述深度图像和所述向导图像构造目标函数进行全局最优化计算以修复所述深度图像。An objective function is constructed according to the depth image and the guide image to perform a global optimization calculation to repair the depth image.
  2. 根据权利要求1所述的修复方法,其特征在于,所述获取所述深度图像的当前场景图像,所述当前场景图像包括多个不同物体区域,将所述当前场景图像的各个所述物体区域映射到不同的像素值范围以获得向导图像包括:The repair method according to claim 1, wherein the acquisition of a current scene image of the depth image, the current scene image includes a plurality of different object regions, and each of the object regions of the current scene image is Mapping to different ranges of pixel values to obtain wizard images include:
    对所述当前场景图像进行场景检测以确定场景类型;Perform scene detection on the current scene image to determine the scene type;
    在所述场景类型为人物图像时进行人像分割;Perform portrait segmentation when the scene type is a human image;
    在所述场景类型为非人物图像时进行物体分割;Perform object segmentation when the scene type is a non-human image;
    根据分割结果确定各个所述物体区域;Determine each of the object regions according to the segmentation result;
    将各个所述物体区域映射到不同的所述像素值范围以获得所述向导图像。Each of the object regions is mapped to different ranges of the pixel values to obtain the guide image.
  3. 根据权利要求2所述的修复方法,其特征在于,所述将各个所述物体区域映射到不同的所述像素值范围以获得所述向导图像包括:The repair method according to claim 2, wherein the mapping each of the object regions to different ranges of the pixel values to obtain the guide image comprises:
    根据分割结果确定各个所述物体区域并形成分割图像,每个所述物体区域在所述分割图像中用相同像素值表示;Each of the object regions is determined according to the segmentation result and a segmented image is formed, and each of the object regions is represented by the same pixel value in the segmented image;
    将所述分割图像与所述当前场景图像进行加权处理以获得所述向导图像。The divided image and the current scene image are weighted to obtain the guide image.
  4. 根据权利要求2所述的修复方法,其特征在于,所述将各个所述物体区域映射到不同的所述像素值范围以获得所述向导图像还包括:The repair method according to claim 2, wherein the mapping each of the object regions to different ranges of the pixel values to obtain the guide image further comprises:
    根据所述物体区域的数量确定各个所述物体区域映射的所述像素值范围;Determine the pixel value range mapped by each of the object regions according to the number of the object regions;
    将各个所述物体区域映射到对应的所述像素值范围以获得所述向导图像。Each of the object regions is mapped to the corresponding pixel value range to obtain the guide image.
  5. 根据权利要求1-4任意一项所述的修复方法,其特征在于,相邻的两个所述像素值范围之间间隔预设范围,所述预设范围的最大值与所述预设范围的最小值的差值大于1。The repair method according to any one of claims 1-4, wherein a preset range is spaced between two adjacent pixel value ranges, and the maximum value of the preset range is the same as the preset range. The difference between the minimum values is greater than 1.
  6. 根据权利要求1所述的修复方法,其特征在于,所述修复方法还包括:The repair method according to claim 1, wherein the repair method further comprises:
    获取历史帧深度图像,所述历史帧深度图像的拍摄时间在所述深度图像的拍摄时间之前;Obtaining a depth image of a historical frame, the shooting time of the depth image of the historical frame is before the shooting time of the depth image;
    获取所述深度图像的空洞像素集;obtaining the hole pixel set of the depth image;
    根据所述历史帧深度图像得到修复像素集;obtaining a repaired pixel set according to the depth image of the historical frame;
    以所述修复像素集替换所述空洞像素集以得到增强深度图像;replacing the set of hole pixels with the set of repaired pixels to obtain an enhanced depth image;
    所述根据所述深度图像和所述向导图像构造目标函数进行全局最优化计算以修复所述深度图像包括:The constructing an objective function according to the depth image and the guide image and performing a global optimization calculation to repair the depth image includes:
    根据所述增强深度图像和所述向导图像构造目标函数进行全局最优化计算以修复所述深度图像。According to the enhanced depth image and the guide image, an objective function is constructed to perform a global optimization calculation to repair the depth image.
  7. 根据权利要求1所述的修复方法,其特征在于,所述根据所述深度图像和所述向导图像构造目标函数进行全局最优化计算以修复所述深度图像还包括:The repair method according to claim 1, wherein the constructing an objective function according to the depth image and the guide image and performing a global optimization calculation to repair the depth image further comprises:
    优化所述目标函数以使得所述目标函数取得最小值,并输出所述最小值对应的修复后的深度图像的当前像素点的像素值,目标函数:The objective function is optimized so that the objective function obtains the minimum value, and the pixel value of the current pixel of the repaired depth image corresponding to the minimum value is output, and the objective function is:
    Figure PCTCN2021080255-appb-100001
    Figure PCTCN2021080255-appb-100001
    其中,i为所述当前像素点的位置,u i为所述当前像素点的像素值,λ为帧内总权重系数,j为i的邻域N(i)的像素点位置,g为所述向导图像,w i,j(g)为所述向导图像对应的边缘加强系数,u j为所述当前像素点的邻域的像素点的像素值,f i为所述深度图像中与所述当前像素点对应的像素值。 Among them, i is the position of the current pixel, ui is the pixel value of the current pixel, λ is the total weight coefficient in the frame, j is the pixel position of the neighborhood N(i) of i, and g is the For the guide image, w i,j (g) is the edge enhancement coefficient corresponding to the guide image, u j is the pixel value of the pixel point in the neighborhood of the current pixel point, and f i is the depth image and the The pixel value corresponding to the current pixel point.
  8. 根据权利要求7所述的修复方法,其特征在于,所述邻域N(i)为4邻域或8邻域。The repair method according to claim 7, wherein the neighborhood N(i) is a 4-neighborhood or an 8-neighborhood.
  9. 根据权利要求7所述的修复方法,其特征在于,λ的取值范围为[100,10000]。The repair method according to claim 7, wherein the value range of λ is [100, 10000].
  10. 根据权利要求7所述的修复方法,其特征在于,
    Figure PCTCN2021080255-appb-100002
    g i为所述向导图像与所述当前像素点对应的像素值,g j为所述向导图像与所述邻域N(i)的j点对应的像素值,σ的取值范围为[1,10]。
    The repair method according to claim 7, wherein,
    Figure PCTCN2021080255-appb-100002
    g i is the pixel value of the guide image corresponding to the current pixel point, g j is the pixel value of the guide image corresponding to the j point of the neighborhood N(i), and the value range of σ is [1 , 10].
  11. 一种深度图像的修复装置,其特征在于,所述修复装置包括:A depth image repairing device, characterized in that the repairing device comprises:
    第一获取模块,用于获取所述深度图像的当前场景图像,所述当前场景图像包括多个不同物体区域,将所述当前场景图像的各个所述物体区域映射到不同的像素值范围以获得向导图像;The first acquisition module is used to acquire the current scene image of the depth image, the current scene image includes a plurality of different object regions, and each of the object regions of the current scene image is mapped to different pixel value ranges to obtain wizard image;
    第一处理模块,用于根据所述深度图像和所述向导图像构造目标函数进行全局最优化计算以修复所述深度图像。The first processing module is configured to construct an objective function according to the depth image and the guide image and perform a global optimization calculation to repair the depth image.
  12. 根据权利要求11所述的修复装置,其特征在于,所述第一获取模块包括:The repair device according to claim 11, wherein the first acquisition module comprises:
    检测单元,用于对所述当前场景图像进行场景检测以确定场景类型;a detection unit, configured to perform scene detection on the current scene image to determine a scene type;
    第一分割单元,用于在所述场景类型为人物图像时进行人像分割;a first segmentation unit, for performing portrait segmentation when the scene type is a human image;
    第二分割单元,用于在所述场景类型为非人物图像时进行物体分割;a second segmentation unit, configured to perform object segmentation when the scene type is a non-personal image;
    确定单元,用于根据分割结果确定各个所述物体区域;a determining unit, configured to determine each of the object regions according to the segmentation result;
    映射单元,用于将各个所述物体区域映射到不同的所述像素值范围以获得所述向导图像。a mapping unit, configured to map each of the object regions to different ranges of the pixel values to obtain the guide image.
  13. 根据权利要求12所述的修复装置,其特征在于,所述映射单元包括:The repair device according to claim 12, wherein the mapping unit comprises:
    第一确定子单元,用于根据分割结果确定各个所述物体区域并形成分割图像,每个所述物体区域在所述分割图像中用相同像素值表示;a first determination subunit, configured to determine each of the object regions according to the segmentation result and form a segmented image, and each of the object regions is represented by the same pixel value in the segmented image;
    加权处理子单元,用于将所述分割图像与所述当前场景图像进行加权处理以获得所述向导图像。A weighting processing subunit, configured to perform weighting processing on the segmented image and the current scene image to obtain the guide image.
  14. 根据权利要求12所述的修复装置,其特征在于,所述映射单元还包括:The repair device according to claim 12, wherein the mapping unit further comprises:
    第二确定子单元,用于根据所述物体区域的数量确定各个所述物体区域映射的所述像素值范围;a second determination subunit, configured to determine the pixel value range mapped by each of the object regions according to the number of the object regions;
    映射子单元,用于将各个所述物体区域映射到对应的所述像素值范围以获得所述向导图像。A mapping subunit, configured to map each of the object regions to the corresponding pixel value ranges to obtain the guide image.
  15. 根据权利要求11-14任意一项所述的修复装置,其特征在于,相邻的两个所述像素值范围之间间隔预设范围,所述预设范围的最大值与所述预设范围的最小值的差值大于1。The repair device according to any one of claims 11-14, wherein a preset range is spaced between two adjacent pixel value ranges, and the maximum value of the preset range is the same as the preset range. The difference between the minimum values is greater than 1.
  16. 根据权利要求11所述的修复装置,其特征在于,所述修复装置还包括:The repair device according to claim 11, wherein the repair device further comprises:
    第二获取模块,用于获取历史帧深度图像,所述历史帧深度图像的拍摄时间在所述深度图像的拍摄时间之前;及a second acquisition module, configured to acquire a depth image of a historical frame, the shooting time of the depth image of the historical frame is before the shooting time of the depth image; and
    获取所述深度图像的空洞像素集;obtaining the hole pixel set of the depth image;
    第二处理模块,用于根据所述历史帧深度图像得到修复像素集;及a second processing module for obtaining a repaired pixel set according to the historical frame depth image; and
    以所述修复像素集替换所述深度图像的所述空洞像素集以得到增强深度图像;replacing the set of hole pixels of the depth image with the set of repaired pixels to obtain an enhanced depth image;
    第一处理模块,用于根据所述增强深度图像和所述向导图像构造目标函数进行全局最优化计算以修复所述深度图像。The first processing module is configured to construct an objective function according to the enhanced depth image and the guide image and perform a global optimization calculation to repair the depth image.
  17. 根据权利要求11所述的修复装置,其特征在于,所述第一处理模块包括:The repair device according to claim 11, wherein the first processing module comprises:
    优化单元,用于优化所述目标函数以使得所述目标函数取得最小值,并输出所述最小值对应的修复后的深度图像的当前像素点的像素值,目标函数:An optimization unit, configured to optimize the objective function so that the objective function obtains a minimum value, and output the pixel value of the current pixel of the repaired depth image corresponding to the minimum value, and the objective function is:
    Figure PCTCN2021080255-appb-100003
    Figure PCTCN2021080255-appb-100003
    其中,i为所述当前像素点的位置,u i为所述当前像素点的像素值,λ为帧内总平滑权重系数,j为i 的邻域N(i)的像素点位置,g为所述向导图像,w i,j(g)为所述向导图像对应的边缘加强系数,u j为所述当前像素点的邻域的像素点的像素值,f i为所述深度图像中与所述当前像素点对应的像素值。 Among them, i is the position of the current pixel, ui is the pixel value of the current pixel, λ is the total smoothing weight coefficient in the frame, j is the pixel position of the neighborhood N(i) of i, and g is For the guide image, w i,j (g) is the edge enhancement coefficient corresponding to the guide image, u j is the pixel value of the pixel point in the neighborhood of the current pixel point, and f i is the difference between the depth image and the depth image. The pixel value corresponding to the current pixel point.
  18. 根据权利要求17所述的修复装置,其特征在于,所述邻域N(i)为4邻域或8邻域。The repair device according to claim 17, wherein the neighborhood N(i) is a 4-neighborhood or an 8-neighborhood.
  19. 根据权利要求17所述的修复装置,其特征在于,λ的取值范围为[100,10000]。The repair device according to claim 17, wherein the value range of λ is [100, 10000].
  20. 根据权利要求17所述的修复装置,其特征在于
    Figure PCTCN2021080255-appb-100004
    g i为所述向导图像与所述当前像素点对应的像素值,g j为所述向导图像与所述邻域N(i)的j点对应的像素值,σ的取值范围为[1,10]。
    The repair device of claim 17, wherein
    Figure PCTCN2021080255-appb-100004
    g i is the pixel value of the guide image corresponding to the current pixel point, g j is the pixel value of the guide image corresponding to the j point of the neighborhood N(i), and the value range of σ is [1 , 10].
  21. 一种摄像头组件,其特征在于,所述摄像头组件包括图像传感器、深度传感器和处理器,所述处理器用于获取当前场景图像,所述当前场景图像包括多个不同物体区域,将所述当前场景图像的各个所述物体区域映射到不同的像素值范围以获得向导图像;根据所述深度图像和所述向导图像构造目标函数进行全局最优化计算以修复所述深度图像。A camera assembly, characterized in that the camera assembly includes an image sensor, a depth sensor, and a processor, and the processor is used to obtain a current scene image, the current scene image includes a plurality of different object regions, and the current scene Each of the object regions of the image is mapped to different pixel value ranges to obtain a guide image; an objective function is constructed according to the depth image and the guide image, and a global optimization calculation is performed to restore the depth image.
  22. 一种电子设备,其特征在于,所述电子设备包括:An electronic device, characterized in that the electronic device comprises:
    权利要求21所述的摄像头组件;及The camera assembly of claim 21; and
    壳体,所述摄像头组件设置在所述壳体上。A casing, the camera assembly is arranged on the casing.
PCT/CN2021/080255 2021-03-11 2021-03-11 Depth image inpainting method and apparatus, camera assembly, and electronic device WO2022188102A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202180094623.8A CN116897532A (en) 2021-03-11 2021-03-11 Depth image restoration method and device, camera component and electronic equipment
PCT/CN2021/080255 WO2022188102A1 (en) 2021-03-11 2021-03-11 Depth image inpainting method and apparatus, camera assembly, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/080255 WO2022188102A1 (en) 2021-03-11 2021-03-11 Depth image inpainting method and apparatus, camera assembly, and electronic device

Publications (1)

Publication Number Publication Date
WO2022188102A1 true WO2022188102A1 (en) 2022-09-15

Family

ID=83226176

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/080255 WO2022188102A1 (en) 2021-03-11 2021-03-11 Depth image inpainting method and apparatus, camera assembly, and electronic device

Country Status (2)

Country Link
CN (1) CN116897532A (en)
WO (1) WO2022188102A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116630203A (en) * 2023-07-19 2023-08-22 科大乾延科技有限公司 Integrated imaging three-dimensional display quality improving method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103561258A (en) * 2013-09-25 2014-02-05 同济大学 Kinect depth video spatio-temporal union restoration method
US20150319421A1 (en) * 2014-04-30 2015-11-05 Altek Semiconductor Corp. Method and apparatus for optimizing depth information
US20180115763A1 (en) * 2016-10-20 2018-04-26 Altek Semiconductor Corp. Optimization method of image depth information and image processing apparatus
CN108399610A (en) * 2018-03-20 2018-08-14 上海应用技术大学 A kind of depth image enhancement method of fusion RGB image information
CN109598736A (en) * 2018-11-30 2019-04-09 深圳奥比中光科技有限公司 The method for registering and device of depth image and color image
CN110147816A (en) * 2019-04-10 2019-08-20 中国科学院深圳先进技术研究院 A kind of acquisition methods of color depth image, equipment, computer storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103561258A (en) * 2013-09-25 2014-02-05 同济大学 Kinect depth video spatio-temporal union restoration method
US20150319421A1 (en) * 2014-04-30 2015-11-05 Altek Semiconductor Corp. Method and apparatus for optimizing depth information
US20180115763A1 (en) * 2016-10-20 2018-04-26 Altek Semiconductor Corp. Optimization method of image depth information and image processing apparatus
CN108399610A (en) * 2018-03-20 2018-08-14 上海应用技术大学 A kind of depth image enhancement method of fusion RGB image information
CN109598736A (en) * 2018-11-30 2019-04-09 深圳奥比中光科技有限公司 The method for registering and device of depth image and color image
CN110147816A (en) * 2019-04-10 2019-08-20 中国科学院深圳先进技术研究院 A kind of acquisition methods of color depth image, equipment, computer storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116630203A (en) * 2023-07-19 2023-08-22 科大乾延科技有限公司 Integrated imaging three-dimensional display quality improving method
CN116630203B (en) * 2023-07-19 2023-11-07 科大乾延科技有限公司 Integrated imaging three-dimensional display quality improving method

Also Published As

Publication number Publication date
CN116897532A (en) 2023-10-17

Similar Documents

Publication Publication Date Title
Agrawal et al. A novel joint histogram equalization based image contrast enhancement
Ghosh et al. A survey on image mosaicing techniques
JP6159298B2 (en) Method for detecting and removing ghost artifacts in HDR image processing using multi-scale normalized cross-correlation
CN104574347B (en) Satellite in orbit image geometry positioning accuracy evaluation method based on multi- source Remote Sensing Data data
CN108986152B (en) Foreign matter detection method and device based on difference image
Kumar et al. A novel method of edge detection using cellular automata
JP2012032370A (en) Defect detection method, defect detection apparatus, learning method, program, and recording medium
CN109919971B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
JP2019204193A (en) Image processing device, image processing method, and program
Jeon et al. Ring difference filter for fast and noise robust depth from focus
US9185270B2 (en) Ghost artifact detection and removal in HDR image creation using graph based selection of local reference
Zhang et al. Motion-free exposure fusion based on inter-consistency and intra-consistency
Chen et al. A color-guided, region-adaptive and depth-selective unified framework for Kinect depth recovery
Haq et al. An edge-aware based adaptive multi-feature set extraction for stereo matching of binocular images
CN114937050A (en) Green curtain matting method and device and electronic equipment
Feng et al. Low-light image enhancement algorithm based on an atmospheric physical model
Stentoumis et al. A local adaptive approach for dense stereo matching in architectural scene reconstruction
WO2022188102A1 (en) Depth image inpainting method and apparatus, camera assembly, and electronic device
KR20180072020A (en) Method, apparatus and computer program stored in computer readable medium for correction of image data
US20080267506A1 (en) Interest point detection
JP7312026B2 (en) Image processing device, image processing method and program
JP2009146150A (en) Method and device for detecting feature position
Xu et al. Features based spatial and temporal blotch detection for archive video restoration
CN115619678A (en) Image deformation correction method and device, computer equipment and storage medium
Xia et al. A coarse-to-fine ghost removal scheme for HDR imaging

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21929580

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180094623.8

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21929580

Country of ref document: EP

Kind code of ref document: A1