WO2013166656A1 - Method and device for extracting and optimizing depth map of image - Google Patents
Method and device for extracting and optimizing depth map of image Download PDFInfo
- Publication number
- WO2013166656A1 WO2013166656A1 PCT/CN2012/075187 CN2012075187W WO2013166656A1 WO 2013166656 A1 WO2013166656 A1 WO 2013166656A1 CN 2012075187 W CN2012075187 W CN 2012075187W WO 2013166656 A1 WO2013166656 A1 WO 2013166656A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- pixel
- source image
- depth map
- current
- pixel point
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 61
- 239000013598 vector Substances 0.000 claims abstract description 84
- 238000001914 filtration Methods 0.000 claims abstract description 43
- 238000012545 processing Methods 0.000 claims abstract description 37
- 238000004364 calculation method Methods 0.000 claims abstract description 21
- 230000001186 cumulative effect Effects 0.000 claims abstract description 5
- 238000009499 grossing Methods 0.000 claims description 41
- 239000000872 buffer Substances 0.000 claims description 25
- 238000006073 displacement reaction Methods 0.000 claims description 15
- 238000005070 sampling Methods 0.000 claims description 11
- 238000009825 accumulation Methods 0.000 claims description 10
- 239000000284 extract Substances 0.000 claims description 9
- 206010036790 Productive cough Diseases 0.000 claims description 5
- 210000003802 sputum Anatomy 0.000 claims description 5
- 208000024794 sputum Diseases 0.000 claims description 5
- 238000002372 labelling Methods 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 15
- 238000000605 extraction Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 3
- 238000005457 optimization Methods 0.000 description 3
- 238000003672 processing method Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 150000002500 ions Chemical class 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/59—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial sub-sampling or interpolation, e.g. alteration of picture size or resolution
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/513—Processing of motion vectors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/597—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding specially adapted for multi-view video sequence encoding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/80—Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
Definitions
- the focus and difficulty is the extraction of 2D video image depth maps.
- the physical meaning of the depth map is: The proximity of different screen content in the 2D video frame sequence to the viewer is the most important source of information for the 3D parallax image.
- various methods and means for extracting depth maps including depth information extraction based on object contours, depth map based on image-based color segmentation, depth map extraction based on virtual space intersection points, object-based motion vector extraction depth map, and Semi-automatic extraction of depth maps and the like based on key frames.
- most of these techniques for extracting depth maps have serious defects, or the depth map is not clear, or the amount of calculation is too large, or there are too many artificial interference factors, etc., so that it is difficult to achieve the display requirements of the 3D terminal display device.
- the object of the present invention is to solve the problem that the depth map of the key frame needs to be manually selected and extracted, and the extracted depth map has low precision and error, and a method and device for extracting and optimizing the image depth map are provided.
- an embodiment of the present invention provides a method for extracting and optimizing an image depth map, where the method includes: acquiring a scene correlation degree of each pixel point in a current source image and the current source image, where the current The source image is a sequence of current video consecutive frames;
- an embodiment of the present invention provides an apparatus for extracting and optimizing an image depth map, where the apparatus includes: a first acquiring unit, configured to acquire a current source image and each pixel point in the current source image. a scene correlation degree, where the current source image is a current video continuous frame sequence;
- a second acquiring unit configured to continuously download the current source image, and obtain each current download The scene correlation of each pixel in the sample source image
- a third acquiring unit configured to perform block matching motion vector calculation on each pixel point in the current squat sample source image and a pixel point corresponding to the previous squat sample source image, to obtain the current squat sample source image The motion vector value of each pixel in the middle;
- a calculating unit configured to separately accumulate motion vector values of each pixel in the current sputum sample source image, and extract an initial depth value of each pixel point from the motion vector accumulation sum, where the initial depth value constitutes a source image initial Depth map
- a first processing unit configured to use each of the pixels in the initial depth map by using a scene correlation of each pixel in the source image and a scene correlation of each pixel in each of the squat source images The point performs continuous super smoothing filtering processing and upper sampling processing to obtain the depth map of the source image.
- FIG. 2 is a flowchart of a method for extracting and optimizing a depth map according to an embodiment of the present invention
- FIG. 4 is a schematic diagram of calculating a correlation degree of any pixel point scene according to an embodiment of the present invention.
- FIG. 5 is a schematic diagram of calculating a correlation degree of a scene point of any pixel on a boundary according to an embodiment of the present invention
- FIG. 6 is an initial depth diagram of a source image according to an embodiment of the present invention
- FIG. 7 is a schematic diagram of assigning weight coefficients to any pixel point according to an embodiment of the present invention.
- FIG. 8 is a schematic diagram of assigning weight coefficients to any pixel on a boundary according to an embodiment of the present invention
- FIG. 9 is a structural diagram of a super smoothing filter according to an embodiment of the present invention
- 10 is a depth map of a source image after optimization according to an embodiment of the present invention
- FIG. 4 is a schematic diagram of calculating a correlation degree of any pixel point scene according to an embodiment of the present invention; wherein, a red pixel point is a selected central pixel point, and a coordinate of the center pixel point is (x, y), and The pixel points adjacent to the central pixel point are adjacent pixel points.
- a red pixel point is a selected central pixel point
- a coordinate of the center pixel point is (x, y)
- the pixel points adjacent to the central pixel point are adjacent pixel points.
- A is the threshold of the scene correlation
- 1 ⁇ 4#er[ ] is the mth bit of the correlation
- m is the adjacent pixel point label.
- FIG. 5 is a schematic diagram of calculating the correlation degree of any pixel point on the boundary according to an embodiment of the present invention; wherein, the red pixel point is selected
- the central pixel, the coordinates of the central pixel are (x, y), and the pixel adjacent to the central pixel is an adjacent pixel.
- the numbering is the same as the above, and only the correlation of the number 2, 3, and 4 pixels in the dotted frame is calculated, and the number is For 0, 1, 5, 6, and 7, the pixel does not exist. Therefore, the correlation flag buffers [0], buffer [1], buffer [5], buffer [6], and buffer [7] are directly assigned. 0, the pixel point processing method at other boundary positions is the same, and therefore, will not be described again.
- each pixel is calculated, and after each pixel in the source image is calculated, There is one correlation flag slot, and all the correlation flag slots of all the pixels constitute the scene correlation of the current source image.
- Step 220 Perform horizontal and vertical 1/2 squatting on the source image, obtain a 1/4 resolution source image, and extract a scene correlation degree from the 1/4 resolution source image;
- the obtained current source image is subjected to horizontal and vertical 1/2 squatting operations, and after 1/2 squatting, scene correlation is extracted from each pixel of the 1/4 resolution source image. Degree, obtains the scene correlation of each pixel in the 1/4 resolution source image and the 1/4 resolution source image.
- the 1/4 resolution is calculated using the method described in step 210.
- Step 230 Perform horizontal and vertical 1/2 squatting on the 1/4 resolution source image again, obtain a 1/16 resolution source image, and extract a scene correlation degree from the 1/16 resolution source image;
- the acquired 1/4 resolution source image is subjected to horizontal and vertical 1/2 squatting operations, and after 1/2 squatting, the scene correlation is extracted from the 1/16 resolution source image. Get the scene correlation of each pixel in the 1/16 resolution source image and the 1/16 resolution source image.
- the pixel correlation of each pixel in the 1/16 resolution source image is calculated using the method described in step 210.
- Step 240 The 1/16 resolution source image performs block matching motion vector calculation with the previous 1/16 resolution source image
- Step 250 extracting an initial depth value from the motion vector accumulation and summing, forming an initial depth map; specifically, acquiring motion vector value summation of each pixel point in the current 1/16 resolution source image according to the description of step 240, The motion vector accumulates and extracts the initial depth value of each pixel, and extracts the initial depth value for all the pixels in the 1/16 resolution source image, and the initial depth value of all the pixels forms the initial image of the 1/16 resolution source image.
- the initial depth value is extracted based on the motion vector accumulation sum for each pixel point; it is assumed that the maximum offset of the moving object in the two consecutive source images is 3.5% wide of the current source image. Degree, at this time, the gray value corresponding to the motion vector value represented by the value is 255, then the gray value represented by the unit pixel displacement is as follows:
- W is the width of the image
- D new _depth ( ⁇ y) represents the current motion vector gradation value for each pixel.
- Step 260 Perform super-smoothing filtering processing on the 1/16-resolution initial depth map, and uploading the sample processing; specifically, from the initial depth map of FIG. 6, since the block matching motion vector is calculated in step 250, There is a large error, which causes the extracted initial depth map to be blurred and unclear. Therefore, in this step, the 1/16 resolution initial depth map is strictly optimized.
- step 230 the scene correlation degree of the 1/16 resolution source image is acquired in step 230, and therefore, the 1/16 resolution initial depth map is super-according to the acquired scene correlation degree of the 1/16 resolution source image. Smoothing the filtering process and performing four iterative filtering; Then, the 1/16 resolution initial depth map processed by the iterative ultra-smoothing filtering is doubled in the horizontal and vertical directions respectively to obtain a 1/4 resolution initial depth map. .
- step 230 the scene correlation degree of the 1/16 resolution source image pixel point has been acquired, and the scene correlation degree of the 1/16 resolution source image pixel point is 1/16 resolution.
- the initial depth map is optimized; adjacent to the central pixel is defined in the calculation correlation In the super smoothing filtering process in this step, each adjacent pixel point is assigned a different weight coefficient, as shown in FIG. 7, FIG. 7 is a weight coefficient of any pixel point according to an embodiment of the present invention.
- the weighting coefficient of each adjacent pixel is used as the filtering tap coefficient of the super smoothing filter, respectively.
- the super smoothing filter is a low pass filter. Since the filter coefficient factor is 8 and is regularly distributed in 8 directions of the central pixel point, the filtering performance is high, and the initial depth map can be effectively smoothed. High-frequency noise and high-frequency components with sharp ridges.
- the correlation between the central pixel point and the 8 adjacent pixel points is obtained according to the correlation degree flag slot at the central pixel point. If the degree of correlation between a neighboring pixel and the central pixel is 1, the gray value of the adjacent pixel is multiplied by the weight coefficient of the adjacent pixel, if the correlation between a neighboring pixel and the central pixel If 0, the weight coefficient of the adjacent pixel is multiplied by the gray value of the central pixel. Finally, the result of multiplying 8 adjacent pixels is added as a smoothing filter for the initial depth map of 1 / 16 resolution. the result of.
- coef 0-coef 7 in FIG. 9 is a weight coefficient of adjacent pixel points, and is also a tap coefficient of the super smoothing filter;
- Step 270 Perform super-smooth filtering processing on the 1/4-resolution depth map, and perform a sample-like processing. Specifically, obtain a 1/4-resolution depth map according to step 260, and obtain step 1 in step 220 according to the description of step 220. /4 resolution of the scene correlation of the source image, therefore, super-smoothing filtering processing on the 1/4-resolution depth map according to the scene correlation degree of the acquired 1/4-resolution source image, and performing two iterative filtering; The 1/4 resolution initial depth map processed by the iterative super-smoothing filter is respectively subjected to horizontal and vertical double-dip, and the depth value of each original resolution pixel is obtained, and the depth value of each original resolution pixel is obtained. Forming a raw resolution depth map to obtain an initial depth map of the original resolution;
- the 1/4 resolution depth map is super-smooth filtered by the method described in step 260.
- Step 280 Obtain a depth map after the optimization process.
- the original resolution depth map is obtained according to step 270, and according to the description of step 210, the scene relevance of the source image is acquired in step 210, and therefore, according to the acquired scene image of the source image The degree of attenuation performs an iterative super smoothing process on the original resolution depth map. Finally, the source image depth map is obtained.
- the corresponding scene correlation degree is obtained in different lower sampling stages, the initial depth map is accumulated and extracted by the motion vector, and the initial depth map is iterated by using the scene correlation degree of different lower sampling stages.
- Ultra-smooth processing, simultaneous sample processing, and finally generate source image depth map improve the image quality of the depth map, make the depth map outline clearer, and the method also keeps the calculation cost of the whole process within a reasonable range.
- FIG. 11 is a device diagram for extracting and optimizing an image depth map according to an embodiment of the present invention.
- the device for extracting and optimizing an image depth map includes: a first acquiring unit 1110, configured to acquire a scene correlation degree of each pixel point in the current source image and the current source image, where the current source image is a current video continuous frame Sequence
- a second acquiring unit 1120 configured to continuously sample the current source image, and obtain a scene correlation degree of each pixel in each of the current squatting source images
- the third obtaining unit 11 30 is configured to perform block matching motion vector calculation on each pixel point in the current squat sample source image and a pixel point corresponding to the previous squat sample source image, to obtain the current squat sample The motion vector value of each pixel in the source image;
- a first processing unit 1150 configured to use each of the initial depth maps by using a scene correlation degree of each pixel point in the source image and a scene correlation degree of each pixel point in each of the squat sample source images
- the pixel points are subjected to continuous super smoothing filtering processing and upper sampling processing to obtain the source image depth map.
- the first acquiring unit 1110 is specifically configured to: select any pixel point as a central pixel point, and mark a pixel point adjacent to the central pixel point;
- the second obtaining unit 1120 is specifically configured to: perform horizontal 15 and vertical 1/2 sampling on the current source image, and obtain a current 1/4 resolution source image and a current 1/4 resolution source. The scene correlation of each pixel in the image;
- the third obtaining unit 1130 is specifically configured to: perform, for each pixel point in the current 1/16th resolution source 0 image, a pixel point corresponding to the previous 1/16 resolution source image. Block matching motion vector calculation, acquiring a motion vector value of each pixel in the current 1/16 resolution source image;
- the motion vector values of each pixel in the current 1/16 resolution source image are separately accumulated.
- the first processing unit 1150 is specifically configured to: assign a weight coefficient to each of the adjacent pixel points, where the weight coefficient is a tap coefficient of the super smoothing filter;
- the first processing unit 1150 is further specifically configured to: perform four iterations of the ultra-smoothing filtering process on the initial depth map, and perform horizontal and vertical depth mapping on the depth map after the four iterations of the ultra-smooth filtering process. Doubled up;
- An iterative super-smoothing filtering process is performed on the original resolution depth map to obtain a source image depth map.
- the corresponding scene correlation degree is obtained in different lower sample stages, the initial depth map is accumulated and extracted by the motion vector, and the initial depth map is iterated by using the scene correlation degree of different lower sample stages.
- Ultra-smooth processing, simultaneous sample processing, and finally generate source image depth map improve the image quality of the depth map, make the depth map outline clearer, and the method also keeps the calculation cost of the whole process within a reasonable range.
- RAM random access memory
- ROM read only memory
- electrically programmable ROM electrically erasable programmable ROM
- registers hard disk, removable disk, CD-ROM, or any other form of storage known in the art. In the medium.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Analysis (AREA)
Abstract
Embodiments of the present invention relate to a method and a device for extracting and optimizing a depth map of an image. The method comprises: obtaining a current source image and scenario relevance of each pixel in the current source image; performing continuous downsampling on the current source image, and obtaining scenario relevance of each pixel in each current downsampled source image; performing block-matching motion vector calculation between each pixel in the current downsampled source image and each corresponding pixel in a previous downsampled source image to obtain a motion vector value of each pixel in the current downsampled source image; accumulating the motion vector value of each pixel in the current downsampled source image, and extracting an initial depth value of each pixel from a cumulative sum of the motion vectors, the initial depth value forming an initial depth map; and performing continuous ultra-smooth filtering processing and upsampling processing on each pixel in the initial depth map by using the scenario relevance of each pixel in the source image and the scenario relevance of each pixel in each downsampled source image, to obtain a depth map of the source image.
Description
一种提取及优化图像深度图的方法与装置 技术领域 Method and device for extracting and optimizing image depth map
本发明涉及图像处理技术领域, 尤其是涉及一种提取及优化图像深度图 的方法与装置。 背景技术 The present invention relates to the field of image processing technologies, and in particular, to a method and apparatus for extracting and optimizing an image depth map. Background technique
三维立体显示技术最近几年高速发展, 三维终端显示设备 ( Three Three-dimensional display technology has developed rapidly in recent years, three-dimensional terminal display equipment (Three
Dimens ions , 3D )如, 3D电视, 3D游戏机等的迅速崛起已成为科技发展的必 然结果。 由于 3D 片源资源稀少、 造价昂贵, 所以由普通的二维 (Two Dimens ions , 2D )视频帧序列转换成 3D视频帧序列的 2D转 3D技术已成为三 维立体显示技术中的热点领域。 The rapid rise of Dimens ions, 3D), such as 3D TV, 3D game consoles, etc., has become a necessary result of technological development. Due to the scarcity of 3D source resources and high cost, 2D to 3D technology, which is converted from a common two-dimensional (2D) video frame sequence into a 3D video frame sequence, has become a hotspot in 3D stereoscopic display technology.
在 2D转 3D技术中, 重点和难点是 2D视频图像深度图的提取。 深度图的 物理意义是: 2D视频帧序列中不同画面内容离观看者的远近程度, 是构成 3D 视差图像最主要的信息来源。 目前提取深度图的方法和手段各种各样, 主要 包括基于物体轮廓提取物体的深度信息、 基于图像的颜色分割提取深度图、 基于虚拟空间交点提取深度图、 基于物体的运动矢量提取深度图以及基于关 键帧半自动提取深度图等。 但是这些众多提取深度图的技术大多都存在严重 的缺陷, 要么深度图模糊不清晰、 要么计算量太大、 要么人工干扰因素太多 等等, 这样就很难达到 3D终端显示设备的显示需求。 In 2D to 3D technology, the focus and difficulty is the extraction of 2D video image depth maps. The physical meaning of the depth map is: The proximity of different screen content in the 2D video frame sequence to the viewer is the most important source of information for the 3D parallax image. At present, there are various methods and means for extracting depth maps, including depth information extraction based on object contours, depth map based on image-based color segmentation, depth map extraction based on virtual space intersection points, object-based motion vector extraction depth map, and Semi-automatic extraction of depth maps and the like based on key frames. However, most of these techniques for extracting depth maps have serious defects, or the depth map is not clear, or the amount of calculation is too large, or there are too many artificial interference factors, etc., so that it is difficult to achieve the display requirements of the 3D terminal display device.
现有技术提供了一种生成二维视频序列深度图的方法, 如图 1 所示, 该 方法首先选取视频帧序列中的关键帧, 并人工生成关键帧的深度图, 然后匹 配估计视频连续帧特征点之间的运动位移, 根据关键帧深度图及运动位移得 出当前帧的深度图。 该文献介绍的这种方法在一定程度上可以提取当前帧深 度图, 但是这种方法需要人工选取和计算关键帧的深度图, 不利于深度图的
全自动化生成, 进而难以在工业领域推广; 还有一点是在进行匹配估计的时 候很容易造成匹配错误, 进而深度图信息也会造成匹配误差, 这样提取的深 度图往往轮廓模糊、 深度信息凹凸不均衡。 发明内容 The prior art provides a method for generating a depth map of a two-dimensional video sequence. As shown in FIG. 1, the method first selects a key frame in a sequence of video frames, and manually generates a depth map of the key frame, and then matches the estimated video continuous frame. The motion displacement between the feature points, and the depth map of the current frame is obtained according to the key frame depth map and the motion displacement. The method described in this document can extract the current frame depth map to a certain extent, but this method needs to manually select and calculate the depth map of the key frame, which is not conducive to the depth map. Fully automated generation, and thus difficult to promote in the industrial field; Another point is that it is easy to cause matching errors when performing matching estimation, and then the depth map information will also cause matching errors, so the extracted depth map tends to be blurred in outline and deep in information. balanced. Summary of the invention
本发明的目的是为了解决现有技术的需人工选取并提取关键帧的深度 图, 造成提取的深度图精度低, 出现误差的问题, 提供了一种提取及优化图 像深度图的方法与装置。 The object of the present invention is to solve the problem that the depth map of the key frame needs to be manually selected and extracted, and the extracted depth map has low precision and error, and a method and device for extracting and optimizing the image depth map are provided.
在第一方面, 本发明实施例提供了一种提取及优化图像深度图的方法, 所述方法包括: 获取当前源图像和所述当前源图像中每个像素点的场景相关 度, 所述当前源图像为当前视频连续帧序列; In a first aspect, an embodiment of the present invention provides a method for extracting and optimizing an image depth map, where the method includes: acquiring a scene correlation degree of each pixel point in a current source image and the current source image, where the current The source image is a sequence of current video consecutive frames;
对所述当前源图像连续下釆样, 获取当前每个下釆样源图像中每个像素 点的场景相关度; And continuously extracting the current source image, and acquiring a scene correlation degree of each pixel in each of the current squat sample source images;
将所述当前下釆样源图像中每个像素点与之前下釆样源图像中相对应的 像素点进行块匹配运动矢量计算, 获取所述当前下釆样源图像中每个像素点 的运动矢量值; Performing a block matching motion vector calculation on each pixel point in the current squat sample source image and a pixel point corresponding to the previous squat sample source image, and acquiring motion of each pixel point in the current squat sample source image Vector value
分别累加所述当前下釆样源图像中每个像素点的运动矢量值, 从运动矢 量累加和中提取每个像素点的初始深度值, 所述初始深度值构成源图像初始 深度图; And accumulating motion vector values of each pixel in the current sputum sample source image respectively, and extracting initial depth values of each pixel point from the motion vector accumulation sum, the initial depth values constituting a source image initial depth map;
利用所述源图像中每个像素点的场景相关度和所述每个下釆样源图像中 每个像素点的场景相关度对所述初始深度图中每个像素点进行连续超平滑滤 波处理和上釆样处理, 获取所述源图像深度图。 Performing continuous ultra-smoothing filtering on each pixel in the initial depth map by using the scene correlation of each pixel in the source image and the scene correlation of each pixel in each of the squat source images And processing the source image to obtain the depth map of the source image.
在第二方面, 本发明实施例提供了一种提取及优化图像深度图的装置, 所述装置包括: 第一获取单元, 用于获取当前源图像和所述当前源图像中每 个像素点的场景相关度, 所述当前源图像为当前视频连续帧序列; In a second aspect, an embodiment of the present invention provides an apparatus for extracting and optimizing an image depth map, where the apparatus includes: a first acquiring unit, configured to acquire a current source image and each pixel point in the current source image. a scene correlation degree, where the current source image is a current video continuous frame sequence;
第二获取单元, 用于对所述当前源图像连续下釆样, 获取当前每个下釆
样源图像中每个像素点的场景相关度; a second acquiring unit, configured to continuously download the current source image, and obtain each current download The scene correlation of each pixel in the sample source image;
第三获取单元, 用于将所述当前下釆样源图像中每个像素点与之前下釆 样源图像中相对应的像素点进行块匹配运动矢量计算, 获取所述当前下釆样 源图像中每个像素点的运动矢量值; a third acquiring unit, configured to perform block matching motion vector calculation on each pixel point in the current squat sample source image and a pixel point corresponding to the previous squat sample source image, to obtain the current squat sample source image The motion vector value of each pixel in the middle;
计算单元, 用于分别累加所述当前下釆样源图像中每个像素点的运动矢 量值, 从运动矢量累加和中提取每个像素点的初始深度值, 所述初始深度值 构成源图像初始深度图; a calculating unit, configured to separately accumulate motion vector values of each pixel in the current sputum sample source image, and extract an initial depth value of each pixel point from the motion vector accumulation sum, where the initial depth value constitutes a source image initial Depth map
第一处理单元, 用于利用所述源图像中每个像素点的场景相关度和所述 每个下釆样源图像中每个像素点的场景相关度对所述初始深度图中每个像素 点进行连续超平滑滤波处理和上釆样处理, 获取所述源图像深度图。 a first processing unit, configured to use each of the pixels in the initial depth map by using a scene correlation of each pixel in the source image and a scene correlation of each pixel in each of the squat source images The point performs continuous super smoothing filtering processing and upper sampling processing to obtain the depth map of the source image.
通过应用本发明实施例公开的方法和装置, 在不同下釆样阶段求出相应 的场景相关度, 通过运动矢量累加和提取初始深度图, 利用不同釆样阶段的 场景相关度对初始深度图进行迭代超平滑处理, 最终生成源图像深度图, 提 高了深度图的图像质量, 让深度图轮廓更加清晰, 同时本方法也让整个过程 的计算开销保持在合理范围之内。 附图说明 By applying the method and device disclosed in the embodiments of the present invention, the corresponding scene correlation degree is obtained in different lower sampling stages, the initial depth map is accumulated and extracted by the motion vector, and the initial depth map is performed by using the scene correlation degree of different sampling stages. The iterative super smoothing process finally generates the source image depth map, which improves the image quality of the depth map and makes the depth map outline clearer. At the same time, the method also keeps the calculation cost of the whole process within a reasonable range. DRAWINGS
图 1为现有技术提取深度图流程图; 1 is a flow chart of a prior art extraction depth map;
图 2为本发明实施例公开的深度图提取及优化的方法流程图; 2 is a flowchart of a method for extracting and optimizing a depth map according to an embodiment of the present invention;
图 3为本发明实施例当前源图像示意图; 3 is a schematic diagram of a current source image according to an embodiment of the present invention;
图 4为本发明实施例计算任一像素点场景相关度的示意图; 4 is a schematic diagram of calculating a correlation degree of any pixel point scene according to an embodiment of the present invention;
图 5为本发明实施例计算边界上任一像素点场景相关度的示意图; 图 6为本发明实施例源图像的初始深度图; 5 is a schematic diagram of calculating a correlation degree of a scene point of any pixel on a boundary according to an embodiment of the present invention; FIG. 6 is an initial depth diagram of a source image according to an embodiment of the present invention;
图 7为本发明实施例为任一像素点分配权重系数示意图; FIG. 7 is a schematic diagram of assigning weight coefficients to any pixel point according to an embodiment of the present invention; FIG.
图 8为本发明实施例为边界上任一像素点分配权重系数示意图; 图 9为本发明实施例超平滑滤波器的结构图;
图 10为本发明实施例源图像优化后深度图; 8 is a schematic diagram of assigning weight coefficients to any pixel on a boundary according to an embodiment of the present invention; FIG. 9 is a structural diagram of a super smoothing filter according to an embodiment of the present invention; 10 is a depth map of a source image after optimization according to an embodiment of the present invention;
图 11为本发明实施例公开的提取及优化图像深度图的装置图。 具体实施方式 FIG. 11 is a diagram of an apparatus for extracting and optimizing an image depth map according to an embodiment of the present invention. detailed description
为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本发 明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于 本发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提下所获 得的所有其他实施例, 都属于本发明保护的范围。 The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
为便于对本发明实施例的理解, 下面将结合附图以具体实施例做进一步 的解释说明, 实施例并不构成对本发明实施例的限定。 In order to facilitate the understanding of the embodiments of the present invention, the embodiments of the present invention are not to be construed as limited.
以图 1为例详细说明本发明实施例公开的图像处理的方法, 图 2为本发 明实施例公开的深度图提取及优化的方法流程图。 1 is a detailed description of a method for image processing disclosed in an embodiment of the present invention, and FIG. 2 is a flow chart of a method for extracting and optimizing a depth map disclosed in an embodiment of the present invention.
如图 2所示, 在本发明实施例中, 首先获取连续当前源图像, 所述当前 源图像为二维连续帧序列, 提取当前源图像中每个像素点的场景相关度, 对 当前源图像分别经过横向和纵向的两次 1/2下釆样操作, 并在两次 1/2下釆 样后进行相应的提取每个像素点的场景相关度, 获取各阶段分辨率源图像中 每个像素点的的场景相关度。 As shown in FIG. 2, in the embodiment of the present invention, a continuous current source image is first acquired, and the current source image is a two-dimensional continuous frame sequence, and the scene correlation degree of each pixel in the current source image is extracted, and the current source image is obtained. Perform two 1/2 squatting operations in the horizontal and vertical directions respectively, and extract the scene correlation of each pixel after two 1/2 swatches, and obtain each of the resolution source images in each stage. The scene relevance of the pixel.
利用经过两次 1/2下釆样后,分辨率为 1/16的源图像中的像素点与之前 的 1/16 分辨率源图像相对应的像素点进行块匹配运动矢量计算, 得出当前 1/16分辨率源图像中像素点的运动矢量值,累加当前 1/16分辨率源图像中像 素点的运动矢量值, 基于运动矢量累加和提取当前 1/16分辨率源图像中像素 点的初始深度值, 每个像素点的初始深度值形成初始深度图; 但是, 所述初 始深度图的分辨率为源图像的 1/16, 因此轮廓模糊不清晰, 还要对所述初始 深度图进行严格优化处理。 After two 1/2 squats, the pixel points in the source image with a resolution of 1/16 are calculated by the block matching motion vector corresponding to the previous 1/16 resolution source image, and the current The motion vector value of the pixel in the 1/16 resolution source image, accumulating the motion vector value of the pixel in the current 1/16 resolution source image, accumulating and extracting the pixel points in the current 1/16 resolution source image based on the motion vector The initial depth value, the initial depth value of each pixel point forms an initial depth map; however, the resolution of the initial depth map is 1/16 of the source image, so the contour blur is not clear, and the initial depth map is also performed. Strictly optimized processing.
对 1/16分辨率初始深度图进行基于 1/16分辨率场景相关度的超平滑滤
波处理, 并进行四次迭代超平滑滤波; 对迭代超平滑滤波处理完的 1 / 16分辨 率深度图分别进行横向和纵向的两倍上釆样, 得到 1 /4 分辨率初始深度图, 对 1 /4分辨率深度图进行基于 1 /4分辨率场景相关度的超平滑滤波处理, 并 进行两次迭代超平滑滤波; 进一步对处理完的 1 /4 分辨率深度图进行两倍上 釆样得到原始分辨率大小的深度图, 再进行基于场景相关度的一次迭代超平 滑滤波处理, 最后获取到优化处理后的深度图, 具体实现的步骤如下所描述: 步骤 210、 获取二维源图像, 并从源图像中提取场景相关度; Ultra-smooth filtering based on 1/16 resolution scene depth for 1/16 resolution initial depth map Wave processing, and four iterations of ultra-smooth filtering; the 1 / 16 resolution depth map processed by the iterative super-smoothing filter is doubled in the horizontal and vertical directions respectively, and the initial depth map of 1 / 4 resolution is obtained. The 1 / 4 resolution depth map performs super smoothing filtering based on 1 / 4 resolution scene correlation, and performs two iterative super smoothing filtering; further doubles the processed 1 / 4 resolution depth map Obtaining a depth map of the original resolution, performing an iterative super-smoothing filtering process based on the scene correlation degree, and finally obtaining the optimized depth map. The specific implementation steps are as follows: Step 210: Acquire a two-dimensional source image, And extracting scene correlation from the source image;
具体地, 首先获取连续当前源图像, 所述当前源图像为二维连续帧序列, 如图 3所示, 图 3为本发明实施例当前源图像示意图; Specifically, the current source image is obtained first, and the current source image is a two-dimensional continuous frame sequence. As shown in FIG. 3, FIG. 3 is a schematic diagram of a current source image according to an embodiment of the present invention;
同时, 从当前源图像中提取场景相关度; At the same time, the scene correlation degree is extracted from the current source image;
在本发明实施例中, 场景相关度为在一帧图像中任一像素点 (任取一像 素点为中心像素点) 与其周围相邻像素点的相关程度。 利用中心像素点处 R (红) 、 G (绿) 、 B (蓝) 的值依次与周围相邻像素点处 R (红) 、 G (绿) 、 B (蓝) 的值相减, 并取差值的绝对值。 如果某一个方向上的相邻像素的差值 的绝对值小于预先设定的相关度阈值, 那么, 就将该方向上相关度标志槽中 的相关度标志位设置 1 , 否则设置 0。 所述相关度标志槽 buffer []是一个 8位 宽的緩冲器, 从最低位到最高位的 8 个相关度标志位依次存放中心像素点与 其最近的 8个相邻像素点按顺时针顺序旋转的相关度信息。 存储 1为中心像 素点与相邻像素点相关, 存储 0 为中心像素点与相邻像素点不相关。 一个相 关度标志槽映射源图像中的任一个像素点。 In the embodiment of the present invention, the scene correlation degree is the degree of correlation between any pixel point (whether a pixel point is a central pixel point) in one frame image and neighboring pixel points. The values of R (red), G (green), and B (blue) at the center pixel are sequentially subtracted from the values of R (red), G (green), and B (blue) at surrounding pixels, and taken The absolute value of the difference. If the absolute value of the difference between adjacent pixels in a certain direction is less than the preset correlation threshold, then the correlation flag in the correlation flag slot in the direction is set to 1, otherwise 0 is set. The correlation flag slot buffer [] is an 8-bit wide buffer, and the 8 correlation flags from the lowest to the highest bits sequentially store the central pixel and its nearest 8 adjacent pixels in a clockwise order. Rotation correlation information. Storage 1 is the center pixel point associated with the adjacent pixel point, and storage 0 is the center pixel point is not related to the adjacent pixel point. A correlation flag slot maps any pixel in the source image.
如图 4所示, 图 4为本发明实施例计算任一像素点场景相关度的示意图; 其中, 红色像素点为选取的中心像素点, 中心像素点的坐标为 (x,y ) , 与所 述中心像素点相邻的像素点为相邻像素点, 在图 4中, 有 8个相邻像素点, 并将 8个相邻像素点按顺时针编号, 如 0— 7号, 所述编号分别对应着场景相 关度标志槽的最低位至最高位; As shown in FIG. 4, FIG. 4 is a schematic diagram of calculating a correlation degree of any pixel point scene according to an embodiment of the present invention; wherein, a red pixel point is a selected central pixel point, and a coordinate of the center pixel point is (x, y), and The pixel points adjacent to the central pixel point are adjacent pixel points. In FIG. 4, there are 8 adjacent pixel points, and 8 adjacent pixel points are numbered clockwise, such as 0-7, the number Corresponding to the lowest to highest position of the scene correlation flag slot;
根据前述方法, 判断每个相邻像素点与中心像素点的相关程度, 假如在
编号 1的相邻像素点与中心像素点的相关,则在相关度标志槽 buffer [1]中存 储 1 ; 因此, 相关度标志槽 buffer [m]的公式为: According to the foregoing method, determining the degree of correlation between each adjacent pixel point and the central pixel point, if The correlation between the adjacent pixel of number 1 and the central pixel is stored in the correlation flag buffer [1]; therefore, the formula of the correlation flag buffer [m] is:
—- JJ [0, \f(x, y)— /( ± j ^士 | + \f(x, y)— /( ^士 士 + \f(x, y)— /( ± j ^士 > A;—- JJ [0, \f(x, y)— /( ± j ^士 | + \f(x, y)— /(^士士+ \f(x, y)— /( ± j ^士士>A;
(式 1 ) (Formula 1 )
其中, = 0,1; 0 < m≤7; m e Z ; /(x, 、 /(x± t,j 士 )为像素点 R (红) 、 G Where = 0,1; 0 < m≤7; m e Z ; /(x, , /(x± t,j 士 ) is the pixel point R (red), G
(绿) 、 B (蓝)分量的值; A为场景相关度的阈值; ¼#er[ ]为相关度的第 m 位; m为相邻像素点标号。 The values of the (green) and B (blue) components; A is the threshold of the scene correlation; 1⁄4#er[ ] is the mth bit of the correlation; m is the adjacent pixel point label.
在此, 说明一下, 在计算边界上像素点相关度的情况, 如图 5所示, 图 5 为本发明实施例计算边界上任一像素点场景相关度的示意图; 其中, 红色像 素点为选取的中心像素点, 中心像素点的坐标为 (x,y ) , 与所述中心像素点 相邻的像素点为相邻像素点, 在图 5中, 中心像素点的坐标取 x=0和 y=0, 即 中心像素点位于当前源图像的第一行, 第一列, 此时, 编号的方式与前述相 同, 只需计算虚线框内的编号为 2、 3、 4像素点的相关度, 编号为 0、 1、 5、 6、 7、 像素点不存在, 因此, 直接将相关度标志槽 buffer [0]、 buffer [1]、 buffer [5]、 buffer [6]、 buffer [7]赋值为 0, 其它边界位置上的像素点处理 方法与之相同, 因此, 不再赘述。 Here, in the case of calculating the pixel point correlation on the boundary, as shown in FIG. 5, FIG. 5 is a schematic diagram of calculating the correlation degree of any pixel point on the boundary according to an embodiment of the present invention; wherein, the red pixel point is selected The central pixel, the coordinates of the central pixel are (x, y), and the pixel adjacent to the central pixel is an adjacent pixel. In FIG. 5, the coordinates of the central pixel are taken as x=0 and y= 0, that is, the central pixel is located in the first row of the current source image, the first column. At this time, the numbering is the same as the above, and only the correlation of the number 2, 3, and 4 pixels in the dotted frame is calculated, and the number is For 0, 1, 5, 6, and 7, the pixel does not exist. Therefore, the correlation flag buffers [0], buffer [1], buffer [5], buffer [6], and buffer [7] are directly assigned. 0, the pixel point processing method at other boundary positions is the same, and therefore, will not be described again.
需要说明的是,上述描述的计算相关度是以 1个像素点为例进行说明的, 在实际计算中, 均要对每个像素点进行计算, 在源图像中每个像素点经计算 后, 均存在 1 个相关度标志槽, 所有像素点的所有相关度标志槽构成了当前 源图像的场景相关度。 It should be noted that the calculation correlation described above is described by taking one pixel as an example. In the actual calculation, each pixel is calculated, and after each pixel in the source image is calculated, There is one correlation flag slot, and all the correlation flag slots of all the pixels constitute the scene correlation of the current source image.
步骤 220、对源图像进行横向和纵向 1/2下釆样,获取 1/4分辨率源图像, 并从 1/4分辨率源图像中提取场景相关度; Step 220: Perform horizontal and vertical 1/2 squatting on the source image, obtain a 1/4 resolution source image, and extract a scene correlation degree from the 1/4 resolution source image;
具体地, 对获取的当前源图像分别经过横向和纵向的 1/2下釆样操作, 并在 1/2下釆样后, 从 1/4分辨率源图像的每个像素点中提取场景相关度, 获取 1/4分辨率源图像和 1/4分辨率源图像中每个像素点的场景相关度。 Specifically, the obtained current source image is subjected to horizontal and vertical 1/2 squatting operations, and after 1/2 squatting, scene correlation is extracted from each pixel of the 1/4 resolution source image. Degree, obtains the scene correlation of each pixel in the 1/4 resolution source image and the 1/4 resolution source image.
在当前 1/4分辨率的釆样阶段, 用步骤 210描述的方法计算出 1/4分辨
率源图像中每个像素点场景相关度。 In the current 1/4 resolution sampling phase, the 1/4 resolution is calculated using the method described in step 210. The scene relevance of each pixel in the source image.
需要说明的是, 对源图像的下釆样处理为现有技术, 在此不再赘述。 步骤 230、 对 1/4分辨率源图像再次进行横向和纵向 1/2下釆样, 获取 1/16分辨率源图像, 并从 1/16分辨率源图像中提取场景相关度; It should be noted that the processing of the source image is a prior art, and details are not described herein again. Step 230: Perform horizontal and vertical 1/2 squatting on the 1/4 resolution source image again, obtain a 1/16 resolution source image, and extract a scene correlation degree from the 1/16 resolution source image;
具体地, 对获取的 1/4分辨率源图像分别经过横向和纵向的 1/2下釆样 操作,并在 1/2下釆样后,从 1/16分辨率源图像中提取场景相关度,获取 1/16 分辨率源图像和 1/16分辨率源图像中每个像素点的场景相关度。 Specifically, the acquired 1/4 resolution source image is subjected to horizontal and vertical 1/2 squatting operations, and after 1/2 squatting, the scene correlation is extracted from the 1/16 resolution source image. Get the scene correlation of each pixel in the 1/16 resolution source image and the 1/16 resolution source image.
在当前 1/16分辨率的釆样阶段, 用步骤 210描述的方法计算出 1/16分 辨率源图像中每个像素点场景相关度。 At the current 1/16 resolution stage, the pixel correlation of each pixel in the 1/16 resolution source image is calculated using the method described in step 210.
需要说明的是, 对 1/4分辨率源图像的下釆样处理为现有技术, 在此不 再赘述。 It should be noted that the processing of the 1/4 resolution source image is prior art and will not be described here.
步骤 240、 1/16分辨率源图像与之前 1/16分辨率源图像进行块匹配运动 矢量计算; Step 240: The 1/16 resolution source image performs block matching motion vector calculation with the previous 1/16 resolution source image;
具体地,利用步骤 230中,经下釆样后的 1 / 16分辨率源图像与之前的 1 / 16 分辨率源图像进行块匹配运动矢量计算, 获取当前 1/16分辨率源图像中每个 像素点的运动矢量值, 并对获取的当前 1/16分辨率源图像中每个像素点的运 动矢量值累加。 Specifically, in step 230, the 1/16 resolution source image after the sample is compared with the previous 1/16 resolution source image for block matching motion vector calculation, and each of the current 1/16 resolution source images is obtained. The motion vector value of the pixel, and the motion vector value of each pixel in the current 1/16 resolution source image is accumulated.
需要说明的是, 基于块匹配的运动矢量累加也为现有技术, 在此不再赘 述。 It should be noted that the motion vector accumulation based on block matching is also a prior art, and is not described here.
步骤 250、 运动矢量累加和中提取初始深度值, 形成初始深度图; 具体地, 根据步骤 240的描述, 获取当前 1/16分辨率源图像中每个像素 点的运动矢量值累加, 从所述运动矢量累加和中提取每个像素点的初始深度 值, 对 1/16分辨率源图像中全部像素点均提取初始深度值, 全部像素点的初 始深度值形成 1/16分辨率源图像的初始深度图; Step 250: extracting an initial depth value from the motion vector accumulation and summing, forming an initial depth map; specifically, acquiring motion vector value summation of each pixel point in the current 1/16 resolution source image according to the description of step 240, The motion vector accumulates and extracts the initial depth value of each pixel, and extracts the initial depth value for all the pixels in the 1/16 resolution source image, and the initial depth value of all the pixels forms the initial image of the 1/16 resolution source image. Depth map
在此, 说明一下, 对每个像素点基于运动矢量累加和中提取初始深度值; 假定, 连续两个源图像中运动物体的最大偏移量为当前源图像的 3.5%宽
度, 此时, 所代表的运动矢量值对应的灰度值为 255 , 那么单位像素位移所代 表的灰度值大小如下公式: Here, it is explained that the initial depth value is extracted based on the motion vector accumulation sum for each pixel point; it is assumed that the maximum offset of the moving object in the two consecutive source images is 3.5% wide of the current source image. Degree, at this time, the gray value corresponding to the motion vector value represented by the value is 255, then the gray value represented by the unit pixel displacement is as follows:
1 = 255 (式 2 ) 1 = 255 (Equation 2)
W *3.5% W *3.5%
其中, W为图像的宽度; Where W is the width of the image;
若计算得到的图像块运动矢量模为表 1 所示的值, 在此, 以举例的方式 说明, 表 1中计算出 9个运动矢量模。 If the calculated image block motion vector modulus is the value shown in Table 1, here, by way of example, nine motion vector modes are calculated in Table 1.
那么, 上述 9个运动矢量模对应的灰度值为: Then, the gray values corresponding to the above nine motion vector modes are:
表 2 运动矢量灰度值
在前述已说明获取的源图像是二维视频帧序列, 从所述二维帧序列中提 取任一像素点的深度信息, 为了保持像素点在停止运动之后, 其深度值仍然 存在, 以便于随时获取其运动信息, 将任一像素点的深度值存入深度暂存器 中。 否则, 一旦像素点在当前源图像中停止了运动, 那么, 之后源图像中该 像素点的运动矢量就会为零, 此时, 如果直接由当前像素点运动矢量值计算 深度信息就会获取错误的结果。 因此, 深度暂存器存放的为像素点之前的深 度信息的累加值, 由于深度暂存器是存在最大值的, 所以, 限制深度暂存器 的最大值为 ¾to,。 Table 2 Motion vector gray value The source image obtained in the foregoing is a sequence of two-dimensional video frames, and the depth information of any pixel point is extracted from the two-dimensional frame sequence. In order to keep the pixel point after the motion is stopped, the depth value still exists, so that the time is convenient. Get its motion information and store the depth value of any pixel in the depth register. Otherwise, once the pixel stops moving in the current source image, then the motion vector of the pixel in the source image will be zero. At this time, if the depth information is directly calculated from the current pixel motion vector value, an error will be obtained. the result of. Therefore, the depth register stores the accumulated value of the depth information before the pixel. Since the depth register has the maximum value, the maximum value of the limit register is 3⁄4 to .
由于在前述中已经获取任一像素点的灰度值, 当前深度图全部灰度值的 累加和为!) 深度暂存器中之前所有深度图的全部灰度值累加和为 若 一直把 D 简单的加到 Dacc中, 最终会超过深度暂存器累加和的最大值 而
导致溢出, 导致像素点深度信息流失; 因此, 在本发明实施例中, 如象 D + Dacc <D 时, 则 1 ∞— (X, = (X, + (式 3 ) 如果 Ζ^+Ζ) >¾to,时, 则 Dacc depth (X, y) = Dacc depth (X, y) * (式 4 ) Since the gray value of any pixel point has been obtained in the foregoing, the cumulative sum of all gray values of the current depth map is! The total gray value summation of all previous depth maps in the depth register is such that if D is simply added to D acc , it will eventually exceed the maximum value of the depth register summation. Causes overflow, resulting in pixel point depth information loss; therefore, in the embodiment of the present invention, as in D + D acc < D, then 1 ∞ - (X, = (X, + (Formula 3) if Ζ^ + Ζ >3⁄4 to , then D acc depth (X, y) = D acc depth (X, y) * (Equation 4)
D < Q J^]|J Q . ( ζ ) D < Q J^]|J Q . ( ζ )
D D _ D D _
t Dtotal _ Dnew ' m.i D—, -D, t D total _ D new ' mi D—, -D,
> 1, 贝' J new 1。 (式 6 ) 其中 0 x h-l, 0 y w-l h w分别为下釆样 1/16分辨率源图像的 高度和宽度。 D 表示为每个像素点之前运动矢量灰度值的累加和, > 1, 贝' J new 1. (Expression 6) where 0 x hl, 0 y wl hw are the height and width of the 1/16 resolution source image, respectively. D represents the sum of the gray values of the motion vectors before each pixel,
Dnew_depth(^y)表示为每个像素点当前运动矢量灰度值。 D new _depth (^y) represents the current motion vector gradation value for each pixel.
需要说明的是, 上述描述的从运动矢量累加和中提取初始深度值是以部分 像素点为例进行说明的,在实际计算中,均要对每个像素点进行提取,在 1/16 分辨率源图像中提取每个像素点初始深度值后, 形成 1/16分辨率源图像的初 始深度图, 如图 6所示, 图 6为本发明实施例源图像的初始深度图。 It should be noted that the initial depth value extracted from the motion vector accumulation sum described above is described by taking some pixel points as an example. In the actual calculation, each pixel point is extracted, at 1/16 resolution. After extracting the initial depth value of each pixel in the source image, an initial depth map of the 1/16 resolution source image is formed. As shown in FIG. 6, FIG. 6 is an initial depth map of the source image according to an embodiment of the present invention.
步骤 260、对 1/16分辨率初始深度图进行超平滑滤波处理,和上釆样处理; 具体地, 从图 6的初始深度图可知, 由于在步骤 250中, 块匹配运动矢量 计算过程中, 存在较大误差, 导致所提取的初始深度图轮廓模糊不清晰, 因 此, 在本步骤中对 1/16分辨率初始深度图进行严格优化处理。 Step 260: Perform super-smoothing filtering processing on the 1/16-resolution initial depth map, and uploading the sample processing; specifically, from the initial depth map of FIG. 6, since the block matching motion vector is calculated in step 250, There is a large error, which causes the extracted initial depth map to be blurred and unclear. Therefore, in this step, the 1/16 resolution initial depth map is strictly optimized.
根据步骤 230的描述, 在步骤 230中获取 1/16分辨率源图像的场景相关 度, 因此, 根据获取的 1/16分辨率源图像的场景相关度对 1/16分辨率初始 深度图进行超平滑滤波处理, 并进行四次迭代滤波; 然后, 对迭代超平滑滤 波处理完的 1/16分辨率初始深度图分别进行横向和纵向的两倍上釆样, 得到 1/4分辨率初始深度图。 According to the description of step 230, the scene correlation degree of the 1/16 resolution source image is acquired in step 230, and therefore, the 1/16 resolution initial depth map is super-according to the acquired scene correlation degree of the 1/16 resolution source image. Smoothing the filtering process and performing four iterative filtering; Then, the 1/16 resolution initial depth map processed by the iterative ultra-smoothing filtering is doubled in the horizontal and vertical directions respectively to obtain a 1/4 resolution initial depth map. .
在本发明实施例中, 根据步骤 230的描述, 已获取了 1/16分辨率源图像 像素点的场景相关度, 根据 1/16分辨率源图像像素点的场景相关度对 1/16 分辨率初始深度图进行优化处理; 在计算相关度中定义了与中心像素点相邻
的像素点, 在本步骤中的超平滑滤波处理中, 再将每个相邻像素点分配不同 的权重系数, 如图 7所示, 图 7为本发明实施例为任一像素点分配权重系数 示意图; In the embodiment of the present invention, according to the description of step 230, the scene correlation degree of the 1/16 resolution source image pixel point has been acquired, and the scene correlation degree of the 1/16 resolution source image pixel point is 1/16 resolution. The initial depth map is optimized; adjacent to the central pixel is defined in the calculation correlation In the super smoothing filtering process in this step, each adjacent pixel point is assigned a different weight coefficient, as shown in FIG. 7, FIG. 7 is a weight coefficient of any pixel point according to an embodiment of the present invention. schematic diagram;
每个相邻像素点的权重系数分别作为超平滑滤波器的滤波抽头系数。所述 超平滑滤波器为低通滤波器, 由于该滤波器系数因子为 8个, 并且有规律的 分布在中心像素点的 8个方向上, 所以, 滤波性能高, 可以有效的平滑初始 深度图中凹凸锐利的高频噪声和高频分量。 The weighting coefficient of each adjacent pixel is used as the filtering tap coefficient of the super smoothing filter, respectively. The super smoothing filter is a low pass filter. Since the filter coefficient factor is 8 and is regularly distributed in 8 directions of the central pixel point, the filtering performance is high, and the initial depth map can be effectively smoothed. High-frequency noise and high-frequency components with sharp ridges.
当选取的中心像素点不在初始深度图的边界上时,根据中心像素点处的相 关度标志槽, 获取中心像素点与 8个相邻像素点的相关情况。 如果某一相邻 像素点与中心像素点相关度为 1 ,则用相邻像素点的灰度值乘以该相邻像素点 的权重系数, 如果某一相邻像素点与中心像素点相关度为 0 , 则用相邻像素点 的权重系数乘以中心像素点的灰度值, 最后, 将 8个相邻像素点相乘的结果 累加起来作为对 1 / 16分辨率初始深度图平滑滤波后的结果。 When the selected central pixel point is not on the boundary of the initial depth map, the correlation between the central pixel point and the 8 adjacent pixel points is obtained according to the correlation degree flag slot at the central pixel point. If the degree of correlation between a neighboring pixel and the central pixel is 1, the gray value of the adjacent pixel is multiplied by the weight coefficient of the adjacent pixel, if the correlation between a neighboring pixel and the central pixel If 0, the weight coefficient of the adjacent pixel is multiplied by the gray value of the central pixel. Finally, the result of multiplying 8 adjacent pixels is added as a smoothing filter for the initial depth map of 1 / 16 resolution. the result of.
图 8 为本发明实施例对边界上任一像素点分配权重系数示意图; 如图 8 所示, 其中, 红色像素点为选取的中心像素点, 中心像素点的坐标为(x,y ) , 与所述中心像素点相邻的像素点为相邻像素点, 在图 8 中, 中心像素点的坐 标取 x=0和 y=0 , 即中心像素点位于当前源图像的第一行, 第一列, 此时, 编 号的方式与前述相同, 只需根据虚线框内的编号为 2、 3、 4像素点的相关度 进行滤波,编号为 0、 1、 5、6、7、像素点不存在,因此,相关度标志槽 buffer [0]、 buffer [ 1 ]、 buffer [5]、 buffer [6]、 buffer [7]值为 0 , 其它边界位置上的像 素点处理方法与之相同, 因此, 不再赘述。 FIG. 8 is a schematic diagram of assigning weight coefficients to any pixel on a boundary according to an embodiment of the present invention; as shown in FIG. 8 , wherein a red pixel is a selected central pixel, and a coordinate of the central pixel is (x, y), The pixel points adjacent to the center pixel are adjacent pixels. In Figure 8, the coordinates of the center pixel point are x=0 and y=0, that is, the center pixel point is located in the first line of the current source image, the first column. In this case, the numbering method is the same as the above, and only needs to be filtered according to the correlation degree of the number 2, 3, and 4 pixels in the dotted line frame, and the numbers are 0, 1, 5, 6, and 7, and the pixel points do not exist. Therefore, the correlation flag slots buffer [0], buffer [1], buffer [5], buffer [6], and buffer [7] have values of 0, and the pixel processing methods at other boundary positions are the same, therefore, Let me repeat.
图 9为本发明实施例超平滑滤波器的结构图, 如图 9所示, 图 9中的 coef 0-coef 7为相邻像素点的权重系数, 也为超平滑滤波器的抽头系数; 在本 发明实施例中,设定 coef 0= coef 2= coef 4= coef 6=1 /6 ; coef 1= coef 3= coef 5= coef 7=l / 12 ; 在设定权重系数时, 要满足 8个相邻像素点的权重系数和为 1 , 即 coef 0+ coef 1+ coef 2+coef 3+ coef 4+coef 5+ coef 6+ coef 7=l。
因此, 对任一像素点进行滤波的公式为:9 is a structural diagram of a super smoothing filter according to an embodiment of the present invention. As shown in FIG. 9, coef 0-coef 7 in FIG. 9 is a weight coefficient of adjacent pixel points, and is also a tap coefficient of the super smoothing filter; In the embodiment of the present invention, setting coef 0=coef 2= coef 4= coef 6=1 /6 ; coef 1= coef 3= coef 5= coef 7=l / 12 ; when setting the weight coefficient, it is necessary to satisfy 8 The sum of the weight coefficients of adjacent pixels is 1 , that is, coef 0+ coef 1+ coef 2+coef 3+ coef 4+coef 5+ coef 6+ coef 7=l. Therefore, the formula for filtering any pixel is:
(式 7 ) (Formula 7)
其中, " eZ,« = 0,1,2,3 ; 0M#er[]为相邻像素点的场景相关度; ~¼#er[]为相 邻像素点的场景相关度的取反; f(x, 为中心像素点 (X, y)处的灰度值。 Where "eZ,« = 0,1,2,3 ; 0M#er[] is the scene correlation of adjacent pixels; ~1⁄4#er[] is the inverse of the scene correlation of adjacent pixels; f (x, the gray value at the center pixel (X, y).
对所述 1/16分辨率初始深度图进行四次迭代超平滑滤波处理完成后, 对 迭代超平滑滤波处理完的 1/16分辨率初始深度图中每个像素点分别进行横向 和纵向的两倍上釆样, 获取每个 1/4分辨率像素点的深度值, 每个 1/4分辨 率像素点的深度值形成 1/4分辨率深度图, 得到 1/4分辨率深度图。 After performing four iterations of the ultra-smoothing filtering process on the 1/16 resolution initial depth map, each pixel in the 1/16 resolution initial depth map processed by the iterative super-smoothing filtering is respectively performed in two horizontal and vertical directions. The depth value of each 1/4 resolution pixel is obtained, and the depth value of each 1/4 resolution pixel is formed into a 1/4 resolution depth map to obtain a 1/4 resolution depth map.
需要说明的是, 上述描述的根据相关度对初始深度图滤波是以 1个像素 点为例进行说明的, 在实际计算中, 均要对每个像素点进行滤波。 It should be noted that the filtering of the initial depth map according to the correlation is described by taking one pixel as an example. In the actual calculation, each pixel is filtered.
对迭代超平滑滤波处理完的 1/16分辨率初始深度图的上釆样处理为现有 技术, 在此不再赘述。 The processing of the 1/16 resolution initial depth map processed by the iterative super smoothing filter is prior art, and will not be described here.
步骤 270、 对 1/4分辨率深度图进行超平滑滤波处理, 和上釆样处理; 具体地, 根据步骤 260获取 1/4分辨率深度图, 根据步骤 220的描述, 在步骤 220中获取 1/4分辨率源图像的场景相关度, 因此, 根据获取的 1/4 分辨率源图像的场景相关度对 1/4 分辨率深度图进行超平滑滤波处理, 并进 行两次迭代滤波; 然后, 对迭代超平滑滤波处理完的 1/4 分辨率初始深度图 分别进行横向和纵向的两倍上釆样, 获取每个原始分辨率像素点的深度值, 每个原始分辨率像素点的深度值形成原始分辨率深度图, 得到原始分辨率的 初始深度图; Step 270: Perform super-smooth filtering processing on the 1/4-resolution depth map, and perform a sample-like processing. Specifically, obtain a 1/4-resolution depth map according to step 260, and obtain step 1 in step 220 according to the description of step 220. /4 resolution of the scene correlation of the source image, therefore, super-smoothing filtering processing on the 1/4-resolution depth map according to the scene correlation degree of the acquired 1/4-resolution source image, and performing two iterative filtering; The 1/4 resolution initial depth map processed by the iterative super-smoothing filter is respectively subjected to horizontal and vertical double-dip, and the depth value of each original resolution pixel is obtained, and the depth value of each original resolution pixel is obtained. Forming a raw resolution depth map to obtain an initial depth map of the original resolution;
在本步骤中的滤波过程中, 用步骤 260描述的方法对 1/4分辨率深度图 进行超平滑滤波。 In the filtering process in this step, the 1/4 resolution depth map is super-smooth filtered by the method described in step 260.
步骤 280、 获取优化处理后的深度图; Step 280: Obtain a depth map after the optimization process.
具体地, 根据步骤 270获取原始分辨率深度图, 根据步骤 210的描述, 在步骤 210 中获取源图像的场景相关度, 因此, 根据获取的源图像的场景相
关度对原始分辨率深度图进行一次迭代超平滑滤波处理; 最后, 获取源图像 深度图。 Specifically, the original resolution depth map is obtained according to step 270, and according to the description of step 210, the scene relevance of the source image is acquired in step 210, and therefore, according to the acquired scene image of the source image The degree of attenuation performs an iterative super smoothing process on the original resolution depth map. Finally, the source image depth map is obtained.
如图 10所示, 图 10为源图像优化处理后深度图; 与图 6源图像的初始 深度图相比较, 初始深度图分辨率较低, 像素点较少, 图像轮廓不清晰, 在 进行较多次迭代超平滑滤波和上釆样后, 初始深度图分辨率升高, 像素点变 多, 深度图轮廓更加清晰, 提高了深度图的图像质量。 As shown in FIG. 10, FIG. 10 is a depth map after source image optimization processing; compared with the initial depth map of the source image of FIG. 6, the initial depth map has lower resolution, fewer pixels, and the image outline is unclear. After multiple iterations of ultra-smooth filtering and uploading, the resolution of the initial depth map is increased, the number of pixels is increased, and the contour of the depth map is more clear, which improves the image quality of the depth map.
通过应用本发明实施例公开的方法, 在不同下釆样阶段求出相应的场景 相关度, 通过运动矢量累加和提取初始深度图, 利用不同下釆样阶段的场景 相关度对初始深度图进行迭代超平滑处理, 同时进行上釆样处理, 最终生成 源图像深度图, 提高了深度图的图像质量, 让深度图轮廓更加清晰, 同时本 方法也让整个过程的计算开销保持在合理范围之内。 By applying the method disclosed in the embodiment of the present invention, the corresponding scene correlation degree is obtained in different lower sampling stages, the initial depth map is accumulated and extracted by the motion vector, and the initial depth map is iterated by using the scene correlation degree of different lower sampling stages. Ultra-smooth processing, simultaneous sample processing, and finally generate source image depth map, improve the image quality of the depth map, make the depth map outline clearer, and the method also keeps the calculation cost of the whole process within a reasonable range.
相应地, 上述实施例是对提取及优化图像深度图的方法描述, 相应地, 也可用图像处理的装置实现。 如图 1 1所示, 图 11为本发明实施例公开的提 取及优化图像深度图的装置图。 所述提取及优化图像深度图的装置包括: 第 一获取单元 1110 , 用于获取当前源图像和所述当前源图像中每个像素点的场 景相关度, 所述当前源图像为当前视频连续帧序列; Accordingly, the above embodiment is a description of a method for extracting and optimizing an image depth map, and correspondingly, it can also be implemented by an image processing device. As shown in FIG. 11, FIG. 11 is a device diagram for extracting and optimizing an image depth map according to an embodiment of the present invention. The device for extracting and optimizing an image depth map includes: a first acquiring unit 1110, configured to acquire a scene correlation degree of each pixel point in the current source image and the current source image, where the current source image is a current video continuous frame Sequence
第二获取单元 1 120 , 用于对所述当前源图像连续下釆样, 获取当前每个 下釆样源图像中每个像素点的场景相关度; a second acquiring unit 1120, configured to continuously sample the current source image, and obtain a scene correlation degree of each pixel in each of the current squatting source images;
第三获取单元 11 30 , 用于将所述当前下釆样源图像中每个像素点与之前 下釆样源图像中相对应的像素点进行块匹配运动矢量计算, 获取所述当前下 釆样源图像中每个像素点的运动矢量值; The third obtaining unit 11 30 is configured to perform block matching motion vector calculation on each pixel point in the current squat sample source image and a pixel point corresponding to the previous squat sample source image, to obtain the current squat sample The motion vector value of each pixel in the source image;
计算单元 1140 , 用于分别累加所述当前下釆样源图像中每个像素点的运 动矢量值, 从运动矢量累加和中提取每个像素点的初始深度值, 所述初始深 度值构成源图像初始深度图; The calculating unit 1140 is configured to separately accumulate motion vector values of each pixel in the current sputum sample source image, and extract an initial depth value of each pixel point from the motion vector accumulation sum, where the initial depth value constitutes a source image Initial depth map;
第一处理单元 1150 , 用于利用所述源图像中每个像素点的场景相关度和 所述每个下釆样源图像中每个像素点的场景相关度对所述初始深度图中每个
像素点进行连续超平滑滤波处理和上釆样处理, 获取所述源图像深度图。 所述装置中, 第一获取单元 1110 具体用于: 选择任一像素点作为中心像 素点, 将与所述中心像素点相邻像素点标号; a first processing unit 1150, configured to use each of the initial depth maps by using a scene correlation degree of each pixel point in the source image and a scene correlation degree of each pixel point in each of the squat sample source images The pixel points are subjected to continuous super smoothing filtering processing and upper sampling processing to obtain the source image depth map. In the device, the first acquiring unit 1110 is specifically configured to: select any pixel point as a central pixel point, and mark a pixel point adjacent to the central pixel point;
获取所述中心像素点红 R、 绿0、 蓝 B分量值与每个所述相邻像素点红 R、 5 绿0、 蓝 B分量值的差值, 并对所述差值取绝对值; Obtaining a difference between the central pixel red R, green 0, and blue B component values and each of the adjacent pixel red R, 5 green 0, and blue B component values, and taking an absolute value of the difference;
将所述绝对值与场景相关度阈值相比较, 如果所述绝对值小于场景相关度 阈值, 则将所述相邻像素点的场景相关度设置为 1相关, 否则, 设置为 0不 相关; Comparing the absolute value with a scene correlation threshold, if the absolute value is smaller than the scene correlation threshold, setting the scene correlation of the adjacent pixel to 1 correlation; otherwise, setting 0 to be irrelevant;
将所述相邻像素点的场景相关度存储在緩冲器中, 所述緩冲器具体为 Store the scene correlation of the adjacent pixel points in a buffer, where the buffer is specifically
1Π Γ , i / j — / (^士 ^ 士^)^ /(^,3 — / (^士
/ (^士 ^ 士^)^ 丄 U buffer[m] = < 1Π Γ , i / j — / (^士^士^)^ /(^,3 — / (^士 / (^士^士^)^ 丄U buffer[m] = <
[0, y) /0士 :, y士 + y) /0士 :, y士 + y) /0士 :, y士 > A; 其中, = 0,1; 0<m≤7;meZ ; /(x,j)、 /(x士 士 A)为像素点红 R、 绿 G、 蓝 B 分量的值; A为场景相关度阈值; ¼#er[ ]为相关度的第 m位; m为相邻像素 点标号。 [0, y) /0士:, y士+ y) /0士:, y士+ y) /0士:, y士 >A; where, = 0,1; 0<m≤7;meZ ; /(x,j), /(x士士A) are the values of the pixel red R, green G, and blue B components; A is the scene correlation threshold; 1⁄4# e r[ ] is the mth bit of the correlation; m is the adjacent pixel point number.
所述装置中, 第二获取单元 1120 具体用于: 对所述当前源图像进行横向 15 和纵向的 1/2下釆样, 获取当前 1/4分辨率源图像和当前 1/4分辨率源图像 中每个像素点的场景相关度; In the device, the second obtaining unit 1120 is specifically configured to: perform horizontal 15 and vertical 1/2 sampling on the current source image, and obtain a current 1/4 resolution source image and a current 1/4 resolution source. The scene correlation of each pixel in the image;
对所述当前 1/4分辨率源图像进行横向和纵向的 1/2下釆样, 获取当前 1/16分辨率源图像和当前 1/16分辨率源图像中每个像素点的场景相关度。 Perform horizontal and vertical 1/2 squatting on the current 1/4 resolution source image to obtain scene correlation degree of each pixel point in the current 1/16 resolution source image and the current 1/16 resolution source image. .
所述装置中, 第三获取单元 1130具体用于: 将所述当前 1/16分辨率源 0 图像中每个像素点与之前的所述 1 / 16分辨率源图像中相对应的像素点进行块 匹配运动矢量计算, 获取所述当前 1/16分辨率源图像中每个像素点的运动矢 量值; In the device, the third obtaining unit 1130 is specifically configured to: perform, for each pixel point in the current 1/16th resolution source 0 image, a pixel point corresponding to the previous 1/16 resolution source image. Block matching motion vector calculation, acquiring a motion vector value of each pixel in the current 1/16 resolution source image;
分别累加所述当前 1/16分辨率源图像中每个像素点的运动矢量值。 The motion vector values of each pixel in the current 1/16 resolution source image are separately accumulated.
所述装置中, 计算单元 1140 具体用于: 获取每个像素点位移的运动矢量 5 模和单位像素位移灰度值, 所述单位像素位移灰度值为 1= 255 , W为图像 In the device, the calculating unit 1140 is specifically configured to: acquire a motion vector 5 mode and a unit pixel displacement gray value of each pixel point displacement, where the unit pixel displacement gray value is 1= 255 , and W is an image.
if* 3.5%
的宽度; If* 3.5% Width
将所述运动矢量模与所述单位像素位移灰度值相乘, 获取所述每个像素点 的运动矢量灰度值; Multiplying the motion vector mode by the unit pixel displacement gray value to obtain a motion vector gray value of each pixel point;
将所述每个像素点的运动矢量灰度值的累加和存储在深度暂存器中; 如果 ¾OT + Dacc < Dtotal; 则 j) = Dacc_depth <Λ + —depth ^, ;And accumulating the sum of the motion vector gray values of each pixel in the depth register; if 3⁄4 OT + D acc < D total; then j) = D acc_depth <Λ + —depth ^, ;
^口果 1 D new +D acc > D ttottall ; " ^ D acc _ d ,ept th,(x,y) = D acc _ d ,epth x,y)*D,0,al ^口果1 D new +D acc > D t t ot t al l ; " ^ D acc _ d , ept t h, (x, y) = D acc _ d , epth x, y) * D, 0, Al
D D
D ^ t—otal, _D ^. new < Q J||J D ^ t—otal, _D. D ^ t—otal, _D ^. new < Q J||J D ^ t—otal, _D.
DL D D L D
D t tai― D, new D—, _D D t ta i― D, new D—, _D
> 1, 则 total 1; > 1, then total 1;
D acc D a D acc D a
其中, 所述 为每个像素点坐标; D 为每个像素点之前运动 矢量灰度值的累加和; 为每个像素点当前运动矢量灰度值; 为 深度暂存器累加和的最大值, 1) 为当前深度图全部灰度值的累加和; ∞为 深度暂存器中之前所有深度图的全部灰度值累加和。 Wherein, the coordinate is the coordinates of each pixel; D is the cumulative sum of the gray values of the motion vectors before each pixel; the gray value of the current motion vector for each pixel; the maximum value of the sum of the depth registers, 1) is the sum of the total gray values of the current depth map; ∞ is the sum of all the gray values of all previous depth maps in the depth register.
所述装置中, 第一处理单元 1150 具体用于: 为所述每个相邻像素点分配 权重系数, 所述权重系数为超平滑滤波的抽头系数; In the device, the first processing unit 1150 is specifically configured to: assign a weight coefficient to each of the adjacent pixel points, where the weight coefficient is a tap coefficient of the super smoothing filter;
调用所述緩冲器中存储的所述相邻像素点的场景相关度; Retrieving a scene correlation of the adjacent pixel points stored in the buffer;
如果所述相邻像素点的场景相关度为 1相关, 则将相邻像素点灰度值与相 邻像素点分配的权重系数相乘; If the scene correlation degree of the adjacent pixel points is 1 correlation, multiplying the adjacent pixel point gray value by the weight coefficient of the adjacent pixel point allocation;
如果所述相邻像素点的场景相关度为 0不相关, 则将中心像素点灰度值与 相邻像素点分配的权重系数相乘; If the scene correlation degree of the adjacent pixel points is 0, the center pixel point gray value is multiplied by the weight coefficient of the adjacent pixel point allocation;
累加所述相邻像素点灰度值与相邻像素点分配的权重系数相乘的值, 以及 所述中心像素点灰度值与相邻像素点分配的权重系数相乘的值;
And accumulating a value obtained by multiplying the gray value of the adjacent pixel point by a weight coefficient assigned by an adjacent pixel point, and a value obtained by multiplying the gray value of the central pixel point by a weight coefficient assigned by an adjacent pixel point;
其中, "eZ,« = 0,l,2,3 ; ¼#er[]为相邻像素点的场景相关度; ~¼#er[]为相 邻像素点的场景相关度的取反; fix, 为中心像素点 (X, y)处的灰度值。
所述装置中, 第一处理单元 1150 进一步具体用于: 对所述初始深度图进 行四次迭代超平滑滤波处理, 对所述经过四次迭代超平滑滤波处理后的深度 图进行横向和纵向的两倍上釆样; Where "eZ,« = 0,l,2,3 ; 1⁄4#er[] is the scene correlation of adjacent pixels; ~1⁄4#er[] is the inverse of the scene correlation of adjacent pixels; , is the gray value at the center pixel (X, y). In the device, the first processing unit 1150 is further specifically configured to: perform four iterations of the ultra-smoothing filtering process on the initial depth map, and perform horizontal and vertical depth mapping on the depth map after the four iterations of the ultra-smooth filtering process. Doubled up;
获取每个 114分辨率像素点的深度值, 所述每个 114分辨率像素点的深度 值形成 1 /4分辨率深度图; Obtaining depth values for each of the 114 resolution pixel points, the depth values of each of the 114 resolution pixel points forming a 1/4 resolution depth map;
对所述 1 /4分辨率深度图进行两次迭代超平滑滤波处理, 对所述经过两次 迭代超平滑滤波处理后的深度图进行横向和纵向的两倍上釆样; Performing two iterative super-smoothing filtering processes on the 1/4 resolution depth map, and performing horizontal and vertical double-draw on the depth map after the two iterations of ultra-smooth filtering;
获取每个原始分辨率像素点的深度值, 所述每个原始分辨率像素点的深度 值形成原始分辨率深度图; Obtaining depth values of each of the original resolution pixel points, the depth values of each of the original resolution pixel points forming an original resolution depth map;
对所述原始分辨率深度图进行一次迭代超平滑滤波处理, 获取源图像深 度图。 An iterative super-smoothing filtering process is performed on the original resolution depth map to obtain a source image depth map.
所述装置中, 所述为所述每个相邻像素点分配权重系数具体为: 累加相 邻像素点的权重系数和为 1。 In the device, the assigning a weight coefficient for each adjacent pixel is specifically: adding a weight coefficient sum of 1 to adjacent pixels.
通过应用本发明实施例公开的装置, 在不同下釆样阶段求出相应的场景 相关度, 通过运动矢量累加和提取初始深度图, 利用不同下釆样阶段的场景 相关度对初始深度图进行迭代超平滑处理, 同时进行上釆样处理, 最终生成 源图像深度图, 提高了深度图的图像质量, 让深度图轮廓更加清晰, 同时本 方法也让整个过程的计算开销保持在合理范围之内。 By applying the device disclosed in the embodiment of the present invention, the corresponding scene correlation degree is obtained in different lower sample stages, the initial depth map is accumulated and extracted by the motion vector, and the initial depth map is iterated by using the scene correlation degree of different lower sample stages. Ultra-smooth processing, simultaneous sample processing, and finally generate source image depth map, improve the image quality of the depth map, make the depth map outline clearer, and the method also keeps the calculation cost of the whole process within a reasonable range.
专业人员应该还可以进一步意识到, 结合本文中所公开的实施例描述的 各示例的单元及算法步骤, 能够以电子硬件、 计算机软件或者二者的结合来 实现, 为了清楚地说明硬件和软件的可互换性, 在上述说明中已经按照功能 一般性地描述了各示例的组成及步骤。 这些功能究竟以硬件还是软件方式来 执行, 取决于技术方案的特定应用和设计约束条件。 专业技术人员可以对每 个特定的应用来使用不同方法来实现所描述的功能, 但是这种实现不应认为 超出本发明实施例的范围。 A person skilled in the art should further appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both, in order to clearly illustrate hardware and software. Interchangeability, the composition and steps of the various examples have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the embodiments of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、 处理
器执行的软件模块, 或者二者的结合来实施。 软件模块可以置于随机存储器The steps of the method or algorithm described in connection with the embodiments disclosed herein may be implemented in hardware, processing The software module executed by the device, or a combination of the two. Software modules can be placed in random access memory
( RAM ) 、 内存、 只读存储器(ROM ) 、 电可编程 R0M、 电可擦除可编程 R0M、 寄存器、 硬盘、 可移动磁盘、 CD-R0M、 或技术领域内所公知的任意其它形式 的存储介质中。 (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage known in the art. In the medium.
以上所述的具体实施方式, 对本发明实施例的目的、 技术方案和有益效 果进行了进一步详细说明, 所应理解的是, 以上所述仅为本发明实施例的具 体实施方式而已, 并不用于限定本发明实施例的保护范围, 凡在本发明实施 例的精神和原则之内, 所做的任何修改、 等同替换、 改进等, 均应包含在本 发明实施例的保护范围之内。
The specific embodiments of the present invention have been described in detail for the purpose of the embodiments of the present invention. The scope of the present invention is defined by the scope of the present invention. Any modifications, equivalents, improvements, etc., which are within the spirit and scope of the embodiments of the present invention, are intended to be included within the scope of the present invention.
Claims
1、 一种提取及优化图像深度图的方法, 其特征在于, 所述方法包括: A method for extracting and optimizing an image depth map, the method comprising:
获取当前源图像和所述当前源图像中每个像素点的场景相关度, 所述当前 源图像为当前视频连续帧序列; Obtaining a scene correlation degree of each pixel point in the current source image and the current source image, where the current source image is a current video continuous frame sequence;
对所述当前源图像连续下釆样, 获取当前每个下釆样源图像中每个像素点 的场景相关度; And continuously extracting the current source image, and acquiring a scene correlation degree of each pixel in each of the current squat sample source images;
将所述当前下釆样源图像中每个像素点与之前下釆样源图像中相对应的 像素点进行块匹配运动矢量计算, 获取所述当前下釆样源图像中每个像素点 的运动矢量值; Performing a block matching motion vector calculation on each pixel point in the current squat sample source image and a pixel point corresponding to the previous squat sample source image, and acquiring motion of each pixel point in the current squat sample source image Vector value
分别累加所述当前下釆样源图像中每个像素点的运动矢量值, 从运动矢量 累加和中提取每个像素点的初始深度值, 所述初始深度值构成源图像初始深 度图; And accumulating motion vector values of each pixel in the current sputum sample source image respectively, and extracting an initial depth value of each pixel point from the motion vector accumulation sum, where the initial depth value constitutes an initial depth map of the source image;
利用所述源图像中每个像素点的场景相关度和所述每个下釆样源图像中 每个像素点的场景相关度对所述初始深度图中每个像素点进行连续超平滑滤 波处理和上釆样处理, 获取所述源图像深度图。 Performing continuous ultra-smoothing filtering on each pixel in the initial depth map by using the scene correlation of each pixel in the source image and the scene correlation of each pixel in each of the squat source images And processing the source image to obtain the depth map of the source image.
2、 根据权利要求 1所述的提取及优化图像深度图的方法, 其特征在于, 所述 获取当前源图像和所述当前源图像中每个像素点的场景相关度具体为: The method for extracting and optimizing an image depth map according to claim 1, wherein the acquiring the scene correlation degree of each pixel point in the current source image and the current source image is specifically:
选择任一像素点作为中心像素点, 为与所述中心像素点相邻像素点标号; 获取所述中心像素点红 R、 绿0、 蓝 B量值与所述相邻像素点红 R、 绿0、 蓝 B分量值的差值, 并对所述差值取绝对值; Selecting any pixel point as a central pixel point, marking a pixel point adjacent to the central pixel point; acquiring the central pixel point red R, green 0, blue B magnitude and the adjacent pixel point red R, green 0. The difference between the values of the blue B components, and taking the absolute value of the difference;
将所述绝对值与场景相关度阈值相比较, 如果所述绝对值小于场景相关度 阈值, 则将所述相邻像素点的场景相关度设置为 1相关, 否则, 设置为 0不 相关; Comparing the absolute value with a scene correlation threshold, if the absolute value is smaller than the scene correlation threshold, setting the scene correlation of the adjacent pixel to 1 correlation; otherwise, setting 0 to be irrelevant;
将所述相邻像素点的场景相关度存储在緩冲器中, 所述緩冲器具体为
u Γ , i / j — / (^士 ^ 士^)^ / (^士
/ (^士 ^ 士^)^ buffer[m] = < Store the scene correlation of the adjacent pixel points in a buffer, where the buffer is specifically u Γ , i / j — / (^士^士^)^ / (^士 / (^士^士^)^ buffer[m] = <
[0, y) /0士 :, y士 + y) /0士 :, y士 + y) /0士 :, y士 > A; 其中, = 0,1; 0<m≤7;meZ ; /(x,j)、 /(x士 士 A)为像素点红 R、 绿 G、 蓝 B 分量的值; A为场景相关度阈值; 0t ,r[ ]为相关度的第 m位; m为相邻像素 点标号。 [0, y) /0士:, y士+ y) /0士:, y士+ y) /0士:, y士 > A; where, = 0,1; 0<m≤7;meZ ; /(x,j), /(x士士A) are the values of the pixel red R, green G, and blue B components; A is the scene correlation threshold; 0t, r[ ] is the mth position of the correlation; m Label adjacent points.
3、 根据权利要求 1所述的提取及优化图像深度图的方法, 其特征在于, 所述 对所述当前源图像连续下釆样, 获取当前每个下釆样源图像中每个像素点的 场景相关度具体为: The method for extracting and optimizing an image depth map according to claim 1, wherein the current source image is continuously sampled, and each pixel point in each of the current squat sample source images is obtained. The scene correlation is specifically as follows:
对所述当前源图像进行横向和纵向的 1/2下釆样, 获取当前 1/4分辨率源 图像和当前 1/4分辨率源图像中每个像素点的场景相关度; Performing horizontal and vertical 1/2 squatting on the current source image to obtain a scene correlation degree of each pixel point in the current 1/4 resolution source image and the current 1/4 resolution source image;
对所述当前 1/4 分辨率源图像进行横向和纵向的 1/2 下釆样, 获取当前 1/16分辨率源图像和当前 1/16分辨率源图像中每个像素点的场景相关度。 Perform horizontal and vertical 1/2 sampling on the current 1/4 resolution source image to obtain scene correlation of each pixel in the current 1/16 resolution source image and the current 1/16 resolution source image. .
4、 根据权利要求 3所述的提取及优化图像深度图的方法, 其特征在于, 所述 将所述当前下釆样源图像中每个像素点与之前下釆样源图像中相对应的像素 点进行块匹配运动矢量计算, 获取所述当前下釆样源图像中每个像素点的运 动矢量值具体为: The method for extracting and optimizing an image depth map according to claim 3, wherein the pixel corresponding to each pixel point in the current squat sample source image and the previous squat sample source image is The point is subjected to block matching motion vector calculation, and the motion vector value of each pixel in the current squat sample source image is obtained as follows:
将所述当前 1/16分辨率源图像中每个像素点与之前的所述 1/16分辨率源 图像中相对应的像素点进行块匹配运动矢量计算, 获取所述当前 1/16分辨率 源图像中每个像素点的运动矢量值; Performing a block matching motion vector calculation on each pixel point in the current 1/16th resolution source image and a pixel point corresponding to the previous 1/16th resolution source image to obtain the current 1/16 resolution The motion vector value of each pixel in the source image;
分别累加所述当前 1/16分辨率源图像中每个像素点的运动矢量值。 The motion vector values of each pixel in the current 1/16 resolution source image are separately accumulated.
5、 根据权利要求 1所述的提取及优化图像深度图的方法, 其特征在于, 所述 从运动矢量累加和中提取每个像素点的初始深度值具体为: The method for extracting and optimizing an image depth map according to claim 1, wherein the initial depth value of each pixel point extracted from the motion vector accumulation sum is specifically:
获取每个像素点位移的运动矢量模和单位像素位移灰度值, 所述单位像素 位移灰度值为 /= 255 , 为图像的宽度; Obtaining a motion vector mode and a unit pixel displacement gray value of each pixel point displacement, wherein the unit pixel displacement gray value is /= 255 , which is a width of the image;
W*3.5% W*3.5%
将所述运动矢量模与所述单位像素位移灰度值相乘, 获取所述每个像素点 的运动矢量灰度值;
将所述每个像素点的运动矢量灰度值的累加和存储在深度暂存器中; 如果 ¾OT + Dacc < Dtotal; 则 Dacc depth (x, y) = Dacc depth (x, y) + Dnew depth (x, y); Multiplying the motion vector mode by the unit pixel displacement gray value to obtain a motion vector gray value of each pixel point; And accumulating the accumulated vector of the motion vector gray values of each pixel in the depth register; if 3⁄4 OT + D acc < D total ; then D acc depth (x, y) = D acc depth (x, y) + D new depth (x, y);
^口果 +D >Df f l; D , f,(x,y), = D , x,y),*D,0,al ^口果+D >D ffl ; D , f ,(x,y), = D , x,y),* D,0,al
D D
D, D, D, D,
<0, 则 <0, then
D D,. D D,.
D Dnew > 1 JIiJ ― · DD new > 1 JIiJ ― ·
D D. 其中, 所述 为每个像素点坐标; ∞ 为每个像素点之前运动矢 量灰度值的累加和; ) (χ, 为每个像素点当前运动矢量灰度值; 为 深度暂存器累加和的最大值, D 为当前深度图全部灰度值的累加和; ∞为 深度暂存器中之前所有深度图的全部灰度值累加和。 D D. where, the coordinates of each pixel point; ∞ is the cumulative sum of the gray values of the motion vectors before each pixel;) (χ, the current motion vector gray value for each pixel; for the depth temporary storage The maximum value of the summation sum, D is the cumulative sum of all gray values of the current depth map; ∞ is the sum of all gray values of all previous depth maps in the depth register.
6、 根据权利要求 2所述的提取及优化图像深度图的方法, 其特征在于, 所述 利用所述源图像中每个像素点的场景相关度和所述每个下釆样源图像中每个 像素点的场景相关度对所述初始深度图中每个像素点进行连续超平滑滤波处 理具体为: 6. The method of extracting and optimizing an image depth map according to claim 2, wherein said utilizing a scene correlation degree of each pixel point in said source image and each of said each squat sample source image The scene correlation degree of each pixel point performs continuous super smoothing filtering processing on each pixel point in the initial depth map, specifically:
为所述每个相邻像素点分配权重系数, 所述权重系数为超平滑滤波的抽头 系数; Assigning a weight coefficient to each of the adjacent pixel points, where the weight coefficient is a tap coefficient of the super smoothing filter;
调用所述緩冲器中存储的所述相邻像素点的场景相关度; Retrieving a scene correlation of the adjacent pixel points stored in the buffer;
如果所述相邻像素点的场景相关度为 1相关, 则将相邻像素点灰度值与相 邻像素点分配的权重系数相乘; If the scene correlation degree of the adjacent pixel points is 1 correlation, multiplying the adjacent pixel point gray value by the weight coefficient of the adjacent pixel point allocation;
如果所述相邻像素点的场景相关度为 0不相关, 则将中心像素点灰度值与 相邻像素点分配的权重系数相乘; If the scene correlation degree of the adjacent pixel points is 0, the center pixel point gray value is multiplied by the weight coefficient of the adjacent pixel point allocation;
累加所述相邻像素点灰度值与相邻像素点分配的权重系数相乘的值, 以及 所述中心像素点灰度值与相邻像素点分配的权重系数相乘的值;
And accumulating a value obtained by multiplying the gray value of the adjacent pixel point by a weight coefficient assigned by an adjacent pixel point, and a value obtained by multiplying the gray value of the central pixel point by a weight coefficient assigned by an adjacent pixel point;
其中, "eZ," = 0,l,2,3; ¼#er[]为相邻像素点的场景相关度; ~ w#er[]为相邻
像素点的场景相关度的取反; f(x, 为中心像素点 (X, y)处的灰度值。 Where "eZ," = 0,l,2,3; 1⁄4#er[] is the scene correlation of adjacent pixels; ~ w#er[] is adjacent The inverse of the scene correlation of the pixel; f(x, the gray value at the center pixel (X, y).
7、 根据权利要求 6所述的提取及优化图像深度图的方法, 其特征在于, 所述 初始深度图中每个像素点进行连续上釆样具体为: The method for extracting and optimizing an image depth map according to claim 6, wherein each pixel point in the initial depth map is continuously uploaded as follows:
对所述初始深度图进行四次迭代超平滑滤波处理, 对所述经过四次迭代超 平滑滤波处理后的深度图进行横向和纵向的两倍上釆样; Four iterations of the ultra-smoothing filtering process are performed on the initial depth map, and the depth maps subjected to the four iterations of the ultra-smoothing filtering are doubled in the horizontal and vertical directions;
获取每个 114分辨率像素点的深度值, 所述每个 114分辨率像素点的深度 值形成 1 /4分辨率深度图; Obtaining depth values for each of the 114 resolution pixel points, the depth values of each of the 114 resolution pixel points forming a 1/4 resolution depth map;
对所述 1 /4分辨率深度图进行两次迭代超平滑滤波处理, 对所述经过两次 迭代超平滑滤波处理后的深度图进行横向和纵向的两倍上釆样; Performing two iterative super-smoothing filtering processes on the 1/4 resolution depth map, and performing horizontal and vertical double-draw on the depth map after the two iterations of ultra-smooth filtering;
获取每个原始分辨率像素点的深度值, 所述每个原始分辨率像素点的深度 值形成原始分辨率深度图; Obtaining depth values of each of the original resolution pixel points, the depth values of each of the original resolution pixel points forming an original resolution depth map;
对所述原始分辨率深度图进行一次迭代超平滑滤波处理, 获取源图像深度 图。 An iterative super smoothing filtering process is performed on the original resolution depth map to obtain a source image depth map.
8、 根据权利要求 6所述的提取及优化图像深度图的方法, 其特征在于, 所述 为所述每个相邻像素点分配权重系数具体为: 累加相邻像素点的权重系数和 为 1。 The method for extracting and optimizing an image depth map according to claim 6, wherein the assigning a weight coefficient for each of the adjacent pixel points is: adding a weight coefficient of the adjacent pixel points to 1 .
9、 一种提取及优化图像深度图的装置, 其特征在于, 所述装置包括: 9. An apparatus for extracting and optimizing an image depth map, the apparatus comprising:
第一获取单元, 用于获取当前源图像和所述当前源图像中每个像素点的场 景相关度, 所述当前源图像为当前视频连续帧序列; a first acquiring unit, configured to acquire a scene correlation degree of each pixel point in the current source image and the current source image, where the current source image is a current video continuous frame sequence;
第二获取单元, 用于对所述当前源图像连续下釆样, 获取当前每个下釆样 源图像中每个像素点的场景相关度; a second acquiring unit, configured to continuously sample the current source image, and acquire a scene correlation degree of each pixel in each of the currently downloaded source images;
第三获取单元, 用于将所述当前下釆样源图像中每个像素点与之前下釆样 源图像中相对应的像素点进行块匹配运动矢量计算, 获取所述当前下釆样源 图像中每个像素点的运动矢量值; a third acquiring unit, configured to perform block matching motion vector calculation on each pixel point in the current squat sample source image and a pixel point corresponding to the previous squat sample source image, to obtain the current squat sample source image The motion vector value of each pixel in the middle;
计算单元, 用于分别累加所述当前下釆样源图像中每个像素点的运动矢量 值, 从运动矢量累加和中提取每个像素点的初始深度值, 所述初始深度值构
成源图像初始深度图; a calculating unit, configured to separately accumulate motion vector values of each pixel in the current sputum sample source image, and extract an initial depth value of each pixel point from the motion vector accumulation sum, the initial depth value structure The initial depth map of the source image;
第一处理单元, 用于利用所述源图像中每个像素点的场景相关度和所述每 个下釆样源图像中每个像素点的场景相关度对所述初始深度图中每个像素点 进行连续超平滑滤波处理和上釆样处理, 获取所述源图像深度图。 a first processing unit, configured to use each of the pixels in the initial depth map by using a scene correlation of each pixel in the source image and a scene correlation of each pixel in each of the squat source images The point performs continuous super smoothing filtering processing and upper sampling processing to obtain the depth map of the source image.
10、 根据权利要求 9 所述的提取及优化图像深度图的装置, 其特征在于, 所 述第一获取单元具体用于: The apparatus for extracting and optimizing an image depth map according to claim 9, wherein the first acquiring unit is specifically configured to:
选择任一像素点作为中心像素点, 将与所述中心像素点相邻像素点标号; 获取所述中心像素点红 R、 绿0、 蓝 B分量值与每个所述相邻像素点红 R、 绿0、 蓝 B分量值的差值, 并对所述差值取绝对值; Selecting any pixel as a central pixel, labeling adjacent pixel points with the central pixel; obtaining the central pixel red R, green 0, blue B component values and each of the adjacent pixel red R , the difference between the values of the green 0 and blue B components, and taking the absolute value of the difference;
将所述绝对值与场景相关度阈值相比较, 如果所述绝对值小于场景相关度 阈值, 则将所述相邻像素点的场景相关度设置为 1相关, 否则, 设置为 0不 相关; Comparing the absolute value with a scene correlation threshold, if the absolute value is smaller than the scene correlation threshold, setting the scene correlation of the adjacent pixel to 1 correlation; otherwise, setting 0 to be irrelevant;
将所述相邻像素点的场景相关度存储在緩冲器中, 所述緩冲器具体为
Store the scene correlation of the adjacent pixel points in a buffer, where the buffer is specifically
其中, = 0,1; 0<m<7;meZ ; /(x,j)、 /(x±t,j士 )为像素点红 R、 ^G, 蓝 Where = 0,1; 0<m<7;meZ ; /(x,j), /(x±t,j士) is the pixel red R, ^G, blue
B分量的值; A为场景相关度阈值; 0t ,r[ ]为相关度的第 m位; m为相邻像 素点标号。 The value of the B component; A is the scene correlation threshold; 0t, r[ ] is the mth bit of the correlation; m is the adjacent pixel point label.
11、 根据权利要求 9 所述的提取及优化图像深度图的装置, 其特征在于, 所 述第二获取单元具体用于: The apparatus for extracting and optimizing an image depth map according to claim 9, wherein the second obtaining unit is specifically configured to:
对所述当前源图像进行横向和纵向的 1/2下釆样, 获取当前 1/4分辨率源 图像和当前 1/4分辨率源图像中每个像素点的场景相关度; Performing horizontal and vertical 1/2 squatting on the current source image to obtain a scene correlation degree of each pixel point in the current 1/4 resolution source image and the current 1/4 resolution source image;
对所述当前 1/4 分辨率源图像进行横向和纵向的 1/2 下釆样, 获取当前 1/16分辨率源图像和当前 1/16分辨率源图像中每个像素点的场景相关度。 Perform horizontal and vertical 1/2 sampling on the current 1/4 resolution source image to obtain scene correlation of each pixel in the current 1/16 resolution source image and the current 1/16 resolution source image. .
12、 根据权利要求 11所述的提取及优化图像深度图的装置, 其特征在于, 所 述第三获取单元具体用于: The apparatus for extracting and optimizing an image depth map according to claim 11, wherein the third obtaining unit is specifically configured to:
将所述当前 1/16分辨率源图像中每个像素点与之前的所述 1/16分辨率源
图像中相对应的像素点进行块匹配运动矢量计算, 获取所述当前 1 / 16分辨率 源图像中每个像素点的运动矢量值; Each pixel in the current 1/16th resolution source image is compared to the previous 1/16 resolution source Performing block matching motion vector calculation on corresponding pixel points in the image, and acquiring motion vector values of each pixel point in the current 1/16 resolution source image;
分别累加所述当前 1 / 16分辨率源图像中每个像素点的运动矢量值。 The motion vector values of each pixel in the current 1 / 16 resolution source image are separately accumulated.
1 3、 根据权利要求 9 所述的提取及优化图像深度图的装置, 其特征在于, 所 述计算单元具体用于: The apparatus for extracting and optimizing an image depth map according to claim 9, wherein the calculating unit is specifically configured to:
获取每个像素点位移的运动矢量模和单位像素位移灰度值, 所述单位像素 位移灰度值为 / = 255 , W为图像的宽度; 将所述运动矢量模与所述单位像素位移灰度值相乘, 获取所述每个像素点 的运动矢量灰度值; Obtaining a motion vector mode and a unit pixel displacement gray value of each pixel point displacement, the unit pixel displacement gray value is /= 255 , W is a width of the image; and the motion vector mode and the unit pixel displacement gray Multiplying the degree values to obtain a motion vector gray value of each pixel point;
将所述每个像素点的运动矢量灰度值的累加和存储在深度暂存器中; 如果 ¾OT + ; 则 <Λ = <Λ + , ; And accumulating the accumulated sum of the motion vector gray values of each pixel in the depth register; if 3⁄4 OT + ; then <Λ = <Λ + , ;
D, D,
如果 ¾OT + ; 则 D aCC— depth = " D,. If 3⁄4 OT + ; then D aCC — depth = " D,.
D—, _D D—, _D
0 , 则 Π D,^ -D, 0 , then Π D,^ -D,
D,, D ― · D,, D ― ·
其中, 所述 为每个像素点坐标; ∞ 为每个像素点之前运动矢 量灰度值的累加和; 为每个像素点当前运动矢量灰度值; 为 深度暂存器累加和的最大值, 1) 为当前深度图全部灰度值的累加和; ∞为 深度暂存器中之前所有深度图的全部灰度值累加和。 Wherein, the coordinates are each pixel point; ∞ is the sum of the gray values of the motion vectors before each pixel; the current motion vector gray value for each pixel; the maximum value of the sum of the depth registers, 1) is the sum of the total gray values of the current depth map; ∞ is the sum of all the gray values of all previous depth maps in the depth register.
14、 根据权利要求 10所述的提取及优化图像深度图的装置, 其特征在于, 所 述第一处理单元具体用于: The apparatus for extracting and optimizing an image depth map according to claim 10, wherein the first processing unit is specifically configured to:
为所述每个相邻像素点分配权重系数, 所述权重系数为超平滑滤波的抽头 系数; Assigning a weight coefficient to each of the adjacent pixel points, where the weight coefficient is a tap coefficient of the super smoothing filter;
调用所述緩冲器中存储的所述相邻像素点的场景相关度;
如果所述相邻像素点的场景相关度为 1相关, 则将相邻像素点灰度值与相 邻像素点分配的权重系数相乘; Retrieving a scene correlation of the adjacent pixel points stored in the buffer; If the scene correlation degree of the adjacent pixel points is 1 correlation, multiplying the adjacent pixel point gray value by the weight coefficient of the adjacent pixel point allocation;
如果所述相邻像素点的场景相关度为 0不相关, 则将中心像素点灰度值与 相邻像素点分配的权重系数相乘; If the scene correlation degree of the adjacent pixel points is 0, the center pixel point gray value is multiplied by the weight coefficient of the adjacent pixel point allocation;
累加所述相邻像素点灰度值与相邻像素点分配的权重系数相乘的值, 以及 所述中心像素点灰度值与相邻像素点分配的权重系数相乘的值; And accumulating a value obtained by multiplying the gray value of the adjacent pixel point by a weight coefficient assigned by an adjacent pixel point, and a value obtained by multiplying the gray value of the central pixel point by a weight coefficient assigned by an adjacent pixel point;
/(^Η^Ι^^^^^+^^ ^^^ΤΡΜ+ΙΙ^ Χ,^+^ ^^^Φ/Ρ +^^ ^^^Μ+Ι /ΡΜ+Ι)] 其中, " e Z,« = 0, 1,2,3 ; w#er[]为相邻像素点的场景相关度; ~ w#er[]为相 邻像素点的场景相关度的取反; 为中心像素点 (X, 处的灰度值. /(^Η^Ι^^^^^+^^ ^^^ΤΡΜ+ΙΙ^ Χ,^+^ ^^^Φ/Ρ +^^ ^^^Μ+Ι /ΡΜ+Ι)] where, " e Z,« = 0, 1,2,3 ; w#er[] is the scene correlation of adjacent pixels; ~ w#er[] is the inverse of the scene correlation of adjacent pixels; Point (X, the gray value at the point.
15、 根据权利要求 14所述的提取及优化图像深度图的装置, 其特征在于, 所 述第一处理单元进一步具体用于: The apparatus for extracting and optimizing an image depth map according to claim 14, wherein the first processing unit is further specifically configured to:
对所述初始深度图进行四次迭代超平滑滤波处理, 对所述经过四次迭代超 平滑滤波处理后的深度图进行横向和纵向的两倍上釆样; Four iterations of the ultra-smoothing filtering process are performed on the initial depth map, and the depth maps subjected to the four iterations of the ultra-smoothing filtering are doubled in the horizontal and vertical directions;
获取每个 114分辨率像素点的深度值, 所述每个 114分辨率像素点的深度 值形成 1 /4分辨率深度图; Obtaining depth values for each of the 114 resolution pixel points, the depth values of each of the 114 resolution pixel points forming a 1/4 resolution depth map;
对所述 1 /4分辨率深度图进行两次迭代超平滑滤波处理, 对所述经过两次 迭代超平滑滤波处理后的深度图进行横向和纵向的两倍上釆样; Performing two iterative super-smoothing filtering processes on the 1/4 resolution depth map, and performing horizontal and vertical double-draw on the depth map after the two iterations of ultra-smooth filtering;
获取每个原始分辨率像素点的深度值, 所述每个原始分辨率像素点的深度 值形成原始分辨率深度图; Obtaining depth values of each of the original resolution pixel points, the depth values of each of the original resolution pixel points forming an original resolution depth map;
对所述原始分辨率深度图进行一次迭代超平滑滤波处理, 获取源图像深度 图。 An iterative super smoothing filtering process is performed on the original resolution depth map to obtain a source image depth map.
16、 根据权利要求 15所述的提取及优化图像深度图的装置, 其特征在于, 所 述为所述每个相邻像素点分配权重系数具体为: 累加相邻像素点的权重系数 和为 1。
The apparatus for extracting and optimizing an image depth map according to claim 15, wherein the assigning a weight coefficient for each of the adjacent pixel points is: adding a weight coefficient of the adjacent pixel points to 1 .
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201280004184.8A CN103493482B (en) | 2012-05-08 | 2012-05-08 | The method and apparatus of a kind of extraction and optimized image depth map |
PCT/CN2012/075187 WO2013166656A1 (en) | 2012-05-08 | 2012-05-08 | Method and device for extracting and optimizing depth map of image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2012/075187 WO2013166656A1 (en) | 2012-05-08 | 2012-05-08 | Method and device for extracting and optimizing depth map of image |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2013166656A1 true WO2013166656A1 (en) | 2013-11-14 |
Family
ID=49550062
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2012/075187 WO2013166656A1 (en) | 2012-05-08 | 2012-05-08 | Method and device for extracting and optimizing depth map of image |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN103493482B (en) |
WO (1) | WO2013166656A1 (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104978554B (en) * | 2014-04-08 | 2019-02-05 | 联想(北京)有限公司 | The processing method and electronic equipment of information |
CN104318586B (en) * | 2014-09-26 | 2017-04-26 | 燕山大学 | Adaptive morphological filtering-based motion blur direction estimation method and device |
CN104394399B (en) * | 2014-10-31 | 2016-08-24 | 天津大学 | Three limit filtering methods of deep video coding |
CN105721852B (en) * | 2014-11-24 | 2018-12-14 | 奥多比公司 | For determining the method, storage equipment and system of the capture instruction of depth refined image |
TWI672677B (en) | 2017-03-31 | 2019-09-21 | 鈺立微電子股份有限公司 | Depth map generation device for merging multiple depth maps |
CN107204011A (en) * | 2017-06-23 | 2017-09-26 | 万维云视(上海)数码科技有限公司 | A kind of depth drawing generating method and device |
CN110049242B (en) * | 2019-04-18 | 2021-08-24 | 腾讯科技(深圳)有限公司 | Image processing method and device |
CN114943793B (en) * | 2021-02-10 | 2025-03-18 | 北京字跳网络技术有限公司 | Fluid rendering method, device, electronic device and storage medium |
CN114240751A (en) * | 2021-12-16 | 2022-03-25 | 海宁奕斯伟集成电路设计有限公司 | Image processing apparatus, method, and program |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101582171A (en) * | 2009-06-10 | 2009-11-18 | 清华大学 | A method and device for creating a depth map |
CN101945288A (en) * | 2010-10-19 | 2011-01-12 | 浙江理工大学 | H.264 compressed domain-based image depth map generation method |
CN101951511A (en) * | 2010-08-19 | 2011-01-19 | 深圳市亮信科技有限公司 | Method for layering video scenes by analyzing depth |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101141648A (en) * | 2007-09-20 | 2008-03-12 | 上海广电(集团)有限公司中央研究院 | Column diagram based weight predicting method |
KR101506926B1 (en) * | 2008-12-04 | 2015-03-30 | 삼성전자주식회사 | Method and appratus for estimating depth, and method and apparatus for converting 2d video to 3d video |
JP5562408B2 (en) * | 2009-04-20 | 2014-07-30 | ドルビー ラボラトリーズ ライセンシング コーポレイション | Directed interpolation and post-processing of data |
CN101969564B (en) * | 2010-10-29 | 2012-01-11 | 清华大学 | Upsampling method for depth video compression of three-dimensional television |
CN102098527B (en) * | 2011-01-28 | 2013-04-10 | 清华大学 | Method and device for transforming two dimensions into three dimensions based on motion analysis |
-
2012
- 2012-05-08 CN CN201280004184.8A patent/CN103493482B/en active Active
- 2012-05-08 WO PCT/CN2012/075187 patent/WO2013166656A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101582171A (en) * | 2009-06-10 | 2009-11-18 | 清华大学 | A method and device for creating a depth map |
CN101951511A (en) * | 2010-08-19 | 2011-01-19 | 深圳市亮信科技有限公司 | Method for layering video scenes by analyzing depth |
CN101945288A (en) * | 2010-10-19 | 2011-01-12 | 浙江理工大学 | H.264 compressed domain-based image depth map generation method |
Also Published As
Publication number | Publication date |
---|---|
CN103493482B (en) | 2016-01-20 |
CN103493482A (en) | 2014-01-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2013166656A1 (en) | Method and device for extracting and optimizing depth map of image | |
EP2164040B1 (en) | System and method for high quality image and video upscaling | |
CN105335947B (en) | Image de-noising method and image denoising device | |
JP5555706B2 (en) | High resolution video acquisition apparatus and method | |
Riemens et al. | Multistep joint bilateral depth upsampling | |
JP2001160139A (en) | Method and device for image processing | |
EP2201783A2 (en) | Apparatus and method for improving image resolution using fuzzy motion estimation | |
WO2009115885A2 (en) | Method and apparatus for super-resolution of images | |
JPH11284834A (en) | Image information combining method | |
CN101853497A (en) | Image enhancement method and device | |
JP2001160138A (en) | Method and device for image processing | |
CN109493373B (en) | Stereo matching method based on binocular stereo vision | |
KR20180122548A (en) | Method and apparaturs for processing image | |
CN104063849A (en) | Video super-resolution reconstruction method based on image block self-adaptive registration | |
CN105574823B (en) | A kind of deblurring method and device of blurred picture out of focus | |
CN108537868A (en) | Information processing equipment and information processing method | |
CN111179195A (en) | Depth image hole filling method and device, electronic equipment and storage medium thereof | |
CN102750668A (en) | Digital image triple interpolation amplification method by combining local direction features | |
JP5492223B2 (en) | Motion vector detection apparatus and method | |
WO2014008329A1 (en) | System and method to enhance and process a digital image | |
CN106920213B (en) | Method and system for acquiring high-resolution image | |
CN103685858A (en) | Method and device for real-time video processing | |
US20070279434A1 (en) | Image processing device executing filtering process on graphics and method for image processing | |
CN104318518A (en) | Projection-onto-convex-sets image reconstruction method based on SURF matching and edge detection | |
CN103618904B (en) | Motion estimation method and device based on pixels |
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: 12876478 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 12876478 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 12876478 Country of ref document: EP Kind code of ref document: A1 |