CN104820991A - Multi-soft-constraint stereo matching method based on cost matrix - Google Patents
Multi-soft-constraint stereo matching method based on cost matrix Download PDFInfo
- Publication number
- CN104820991A CN104820991A CN201510251429.2A CN201510251429A CN104820991A CN 104820991 A CN104820991 A CN 104820991A CN 201510251429 A CN201510251429 A CN 201510251429A CN 104820991 A CN104820991 A CN 104820991A
- Authority
- CN
- China
- Prior art keywords
- cost
- value
- pixel
- disparity
- matching
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 239000011159 matrix material Substances 0.000 title claims abstract description 77
- 238000000034 method Methods 0.000 title claims abstract description 57
- 238000009825 accumulation Methods 0.000 claims abstract description 21
- 230000011218 segmentation Effects 0.000 claims abstract description 12
- 238000009792 diffusion process Methods 0.000 claims abstract description 6
- 238000003709 image segmentation Methods 0.000 claims description 29
- 230000003044 adaptive effect Effects 0.000 claims description 7
- 238000005070 sampling Methods 0.000 claims description 6
- 238000011524 similarity measure Methods 0.000 claims description 6
- 238000004364 calculation method Methods 0.000 claims description 3
- 238000012545 processing Methods 0.000 claims description 3
- 238000012546 transfer Methods 0.000 claims description 3
- 230000000007 visual effect Effects 0.000 claims description 2
- 238000001514 detection method Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000001575 pathological effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/50—Depth or shape recovery
- G06T7/529—Depth or shape recovery from texture
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/19—Recognition using electronic means
- G06V30/192—Recognition using electronic means using simultaneous comparisons or correlations of the image signals with a plurality of references
- G06V30/195—Recognition using electronic means using simultaneous comparisons or correlations of the image signals with a plurality of references using a resistor matrix
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
- G06T2207/10012—Stereo images
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20172—Image enhancement details
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/75—Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
- G06V10/759—Region-based matching
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Mathematical Physics (AREA)
- Multimedia (AREA)
- Image Processing (AREA)
Abstract
Description
技术领域technical field
本发明属于计算视觉和摄影测量技术领域,涉及一种基于代价矩阵的立体匹配方法,尤其是涉及一种基于代价矩阵进行多重软约束的立体匹配方法。The invention belongs to the technical field of computational vision and photogrammetry, and relates to a stereo matching method based on a cost matrix, in particular to a stereo matching method based on a cost matrix with multiple soft constraints.
背景技术Background technique
立体匹配是计算视觉和摄影测量领域的一个基础和关键问题。立体匹配的概念最早在摄影测量领域提出,用于解决数字航空摄影测量自动化测图的问题。立体匹配也是计算机视觉领域的关键问题,影响到对人的视觉系统建模,机器人导航和操作,3D模型建立以及在计算机中生成的影像中混合实景动作等。Stereo matching is a fundamental and key problem in the fields of computational vision and photogrammetry. The concept of stereo matching was first proposed in the field of photogrammetry to solve the problem of automatic mapping of digital aerial photogrammetry. Stereo matching is also a key issue in the field of computer vision, affecting modeling of the human visual system, robot navigation and manipulation, 3D model building, and mixing real-world actions with computer-generated images.
立体匹配是个病态问题,尤其对于缺乏纹理和重复纹理区域以及视差不连续的误匹配问题一直难以全面解决。为取得更好的匹配结果,需要合理纳入更多的先验条件约束。匹配算法一般采用局部基于窗口的匹配,匹配过程中利用影像局部信息改善窗口匹配,同时利用金字塔分层匹配策略等提高稳定性和正确率。然而这些方法往往需要较大的匹配窗口,导致很难保留影像的细节。也有一些算法纳入影像分割约束,但是对于图像分割结果有很强的依赖性。总之,传统的立体匹配方法往往直接用各种约束条件减小视差搜索范围,因此对于先验条件依赖性很强,容易产生误匹配。Stereo matching is a pathological problem, especially for the lack of texture and repeated texture regions, and the mismatching problems of discontinuous disparity have been difficult to solve comprehensively. In order to achieve better matching results, more prior constraints need to be incorporated reasonably. The matching algorithm generally uses local window-based matching. During the matching process, the local information of the image is used to improve the window matching. At the same time, the pyramid layered matching strategy is used to improve the stability and accuracy. However, these methods often require large matching windows, making it difficult to preserve image details. There are also some algorithms that incorporate image segmentation constraints, but have a strong dependence on image segmentation results. In short, the traditional stereo matching method often directly uses various constraints to reduce the disparity search range, so it is highly dependent on the prior conditions and is prone to mis-matching.
近年来出现一些通过改进代价积聚方法实现匹配的算法,例如采用自适应代价积聚方法改善局部窗口匹配算法,采用多尺度代价积聚方法解决重复纹理的匹配问题,采用半全局代价积聚方法解决视差不连续的匹配问题。这些算法的共同点都是在代价矩阵中实现各自的约束,但是由于纳入的约束不够充分,因此难以较全面地解决误匹配问题。In recent years, there have been some algorithms that achieve matching by improving the cost accumulation method, such as using the adaptive cost accumulation method to improve the local window matching algorithm, using the multi-scale cost accumulation method to solve the matching problem of repeated textures, and using the semi-global cost accumulation method to solve the parallax discontinuity matching problem. The common point of these algorithms is to implement their respective constraints in the cost matrix, but because the constraints included are not sufficient, it is difficult to solve the mismatching problem comprehensively.
发明内容Contents of the invention
本发明主要是解决现有技术所存在对于先验条件约束依赖性过强的问题;提供了一种能同时纳入多重先验约束条件的基于代价矩阵的多重软约束代价积聚方法来完成立体匹配,可以有效解决缺乏纹理和重复纹理区域以及边缘的误匹配问题。The present invention mainly solves the problem of excessive dependence on the priori condition constraints existing in the prior art; it provides a multiple soft constraint cost accumulation method based on the cost matrix that can simultaneously incorporate multiple priori constraints to complete stereo matching, It can effectively solve the problem of lack of texture and repeated texture areas and the mismatching of edges.
本发明所采用的技术方案是:一种基于代价矩阵的多重软约束立体匹配方法,其特征在于,包括以下步骤:The technical scheme adopted in the present invention is: a kind of multiple soft constraint stereo matching method based on cost matrix, it is characterized in that, comprises the following steps:
步骤1:在原始影像集中选择其中一幅核线影像作为基准影像,并对其中每个像素利用AD-Census-Sobel作为相似性测度,计算每个候选视差值的匹配代价,生成一个三维匹配代价矩阵;Step 1: Select one of the epipolar images in the original image set as the reference image, and use AD-Census-Sobel as the similarity measure for each pixel, calculate the matching cost of each candidate disparity value, and generate a three-dimensional matching cost matrix;
步骤2:对步骤1中得到的代价矩阵进行多尺度降采样,构成代价矩阵金字塔;Step 2: Perform multi-scale downsampling on the cost matrix obtained in step 1 to form a cost matrix pyramid;
步骤3:对基准影像也进行相应的多尺度降采样,构成影像金字塔;Step 3: Perform corresponding multi-scale downsampling on the reference image to form an image pyramid;
步骤4;对步骤3中得到的影像金字塔各层影像分别进行图像分割;Step 4; Carry out image segmentation respectively to the images of each layer of the image pyramid obtained in step 3;
步骤5:对步骤2中得到的代价矩阵金字塔,从顶层代价矩阵开始对各层代价矩阵进行自适应权重的代价积聚;Step 5: For the cost matrix pyramid obtained in step 2, start from the top-level cost matrix to accumulate the cost of adaptive weights for each layer of cost matrix;
步骤6:根据步骤4中所述的图像分割结果,对步骤5中处理后的代价矩阵进一步进行“投票式”分割约束下的代价积聚;Step 6: According to the image segmentation results described in step 4, the cost matrix processed in step 5 is further subjected to cost accumulation under the "voting" segmentation constraint;
步骤7:将该层代价积聚结果传递给下层代价矩阵;Step 7: Transfer the cost accumulation result of this layer to the lower layer cost matrix;
步骤8:从上往下对金字塔代价矩阵重复进行步骤5至步骤7的操作,直至原始代价矩阵,最后对原始代价矩阵进行步骤5和步骤6操作;Step 8: Repeat steps 5 to 7 on the pyramid cost matrix from top to bottom until the original cost matrix, and finally perform steps 5 and 6 on the original cost matrix;
步骤9:对步骤8中处理后得到的代价矩阵,对每个像素取代价最小且匹配置信度大于预定阈值的视差作为最终视差,然后用已取得视差的点作为控制在代价矩阵中对未匹配点进行代价扩散,最后采用“赢家通吃”方法生成视差图;Step 9: For the cost matrix obtained after processing in step 8, replace the disparity with the minimum cost and matching confidence greater than the predetermined threshold for each pixel as the final disparity, and then use the obtained disparity point as a control in the cost matrix for unmatched Points for cost diffusion, and finally use the "winner takes all" method to generate a disparity map;
步骤10:在原始影像集中选择另一张影像作为基准影像,重复执行上述步骤1至步骤9,生成另一幅视差图,通过对比两幅视差图对应像素的视差一致性检测误匹配点,得到去除误匹配点视差图;对去除误匹配点视差图进行视差内插,填补误匹配造成的黑洞,生成完整视差图;利用完整视差图和影像外方位元素,根据前方交会原理计算深度图和数字表面模型。Step 10: Select another image in the original image set as the reference image, repeat the above steps 1 to 9 to generate another disparity map, and detect the mismatching points by comparing the disparity consistency of the corresponding pixels of the two disparity maps to obtain Remove the disparity map of mismatching points; perform parallax interpolation on the disparity map of removed mismatching points, fill in the black holes caused by mismatching, and generate a complete disparity map; use the complete disparity map and the outer orientation elements of the image to calculate the depth map and digital according to the front intersection principle surface model.
作为优选,步骤1中,As a preference, in step 1,
所述的AD-Census-Sobel相似性测度的定义如下:The definition of the AD-Census-Sobel similarity measure is as follows:
cost(p,d)=exp(α*AD(p,d)+β*Census(p,d)+γ*Sobel(p,d)) (式壹);cost(p,d)=exp(α*AD(p,d)+β*Census(p,d)+γ*Sobel(p,d)) (Formula 1);
其中,p表示基准影像上的像素坐标p(x,y),d是视差值,α,β和γ是权重系数,一般要求均为正数且α+β+γ=1,AD(p,d)是指基准影像像素p及其在匹配影像上的共轭像素p+d的灰度差绝对值,Census(p,d)是指基准影像像素p及其在匹配影像上的共轭像素p+d的Census匹配测度值,Sobel(p,d)是指基准影像像素p及其在匹配影像上的共轭像素p+d的Sobel匹配测度值;Among them, p represents the pixel coordinate p(x, y) on the reference image, d is the parallax value, α, β and γ are weight coefficients, generally required to be positive numbers and α+β+γ=1, AD(p ,d) refers to the absolute value of the gray level difference between the reference image pixel p and its conjugate pixel p+d on the matching image, and Census(p,d) refers to the reference image pixel p and its conjugate pixel on the matching image The Census matching measure value of pixel p+d, Sobel(p,d) refers to the Sobel matching measure value of reference image pixel p and its conjugate pixel p+d on the matching image;
根据式壹对基准影像逐像素计算不同视差d对应的匹配代价值,构成一个由影像横坐标W,纵坐标H以及视差值D表示的三维匹配代价矩阵。According to formula 1, the matching cost values corresponding to different disparities d are calculated pixel by pixel for a pair of reference images, and a three-dimensional matching cost matrix represented by image abscissa W, ordinate H and disparity value D is formed.
作为优选,步骤2中所述的代价矩阵金字塔的生成方法为,对步骤1中得到的三维匹配代价矩阵保持视差值D方向不变而在横坐标W和纵坐标H方向采用高斯金字塔进行降采样,按照此方法经过多次降采样即可生成多尺度代价矩阵。Preferably, the generation method of the cost matrix pyramid described in step 2 is to keep the disparity value D direction unchanged for the three-dimensional matching cost matrix obtained in step 1, and use a Gaussian pyramid in the direction of abscissa W and ordinate H to reduce Sampling, according to this method, a multi-scale cost matrix can be generated after multiple downsampling.
作为优选,步骤3中所述的多尺度降采样的方法为,对原始影像在横坐标W和纵坐标H方向采用高斯金字塔进行降采样,按照此方法经过多次降采样即可生成影像金字塔。Preferably, the multi-scale down-sampling method described in step 3 is to use a Gaussian pyramid to down-sample the original image in the directions of the abscissa W and the ordinate H, and the image pyramid can be generated through multiple down-sampling according to this method.
作为优选,步骤4中所述的图像分割方法为首先采用现有的图像分割方法,然后在图像分割完成之后进行分割块聚类,而对于其元素数目大于预定阈值的类别再次进行分割,直至每个类别的元素数目不大于预定阈值。Preferably, the image segmentation method described in step 4 is to first adopt the existing image segmentation method, then perform segmentation block clustering after the image segmentation is completed, and perform segmentation again for categories whose number of elements is greater than a predetermined threshold, until each The number of elements of a category is not greater than a predetermined threshold.
作为优选,步骤5中所述的自适应权重的代价积聚方法为,根据每个像素点p为中心一定窗口内的像素q与该点的欧氏距离dist(p,q)和灰度值差异|Ip-Iq|确定像素点q对于像素点p代价的贡献值,如此累加窗口所有像素对于像素p代价的贡献而得到p最终的代价值cost(p,d),具体的计算方法如下:As a preference, the cost accumulation method of the adaptive weight described in step 5 is based on the Euclidean distance dist(p,q) and gray value difference between pixel q in a certain window centered on each pixel point p and the point |I p -I q |Determine the contribution value of pixel q to the cost of pixel p, so that the contribution of all pixels in the window to the cost of pixel p is accumulated to obtain the final cost value cost(p,d) of p. The specific calculation method is as follows :
weight(q,d)=exp(α*dis(p,q)+β*|Ip-Iq|)weight(q,d)=exp(α*dis(p,q)+β*|I p -I q |)
其中,weight(q,d)表示进行代价积聚时邻域像素的权重值,α、β是计算该权重值时涉及的参数,分别对应欧氏距离dist(p,q)和灰度值差异|Ip-Iq|的权重系数,一般要求均为正数且α+β=1。Among them, weight(q,d) represents the weight value of the neighborhood pixels when the cost is accumulated, α and β are the parameters involved in calculating the weight value, corresponding to the Euclidean distance dist(p,q) and the gray value difference| The weight coefficients of I p -I q | are generally required to be positive numbers and α+β=1.
作为优选,步骤6的具体实现包括以下子步骤:As preferably, the specific realization of step 6 includes the following sub-steps:
步骤6.1:对每个图像分割块,分别累加该图像分割块中所有像素点的每个视差值对应的总代价,得到整个图像分割块中,匹配代价随视差值变化的视差-代价直方图;Step 6.1: For each image segmentation block, add up the total cost corresponding to each disparity value of all pixels in the image segmentation block, and obtain the disparity-cost histogram of the matching cost changing with the disparity value in the entire image segmentation block picture;
步骤6.2:根据直方图计算匹配代价均值,每个视差值与均值的差值以及这些差值的均值,并对其差值为负且绝对值大于差值均值的视差值赋以惩罚,即赋以一个负的代价值,按此方法得到一个对应于步骤6.1中所述的视差-代价直方图的视差-代价惩罚直方图;Step 6.2: Calculate the mean value of the matching cost, the difference between each disparity value and the mean value and the mean value of these differences according to the histogram, and assign a penalty to the disparity value whose difference is negative and whose absolute value is greater than the mean value of the difference, That is, a negative cost value is assigned, and a disparity-cost penalty histogram corresponding to the disparity-cost histogram described in step 6.1 is obtained in this way;
步骤6.3:对图像分割块逐像素地施加上述代价惩罚,即根据步骤6.2中所述的视差-代价惩罚直方图,对每个像素的视差值加上相应的代价惩罚;Step 6.3: Apply the above cost penalty to the image segmentation block pixel by pixel, that is, add the corresponding cost penalty to the disparity value of each pixel according to the disparity-cost penalty histogram described in step 6.2;
其中代价惩罚的计算方法如下:The cost penalty is calculated as follows:
其中,cd为分割块对应于视差d的代价,α为权重系数。Among them, c d is the cost of the segmentation block corresponding to the disparity d, and α is the weight coefficient.
作为优选,步骤7中所述的将该层代价积聚结果传递给下层代价矩阵,其具体实现包括以下子步骤:As preferably, the layer cost accumulation result described in step 7 is passed to the lower layer cost matrix, and its specific implementation includes the following sub-steps:
步骤7.1:分别对每个像素点在视差范围内的代价值进行一维最小平方卷积;注意,这里卷积的目的是使得上层匹配代价随视差变化更加平滑,因此也可以采用最小和卷积或其他卷积方法;Step 7.1: Perform one-dimensional minimum square convolution on the cost value of each pixel within the parallax range; note that the purpose of the convolution here is to make the upper layer matching cost smoother with the parallax change, so the minimum sum convolution can also be used or other convolution methods;
步骤7.2:根据金字塔像素对应关系,将该层每个像素的代价值累加到下层对应像素相应视差的代价值。Step 7.2: According to the pyramid pixel correspondence, add the cost value of each pixel in this layer to the cost value of the corresponding disparity of the corresponding pixel in the lower layer.
作为优选,步骤9中所述的匹配置信度即匹配代价次小值和最小值之比,对于只有匹配置信度大于预定阈值的像素才能首次取得视差;根据已取得视差的点作为控制在代价矩阵中对未匹配点进行代价扩散的方法如下:标记已匹配点和未匹配点,然后对每个已匹配点一定窗口邻域内的未匹配像素对应于该已匹配点的视差代价减去一定惩罚值,具体如下公式所示:As a preference, the matching confidence degree described in step 9 is the ratio of the second minimum value of the matching cost to the minimum value, and only the pixels whose matching confidence degree is greater than a predetermined threshold can obtain parallax for the first time; The method of cost diffusion for unmatched points is as follows: mark the matched points and unmatched points, and then subtract a certain penalty value from the unmatched pixels in a certain window neighborhood of each matched point corresponding to the disparity cost of the matched point , as shown in the following formula:
其中,p表示已匹配点,q表示未匹配点,P表示惩罚值,D(p)表示初始视差图D在p点处的取值。Among them, p represents the matched point, q represents the unmatched point, P represents the penalty value, and D(p) represents the value of the initial disparity map D at point p.
本发明具有如下优点:在立体匹配过程中考虑了局部纹理结构和灰度信息,增强了同名点可区分性;纳入了多尺度约束,增强了重复纹理区域的匹配能力;纳入了分割约束,增强了弱纹理区域的匹配能力;根据初级可靠匹配结果进行代价扩散,增强了匹配稳定性;在代价矩阵中完成以上所有约束,每种约束都是不能直接决定最终匹配结果的软约束,进一步增强了匹配结果的稳定性和可靠性。The present invention has the following advantages: local texture structure and gray information are considered in the process of stereo matching, and the distinguishability of points with the same name is enhanced; multi-scale constraints are incorporated to enhance the matching ability of repeated texture regions; segmentation constraints are incorporated to enhance The matching ability of the weak texture area is improved; the cost diffusion is carried out according to the primary reliable matching result, which enhances the matching stability; all the above constraints are completed in the cost matrix, and each constraint is a soft constraint that cannot directly determine the final matching result, which further enhances the Stability and reliability of matching results.
附图说明Description of drawings
图1:为本发明实施例的总体流程图;Fig. 1: is the overall flowchart of the embodiment of the present invention;
图2:为本发明实施例的对代价矩阵进行多尺度降采样方法示意图;Figure 2: a schematic diagram of a multi-scale downsampling method for a cost matrix according to an embodiment of the present invention;
图3:为本发明实施例的基于代价矩阵的“投票式”分割约束代价积聚方法示意图。Fig. 3 is a schematic diagram of a cost accumulation method based on a cost matrix "voting" partition constraint according to an embodiment of the present invention.
具体实施方式Detailed ways
为了便于本领域普通技术人员理解和实施本发明,下面结合附图及实施例对本发明作进一步的详细描述,应当理解,此处所描述的实施示例仅用于说明和解释本发明,并不用于限定本发明。In order to facilitate those of ordinary skill in the art to understand and implement the present invention, the present invention will be described in further detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the implementation examples described here are only used to illustrate and explain the present invention, and are not intended to limit this invention.
请见图1,本发明提供的一种基于代价矩阵的多重软约束立体匹配方法,包括以下步骤:Please see Fig. 1, a kind of multiple soft constraint stereo matching method based on cost matrix provided by the present invention, comprises the following steps:
步骤1:在原始影像集中选择其中一幅核线影像作为基准影像,并对其中每个像素利用AD-Census-Sobel作为相似性测度,计算每个候选视差值的匹配代价,生成一个三维匹配代价矩阵;Step 1: Select one of the epipolar images in the original image set as the reference image, and use AD-Census-Sobel as the similarity measure for each pixel, calculate the matching cost of each candidate disparity value, and generate a three-dimensional matching cost matrix;
AD-Census-Sobel相似性测度的定义如下:The AD-Census-Sobel similarity measure is defined as follows:
cost(p,d)=exp(α*AD(p,d)+β*Census(p,d)+γ*Sobel(p,d)) (式壹);cost(p,d)=exp(α*AD(p,d)+β*Census(p,d)+γ*Sobel(p,d)) (Formula 1);
其中,p表示基准影像上的像素坐标p(x,y),d是视差值,α,β和γ是权重系数,一般要求均为正数且α+β+γ=1,AD(p,d)是指基准影像像素p及其在匹配影像上的共轭像素p+d的灰度差绝对值,Census(p,d)是指基准影像像素p及其在匹配影像上的共轭像素p+d的Census匹配测度值,Sobel(p,d)是指基准影像像素p及其在匹配影像上的共轭像素p+d的Sobel匹配测度值;Among them, p represents the pixel coordinate p(x, y) on the reference image, d is the parallax value, α, β and γ are weight coefficients, generally required to be positive numbers and α+β+γ=1, AD(p ,d) refers to the absolute value of the gray level difference between the reference image pixel p and its conjugate pixel p+d on the matching image, and Census(p,d) refers to the reference image pixel p and its conjugate pixel on the matching image The Census matching measure value of pixel p+d, Sobel(p,d) refers to the Sobel matching measure value of reference image pixel p and its conjugate pixel p+d on the matching image;
根据式壹对基准影像逐像素计算不同视差d对应的匹配代价值,构成一个由影像横坐标W,纵坐标H以及视差值D表示的三维匹配代价矩阵,大小为W*H*D。Calculate the matching cost values corresponding to different disparities d pixel by pixel according to the formula 1 pair of reference images, and form a three-dimensional matching cost matrix represented by the image abscissa W, ordinate H and disparity value D, with a size of W*H*D.
步骤2:对步骤1中得到的代价矩阵进行多尺度降采样,构成代价矩阵金字塔;Step 2: Perform multi-scale downsampling on the cost matrix obtained in step 1 to form a cost matrix pyramid;
请见图2,代价矩阵金字塔的生成方法为,对步骤1中得到的三维匹配代价矩阵保持视差值D方向不变而在横坐标W和纵坐标H方向采用高斯金字塔进行降采样,按照此方法经过多次降采样即可生成多尺度代价矩阵。Please see Figure 2. The method of generating the cost matrix pyramid is to keep the disparity value D direction unchanged for the three-dimensional matching cost matrix obtained in step 1, and use the Gaussian pyramid for downsampling in the abscissa W and ordinate H directions. According to this The method can generate a multi-scale cost matrix through multiple downsampling.
步骤3:对基准影像也进行相应的多尺度降采样,构成影像金字塔;其中多尺度降采样的方法为,对原始影像在横坐标W和纵坐标H方向采用高斯金字塔进行降采样,按照此方法经过多次降采样即可生成影像金字塔。Step 3: Carry out corresponding multi-scale down-sampling on the reference image to form an image pyramid; the method of multi-scale down-sampling is to use Gaussian pyramid to down-sample the original image in the direction of abscissa W and ordinate H, according to this method The image pyramid can be generated by multiple downsampling.
步骤4;对步骤3中得到的影像金字塔各层影像分别进行图像分割;图像分割方法为首先采用现有的图像分割方法,然后在图像分割完成之后进行分割块聚类,而对于其元素数目大于预定阈值的类别再次进行分割,直至每个类别的元素数目不大于预定阈值。Step 4; Carry out image segmentation to the images of each layer of the image pyramid obtained in step 3; the image segmentation method is to first adopt the existing image segmentation method, and then perform segmentation block clustering after the image segmentation is completed, and for its element number greater than The categories of the predetermined threshold are divided again until the number of elements of each category is not greater than the predetermined threshold.
步骤5:对步骤2中得到的代价矩阵金字塔,从顶层代价矩阵开始对各层代价矩阵进行自适应权重的代价积聚;自适应权重的代价积聚方法为,根据每个像素点p为中心一定窗口内的像素q与该点的欧氏距离dist(p,q)和灰度值差异|Ip-Iq|确定像素点q对于像素点p代价的贡献值,如此累加窗口所有像素对于像素p代价的贡献而得到p最终的代价值cost(p,d),具体的计算方法如下:Step 5: For the cost matrix pyramid obtained in step 2, start from the top-level cost matrix to accumulate the cost of adaptive weights for each layer of the cost matrix; the method of cost accumulation for adaptive weights is to use each pixel point p as the center for a certain window The Euclidean distance dist(p,q) and the gray value difference between the pixel q in the pixel q and the point |I p -I q | determine the contribution value of the pixel point q to the pixel point p cost, so that all pixels in the window are accumulated for the pixel p The final cost value cost(p,d) of p is obtained by the contribution of the cost. The specific calculation method is as follows:
weight(q,d)=exp(α*dis(p,q)+β*|Ip-Iq|)weight(q,d)=exp(α*dis(p,q)+β*|I p -I q |)
其中,weight(q,d)表示进行代价积聚时邻域像素的权重值,α、β是计算该权重值时涉及的参数,分别对应欧氏距离dist(p,q)和灰度值差异|Ip-Iq|的权重系数,一般要求均为正数且α+β=1。Among them, weight(q,d) represents the weight value of the neighborhood pixels when the cost is accumulated, α and β are the parameters involved in calculating the weight value, corresponding to the Euclidean distance dist(p,q) and the gray value difference| The weight coefficients of I p -I q | are generally required to be positive numbers and α+β=1.
步骤6:根据步骤4中所述的图像分割结果,对步骤5中处理后的代价矩阵进一步进行“投票式”分割约束下的代价积聚;Step 6: According to the image segmentation results described in step 4, the cost matrix processed in step 5 is further subjected to cost accumulation under the "voting" segmentation constraint;
请见图3,具体实现包括以下子步骤:See Figure 3, the specific implementation includes the following sub-steps:
步骤6.1:对每个图像分割块,分别累加该图像分割块中所有像素点的每个视差值对应的总代价,得到整个图像分割块中,匹配代价随视差值变化的视差-代价直方图;Step 6.1: For each image segmentation block, add up the total cost corresponding to each disparity value of all pixels in the image segmentation block, and obtain the disparity-cost histogram of the matching cost changing with the disparity value in the entire image segmentation block picture;
步骤6.2:根据直方图计算匹配代价均值,每个视差值与均值的差值以及这些差值的均值,并对其差值为负且绝对值大于差值均值的视差值赋以惩罚,即赋以一个负的代价值,按此方法得到一个对应于步骤6.1中所述的视差-代价直方图的视差-代价惩罚直方图;Step 6.2: Calculate the mean value of the matching cost, the difference between each disparity value and the mean value and the mean value of these differences according to the histogram, and assign a penalty to the disparity value whose difference is negative and whose absolute value is greater than the mean value of the difference, That is, a negative cost value is assigned, and a disparity-cost penalty histogram corresponding to the disparity-cost histogram described in step 6.1 is obtained in this way;
步骤6.3:对图像分割块逐像素地施加上述代价惩罚,即根据步骤6.2中所述的视差-代价惩罚直方图,对每个像素的视差值加上相应的代价惩罚;Step 6.3: Apply the above cost penalty to the image segmentation block pixel by pixel, that is, add the corresponding cost penalty to the disparity value of each pixel according to the disparity-cost penalty histogram described in step 6.2;
其中代价惩罚的计算方法如下:The cost penalty is calculated as follows:
其中,cd为分割块对应于视差d的代价,α为权重系数。Among them, c d is the cost of the segmentation block corresponding to the disparity d, and α is the weight coefficient.
步骤7:将该层代价积聚结果传递给下层代价矩阵;其具体实现包括以下子步骤:Step 7: Transfer the cost accumulation result of this layer to the lower layer cost matrix; its specific implementation includes the following sub-steps:
步骤7.1:分别对每个像素点在视差范围内的代价值按照式肆进行一维最小平方卷积;Step 7.1: Perform one-dimensional least square convolution on the cost value of each pixel within the parallax range according to formula 4;
其中,cost'(d)代表卷积后视差d对应的代价值,d'为视差搜索范围内其他视差值;Among them, cost'(d) represents the cost value corresponding to the parallax d after convolution, and d' is other parallax values within the parallax search range;
步骤7.2:根据金字塔像素对应关系,将该层每个像素的代价值累加到下层对应像素相应视差的代价值。Step 7.2: According to the pyramid pixel correspondence, add the cost value of each pixel in this layer to the cost value of the corresponding disparity of the corresponding pixel in the lower layer.
步骤8:从上往下对金字塔代价矩阵重复进行步骤5至步骤7的操作,直至原始代价矩阵,最后对原始代价矩阵进行步骤5和步骤6操作;Step 8: Repeat steps 5 to 7 on the pyramid cost matrix from top to bottom until the original cost matrix, and finally perform steps 5 and 6 on the original cost matrix;
步骤9:对步骤8中处理后得到的代价矩阵,按式伍对每个像素取代价最小且匹配置信度大于预定阈值的视差作为最终视差,匹配置信度Tconf即匹配代价次小值和最小值之比,对于只有匹配置信度大于预定阈值的像素才能首次取得视差。Step 9: For the cost matrix obtained after processing in step 8, replace the disparity with the smallest cost and the matching confidence greater than the predetermined threshold for each pixel according to Equation 5 as the final disparity. The ratio of the values, for the first time disparity can be obtained only for pixels whose matching confidence is greater than a predetermined threshold.
(式伍); (style five);
然后标记已匹配点和未匹配点,然后按式陆对每个已匹配点8邻域内的未匹配像素对应于该已匹配点的视差代价减去一定惩罚值P,从而将已匹配结果以代价的惩罚的形式扩散到邻域未匹配点。Then mark the matched point and the unmatched point, and then subtract a certain penalty value P from the disparity cost of the unmatched pixel in the 8 neighborhood of each matched point corresponding to the matched point according to the formula, so that the matched result is converted to the cost The form of the penalty is diffused to the neighborhood of unmatched points.
其中,p表示已匹配点,q表示未匹配点,P表示惩罚值,D(p)表示初始视差图D在p点处的取值。Among them, p represents the matched point, q represents the unmatched point, P represents the penalty value, and D(p) represents the value of the initial disparity map D at point p.
最后采用式柒所示的“赢家通吃”方法生成视差图。Finally, the "winner takes all" method shown in formula 7 is used to generate the disparity map.
步骤10:在原始影像集中选择另一张影像作为基准影像,重复执行上述步骤1至步骤9,生成另一幅视差图,通过对比两幅视差图对应像素的视差一致性检测误匹配点,得到去除误匹配点视差图;对去除误匹配点视差图进行视差内插,填补误匹配造成的黑洞,生成完整视差图;利用完整视差图和影像外方位元素,根据前方交会原理计算深度图和数字表面模型。Step 10: Select another image in the original image set as the reference image, repeat the above steps 1 to 9 to generate another disparity map, and detect the mismatching points by comparing the disparity consistency of the corresponding pixels of the two disparity maps to obtain Remove the disparity map of mismatching points; perform parallax interpolation on the disparity map of removed mismatching points, fill in the black holes caused by mismatching, and generate a complete disparity map; use the complete disparity map and the outer orientation elements of the image to calculate the depth map and digital according to the front intersection principle surface model.
左右视差一致性检测的数学度量为:The mathematical measure of left-right disparity consistency detection is:
LRC(p)=|DL-R(p)-DR-L(p+DL-R(p))| (式捌);LRC (p)=|D LR (p)-D RL (p+D LR (p))| (formula eight);
其中,DL-R表示以左图为参考影像的匹配结果,DR-L为以右图为参考影像的匹配结果,LRC(p)大于一定阈值的匹配点被认为是非法点。Among them, D LR represents the matching result with the left image as the reference image, D RL is the matching result with the right image as the reference image, and the matching points with LRC(p) greater than a certain threshold are considered as illegal points.
对上述视差图进行遮挡检测和视差内插,利用已有正确匹配点视差填补其邻域误匹配造成的黑洞,生成完整的视差图;Perform occlusion detection and parallax interpolation on the above disparity map, use the disparity of the existing correct matching point to fill the black hole caused by the mis-match of its neighborhood, and generate a complete disparity map;
其中,遮挡检测方法为:对于基准影像上的一个非法点p,在匹配影像上沿水平核线方向进行搜索,如果存在一个视差d使得D(p+d)-d<Td,则该点为误匹配,否则为遮挡,如式玖所示:Among them, the occlusion detection method is: for an illegal point p on the reference image, search along the horizontal epipolar line on the matching image, if there is a parallax d such that D(p+d)-d<T d , then the point It is a mismatch, otherwise it is an occlusion, as shown in formula 9:
视差内插方法为:The parallax interpolation method is:
其中,Dlow(q∈Np)表示从邻域中选择较小的视差,Dmedian(q∈Np)表示从邻域中选择视差中值。Among them, D low (q∈N p ) means to select a smaller disparity from the neighborhood, and D median (q∈N p ) means to choose the median value of the disparity from the neighborhood.
利用上述视差图和影像外方位元素可以通过前方交会计算深度图或数字表面模型。A depth map or a digital surface model can be calculated by forward intersection using the above disparity map and image exterior orientation elements.
应当理解的是,本说明书未详细阐述的部分均属于现有技术。It should be understood that the parts not described in detail in this specification belong to the prior art.
应当理解的是,上述针对较佳实施例的描述较为详细,并不能因此而认为是对本发明专利保护范围的限制,本领域的普通技术人员在本发明的启示下,在不脱离本发明权利要求所保护的范围情况下,还可以做出替换或变形,均落入本发明的保护范围之内,本发明的请求保护范围应以所附权利要求为准。It should be understood that the above-mentioned descriptions for the preferred embodiments are relatively detailed, and should not therefore be considered as limiting the scope of the patent protection of the present invention. Within the scope of protection, replacements or modifications can also be made, all of which fall within the protection scope of the present invention, and the scope of protection of the present invention should be based on the appended claims.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510251429.2A CN104820991B (en) | 2015-05-15 | 2015-05-15 | A kind of multiple soft-constraint solid matching method based on cost matrix |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510251429.2A CN104820991B (en) | 2015-05-15 | 2015-05-15 | A kind of multiple soft-constraint solid matching method based on cost matrix |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104820991A true CN104820991A (en) | 2015-08-05 |
CN104820991B CN104820991B (en) | 2017-10-03 |
Family
ID=53731276
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510251429.2A Active CN104820991B (en) | 2015-05-15 | 2015-05-15 | A kind of multiple soft-constraint solid matching method based on cost matrix |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104820991B (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106340036A (en) * | 2016-08-08 | 2017-01-18 | 东南大学 | Binocular stereoscopic vision-based stereo matching method |
CN107316326A (en) * | 2017-06-29 | 2017-11-03 | 海信集团有限公司 | Applied to disparity map computational methods of the binocular stereo vision based on side and device |
CN107507232A (en) * | 2017-07-14 | 2017-12-22 | 天津大学 | Stereo Matching Algorithm based on multiple dimensioned iteration |
CN107635127A (en) * | 2016-07-05 | 2018-01-26 | 现代自动车株式会社 | Need the Stereo image matching apparatus and method calculated on a small quantity |
CN108513120A (en) * | 2017-05-18 | 2018-09-07 | 苏州纯青智能科技有限公司 | A kind of three-dimensional image matching method based on left and right sight |
CN109886968A (en) * | 2019-02-18 | 2019-06-14 | 中国科学院遥感与数字地球研究所 | A Dense Matching Method for Linear Array Remote Sensing Image |
TWI665906B (en) * | 2018-07-04 | 2019-07-11 | 中華精測科技股份有限公司 | Method for detecting and processing stereoscopic image |
CN110060283A (en) * | 2019-04-17 | 2019-07-26 | 武汉大学 | It is a kind of to estimate half global dense Stereo Matching algorithm more |
CN110176060A (en) * | 2019-04-28 | 2019-08-27 | 华中科技大学 | Dense three-dimensional rebuilding method and system based on the guidance of multiple dimensioned Geometrical consistency |
CN110910438A (en) * | 2018-09-17 | 2020-03-24 | 中国科学院沈阳自动化研究所 | High-speed stereo matching algorithm for ultrahigh-resolution binocular image |
CN111462195A (en) * | 2020-04-09 | 2020-07-28 | 武汉大学 | Irregular angle direction cost aggregation path determination method based on mainline constraint |
CN112070819A (en) * | 2020-11-11 | 2020-12-11 | 湖南极点智能科技有限公司 | Face depth image construction method and device based on embedded system |
CN113610964A (en) * | 2021-05-18 | 2021-11-05 | 电子科技大学 | Three-dimensional reconstruction method based on binocular vision |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102026013A (en) * | 2010-12-18 | 2011-04-20 | 浙江大学 | Stereo video matching method based on affine transformation |
CN102665086A (en) * | 2012-04-26 | 2012-09-12 | 清华大学深圳研究生院 | Method for obtaining parallax by using region-based local stereo matching |
CN103325120A (en) * | 2013-06-30 | 2013-09-25 | 西南交通大学 | Rapid self-adaption binocular vision stereo matching method capable of supporting weight |
-
2015
- 2015-05-15 CN CN201510251429.2A patent/CN104820991B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102026013A (en) * | 2010-12-18 | 2011-04-20 | 浙江大学 | Stereo video matching method based on affine transformation |
CN102665086A (en) * | 2012-04-26 | 2012-09-12 | 清华大学深圳研究生院 | Method for obtaining parallax by using region-based local stereo matching |
CN103325120A (en) * | 2013-06-30 | 2013-09-25 | 西南交通大学 | Rapid self-adaption binocular vision stereo matching method capable of supporting weight |
Non-Patent Citations (4)
Title |
---|
HEIKO HIRSCHM¨ULLER AND DANIEL SCHARSTEIN: "Evaluation of Stereo Matching Costs on Images with Radiometric Differences", 《IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE》 * |
YONGJUN ZHANG 等: "Direct relative orientation with four independent constraints", 《2011 INTERNATIONAL SOCIETY FOR PHOTOGRAMMETRY AND REMOTE SENSING》 * |
孔相澧 等: "基于全局优化的保细节分层多视图立体匹配", 《计算机辅助设计与图形学学报》 * |
杨玉娟 等: "分层正交动态规划立体匹配算法", 《中国科学技术大学学报》 * |
Cited By (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107635127A (en) * | 2016-07-05 | 2018-01-26 | 现代自动车株式会社 | Need the Stereo image matching apparatus and method calculated on a small quantity |
CN107635127B (en) * | 2016-07-05 | 2020-06-12 | 现代自动车株式会社 | Stereoscopic image matching apparatus and method requiring small amount of calculation |
CN106340036A (en) * | 2016-08-08 | 2017-01-18 | 东南大学 | Binocular stereoscopic vision-based stereo matching method |
CN108513120A (en) * | 2017-05-18 | 2018-09-07 | 苏州纯青智能科技有限公司 | A kind of three-dimensional image matching method based on left and right sight |
CN107316326A (en) * | 2017-06-29 | 2017-11-03 | 海信集团有限公司 | Applied to disparity map computational methods of the binocular stereo vision based on side and device |
CN107316326B (en) * | 2017-06-29 | 2020-10-30 | 海信集团有限公司 | Edge-based disparity map calculation method and device applied to binocular stereo vision |
CN107507232B (en) * | 2017-07-14 | 2020-06-16 | 天津大学 | Stereo matching method based on multi-scale iteration |
CN107507232A (en) * | 2017-07-14 | 2017-12-22 | 天津大学 | Stereo Matching Algorithm based on multiple dimensioned iteration |
TWI665906B (en) * | 2018-07-04 | 2019-07-11 | 中華精測科技股份有限公司 | Method for detecting and processing stereoscopic image |
CN110910438B (en) * | 2018-09-17 | 2022-03-22 | 中国科学院沈阳自动化研究所 | High-speed stereo matching algorithm for ultrahigh-resolution binocular image |
CN110910438A (en) * | 2018-09-17 | 2020-03-24 | 中国科学院沈阳自动化研究所 | High-speed stereo matching algorithm for ultrahigh-resolution binocular image |
CN109886968A (en) * | 2019-02-18 | 2019-06-14 | 中国科学院遥感与数字地球研究所 | A Dense Matching Method for Linear Array Remote Sensing Image |
CN110060283A (en) * | 2019-04-17 | 2019-07-26 | 武汉大学 | It is a kind of to estimate half global dense Stereo Matching algorithm more |
CN110176060B (en) * | 2019-04-28 | 2020-09-18 | 华中科技大学 | Dense three-dimensional reconstruction method and system based on multi-scale geometric consistency guidance |
CN110176060A (en) * | 2019-04-28 | 2019-08-27 | 华中科技大学 | Dense three-dimensional rebuilding method and system based on the guidance of multiple dimensioned Geometrical consistency |
CN111462195A (en) * | 2020-04-09 | 2020-07-28 | 武汉大学 | Irregular angle direction cost aggregation path determination method based on mainline constraint |
CN111462195B (en) * | 2020-04-09 | 2022-06-07 | 武汉大学 | A method for determining the cost aggregation path for irregular angles and directions based on main line constraints |
CN112070819A (en) * | 2020-11-11 | 2020-12-11 | 湖南极点智能科技有限公司 | Face depth image construction method and device based on embedded system |
CN112070819B (en) * | 2020-11-11 | 2021-02-02 | 湖南极点智能科技有限公司 | Face depth image construction method and device based on embedded system |
CN113610964A (en) * | 2021-05-18 | 2021-11-05 | 电子科技大学 | Three-dimensional reconstruction method based on binocular vision |
CN113610964B (en) * | 2021-05-18 | 2023-06-02 | 电子科技大学 | A 3D reconstruction method based on binocular vision |
Also Published As
Publication number | Publication date |
---|---|
CN104820991B (en) | 2017-10-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104820991B (en) | A kind of multiple soft-constraint solid matching method based on cost matrix | |
CN106355570B (en) | A kind of binocular stereo vision matching method of combination depth characteristic | |
CN102750711B (en) | A kind of binocular video depth map calculating method based on Iamge Segmentation and estimation | |
CN104780355B (en) | Empty restorative procedure based on the degree of depth in a kind of View Synthesis | |
CN103106651B (en) | Method for obtaining parallax error plane based on three-dimensional hough | |
CN106504284A (en) | A kind of depth picture capturing method combined with structure light based on Stereo matching | |
CN104966289B (en) | A kind of depth estimation method based on 4D light fields | |
CN110659664B (en) | A method for recognizing small objects with high precision based on SSD | |
CN107301664A (en) | Improvement sectional perspective matching process based on similarity measure function | |
CN106408513A (en) | Super-resolution reconstruction method of depth map | |
CN107071383A (en) | The virtual visual point synthesizing method split based on image local | |
CN104166987B (en) | Parallax estimation method based on improved adaptive weighted summation and belief propagation | |
CN106060509B (en) | Introduce the free view-point image combining method of color correction | |
CN102903111B (en) | Large area based on Iamge Segmentation low texture area Stereo Matching Algorithm | |
CN107103610B (en) | automatic detection method for suspicious region matched with satellite images in stereo mapping | |
CN104182968A (en) | Method for segmenting fuzzy moving targets by wide-baseline multi-array optical detection system | |
CN108038887A (en) | Based on binocular RGB-D camera depth profile methods of estimation | |
CN117557617B (en) | Multi-view dense matching method, system and equipment based on plane priori optimization | |
CN113284230B (en) | Three-dimensional reconstruction method for image sequence | |
CN102740096A (en) | Space-time combination based dynamic scene stereo video matching method | |
CN106530336A (en) | Stereo matching algorithm based on color information and graph-cut theory | |
CN112435267B (en) | Disparity map calculation method for high-resolution urban satellite stereo image | |
CN107610148B (en) | A foreground segmentation method based on binocular stereo vision system | |
CN107341823B (en) | A Minimal Branch Stereo Matching Method Based on Feature Fusion | |
CN110942102B (en) | Probability relaxation epipolar matching method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |