CN117557617B - Multi-view dense matching method, system and equipment based on plane priori optimization - Google Patents

Multi-view dense matching method, system and equipment based on plane priori optimization Download PDF

Info

Publication number
CN117557617B
CN117557617B CN202410044496.6A CN202410044496A CN117557617B CN 117557617 B CN117557617 B CN 117557617B CN 202410044496 A CN202410044496 A CN 202410044496A CN 117557617 B CN117557617 B CN 117557617B
Authority
CN
China
Prior art keywords
current
determining
reference image
line
image
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.)
Active
Application number
CN202410044496.6A
Other languages
Chinese (zh)
Other versions
CN117557617A (en
Inventor
范雪妍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Normal University
Original Assignee
Shandong Normal University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Normal University filed Critical Shandong Normal University
Priority to CN202410044496.6A priority Critical patent/CN117557617B/en
Publication of CN117557617A publication Critical patent/CN117557617A/en
Application granted granted Critical
Publication of CN117557617B publication Critical patent/CN117557617B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10028Range image; Depth image; 3D point clouds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Image Processing (AREA)

Abstract

The invention aims to provide a multi-view dense matching method, system and equipment based on plane prior optimization, and relates to the technical field of dense matching. The method comprises the following steps: initializing depth information of all pixel points in a current reference image, and dividing the current reference image into a line characteristic region and a non-line characteristic region; determining a visible image set according to the visibility of the neighborhood pixel set of each pixel in the current reference image in the neighbor image set of the current reference image; constructing a new multi-view matching cost function by using the probability map model through the plane prior information, the visible image set and the current line features; updating the depth information of all pixel points in the current reference image according to the multi-view matching cost function to obtain a dense matching result of the current reference image; and fusing the dense matching results of the multiple images to obtain a multi-view dense matching result of the scene to be modeled. The invention can determine the depth information of the weak texture region by constructing a new multi-view matching cost function.

Description

一种基于平面先验优化的多视密集匹配方法、系统及设备A multi-view dense matching method, system and device based on plane prior optimization

技术领域Technical Field

本发明涉及密集匹配技术领域,特别是涉及一种基于平面先验优化的多视密集匹配方法、系统及设备。The present invention relates to the field of dense matching technology, and in particular to a multi-view dense matching method, system and device based on plane prior optimization.

背景技术Background Art

密集匹配是一种用于计算机视觉中的三维重建技术。该技术旨在从两个或多个二维影像中估计其对应场景的三维几何结构。与稀疏重建相比,密集匹配能够提供更准确的深度信息,并生成更具细节和真实感的三维模型。密集匹配的核心思想是通过像素级别的匹配将不同视点的影像重叠在一起,从而计算出每个像素的深度信息。这种匹配可以基于多种方法实现,最常用的实现方式是利用基于光度一致性的密集匹配方法实现。该方法的核心思想是通过将不同视角的影像对齐,使它们在光度上保持一致,并在此基础上进行像素级别的匹配,从而计算出每个像素的深度信息。该方法主要通过利用不同影像之间的光度信息来提高匹配的精度和鲁棒性。但在影像中的弱纹理区域,光度一致性不再可靠,所计算深度信息在弱纹理区域不准确,通过后续深度融合后所获得的密集点云存在发散的现象。Dense matching is a 3D reconstruction technique used in computer vision. The technique aims to estimate the 3D geometric structure of the corresponding scene from two or more 2D images. Compared with sparse reconstruction, dense matching can provide more accurate depth information and generate more detailed and realistic 3D models. The core idea of dense matching is to overlap images from different viewpoints through pixel-level matching to calculate the depth information of each pixel. This matching can be implemented based on a variety of methods. The most common implementation method is to use the dense matching method based on photometric consistency. The core idea of this method is to align images from different perspectives to make them consistent in photometrics, and then perform pixel-level matching on this basis to calculate the depth information of each pixel. This method mainly improves the accuracy and robustness of matching by utilizing the photometric information between different images. However, in the weak texture area of the image, the photometric consistency is no longer reliable, the calculated depth information is inaccurate in the weak texture area, and the dense point cloud obtained after subsequent depth fusion has a divergent phenomenon.

发明内容Summary of the invention

本发明的目的是提供一种基于平面先验优化的多视密集匹配方法、系统及设备,能够确定弱纹理区域的深度信息。The purpose of the present invention is to provide a multi-view dense matching method, system and device based on plane prior optimization, which can determine the depth information of weak texture areas.

为实现上述目的,本发明提供了如下方案:一种基于平面先验优化的多视密集匹配方法,包括:获取待建模场景的稀疏点云和多张影像;不同影像的拍摄角度不同;确定任一影像为当前参考影像;根据待建模场景的稀疏点云,从多张影像中确定当前参考影像的邻居影像集;利用稀疏点云的三角化处理,初始化当前参考图像中所有像素点的深度信息,得到当前参考影像初始化深度图;所述深度信息包括深度值和法线值;提取当前参考影像初始化深度图中的线特征集合;根据线特征集合,将当前参考影像划分为线特征区域和非线特征区域;根据所述线特征区域和所述非线特征区域,构建平面先验信息;确定当前参考影像中每个像素的邻域像素集;根据当前参考影像中每个像素的邻域像素集在当前参考影像的邻居影像集的可见性确定可见影像集;利用概率图模型将平面先验信息、可见影像集和多个当前线特征构建新的多视图匹配代价函数;根据多视图匹配代价函数更新当前参考图像中所有像素点的深度信息,得到当前参考影像的密集匹配结果;更新当前参考影像并返回步骤“根据待建模场景的稀疏点云,从多张影像中确定当前参考影像的邻居影像集”直至遍历所有影像,得到多张影像的密集匹配结果;对多张影像的密集匹配结果进行融合,得到待建模场景的多视密集匹配结果。To achieve the above-mentioned purpose, the present invention provides the following scheme: a multi-view dense matching method based on plane prior optimization, comprising: obtaining a sparse point cloud and multiple images of a scene to be modeled; different images have different shooting angles; determining any image as a current reference image; determining a neighbor image set of the current reference image from multiple images according to the sparse point cloud of the scene to be modeled; initializing the depth information of all pixels in the current reference image by triangulation processing of the sparse point cloud to obtain an initialized depth map of the current reference image; the depth information includes depth values and normal values; extracting a line feature set in the initialized depth map of the current reference image; dividing the current reference image into a line feature region and a non-line feature region according to the line feature set; constructing a plane prior according to the line feature region and the non-line feature region. Prior information; determine the neighborhood pixel set of each pixel in the current reference image; determine the visible image set according to the visibility of the neighborhood pixel set of each pixel in the current reference image in the neighbor image set of the current reference image; use the probabilistic graph model to construct a new multi-view matching cost function with the plane prior information, the visible image set and multiple current line features; update the depth information of all pixels in the current reference image according to the multi-view matching cost function to obtain the dense matching result of the current reference image; update the current reference image and return to the step "determine the neighbor image set of the current reference image from multiple images according to the sparse point cloud of the scene to be modeled" until all images are traversed to obtain the dense matching results of multiple images; fuse the dense matching results of multiple images to obtain the multi-view dense matching result of the scene to be modeled.

一种基于平面先验优化的多视密集匹配系统,包括:场景数据获取模块,用于获取待建模场景的稀疏点云和多张影像;不同影像的拍摄角度不同;当前参考影像确定模块,用于确定任一影像为当前参考影像;邻居影像集确定模块,用于根据待建模场景的稀疏点云,从多张影像中确定当前参考影像的邻居影像集;初始化深度模块,用于利用稀疏点云的三角化处理,初始化当前参考图像中所有像素点的深度信息,得到当前参考影像初始化深度图;所述深度信息包括深度值和法线值;线特征集合提取模块,用于提取当前参考影像初始化深度图中的线特征集合;线特征区域划分模块,用于根据线特征集合,将当前参考影像划分为线特征区域和非线特征区域;平面先验信息构建模块,用于根据所述线特征区域和所述非线特征区域,构建平面先验信息;邻域像素集确定模块,用于确定当前参考影像中每个像素的邻域像素集;可见影像集确定模块,用于根据当前参考影像中每个像素的邻域像素集在当前参考影像的邻居影像集的可见性确定可见影像集。A multi-view dense matching system based on plane prior optimization includes: a scene data acquisition module, used to acquire a sparse point cloud and multiple images of a scene to be modeled; different images have different shooting angles; a current reference image determination module, used to determine any image as the current reference image; a neighbor image set determination module, used to determine the neighbor image set of the current reference image from multiple images according to the sparse point cloud of the scene to be modeled; an initialization depth module, used to initialize the depth information of all pixels in the current reference image by triangulation processing of the sparse point cloud, and obtain an initialization depth map of the current reference image; the depth information includes depth values and method Line value; a line feature set extraction module, used to extract the line feature set in the initialization depth map of the current reference image; a line feature area division module, used to divide the current reference image into a line feature area and a non-line feature area according to the line feature set; a plane prior information construction module, used to construct plane prior information according to the line feature area and the non-line feature area; a neighborhood pixel set determination module, used to determine the neighborhood pixel set of each pixel in the current reference image; a visible image set determination module, used to determine the visible image set according to the visibility of the neighborhood pixel set of each pixel in the current reference image in the neighbor image set of the current reference image.

多视图匹配代价函数确定模块,用于利用概率图模型将平面先验信息、可见影像集和多个当前线特征构建新的多视图匹配代价函数;子密集匹配结果确定模块,用于根据多视图匹配代价函数更新当前参考图像中所有像素点的深度信息,得到当前参考影像的密集匹配结果;总密集匹配结果确定模块,用于更新当前参考影像并返回执行邻居影像集确定模块直至遍历所有影像,得到多张影像的密集匹配结果;多视密集匹配模块,用于对多张影像的密集匹配结果进行融合,得到待建模场景的多视密集匹配结果。A multi-view matching cost function determination module is used to use a probabilistic graph model to construct a new multi-view matching cost function using plane prior information, visible image sets and multiple current line features; a sub-dense matching result determination module is used to update the depth information of all pixels in the current reference image according to the multi-view matching cost function to obtain the dense matching result of the current reference image; a total dense matching result determination module is used to update the current reference image and return to execute the neighbor image set determination module until all images are traversed to obtain the dense matching results of multiple images; a multi-view dense matching module is used to fuse the dense matching results of multiple images to obtain the multi-view dense matching results of the scene to be modeled.

一种电子设备,包括存储器及处理器,所述存储器用于存储计算机程序,所述处理器运行所述计算机程序以使所述电子设备执行所述的一种基于平面先验优化的多视密集匹配方法。An electronic device comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute a multi-view dense matching method based on plane prior optimization.

根据本发明提供的具体实施例,本发明公开了以下技术效果:本发明的目的是提供一种基于平面先验优化的多视密集匹配方法、系统及设备,针对弱纹理区域的深度信息估计不准确问题,以ACMP算法为基础,设计一种基于场景线特征约束的平面先验辅助优化的多视密集匹配方法,并提出了两种不同阶段的深度信息优化方法,一是利用稀疏重建的稀疏点云初始化深度信息,实现较高精度的深度信息的快速传播;二是利用场景的线特征约束,构建高质量平面先验模型,优化弱纹理区域的深度信息,实现弱纹理区域的深度信息的准确计算。According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects: The purpose of the present invention is to provide a multi-view dense matching method, system and device based on plane prior optimization. In view of the problem of inaccurate depth information estimation in weak texture areas, a multi-view dense matching method based on plane prior assisted optimization with scene line feature constraints is designed based on the ACMP algorithm, and two depth information optimization methods at different stages are proposed. One is to initialize depth information using sparse point clouds reconstructed from sparse points to achieve rapid propagation of high-precision depth information; the other is to use the line feature constraints of the scene to construct a high-quality plane prior model, optimize the depth information in weak texture areas, and achieve accurate calculation of depth information in weak texture areas.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

图1为本发明实施例1中基于平面先验优化的多视密集匹配方法流程图。FIG1 is a flow chart of a multi-view dense matching method based on plane prior optimization in Embodiment 1 of the present invention.

图2为本发明实施例1中稀疏点在参考影像中构成的最小包围盒面积示意图。FIG. 2 is a schematic diagram of the minimum bounding box area formed by sparse points in a reference image in Embodiment 1 of the present invention.

图3为本发明实施例1中相机中心与稀疏点构成的夹角示意图。FIG. 3 is a schematic diagram of the angle formed by the camera center and the sparse points in Example 1 of the present invention.

图4为本发明实施例1中稀疏点为中心的单位球在影像上的投影距离。FIG. 4 is a diagram showing the projection distance of a unit sphere centered on a sparse point on an image in Embodiment 1 of the present invention.

图5为本发明实施例1中深度信息的随机初始化一次迭代结果示意图。FIG. 5 is a schematic diagram of a result of one iteration of random initialization of depth information in Embodiment 1 of the present invention.

图6为本发明实施例1中深度信息的随机初始化二次迭代结果示意图。FIG. 6 is a schematic diagram of a result of a second iteration of random initialization of depth information in Embodiment 1 of the present invention.

图7为本发明实施例1中深度信息的随机初始化三次迭代结果示意图。FIG. 7 is a schematic diagram of the results of three iterations of random initialization of depth information in Embodiment 1 of the present invention.

图8为本发明实施例1中深度信息规则初始化的一次迭代结果结果示意图。FIG. 8 is a schematic diagram of the result of one iteration of the depth information rule initialization in Embodiment 1 of the present invention.

图9为本发明实施例1中深度信息规则初始化的二次迭代结果结果示意图。FIG. 9 is a schematic diagram of secondary iteration results of depth information rule initialization in Embodiment 1 of the present invention.

图10为本发明实施例1中深度信息规则初始化的三次迭代结果结果示意图。FIG. 10 is a schematic diagram of the results of three iterations of initializing the depth information rule in Example 1 of the present invention.

图11为本发明实施例1中线段夹角判断示意图。FIG. 11 is a schematic diagram of determining the angle of a line segment in Embodiment 1 of the present invention.

图12为本发明实施例1中线段垂直距离判断示意图。FIG. 12 is a schematic diagram of determining the vertical distance of a line segment in Embodiment 1 of the present invention.

图13为本发明实施例1中线段端点距离判断示意图。FIG. 13 is a schematic diagram of determining the distance between endpoints of a line segment in Embodiment 1 of the present invention.

图14为本发明实施例1中线段重合判断示意图。FIG. 14 is a schematic diagram of line segment overlap determination in Embodiment 1 of the present invention.

图15为本发明实施例1中线段端点聚类判断示意图。FIG. 15 is a schematic diagram of segment endpoint clustering determination in Embodiment 1 of the present invention.

图16为本发明实施例1中原始影像示意图。FIG. 16 is a schematic diagram of an original image in Embodiment 1 of the present invention.

图17为本发明实施例1中掩模图示意图。FIG. 17 is a schematic diagram of a mask image in Embodiment 1 of the present invention.

图18为本发明实施例1中“红黑棋盘”并行传播策略示意图。FIG18 is a schematic diagram of the “red and black chessboard” parallel propagation strategy in Example 1 of the present invention.

图19为本发明实施例1中“红黑棋盘”并行传播策略传播路径示意图。FIG19 is a schematic diagram of the propagation path of the “red and black chessboard” parallel propagation strategy in Example 1 of the present invention.

图20为本发明实施例1中邻域像素示意图。FIG20 is a schematic diagram of neighborhood pixels in Example 1 of the present invention.

图21为本发明实施例1中ACMP方法对Dortmund数据集内区域一的平面先验信息提取结果示意图。FIG. 21 is a schematic diagram of the results of extracting plane prior information of region 1 in the Dortmund dataset using the ACMP method in Example 1 of the present invention.

图22为本发明实施例1对Dortmund数据集内区域一的平面先验信息提取结果示意图。FIG. 22 is a schematic diagram of the results of extracting plane prior information of region 1 in the Dortmund dataset according to Example 1 of the present invention.

图23为本发明实施例1中ACMP方法对Dortmund数据集内区域二的平面先验信息提取结果示意图。FIG23 is a schematic diagram of the results of extracting plane prior information of region 2 in the Dortmund dataset using the ACMP method in Example 1 of the present invention.

图24为本发明实施例1对Dortmund数据集内区域二的平面先验信息提取结果示意图。FIG. 24 is a schematic diagram of the results of plane prior information extraction for region 2 in the Dortmund dataset according to Example 1 of the present invention.

图25为本发明实施例1中ACMP方法对Garden数据集内区域三的平面先验信息提取结果示意图。FIG. 25 is a schematic diagram of the results of extracting plane prior information of region three in the Garden data set using the ACMP method in Example 1 of the present invention.

图26为本发明实施例1对Garden数据集内区域三的平面先验信息提取结果示意图。FIG26 is a schematic diagram of the results of extracting plane prior information of area three in the Garden data set according to Example 1 of the present invention.

图27为本发明实施例1中ACMP方法对Garden数据集内区域四的平面先验信息提取结果示意图。FIG27 is a schematic diagram of the results of extracting plane prior information of area 4 in the Garden data set using the ACMP method in Example 1 of the present invention.

图28为本发明实施例1对Garden数据集内区域四的平面先验信息提取结果示意图。FIG28 is a schematic diagram of the results of extracting plane prior information of area 4 in the Garden data set according to Example 1 of the present invention.

图29为本发明实施例1中ACMP方法对Central-Urban数据集内区域五的平面先验信息提取结果示意图。FIG29 is a schematic diagram of the results of extracting plane prior information of area five in the Central-Urban dataset using the ACMP method in Example 1 of the present invention.

图30为本发明实施例1对Central-Urban数据集内区域五的平面先验信息提取结果示意图。FIG30 is a schematic diagram of the results of plane prior information extraction for region five in the Central-Urban dataset according to Example 1 of the present invention.

图31为本发明实施例1中ACMP方法对Central-Urban数据集内区域六的平面先验信息提取结果示意图。FIG31 is a schematic diagram of the results of extracting plane prior information of area six in the Central-Urban dataset using the ACMP method in Example 1 of the present invention.

图32为本发明实施例1对Central-Urban数据集内区域六的平面先验信息提取结果示意图。FIG32 is a schematic diagram of the results of extracting plane prior information of area six in the Central-Urban dataset according to Example 1 of the present invention.

图33为本发明实施例1中ACMP方法对Dortmund数据集内区域一的深度信息计算结果示意图。FIG33 is a schematic diagram of the calculation results of the depth information of region 1 in the Dortmund dataset using the ACMP method in Example 1 of the present invention.

图34为本发明实施例1对Dortmund数据集内区域一的深度信息计算结果示意图。FIG34 is a schematic diagram of the depth information calculation results of region 1 in the Dortmund dataset according to Example 1 of the present invention.

图35为本发明实施例1中ACMP方法对Dortmund数据集内区域二的深度信息计算结果示意图。FIG35 is a schematic diagram showing the calculation results of the depth information of region 2 in the Dortmund dataset using the ACMP method in Example 1 of the present invention.

图36为本发明实施例1对Dortmund数据集内区域二的深度信息计算结果示意图。FIG36 is a schematic diagram of the depth information calculation results of region 2 in the Dortmund dataset according to Example 1 of the present invention.

图37为本发明实施例1中ACMP方法对Garden数据集内区域三的深度信息计算结果示意图。FIG37 is a schematic diagram of the depth information calculation results of area three in the Garden data set using the ACMP method in Example 1 of the present invention.

图38为本发明实施例1对Garden数据集内区域三的深度信息计算结果示意图。FIG38 is a schematic diagram of the depth information calculation results of area three in the Garden data set according to Example 1 of the present invention.

图39为本发明实施例1中ACMP方法对Garden数据集内区域四的深度信息计算结果示意图。FIG39 is a schematic diagram of the depth information calculation results of area 4 in the Garden data set using the ACMP method in Example 1 of the present invention.

图40为本发明实施例1对Garden数据集内区域四的深度信息计算结果示意图。FIG40 is a schematic diagram of the depth information calculation results of area 4 in the Garden data set according to Example 1 of the present invention.

图41为本发明实施例1中ACMP方法对Central-Urban数据集内区域五的深度信息计算结果示意图。FIG41 is a schematic diagram of the depth information calculation results of area five in the Central-Urban dataset using the ACMP method in Example 1 of the present invention.

图42为本发明实施例1对Central-Urban数据集内区域五的深度信息计算结果示意图。FIG42 is a schematic diagram of the depth information calculation results of area five in the Central-Urban dataset according to Example 1 of the present invention.

图43为本发明实施例1中ACMP方法对Central-Urban数据集内区域六的深度信息计算结果示意图。FIG43 is a schematic diagram of the depth information calculation results of area six in the Central-Urban dataset using the ACMP method in Example 1 of the present invention.

图44为本发明实施例1对Central-Urban数据集内区域六的深度信息计算结果示意图。FIG44 is a schematic diagram of the depth information calculation results of area six in the Central-Urban dataset according to Example 1 of the present invention.

图45为本发明实施例1中ACMP方法对Dortmund数据集内区域一的立面图。Figure 45 is a vertical view of area 1 in the Dortmund dataset using the ACMP method in Example 1 of the present invention.

图46为本发明实施例1对Dortmund数据集内区域一的立面图。FIG. 46 is an elevation view of area 1 in the Dortmund dataset according to Example 1 of the present invention.

图47为本发明实施例1中ACMP方法对Dortmund数据集内区域二的立面图。FIG47 is a vertical elevation diagram of region 2 in the Dortmund dataset using the ACMP method in Example 1 of the present invention.

图48为本发明实施例1对Dortmund数据集内区域二的立面图。FIG. 48 is an elevation view of area 2 in the Dortmund dataset according to Example 1 of the present invention.

图49为本发明实施例1中ACMP方法对Garden数据集内区域三的立面图。FIG49 is a vertical view of region three in the Garden data set using the ACMP method in Example 1 of the present invention.

图50为本发明实施例1对Garden数据集内区域三的立面图。FIG50 is a vertical view of area three in the Garden data set according to Example 1 of the present invention.

图51为本发明实施例1中ACMP方法对Garden数据集内区域四的立面图。Figure 51 is a vertical view of area 4 in the Garden data set using the ACMP method in Example 1 of the present invention.

图52为本发明实施例1对Garden数据集内区域四的立面图。FIG52 is a vertical elevation view of area 4 in the Garden data set according to Example 1 of the present invention.

图53为本发明实施例1中ACMP方法对Central-Urban数据集内区域五的立面图。Figure 53 is a vertical view of area 5 in the Central-Urban dataset using the ACMP method in Example 1 of the present invention.

图54为本发明实施例1对Central-Urban数据集内区域五的立面图。FIG54 is a elevation view of area five in the Central-Urban dataset according to Example 1 of the present invention.

图55为本发明实施例1中ACMP方法对Central-Urban数据集内区域六的立面图。Figure 55 is a vertical view of area six in the Central-Urban dataset using the ACMP method in Example 1 of the present invention.

图56为本发明实施例1对Central-Urban数据集内区域六的立面图。FIG56 is a elevation view of area six in the Central-Urban dataset according to Example 1 of the present invention.

具体实施方式DETAILED DESCRIPTION

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

本发明的目的是提供一种基于平面先验优化的多视密集匹配方法、系统及设备,能够确定弱纹理区域的深度信息。The purpose of the present invention is to provide a multi-view dense matching method, system and device based on plane prior optimization, which can determine the depth information of weak texture areas.

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

实施例1:如图1所示,本实施例提供了一种基于平面先验优化的多视密集匹配方法,包括:步骤101:获取待建模场景的稀疏点云和多张影像。不同影像的拍摄角度不同。Embodiment 1: As shown in FIG1 , this embodiment provides a multi-view dense matching method based on plane prior optimization, including: Step 101: obtaining a sparse point cloud and multiple images of a scene to be modeled. Different images are shot at different angles.

步骤102:确定任一影像为当前参考影像。Step 102: Determine any image as a current reference image.

步骤103:根据待建模场景的稀疏点云,从多张影像中确定当前参考影像的邻居影像集。Step 103: According to the sparse point cloud of the scene to be modeled, a neighbor image set of the current reference image is determined from multiple images.

步骤104:利用稀疏点云的三角化处理,初始化当前参考图像中所有像素点的深度信息,得到当前参考影像初始化深度图。深度信息包括深度值和法线值。Step 104: Initialize the depth information of all pixels in the current reference image by triangulation of the sparse point cloud to obtain the initialization depth map of the current reference image. The depth information includes depth values and normal values.

步骤105:提取当前参考影像初始化深度图中的线特征集合。Step 105: Extract the line feature set in the current reference image initialization depth map.

步骤106:根据线特征集合,将当前参考影像划分为线特征区域和非线特征区域。Step 106: Divide the current reference image into a line feature region and a non-line feature region according to the line feature set.

步骤107:根据线特征区域和非线特征区域,构建平面先验信息。Step 107: construct plane prior information based on the line feature area and the non-line feature area.

步骤108:确定当前参考影像中每个像素的邻域像素集。Step 108: Determine the neighborhood pixel set of each pixel in the current reference image.

步骤109:根据当前参考影像中每个像素的邻域像素集在当前参考影像的邻居影像集的可见性确定可见影像集。Step 109: Determine a visible image set according to the visibility of a neighborhood pixel set of each pixel in the current reference image in a neighbor image set of the current reference image.

步骤1010:利用概率图模型将平面先验信息、可见影像集和多个当前线特征构建新的多视图匹配代价函数。Step 1010: Use the probabilistic graphical model to construct a new multi-view matching cost function by combining the plane prior information, the visible image set and multiple current line features.

步骤1011:根据多视图匹配代价函数更新当前参考图像中所有像素点的深度信息,得到当前参考影像的密集匹配结果。Step 1011: Update the depth information of all pixels in the current reference image according to the multi-view matching cost function to obtain a dense matching result of the current reference image.

步骤1012:更新当前参考影像并返回步骤103直至遍历所有影像,得到多张影像的密集匹配结果。Step 1012: Update the current reference image and return to step 103 until all images are traversed to obtain dense matching results of multiple images.

步骤1013:对多张影像的密集匹配结果进行融合,得到待建模场景的多视密集匹配结果。Step 1013: Fuse the dense matching results of multiple images to obtain a multi-view dense matching result of the scene to be modeled.

步骤103,包括:Step 103 includes:

步骤103-1:从待建模场景的稀疏点云中确定当前参考影像的可见稀疏点集合。Step 103-1: Determine a set of visible sparse points of the current reference image from the sparse point cloud of the scene to be modeled.

步骤103-2:确定任一待定影像为当前待定影像。待定影像为除当前参考影像外的多张影像。Step 103-2: Determine any pending image as the current pending image. The pending images are multiple images other than the current reference image.

步骤103-3:从待建模场景的稀疏点云中确定当前待定影像的可见稀疏点集合。Step 103-3: Determine the visible sparse point set of the current image to be determined from the sparse point cloud of the scene to be modeled.

步骤103-4:确定当前参考影像的可见稀疏点集合与当前待定影像的可见稀疏点集合的交集为当前参考影像与当前待定影像的共同可见稀疏点集合。Step 103-4: Determine that the intersection of the visible sparse point set of the current reference image and the visible sparse point set of the current pending image is the common visible sparse point set of the current reference image and the current pending image.

步骤103-5:根据共同可见稀疏点集合,确定当前参考影像与当前待定影像的相关性得分。Step 103-5: Determine the correlation score between the current reference image and the current pending image based on the common visible sparse point set.

步骤103-6:更新当前待定影像,并返回步骤103-1,直至遍历所有待定影像,得到当前参考影像与所有待定影像的相关性得分。Step 103-6: Update the current pending image and return to step 103-1 until all pending images are traversed to obtain the correlation scores between the current reference image and all pending images.

步骤103-7:按照相关性得分对待定影像进行降序排列。Step 103-7: Arrange the pending images in descending order according to the correlation scores.

步骤103-8:确定前预设个数个待定影像为当前参考影像的邻居影像集。Step 103-8: Determine a preset number of pending images as a neighbor image set of the current reference image.

步骤104,包括:步骤104-1:将当前参考影像的可见稀疏点集合投影到当前参考影像上,得到当前参考影像的投影点集合。Step 104 includes: Step 104-1: projecting the visible sparse point set of the current reference image onto the current reference image to obtain the projection point set of the current reference image.

步骤104-2:利用Delaunay算法对当前参考影像的投影点集合进行三角剖分,生成二维网格。Step 104-2: Use the Delaunay algorithm to triangulate the projection point set of the current reference image to generate a two-dimensional grid.

步骤104-3:根据当前参考影像的投影点集合的稀疏深度信息,构建三维网格。Step 104-3: Construct a three-dimensional grid based on the sparse depth information of the projection point set of the current reference image.

步骤104-4:利用稀疏重建确定当前参考影像的影像位姿。Step 104-4: Determine the image pose of the current reference image using sparse reconstruction.

步骤104-5:确定当前参考影像中任一像素点为当前像素点。Step 104-5: Determine any pixel point in the current reference image as the current pixel point.

步骤104-6:根据影像位姿,计算当前像素点对应的当前投影光线。Step 104-6: Calculate the current projection light corresponding to the current pixel point according to the image posture.

步骤104-7:将当前投影光线投影至三维网格,确定三维网格中与当前投影光线相交的三角面片为当前三角面片。Step 104-7: Project the current projection light onto the three-dimensional mesh, and determine that the triangle facet in the three-dimensional mesh that intersects with the current projection light is the current triangle facet.

步骤104-8:根据当前三角面片的3个顶点坐标确定当前三角面片平面方程。Step 104-8: Determine the plane equation of the current triangle according to the coordinates of the three vertices of the current triangle.

步骤104-9:根据当前三角面片平面方程的系数,确定当前像素点的深度值和法线值。Step 104-9: Determine the depth value and normal value of the current pixel point according to the coefficients of the current triangle plane equation.

步骤104-10:更新当前像素点并返回步骤104-6,直至遍历当前参考影像中的所有像素点,得到当前参考影像初始化深度图。Step 104-10: Update the current pixel and return to step 104-6 until all pixels in the current reference image are traversed to obtain the initialization depth map of the current reference image.

步骤105,包括:步骤105-1:利用LSD直线检测法提取当前参考影像初始化深度图中的多个线特征,得到初始线特征集合。线特征为线段。Step 105 includes: Step 105-1: extract multiple line features in the initialization depth map of the current reference image using the LSD line detection method to obtain an initial line feature set. The line feature is a line segment.

步骤105-2:删除初始线特征集合中长度小于长度阈值的线特征。Step 105-2: Delete the line features in the initial line feature set whose length is less than the length threshold.

步骤105-3:连接初始线特征集合中共线的线特征。Step 105-3: Connect the collinear line features in the initial line feature set.

步骤105-4:确定初始线特征集合中任一线特征为当前线特征。Step 105-4: Determine any line feature in the initial line feature set as the current line feature.

步骤105-5:确定初始线特征集合中当前线特征之外的多个线特征为待匹配线特征。Step 105-5: Determine multiple line features other than the current line feature in the initial line feature set as line features to be matched.

步骤105-6:确定任一待匹配线特征为当前待匹配线特征。Step 105-6: Determine any line feature to be matched as the current line feature to be matched.

步骤105-7:确定当前线特征与当前待匹配线特征的夹角为当前夹角。Step 105-7: Determine the angle between the current line feature and the current line feature to be matched as the current angle.

步骤105-8:在当前夹角大于或等于夹角阈值时,更新当前待匹配线特征,并返回步骤105-7。Step 105-8: When the current angle is greater than or equal to the angle threshold, update the current line feature to be matched and return to step 105-7.

步骤105-9:在当前夹角小于夹角时,确定当前线特征与当前待匹配线特征为当前近似平行线特征对。Step 105-9: When the current angle is smaller than the angle, determine that the current line feature and the current line feature to be matched are a current approximately parallel line feature pair.

步骤105-10:根据当前待匹配线特征的两个端点坐标构建当前待匹配线特征的直线方程。Step 105-10: construct the straight line equation of the current line feature to be matched according to the coordinates of the two endpoints of the current line feature to be matched.

步骤105-11:根据当前待匹配线特征的直线方程,确定当前线特征的一个端点到当前待匹配线特征的距离为第一距离。Step 105-11: According to the straight line equation of the current line feature to be matched, determine the distance from one endpoint of the current line feature to the current line feature to be matched as the first distance.

步骤105-12:根据当前待匹配线特征的直线方程,确定当前线特征的另一个端点到当前待匹配线特征的距离为第二距离。Step 105-12: According to the straight line equation of the current line feature to be matched, determine the distance from the other endpoint of the current line feature to the current line feature to be matched as the second distance.

步骤105-13:确定第一距离和第二距离的均值为当前近似平行线特征对的垂直距离。Step 105-13: Determine the mean of the first distance and the second distance as the perpendicular distance of the current pair of approximate parallel line features.

步骤105-14:在垂直距离小于垂直距离阈值时,利用最小二乘法将当前近似平行线特征对进行拟合处理,得到拟合线特征。Step 105-14: When the vertical distance is less than the vertical distance threshold, the current approximate parallel line feature pair is fitted using the least squares method to obtain a fitted line feature.

步骤105-15:采用拟合线特征替换初始线特征集合中的当前近似平行线特征对。Step 105-15: Use the fitted line features to replace the current approximate parallel line feature pairs in the initial line feature set.

步骤105-16:将拟合线特征作为当前线特征,并返回步骤105-6直至遍历所有待匹配线特征。Step 105-16: Use the fitted line feature as the current line feature, and return to step 105-6 until all line features to be matched are traversed.

步骤105-17:更新当前线特征,并返回步骤105-5直至遍历初始线特征集合,确定待定线特征集合。Step 105-17: Update the current line feature and return to step 105-5 until the initial line feature set is traversed and the pending line feature set is determined.

步骤105-18:确定待定线特征集合中任一线特征为当前线特征。Step 105-18: Determine any line feature in the pending line feature set as the current line feature.

步骤105-19:确定当前线特征的任一端点为当前端点。Step 105-19: Determine any endpoint of the current line feature as the current endpoint.

步骤105-20:确定待定线特征集合中当前线特征外的所有线特征的端点为当前端点集合。Step 105-20: Determine the endpoints of all line features other than the current line feature in the pending line feature set as the current endpoint set.

步骤105-21:确定当前端点集合中与当前端点的距离小于距离阈值的多个端点为待合并端点。Step 105-21: Determine multiple endpoints in the current endpoint set whose distances from the current endpoint are less than a distance threshold as endpoints to be merged.

步骤105-22:确定当前端点与多个待合并端点为待合并点集。Step 105-22: Determine that the current endpoint and multiple endpoints to be merged are a point set to be merged.

步骤105-23:确定待合并点集所在的线特征为待合并线特征集合。Step 105-23: Determine the line features where the point set to be merged is located as the line feature set to be merged.

步骤105-24:确定待合并点集的坐标均值为合并点的坐标。Step 105-24: Determine the coordinate mean of the point set to be merged as the coordinate of the merged point.

步骤105-25:将待合并点集中的所有点均与合并点连接,得到合并线特征。Step 105-25: Connect all points in the point set to be merged with the merge point to obtain a merge line feature.

步骤105-26:采用合并线特征替换待定线特征集合中的待合并线特征集合,并返回步骤105-18直至遍历待定线特征集合,得到当前参考影像初始化深度图中的线特征集合。Step 105-26: Use the merged line features to replace the line feature set to be merged in the line feature set to be determined, and return to step 105-18 until the line feature set to be determined is traversed to obtain the line feature set in the depth map initialized by the current reference image.

步骤107,包括:步骤107-1:利用ACMH方法进行初匹配,确定当前参考影像中置信度小于第一置信度阈值的匹配点为待定结构点。Step 107 includes: Step 107-1: Performing initial matching using the ACMH method to determine matching points in the current reference image whose confidence level is less than a first confidence level threshold as pending structural points.

步骤107-2:确定线特征区域中所有待定结构点为选定结构点。Step 107-2: Determine all pending structural points in the line feature region as selected structural points.

步骤107-3:确定非线特征区域中置信度小于第二置信度阈值的候选结构点为选定结构点。第二置信度阈值小于第一置信度阈值。Step 107-3: Determine the candidate structure points in the non-linear feature region whose confidence is less than a second confidence threshold as selected structure points. The second confidence threshold is less than the first confidence threshold.

步骤107-4:基于多个选定结构点,采用Delaunay算法构网生成多个三角图元。Step 107-4: Based on the multiple selected structural points, a Delaunay algorithm is used to construct a mesh to generate multiple triangular primitives.

步骤107-5:确定任一三角图元为当前三角图元。Step 107-5: Determine any triangle primitive as the current triangle primitive.

步骤107-6:根据当前三角图元的3个顶点确定当前平面先验信息。Step 107-6: Determine the current plane prior information based on the three vertices of the current triangle primitive.

步骤107-7:构建当前三角图元的平面方程。Step 107-7: Construct the plane equation of the current triangle primitive.

步骤107-8:确定当前平面先验信息为当前三角图元中所有像素的平面先验信息。Step 107-8: Determine that the current plane prior information is the plane prior information of all pixels in the current triangle primitive.

步骤107-9:更新当前三角图元,并返回步骤107-6直至遍历所有三角图元,确定当前参考影像中所有像素的平面先验信息。Step 107-9: Update the current triangle primitive and return to step 107-6 until all triangle primitives are traversed to determine the plane prior information of all pixels in the current reference image.

步骤1010,包括:步骤1010-1:确定任一像素为当前像素。Step 1010 includes: Step 1010-1: Determine any pixel as the current pixel.

步骤1010-2:确定当前像素的深度信息和当前像素的邻域像素集中每个邻域像素的深度信息为候选假设集。Step 1010-2: Determine the depth information of the current pixel and the depth information of each neighboring pixel in the neighborhood pixel set of the current pixel as a candidate hypothesis set.

步骤1010-3:确定当前像素在选取候选假设集中每个候选假设时与可见影像的光度一致性构建匹配代价矩阵。Step 1010-3: Determine the photometric consistency of the current pixel with the visible image when selecting each candidate hypothesis in the candidate hypothesis set to construct a matching cost matrix.

步骤1010-4:根据匹配代价矩阵确定每个候选假设的最终匹配代价。Step 1010-4: Determine the final matching cost of each candidate hypothesis according to the matching cost matrix.

步骤1010-5:更新当前像素并返回步骤1010-4,得到每像素选取不同候选假设的最终匹配代价。Step 1010-5: Update the current pixel and return to step 1010-4 to obtain the final matching cost of selecting different candidate hypotheses for each pixel.

步骤1010-6:根据每像素选取不同候选假设的最终匹配代价,以及每个像素的平面先验信息,构建平面优化概率图模型。Step 1010-6: construct a plane optimization probability graph model based on the final matching costs of different candidate hypotheses selected for each pixel and the plane prior information of each pixel.

具体的,本实施例一种基于平面先验优化的多视密集匹配方法,核心步骤大致可包括:(1)影像组合的计算:以每张影像和稀疏点云为数据源,依次作为参考影像,基于参考影像与剩余影像间的共同可见的稀疏点、投影面积、夹角等因子计算得分,为其选出一组邻居影像集合。(2)深度信息的初始化:利用以稀疏点云及影像位姿计为数据输入,经过稀疏点云的三角化完成对每张参考图像的深度信息初始化任务。(3)场景线特征区域提取:场景的线特征区域是以从影像中提取出的线特征为中心,一定像素大小为半径,所建立的线型缓冲区域。在影像中,弱纹理区域通常具有较强的平面特性,这些区域提取的线特征较少,因此通常为非线特征区域。相反,强纹理区域通常具有明显的结构特征,这些区域提取的线特征较多,因此通常为线特征区域。要想完成场景线特征区域提取,首先经过尺度缩放、梯度计算、区域生长等步骤提取直线段;然后经过细碎线段过滤、位于同一直线上的线段的连接、对不位于同一条直线但端点距离相近的线段的连接等步骤完成线段封闭。(4)平面先验优化的深度值优化策略:主要包括平面先验信息提取、像素级别的影像选择和构建平面优化模型。首先利用选取的置信度较好的匹配点作为结构点构建平面先验信息,然后利用每个像素的邻域像素在邻居影像的可见性来选择可见影像集,其次利用概率图模型将平面先验信息、光度一致性以及上一步骤中提取的场景线特征进行结合,构建新的多视图匹配代价函数,完成深度值的优化,最终达到提升弱纹理区域深度值精度的目的。Specifically, the core steps of the multi-view dense matching method based on plane prior optimization in this embodiment may include: (1) Calculation of image combination: using each image and sparse point cloud as data sources, and taking them as reference images in turn, the scores are calculated based on factors such as the commonly visible sparse points, projection area, and angle between the reference image and the remaining images, and a set of neighbor image sets is selected for it. (2) Initialization of depth information: using the sparse point cloud and image pose as data input, the depth information initialization task of each reference image is completed through triangulation of the sparse point cloud. (3) Scene line feature region extraction: The line feature region of the scene is a linear buffer region established with the line feature extracted from the image as the center and a certain pixel size as the radius. In the image, weak texture regions usually have strong plane characteristics, and fewer line features are extracted from these regions, so they are usually non-line feature regions. On the contrary, strong texture regions usually have obvious structural features, and more line features are extracted from these regions, so they are usually line feature regions. To complete the scene line feature region extraction, first extract the straight line segment through the steps of scale scaling, gradient calculation, and region growing; then complete the line segment closure through the steps of fine segment filtering, connecting the line segments on the same straight line, and connecting the line segments that are not on the same straight line but have similar endpoint distances. (4) Depth value optimization strategy of plane prior optimization: mainly includes plane prior information extraction, pixel-level image selection, and plane optimization model construction. First, use the selected matching points with good confidence as structural points to construct plane prior information, and then use the visibility of each pixel's neighborhood pixels in the neighboring images to select the visible image set. Secondly, use the probabilistic graph model to combine the plane prior information, photometric consistency, and the scene line features extracted in the previous step to construct a new multi-view matching cost function to optimize the depth value, and finally achieve the purpose of improving the depth value accuracy of the weak texture area.

1.密集匹配预处理。1. Dense matching preprocessing.

1.1 影像组合的计算。1.1 Calculation of image combination.

在进行多视密集匹配时,每张影像将依次作为参考影像,影像组合的计算是为每张参考影像选出一组邻居影像集合,便于在多视密集匹配和深度融合等后续步骤中使用。本实施例依据全局视图选择算法,为场景中每张影像选出一组具有良好邻域的影像集合。这些影像在场景内容、外观和尺度方面都是理想的邻居影像。其核心思想是基于参考影像与剩余影像间的共同可见的稀疏点p计算相关性得分,得分按照从高到低进行排序,根据得分排序从影像集中挑选出Nbest张影像作为参考影像的邻居影像。在本实施例中取。相关性得分计算公式如式(1):When performing multi-view dense matching, each image will be used as a reference image in turn, and the calculation of the image combination is to select a set of neighboring images for each reference image, so as to facilitate use in subsequent steps such as multi-view dense matching and deep fusion. This embodiment selects a set of images with good neighborhoods for each image in the scene based on the global view selection algorithm. These images are ideal neighbor images in terms of scene content, appearance and scale. The core idea is to calculate the correlation score based on the commonly visible sparse points p between the reference image and the remaining images. The scores are sorted from high to low, and the N best images are selected from the image set as neighbor images of the reference image according to the score sorting. In this embodiment, . Relevance score The calculation formula is as follows:

.

式(1)中,为参考影像Ir所见稀疏点集合,为影像In所见稀疏点集合。为参考影像Ir和影像In的共同可见的稀疏点p构成的面积权重因子,计算公式如式(2)。In formula (1), is the sparse point set seen in the reference image I r , is the sparse point set seen in image I n . is the area weight factor composed of the sparse points p that are commonly visible in the reference image I r and the image I n , and the calculation formula is as shown in formula (2).

(2)。 (2).

其中,为共同可见的稀疏点在参考影像中构成的最小包围盒面积,如图2;为参考影像Ir的图幅面积。图2中,实线框表示参考影像Ir,虚线框表示影像In,标注有“橙”字的圆圈表示参考影像可见稀疏点;标注有“紫”字的圆圈表示影像In可见稀疏点;标注有“蓝”字的圆圈表示参考影像与影像In共同可见的稀疏点。in, It is the minimum bounding box area formed by the commonly visible sparse points in the reference image, as shown in Figure 2; is the image area of the reference image I r . In Figure 2, the solid line frame represents the reference image I r , the dotted line frame represents the image I n , the circles marked with “orange” represent the sparse points visible in the reference image; the circles marked with “purple” represent the sparse points visible in the image I n ; the circles marked with “blue” represent the sparse points visible in both the reference image and the image I n .

式(1)中,为参考影像Ir和影像In在共同可见的稀疏点p上构成的角度权重因子,计算公式如式(3)。In formula (1), is the angle weight factor formed by the reference image I r and the image I n at the commonly visible sparse point p, and the calculation formula is as shown in formula (3).

(3)。 (3).

其中,表示参考影像Ir和影像In对应的相机中心与稀疏点p构成的夹角,如图3所示。图3中,标注有“橙”字的圆圈表示参考影像可见稀疏点;标注有“紫”字的圆圈表示影像In可见稀疏点;标注有“蓝”字的圆圈表示参考影像与影像In共同可见的稀疏点。在实际应用中应取在一定的范围内,若较小,参考影像Ir和影像In所形成的成像几何条件较差,造成深度值估计不准确;若较大,参考影像Ir和影像In之间的视角差异较大,容易引起匹配代价计算不准确。因此,本实施例选取最小角,最大角in, represents the angle between the camera center and the sparse point p corresponding to the reference image I r and the image I n , as shown in Figure 3. In Figure 3, the circle marked with "orange" indicates the sparse point visible in the reference image; the circle marked with "purple" indicates the sparse point visible in the image I n ; the circle marked with "blue" indicates the sparse point visible in both the reference image and the image I n . Should be within a certain range. If the image geometry formed by the reference image I r and the image I n is poor, the depth value estimation is inaccurate. The larger the angle of view, the greater the difference between the reference image I r and the image I n , which may easily lead to inaccurate calculation of the matching cost. , the maximum angle .

式(1)中,为参考影像Ir和影像In在共同可见的稀疏点p上构成的尺度权重因子,计算公式如式(4)。In formula (1), is the scale weight factor of the reference image Ir and the image In at the commonly visible sparse point p, and the calculation formula is as shown in formula (4).

(4)。 (4).

其中,表示以稀疏点p为中心的单位球在影像Ii上的投影距离,如图4所示。当稀疏点p为中心的单位球在参考影像Ir和影像In上的投影距离的尺度差异较小时,则稀疏点p在影像Ir和In的分辨率相似,匹配代价的计算越准确。in, , It represents the projection distance of the unit sphere centered on the sparse point p on the image I i , as shown in Figure 4. When the scale difference of the projection distance of the unit sphere centered on the sparse point p on the reference image I r and the image I n is small, the resolution of the sparse point p in the images I r and I n is similar, and the calculation of the matching cost is more accurate.

1.2 深度信息的初始化。1.2 Initialization of depth information.

基于光度一致性的密集匹配算法在使用稀疏点云方面效果不佳。例如仅根据稀疏点云的深度范围来随机初始化深度信息。虽然基于光度一致性的密集匹配算法不需要很好的初始值,但这会增加算法的迭代次数,降低稳健性,尤其是当场景深度范围较大时。为了克服这些问题,本实施例使用稀疏重建步骤得到的稀疏点云初始化深度信息。这可以为每张影像生成更准确的初始深度信息。该过程包括稀疏点云的规则化和规则初始化深度信息。Dense matching algorithms based on photometric consistency do not work well with sparse point clouds. For example, the depth information is randomly initialized based only on the depth range of the sparse point cloud. Although dense matching algorithms based on photometric consistency do not require good initial values, this will increase the number of iterations of the algorithm and reduce robustness, especially when the scene depth range is large. To overcome these problems, the present embodiment uses the sparse point cloud obtained in the sparse reconstruction step to initialize the depth information. This can generate more accurate initial depth information for each image. The process includes regularization of the sparse point cloud and regular initialization of the depth information.

稀疏点云规则化是指利用影像Ii可见的稀疏点云获取场景的大致形状。该过程分为三个步骤:首先将稀疏点云投影到影像Ii上,得到对应的投影点集合;然后利用Delaunay算法对投影点进行三角剖分,生成二维网格;最后结合投影点的深度信息,将二维网格转换为三维网格Mi。具体地说,对于每个投影点,其深度信息可以通过稀疏重建算法估计得到。利用Delaunay算法生成二维网格后,投影点之间的连接关系已知。将投影点的深度信息与投影点之间的连接关系进行结合,可以将二维网格转换为三维网格,从而获得场景的大致形状。Sparse point cloud regularization refers to the use of sparse point clouds visible in image I i Get the approximate shape of the scene. The process is divided into three steps: first, the sparse point cloud Project it onto image I i and get the corresponding projection point set ; Then the projection points are triangulated using the Delaunay algorithm to generate a two-dimensional mesh; Finally, the two-dimensional mesh is converted into a three-dimensional mesh Mi by combining the depth information of the projection points. Specifically, for each projection point, its depth information can be estimated by a sparse reconstruction algorithm. After the two-dimensional mesh is generated using the Delaunay algorithm, the connection relationship between the projection points is known. Combining the depth information of the projection points with the connection relationship between the projection points can convert the two-dimensional mesh into a three-dimensional mesh, thereby obtaining the approximate shape of the scene.

规则初始化深度信息是利用影像Ii计算得出的三维网格Mi对影像Ii的深度信息进行初始化。该过程分为三个步骤:首先根据稀疏重建获得的影像位姿计算影像Ii中像素对应的投影光线。将投影光线投影至三维网格Mi中,获得与投影光线相交的三角面片;然后基于三角面片的顶点坐标计算三角面片所在平面的数学表达式;最后根据式(5)计算像素 的初始深度信息,即深度值和法线值The rule of initializing depth information is to use the three-dimensional grid Mi calculated from image Ii to initialize the depth information of image Ii . The process is divided into three steps: First, the pixel position in image Ii is calculated based on the image pose obtained by sparse reconstruction. The corresponding projection light . Project the light Projected into the three-dimensional grid Mi , obtain the same Intersecting triangles ; Then calculate the mathematical expression of the plane where the triangle is located based on the vertex coordinates of the triangle ; Finally, the pixel is calculated according to formula (5) The initial depth information, that is, the depth value and normal value .

(5)。 (5).

其中,表示投影光线与三角面片的交点坐标。对影像Ii的全部像素重复上述计算,最终得到影像Ii的初始深度信息。in, Represents projection light With triangles The above calculation is repeated for all pixels of image I i , and finally the initial depth information of image I i is obtained.

对于影像中特征显著的强纹理区域,无论是随机初始化还是规则初始化都可以得到接近真值的初值。但是规则初始化利用了场景结构保持较好的稀疏点云信息,因此相对于随机初始化,规则初始化所需迭代次数更少,而且更加稳健。对于影像中特征不显著的弱纹理区域,规则初始化相比于随机初始化能够获得更接近真值的初值。深度信息的随机初始化以及规则初始化的迭代结果如图5-图10所示。For strong texture areas with significant features in the image, both random initialization and rule initialization can obtain initial values close to the true value. However, rule initialization uses sparse point cloud information with good scene structure preservation, so it requires fewer iterations and is more robust than random initialization. For weak texture areas with insignificant features in the image, rule initialization can obtain initial values closer to the true value than random initialization. The iterative results of random initialization and rule initialization of depth information are shown in Figures 5 to 10.

2.基于场景线特征约束的多视密集匹配。2. Multi-view dense matching based on scene line feature constraints.

通过多视密集匹配获得的每张倾斜影像的深度图是基于倾斜影像三维重建的重要数据源。然而在倾斜影像处理过程中通常会存在两方面的问题:(1)在倾斜影像中的弱纹理区域光度一致性不再可靠,导致影像之间的匹配结果不准确。(2)ACMP算法在构建平面先验模型时并没有考虑场景的结构特征,导致所获得平面先验信息不准确。针对以上两方面的问题,本实施例以ACMP算法为基础,设计一种基于场景线特征约束的平面先验辅助优化的多视密集匹配方法。其核心思想是由于影像的线特征能够大体描绘场景的结构特征,因此基于每张影像的线特征,将影像划分为线特征区域以及非线特征区域。针对不同区域选取不同置信区间的匹配点作为结构点,构建Delaunay三角网生成高质量的平面先验信息。结合平面先验信息和影像之间光度一致性构建平面优化概率图模型,使弱纹理区域的深度信息趋向于平面结构的深度信息,从而优化弱纹理区域深度信息估计不准确问题。主要流程包括场景线特征区域提取以及平面先验辅助优化的多视密集匹配。The depth map of each oblique image obtained by multi-view dense matching is an important data source for three-dimensional reconstruction based on oblique images. However, there are usually two problems in the process of oblique image processing: (1) The photometric consistency of weak texture areas in oblique images is no longer reliable, resulting in inaccurate matching results between images. (2) The ACMP algorithm does not consider the structural features of the scene when constructing the plane prior model, resulting in inaccurate plane prior information. In response to the above two problems, this embodiment is based on the ACMP algorithm and designs a multi-view dense matching method based on the plane prior assisted optimization of the scene line feature constraint. The core idea is that since the line features of the image can roughly describe the structural features of the scene, the image is divided into a line feature area and a non-line feature area based on the line features of each image. Matching points with different confidence intervals are selected as structural points for different areas, and a Delaunay triangulation is constructed to generate high-quality plane prior information. A plane optimization probability graph model is constructed by combining the plane prior information and the photometric consistency between images, so that the depth information of the weak texture area tends to the depth information of the plane structure, thereby optimizing the problem of inaccurate depth information estimation in the weak texture area. The main process includes scene line feature region extraction and multi-view dense matching assisted by plane prior optimization.

1 场景线特征区域提取。1 Scene line feature region extraction.

场景的线特征区域是以从影像中提取出的线特征为中心,一定像素大小为半径,所建立的线型缓冲区域。在影像中,弱纹理区域通常具有较强的平面特性,这些区域提取的线特征较少,因此通常为非线特征区域。相反,强纹理区域通常具有明显的结构特征,这些区域提取的线特征较多,因此通常为线特征区域。在影像中的非线特征区域选取少量高置信度的匹配点作为结构点,保证弱纹理区域生成较大的三角图元,从而在弱纹理区域采用较大平面结构约束,以保留平面结构处的深度信息平整;反之,在影像中的线特征区域选取大量具有可信置信度的匹配点作为结构点,保证强纹理区域生成较为细碎的三角图元,从而在强纹理区域采用较小平面结构约束,以保留边缘结构处深度信息突变。The line feature area of the scene is a linear buffer area established with the line feature extracted from the image as the center and a certain pixel size as the radius. In the image, weak texture areas usually have strong planar characteristics, and fewer line features are extracted from these areas, so they are usually non-line feature areas. On the contrary, strong texture areas usually have obvious structural features, and more line features are extracted from these areas, so they are usually line feature areas. A small number of high-confidence matching points are selected as structural points in the non-line feature area of the image to ensure that the weak texture area generates larger triangular primitives, so that a larger plane structure constraint is used in the weak texture area to retain the flatness of the depth information at the plane structure; on the contrary, a large number of matching points with credible confidence are selected as structural points in the line feature area of the image to ensure that the strong texture area generates relatively fine triangular primitives, so that a smaller plane structure constraint is used in the strong texture area to retain the depth information mutation at the edge structure.

当前,常用的线特征检测方法有:Canny边缘检测算法、Hough变换检测法、EDLines直线检测法、LSD直线检测法。Currently, the commonly used line feature detection methods are: Canny edge detection algorithm, Hough transform detection method, EDLines straight line detection method, and LSD straight line detection method.

(1)Canny边缘检测算法:Canny边缘检测算法的基本思想是利用图像中的梯度信息,通过多个步骤检测出图像中的边缘。Canny算法能够精确地检测出图像中的边缘,并对边缘进行精细的提取,且通过高斯滤波去除了图像中的噪声,能够有效地提高边缘检测的准确度。但Canny算法需要对图像进行多次卷积和运算,计算量较大,处理速度较慢。算法中的阈值需要根据具体的图像进行调节,如何选择阈值并没有一个明确的规定,需要根据实际情况进行尝试和调整。总的来说,Canny边缘检测算法是一种高精度的图像边缘检测算法,但在实际应用中需要考虑到其计算量大和参数设定较难等问题。(1) Canny edge detection algorithm: The basic idea of the Canny edge detection algorithm is to use the gradient information in the image to detect the edges in the image through multiple steps. The Canny algorithm can accurately detect the edges in the image and extract the edges finely. It also removes the noise in the image through Gaussian filtering, which can effectively improve the accuracy of edge detection. However, the Canny algorithm requires multiple convolutions and operations on the image, which requires a large amount of calculation and a slow processing speed. The threshold in the algorithm needs to be adjusted according to the specific image. There is no clear regulation on how to choose the threshold, and it needs to be tried and adjusted according to the actual situation. In general, the Canny edge detection algorithm is a high-precision image edge detection algorithm, but in practical applications, it is necessary to consider its large amount of calculation and difficult parameter setting.

(2) Hough变换检测法:Hough变换是将图像坐标空间变换到参数空间,利用点与线的对偶性,将原始图像空间中的曲线,通过曲线表达形式转化为参数空间中的一个点。这样就把原始图像中的曲线检测问题转化为寻找参数空间中的峰值问题。Hough变换检测法对于不规则形状的检测效果好,可以检测任意形状的对象,包括直线、圆、多边形等不规则形状。但该方法计算复杂度高,需要对每个像素点进行计算,因此在处理大图像时计算复杂度较高,而且该方法通常会存在计算上的误差。(2) Hough transform detection method: Hough transform transforms the image coordinate space into parameter space, and uses the duality of points and lines to transform the curve in the original image space into a point in the parameter space through curve expression. In this way, the curve detection problem in the original image is transformed into the problem of finding the peak in the parameter space. The Hough transform detection method has a good effect on the detection of irregular shapes and can detect objects of any shape, including irregular shapes such as straight lines, circles, and polygons. However, this method has high computational complexity and needs to be calculated for each pixel. Therefore, the computational complexity is high when processing large images, and this method usually has computational errors.

(3) EDLines直线检测法:EDLines直线检测法的基本思想是首先通过在提前生成的像素链上遍历,将所有的初始直线段筛选出来,并利用拟合方法将其进行拟合,使其成为更加完整的直线段。该方法通过连接边缘点来提取直线段,可以得到较为准确的直线段检测结果,且该方法具有较快的计算速度。但该方法对噪声和部分遮挡比较敏感,容易影响直线段检测结果的准确性。且该方法的直线段检测结果与参数选择有关,需要进行一定的参数调节才能得到较好的检测效果。(3) EDLines line detection method: The basic idea of EDLines line detection method is to first traverse the pixel chain generated in advance to screen out all the initial straight line segments, and then use the fitting method to fit them to make them more complete straight line segments. This method extracts straight line segments by connecting edge points, and can obtain more accurate straight line segment detection results. This method has a faster calculation speed. However, this method is sensitive to noise and partial occlusion, which can easily affect the accuracy of straight line segment detection results. In addition, the straight line segment detection results of this method are related to parameter selection, and certain parameter adjustments are required to obtain better detection results.

(4) LSD直线检测法:LSD直线检测算法是一种基于图像梯度的直线检测算法,它能够在线性时间内检测亚像素级别的直线,通过合并相似梯度方向的像素点来提高计算速度,同时具有自适应的参数调整和可控的错误率。因此,LSD直线检测算法在现代直线检测算法中被视为里程碑。但是该算法对直线长度有一定的限制,长直线容易被分割成多个短直线。(4) LSD line detection method: The LSD line detection algorithm is a line detection algorithm based on image gradients. It can detect sub-pixel lines in linear time and improve the calculation speed by merging pixels with similar gradient directions. It also has adaptive parameter adjustment and controllable error rate. Therefore, the LSD line detection algorithm is regarded as a milestone in modern line detection algorithms. However, the algorithm has certain limitations on the length of lines, and long lines are easily split into multiple short lines.

在上述四种线特征检测算法中,Canny边缘检测算法和Hough变换检测法计算复杂度较高,所需运行时间较长,因此这两种方法并不适用于本实施例方法中的线特征提取。相比之下,LSD直线检测法与EDLines直线检测法均具有较快的检测速度,但LSD直线检测法能够利用自适应的参数检测亚像素级别的直线。为此,本实施例基于LSD直线检测法提取影像中的线特征,并以此对影像进行二值划分,将影像划分为线特征区域以及非线特征区域。Among the above four line feature detection algorithms, the Canny edge detection algorithm and the Hough transform detection method have high computational complexity and require long running time, so these two methods are not suitable for line feature extraction in the method of this embodiment. In contrast, both the LSD line detection method and the EDLines line detection method have faster detection speeds, but the LSD line detection method can use adaptive parameters to detect sub-pixel level lines. To this end, this embodiment extracts line features in the image based on the LSD line detection method, and uses this to perform binary division on the image, dividing the image into a line feature area and a non-line feature area.

LSD直线检测法主要包括四个关键步骤,分别为:尺度缩放、梯度计算、区域生长以及直线提取。The LSD line detection method mainly includes four key steps: scale scaling, gradient calculation, region growing and line extraction.

(1)尺度缩放:通过高斯降采样对影像进行尺度缩放,从而减缓或解决影像中出现的混叠与量化伪像问题。(1) Scaling: The image is scaled by Gaussian downsampling to reduce or resolve the aliasing and quantization artifacts that appear in the image.

(2)梯度计算:梯度计算通常使用每个像素点的右侧和下方的像素,计算该像素点对应的梯度大小和方向,具体计算公式如式(6)、式(7)所示。这种方法旨在尽可能少地使用其他像素,从而增强其对有噪声影像的鲁棒性。(2) Gradient calculation: Gradient calculation usually uses the pixels to the right and below each pixel to calculate the gradient size corresponding to the pixel. and direction , the specific calculation formula is shown in equation (6) and equation (7). This method aims to use other pixels as little as possible, thereby enhancing its robustness to noisy images.

(6)。 (6).

(7)。 (7).

其中,的计算公式如式(8)所示。代表在像素(x,y)处的x方向的梯度大小;代表在像素(x,y)处的y方向的梯度大小。in, and The calculation formula of is shown in formula (8). Represents the gradient magnitude in the x direction at the pixel (x, y); Represents the gradient magnitude in the y direction at the pixel (x, y).

(8)。 (8).

其中,为像素处的影像灰度值。in, Pixel The gray value of the image at .

(3)区域生长:通过贪心算法,将相邻且具有一致梯度方向的像素点连接形成连通域,并在此基础上生成矩形框,其中连通域又称为直线支撑区域。在生成矩形框后,根据矩形度的大小判断是否需要按照规则将连通域断开,以形成多个矩形度更大的连通域。(3) Region growing: Through a greedy algorithm, adjacent pixels with consistent gradient directions are connected to form a connected domain, and a rectangular frame is generated on this basis. The connected domain is also called the straight line support region. After the rectangular frame is generated, it is determined whether the connected domain needs to be disconnected according to the rules based on the size of the rectangularity to form multiple connected domains with larger rectangularity.

(4)直线提取:对生成的所有连通域进行矩形改善和筛选,保留其中满足条件的连通域,即为最后的直线检测结果。的计算公式如式(9)所示。(4) Line extraction: Rectangle improvement and screening of all generated connected domains are performed, and those that meet the requirements are retained. The connected domain of the condition is the final straight line detection result. The calculation formula of is shown in formula (9).

(9)。 (9).

其中,为影像的像幅大小,为直线支撑区域像素点数目,klsd为与直线支撑区域方向垂直的像素点的数目,为矩形改善精度,表示的不同值的数量。in, is the image size, is the number of pixels in the straight line support area, k lsd is the number of pixels perpendicular to the straight line support area, Improved precision for rectangles, express The number of different values of .

由于LSD直线检测法是一种局部检测算法,提取的线特征较为零散且不连续。因此为更好的体现场景的结构特征,本实施例对LSD直线检测法提取的线特征进行线段连接。主要步骤包括以下三步。Since the LSD line detection method is a local detection algorithm, the extracted line features are relatively scattered and discontinuous. Therefore, in order to better reflect the structural characteristics of the scene, this embodiment connects the line features extracted by the LSD line detection method with line segments. The main steps include the following three steps.

(1)为了更好地表示场景的结构并减少计算复杂度,对LSD直线检测法提取的线段集进行过滤,去除长度小于长度阈值的线段。这些较短的线段并不能有效地表示场景的结构,反而会增加后续步骤的计算量。因此,在线段连接之前应该将它们过滤和去除。(1) In order to better represent the structure of the scene and reduce the computational complexity, the line segment set extracted by the LSD line detection method is filtered to remove the line segments whose length is less than the length threshold. These shorter line segments cannot effectively represent the structure of the scene, but will increase the amount of calculation in subsequent steps. Therefore, they should be filtered and removed before the line segments are connected.

(2)在对线段集过滤后再对位于同一直线上的线段进行连接。依次遍历线段集中的所有线段,将其中任意一条线段与线段集中的其他线段进行匹配验证,根据线段之间的夹角、距离等条件判断两线段是否能够进行连接,具体判断过程如下:(2) After filtering the line segment set, connect the line segments on the same straight line. Traverse all the line segments in the line segment set in turn and connect any line segment With other segments in the segment set Perform matching verification and determine whether two line segments can be connected based on the angle, distance and other conditions between the line segments. The specific judgment process is as follows:

①线段夹角判断:根据线段的斜率,计算两线段之间的夹角,计算公式如式(10)。① Determination of line segment angle: According to the line segment , The slope , , calculate the angle between two line segments , the calculation formula is as shown in formula (10).

(10)。 (10).

如果小于角度阈值,则判断两线段近似平行,如图11所示。if Less than angle threshold , then the two line segments are judged to be approximately parallel, as shown in Figure 11.

②垂直相对距离判断:通过线段的端点坐标计算线段的直线方程。分别计算线段的两端点到线段的距离,计算公式如式(11)。②Vertical relative distance judgment: through line segments Calculate the line segment using the endpoint coordinates Equation of the line . Calculate the line segments separately The two endpoints , To Segment Distance , , the calculation formula is as shown in formula (11).

(11)。 (11).

的均值作为线段之间的垂直距离。若垂直距离小于距离阈值,则说明两线段位于同一水平线上,如图12所示。Pick , The mean of , The vertical distance between If the vertical distance Less than distance threshold , it means that the two line segments are on the same horizontal line, as shown in Figure 12.

③端点距离判断:计算点到点之间的距离,点到点之间的距离。从中找出最大值与最小值,记作,计算公式如式(12)。③Endpoint distance judgment: calculation point To point , The distance between , ,point To point , The distance between , .from , , , Find the maximum and minimum values in , , the calculation formula is as shown in formula (12).

(12)。 (12).

如果小于距离阈值,则说明两线段相邻,如图13所示。if Less than distance threshold , it means that the two line segments are adjacent, as shown in Figure 13.

如果大于距离阈值,但两线段存在重合部分,则也可说明两线段相邻,如图14所示。if Greater than distance threshold , but if there is an overlapping part between the two line segments, it can also be said that the two line segments are adjacent, as shown in Figure 14.

如果两线段均满足上述三个条件,使用最小二乘法将两线段进行拟合优化,合成最优直线段。最小二乘法拟合优化的步骤如下。If both line segments meet the above three conditions, the least squares method is used to fit and optimize the two line segments to synthesize the optimal straight line segment. The steps of least squares method fitting optimization are as follows.

把直线的的表示形式转化为的形式,其中,。根据最小二乘原理,存在函数如式(13)。The straight line The representation is converted into of the form, in which , According to the least squares principle, there exists a function such as formula (13).

(13)。 (13).

其中,表示参与拟合的端点的个数,在本实施例中取。当此函数取最小值时,求得拟合直线的两个参数A、B。根据函数的极值定理,存在方程组如式(14)。in, Indicates the number of endpoints involved in the fitting. In this embodiment, When this function takes the minimum value, the two parameters A and B of the fitting line are obtained. According to the extreme value theorem of the function, there exists a set of equations such as equation (14).

(14)。 (14).

求解方程组,得出参数A、B的值,获得最优拟合直线的表达式。根据线段相距最远的两端点,计算拟合线段的端点。在计算得出拟合线段后,从线段集中移除线段,并加入拟合线段。然后,将拟合线段作为新的与其他线段匹配验证。重复这个过程,直到线段集中所有线段都被用作进行匹配验证,从而得到一个新的线段集。Solve the equations to get the values of parameters A and B, and obtain the expression of the best fitting straight line. , The two endpoints that are farthest apart are used to calculate the endpoints of the fitted line segment. After the fitted line segment is calculated, the line segment is removed from the line segment set. , , and add the fitting line segment. Then, the fitting line segment is used as the new Verify by matching with other segments. Repeat this process until all segments in the segment set have been used as Perform matching verification to obtain a new set of line segments.

(3)在获得一个新的线段集后,再对不位于同一条直线但端点距离相近的线段进行连接,如图15所示。依次遍历新的线段集中所有线段,计算其中任意一条线段与线段集中其他线段的端点距离,收集端点距离小于距离阈值的线段,构成所对应的收集线段集,并将线段加入收集线段集中。依次遍历收集线段集中所有线段,计算该线段所在直线与线段集中其他线段所在直线的交点。将计算得出的所有交点坐标的均值作为收集线段集中线段的新端点。(3) After obtaining a new line segment set, connect the line segments that are not on the same straight line but have similar endpoint distances, as shown in Figure 15. Traverse all the line segments in the new line segment set in turn and calculate any line segment With other segments in the segment set The endpoint distance is less than the distance threshold. The line segments constitute The corresponding collection segment set and the segment Add to the collection line segment set. Traverse all line segments in the collection line segment set in turn, and calculate the intersection of the line segment with the lines of other line segments in the line segment set. The average of all calculated intersection coordinates is used as the new endpoint of the line segment in the collection line segment set.

通过以上步骤对LSD直线检测法提取的线特征连接后,根据经验值(5像素)构建缓冲区(Buffer zone of feature line, BZFL)。最后根据式(15)对影像进行二值划分。After connecting the line features extracted by the LSD line detection method through the above steps, a buffer zone of feature line (BZFL) is constructed according to the empirical value (5 pixels). Finally, the image is divided into two values according to formula (15).

(15)。 (15).

其中,表示像素坐标,当像素坐标位于非线特征区域时,像素值;当像素坐标位于线特征区域时,像素值。所生成的掩模图前后如图16-图17所示。in, Represents the pixel coordinates. When the pixel coordinates are located in the non-line feature area, the pixel value ; When the pixel coordinates are in the line feature area, the pixel value The generated mask images before and after are shown in Figures 16 and 17.

平面先验优化的多视密集匹配。Multi-view dense matching with planar prior optimization.

基于光度一致性的密集匹配方法主要依靠影像间的光度一致性来评估匹配的准确性。由于影像中的强纹理区域具有明显的场景结构特征,因此这些区域的光度一致性较为可靠,能够获得准确的深度信息。但由于弱纹理区域通常具有平面特性,因此在弱纹理区域光度一致性不再可靠,所获得深度信息存在不准确的问题。平面先验优化的多视密集匹配方法的核心思想是基于平面先验信息并结合光度一致性构建概率图模型,使弱纹理区域的深度信息趋向于平面结构的深度信息,从而优化弱纹理区域深度信息估计不准确问题。主要流程包括平面先验信息提取、像素级别的影像选择和构建平面优化模型。The dense matching method based on photometric consistency mainly relies on the photometric consistency between images to evaluate the accuracy of matching. Since the strong texture areas in the image have obvious scene structure characteristics, the photometric consistency of these areas is relatively reliable and accurate depth information can be obtained. However, since the weak texture areas usually have planar characteristics, the photometric consistency in the weak texture areas is no longer reliable, and the depth information obtained is inaccurate. The core idea of the multi-view dense matching method based on plane prior optimization is to construct a probabilistic graph model based on plane prior information and combined with photometric consistency, so that the depth information of the weak texture area tends to the depth information of the plane structure, thereby optimizing the inaccurate depth information estimation problem of the weak texture area. The main process includes plane prior information extraction, pixel-level image selection and construction of a plane optimization model.

平面先验信息的提取是指利用选取的置信度较好的匹配点作为结构点构建平面先验信息。本实施例采用ACMH方法进行初匹配,获得每张影像的初始深度图,并根据影像的二值化结果,选取不同置信区间的匹配点。置信度的数值大于等于0,以第二置信度阈值为0.05,第一置信度阈值为0.1为例说明,具体步骤为:首先选取置信度小于0.1的匹配点作为候选结构点;然后根据候选结构点的像素坐标判断候选结构点所在区域。若为非线特征区域,选取置信区间为[0~0.05]的结构点,从而提高结构点的质量并减少结构点的数量。若为线特征区域,选取置信区间为[0~0.1]的结构点,从而在保持深度信息准确性的前提下,提高结构点的数量;最后,采用Delaunay算法进行构网并生成三角图元。对于每个三角图元,使用其对应的三个顶点计算平面先验信息,及物方空间中的平面方程。同一三角图元内的像素共享相同的平面先验信息。The extraction of plane prior information refers to the use of selected matching points with better confidence as structure points to construct plane prior information. This embodiment uses the ACMH method for initial matching to obtain the initial depth map of each image, and selects matching points of different confidence intervals according to the binarization result of the image. The value of the confidence is greater than or equal to 0. Taking the second confidence threshold as 0.05 and the first confidence threshold as 0.1 as an example, the specific steps are: first, select matching points with a confidence less than 0.1 as candidate structure points; then determine the area where the candidate structure points are located according to the pixel coordinates of the candidate structure points. If it is a non-line feature area, select structure points with a confidence interval of [0~0.05], thereby improving the quality of the structure points and reducing the number of structure points. If it is a line feature area, select structure points with a confidence interval of [0~0.1], thereby increasing the number of structure points while maintaining the accuracy of the depth information; finally, use the Delaunay algorithm to construct a network and generate triangular primitives. For each triangular primitive, use its corresponding three vertices to calculate the plane prior information and the plane equation in the object space. Pixels within the same triangle primitive share the same plane prior information.

像素级别的影像选择是利用每个像素的邻域像素在邻居影像的可见性来选择可见影像集。本实施例借鉴“红黑棋盘”并行传播策略,将参考影像像素分为“红黑”像素,如图18所示。图18中,标注有“红”字的圆圈表示“红”像素;填充有黑色的圆圈表示“黑”像素;在并行传播过程中,依次进行“红”像素和“黑”像素深度信息的并行传播,即利用邻域“红”像素的深度信息传播到“黑”像素,反之亦然,传播路径如图19。图19中,标注有“红”字的圆圈表示“红”像素;根据传播路径的距离,将邻域像素分为4个层级,如图20,图20中,标注有“红”字的圆圈表示“红”像素;标注有“黄”字的圆圈表示黄色像素;每个层级由深到浅代表距离由近到远。从每个层级中选择两个匹配代价最小的像素作为具有可靠深度信息的像素,共选择8个像素作为视图选择的邻域像素,如图20的黄色像素所示。最后,按照距离加权的方法计算邻居影像可见性,具体计算公式如式(16)。Image selection at the pixel level is to select the visible image set by using the visibility of the neighboring pixels of each pixel in the neighboring image. This embodiment draws on the "red and black chessboard" parallel propagation strategy to divide the reference image pixels into "red and black" pixels, as shown in Figure 18. In Figure 18, the circle marked with the word "red" represents the "red" pixel; the circle filled with black represents the "black" pixel; in the parallel propagation process, the depth information of the "red" pixel and the "black" pixel is propagated in parallel in sequence, that is, the depth information of the neighboring "red" pixel is propagated to the "black" pixel, and vice versa. The propagation path is shown in Figure 19. In Figure 19, the circle marked with the word "red" represents the "red" pixel; according to the distance of the propagation path, the neighborhood pixels are divided into 4 levels, as shown in Figure 20. In Figure 20, the circle marked with the word "red" represents the "red" pixel; the circle marked with the word "yellow" represents the yellow pixel; each level from deep to shallow represents the distance from near to far. From each level, two pixels with the smallest matching cost are selected as pixels with reliable depth information, and a total of 8 pixels are selected as neighborhood pixels for view selection, as shown in the yellow pixels in Figure 20. Finally, the visibility of neighbor images is calculated using the distance weighted method, and the specific calculation formula is shown in Equation (16).

(16)。 (16).

其中,表示邻居影像j的可见性,为邻域像素的距离倒数权重,表示邻域像素在前一次迭代的NCC匹配代价,根据经验值取。从式(16)中可以得出,邻域像素与当前像素的距离越近,且相对于邻居影像j的匹配代价越高,邻居影像j的可见性越高。对参考影像的所有邻居影像的可见性从高到低排序,取前个邻居影像作为当前像素的可见影像集。in, represents the visibility of neighbor image j, Neighborhood pixels The inverse distance weight of Represents the neighborhood pixels In the previous iteration, the NCC matching cost is taken according to the empirical value. From equation (16), it can be concluded that the closer the distance between the neighbor pixel and the current pixel is, and the higher the matching cost relative to the neighbor image j, the higher the visibility of the neighbor image j. Sort the visibility of all neighbor images of the reference image from high to low, and take the top neighbor images as the visible image set of the current pixel.

构建平面优化模型是指利用概率图模型将平面先验信息和光度一致性相结合,构建新的多视图匹配代价。由于这种新的多视图匹配代价同时考虑了光度一致性以及平面先验信息,因此不仅适合于恢复强纹理区域的深度信息,也能有效恢复弱纹理区域的深度信息。首先将当前待更新像素的深度信息以及上一步中选择的8个邻域像素的深度信息作为当前待更新像素的候选假设集。Constructing a plane optimization model means using a probabilistic graph model to combine plane prior information and photometric consistency to construct a new multi-view matching cost. Since this new multi-view matching cost takes into account both photometric consistency and plane prior information, it is not only suitable for recovering depth information in strong texture areas, but also effectively recovering depth information in weak texture areas. First, the depth information of the current pixel to be updated and the depth information of the 8 neighboring pixels selected in the previous step are used as the candidate hypothesis set for the current pixel to be updated.

.

其中表示当前待更新像素对应平面结构的深度信息,di为第i个像素(当前待更新像素)点的视差值;ni为第i个像素点的法线值。相对于个可见影像,每个候选假设会有个NCC匹配代价,即当前待更新像素q在取候选假设时与可见影像j的光度一致性,其计算公式如式(17)。in Indicates the depth information of the plane structure corresponding to the current pixel to be updated, d i is the disparity value of the i-th pixel (the current pixel to be updated); ni is the normal value of the i-th pixel. visible images, each candidate hypothesis will have NCC matching cost, that is, the current pixel q to be updated is taken in the candidate hypothesis The photometric consistency with the visible image j is calculated as shown in formula (17).

(17)。 (17).

其中,表示以当前待更新像素q为中心构建的的矩形窗口,表示像素在参考影像中的像素值,表示像素在可见影像上经过单应变换后的对应像素的像素值。这些候选假设对应的个匹配代价构成如式(18)的矩阵。in, It means that the pixel q to be updated is the center of the A rectangular window, Represents pixels The pixel value in the reference image, Represents pixels The pixel values of the corresponding pixels after homography transformation on the visible image. These candidate hypotheses correspond to The matching costs form a matrix as shown in formula (18).

(18)。 (18).

矩阵每一行的匹配代价可以度量候选假设相对于可见影像的可靠性,因此采用式(19),取前m个最好NCC匹配代价的加权均值,作为当前待更新像素相对于候选假设的最终匹配代价。The matching cost of each row of the matrix can measure the candidate hypothesis Relative to the reliability of the visible image, we use formula (19) to take the weighted average of the top m best NCC matching costs as the current pixel to be updated relative to the candidate hypothesis The final matching cost.

(19)。 (19).

其中,为NCC匹配代价。in, Match the cost for NCC.

其次为了采用平面先验信息辅助优化密集匹配,本实施例构建平面优化概率图模型,其计算公式如式(20)。Secondly, in order to use plane prior information to assist in optimizing dense matching, this embodiment constructs a plane optimization probability graph model, and its calculation formula is as shown in formula (20).

(20)。 (20).

其中,dp为第p个像素点的视差值;np为第p个像素点的法线值;邻居传播权重因子、平面先验衡量常数、视差的步长、法线差的步长,取值如式(21)所示。Among them, dp is the disparity value of the p-th pixel; np is the normal value of the p-th pixel; the neighbor propagation weight factor , plane priori weight constant , the parallax step size , the step size of the normal difference , the value is shown in formula (21).

(21)。 (twenty one).

其中,dmax为法线的最大值;dmin为法线的最小值。Among them, d max is the maximum value of the normal line; d min is the minimum value of the normal line.

对于式(20),等式右边第一项为匹配代价,对应当前待更新像素q在候选假设的光度一致性。第二项为平面先验的正则项,若当前待更新像素q的深度信息与平面结构的深度信息一致,则给予奖励,否则给予惩罚,从而使弱纹理区域的深度信息趋向于平面结构的深度信息,优化弱纹理区域的深度估计。最后取最好的候选假设作为当前待更新像素的深度信息。For equation (20), the first term on the right side of the equation is the matching cost, corresponding to the current pixel q to be updated in the candidate hypothesis The second term is the regular term of the plane prior. If the depth information of the current pixel q to be updated is consistent with the depth information of the plane structure, a reward is given, otherwise a penalty is given, so that the depth information of the weak texture area tends to the depth information of the plane structure, and the depth estimation of the weak texture area is optimized. Finally, The best candidate hypothesis is used as the depth information of the current pixel to be updated.

3 实验与分析。3 Experiment and analysis

3.1 实验数据与环境。3.1 Experimental data and environment.

本实施例实验将从平面信息提取结果、深度信息计算结果以及平面区域平整度等方面验证本实施例方法的有效性。实验数据包括:(1)ISPRS提供的公开数据集Dortmund,该数据集由一个五镜头倾斜成像系统捕获,图像数量为584张,分辨率为8176×6132。(2)实地采集的倾斜摄影数据集,主要由Garden及Central-Urban两个不同的场景组成,图像数量分别为162和566张,分辨率分别为5472×3648和4864×3648,涵盖的主要地物类型包括:建筑、植被、道路、水面等,对实验验证具有普遍意义。The experiment of this embodiment will verify the effectiveness of the method of this embodiment from the aspects of plane information extraction results, depth information calculation results and plane area flatness. The experimental data include: (1) the public dataset Dortmund provided by ISPRS, which is captured by a five-lens oblique imaging system, with 584 images and a resolution of 8176×6132. (2) the oblique photography dataset collected on site, mainly composed of two different scenes, Garden and Central-Urban, with 162 and 566 images respectively, and resolutions of 5472×3648 and 4864×3648 respectively. The main types of objects covered include: buildings, vegetation, roads, water surfaces, etc., which are of universal significance for experimental verification.

实验运行环境为一台工作站,Windows 10 64-bit操作系统,Intel Core(TM) i9-10900X CPU(主频为3.70GHz),128GB内存。The experimental running environment is a workstation with Windows 10 64-bit operating system, Intel Core(TM) i9-10900X CPU (main frequency is 3.70GHz), and 128GB memory.

3.2 平面先验信息提取结果分析。3.2 Analysis of plane prior information extraction results.

平面先验信息是指选取部分置信度较好的匹配点作为结构点,采用Delaunay算法进行构网所生成的三角图元。现有ACMP方法在选择匹配点时并未考虑场景结构特征,本实施例方法在现有ACMP方法基础上进行改进,将场景分为线特征区域以及非线特征区域,在非线特征区域选取少量高置信度的匹配点,在线特征区域选取大量具有可信置信度的匹配点,从而保证在弱纹理区域具有较大的平面结构约束,在强纹理区域具有较小的平面结构约束,优化不同区域的深度估计结果。图21-图32展示了ACMP方法以及本实施例方法在Dortmund数据集、Garden数据集以及Central-Urban数据集的提取结果。Plane prior information refers to the triangular primitives generated by selecting some matching points with good confidence as structural points and using the Delaunay algorithm to construct the network. The existing ACMP method does not consider the scene structure characteristics when selecting matching points. The method of this embodiment is improved on the basis of the existing ACMP method, and the scene is divided into a line feature area and a non-line feature area. A small number of high-confidence matching points are selected in the non-line feature area, and a large number of matching points with credible confidence are selected in the line feature area, thereby ensuring that there are larger plane structure constraints in weak texture areas and smaller plane structure constraints in strong texture areas, and optimizing the depth estimation results in different areas. Figures 21-32 show the extraction results of the ACMP method and the method of this embodiment on the Dortmund dataset, Garden dataset, and Central-Urban dataset.

在影像中的强纹理区域,ACMP方法以及本实施例方法所形成的三角图元相对较小,两种方法均能够较好保持场景的结构特征;在影像中的弱纹理区域,ACMP方法以及本实施例方法通常所形成的三角图元相对较大,但在部分弱纹理区域,ACMP方法所形成三角图元过于细碎。而本实施例方法利用场景的线特征约束构建平面先验信息,在非线特征区域选取少量高置信度的匹配点作为结构点,因此所形成的三角图元相对较大,能够更好的保证弱纹理区域深度估计的准确性。In the strong texture area of the image, the triangular primitives formed by the ACMP method and the method of this embodiment are relatively small, and both methods can better maintain the structural features of the scene; in the weak texture area of the image, the triangular primitives formed by the ACMP method and the method of this embodiment are generally relatively large, but in some weak texture areas, the triangular primitives formed by the ACMP method are too fragmented. The method of this embodiment uses the line feature constraints of the scene to construct plane prior information, and selects a small number of high-confidence matching points as structural points in the non-line feature area, so the triangular primitives formed are relatively large, which can better ensure the accuracy of depth estimation in weak texture areas.

3.3 深度信息计算结果分析。3.3 Analysis of depth information calculation results.

对于Dortmund数据集、Garden数据集以及Central-Urban数据集,ACMP方法以及本实施例方法在区域一至区域六计算的深度信息如图33-图44所示。For the Dortmund dataset, the Garden dataset, and the Central-Urban dataset, the depth information calculated by the ACMP method and the method of this embodiment in regions 1 to 6 is shown in FIGS. 33 to 44 .

从图33-图44中可以看出,ACMP方法以及本实施例方法在强纹理区域,均能计算得出较为准确的深度信息。在大部分弱纹理区域,计算得出的深度信息也较为平滑。主要是因为ACMP方法以及本实施例方法在光度一致性的基础上加入平面先验信息,从而能够优化弱纹理区域的深度估计。然而在部分弱纹理区域,ACMP方法计算得出的深度信息会存在部分异常值。主要是因为在这些区域ACMP方法生成的平面先验信息过于细碎,因此只能够部分缓解弱纹理区域的异常深度信息。而本实施例方法在ACMP方法的基础上加入了稀疏点云初始化深度信息以及基于场景线特征约束的平面先验信息的构建,因此能够更好的改善弱纹理区域深度信息估计不准确的问题。As can be seen from Figures 33 to 44, the ACMP method and the method of this embodiment can calculate relatively accurate depth information in strong texture areas. In most weak texture areas, the calculated depth information is also relatively smooth. This is mainly because the ACMP method and the method of this embodiment add plane prior information on the basis of photometric consistency, so that the depth estimation of weak texture areas can be optimized. However, in some weak texture areas, the depth information calculated by the ACMP method will have some outliers. This is mainly because the plane prior information generated by the ACMP method in these areas is too fragmented, so it can only partially alleviate the abnormal depth information in weak texture areas. The method of this embodiment adds sparse point cloud initialization depth information and the construction of plane prior information based on scene line feature constraints on the basis of the ACMP method, so it can better improve the problem of inaccurate depth information estimation in weak texture areas.

3.4 平面区域平整度分析。3.4 Flatness analysis of plane area.

在多视密集匹配过程中,ACMP方法未考虑场景结构特征,仅采用匹配代价较好的匹配点构建平面先验信息,导致在弱纹理区域的平面先验信息较多,生成的密集点云在平面区域不够平整。而本实施例方法,在ACMP方法的基础上,利用稀疏点云初始化深度信息,并利用场景线特征约束构建平面先验信息,优化弱纹理区域的平面先验信息数量,能够提高生成的密集点云在平面区域的平整度。为验证以上分析结果,在本节实验中,本实施例方法采用ACMP方法中的深度融合方法生成密集点云,并用局部平面精度评价ACMP方法以及本实施例方法在平面区域的平整度。其中局部平面精度是指密集点云到局部拟合平面的距离的均方根误差值。图45-图56展示了平面区域(区域一至区域六)的密集点云的立面图。这些平面区域的局部平面精度统计结果见表1。表1中局部平面精度的单位为cm。In the multi-view dense matching process, the ACMP method does not consider the scene structure features, and only uses matching points with better matching costs to construct plane prior information, resulting in more plane prior information in weak texture areas, and the generated dense point cloud is not flat enough in the plane area. On the basis of the ACMP method, the method of this embodiment uses sparse point clouds to initialize depth information, and uses scene line feature constraints to construct plane prior information, optimizes the number of plane prior information in weak texture areas, and can improve the flatness of the generated dense point cloud in the plane area. To verify the above analysis results, in this section of the experiment, the method of this embodiment uses the deep fusion method in the ACMP method to generate dense point clouds, and uses local plane accuracy to evaluate the flatness of the ACMP method and the method of this embodiment in the plane area. The local plane accuracy refers to the root mean square error value of the distance from the dense point cloud to the local fitting plane. Figures 45-56 show the elevation views of the dense point clouds in the plane area (area one to area six). The statistical results of the local plane accuracy of these plane areas are shown in Table 1. The unit of local plane accuracy in Table 1 is cm.

表1 平面区域平整度对比表Table 1. Flatness comparison of plane areas

ACMP方法ACMP Method 本实施例方法The method of this embodiment 提高(%)improve(%) 区域一Area 1 0.3280.328 0.2270.227 30.79%30.79% 区域二Area 2 0.2470.247 0.1840.184 25.51%25.51% 区域三Area 3 0.1950.195 0.1490.149 23.58%23.58% 区域四Area 4 0.240.24 0.1740.174 27.5%27.5% 区域五Area 5 0.3080.308 0.2160.216 29.87%29.87% 区域六Area 6 0.2140.214 0.1560.156 27.1%27.1%

从图45-图56以及表1中可以得出,在区域一至区域六中,本实施例方法融合产生的密集点云的平整度要比ACMP方法高,例如:在区域一中提高30.79%,在区域三中提高23.58%,整体平均提高27.39%。主要是因为,本实施例方法引入稀疏点云初始深度信息以及利用场景线特征约束构建平面先验信息。在相同迭代次数中,本实施例方法能够更快收敛,在弱纹理区域产生的异常深度信息更少,能够有效提高弱纹理区域的平整度。It can be concluded from Figures 45-56 and Table 1 that in areas 1 to 6, the flatness of the dense point cloud generated by the fusion of the method of this embodiment is higher than that of the ACMP method, for example: an increase of 30.79% in area 1, an increase of 23.58% in area 3, and an overall average increase of 27.39%. This is mainly because the method of this embodiment introduces the initial depth information of the sparse point cloud and uses the scene line feature constraints to construct the plane prior information. In the same number of iterations, the method of this embodiment can converge faster, generate less abnormal depth information in the weak texture area, and can effectively improve the flatness of the weak texture area.

基于倾斜影像的三维建模技术作为摄影测量以及计算机视觉中的新兴技术,因其具有重建效率高以及效果逼真等特点,被广泛应用于城市实景三维模型重建和新型基础测绘等应用。稠密重建作为基于倾斜影像的三维建模技术中构建高质量模型的关键一步,存在弱纹理区域匹配精度低的问题。针对该问题,本实施例从平面先验优化多视密集匹配进行研究,主要内容与结论如下。As an emerging technology in photogrammetry and computer vision, the 3D modeling technology based on oblique images is widely used in applications such as urban real-scene 3D model reconstruction and new basic surveying and mapping due to its high reconstruction efficiency and realistic effects. Dense reconstruction is a key step in building high-quality models in 3D modeling technology based on oblique images, but there is a problem of low matching accuracy in weak texture areas. To address this problem, this embodiment studies multi-view dense matching from the perspective of plane prior optimization. The main contents and conclusions are as follows.

首先介绍了多视密集匹配的预处理,主要内容包括影像组合的计算和深度信息的初始化;然后对基于场景线特征约束的平面先验辅助优化的多视密集匹配方法和理论基础进行概略阐述,主要内容包括场景线特征区域提取以及平面先验优化的多视密集匹配;最后采用三组数据集进行实验并进行定性和定量分析。Firstly, the preprocessing of multi-view dense matching is introduced, which mainly includes the calculation of image combination and the initialization of depth information. Then, the multi-view dense matching method and theoretical basis based on plane prior-assisted optimization with scene line feature constraints are briefly described, which mainly includes scene line feature region extraction and multi-view dense matching with plane prior optimization. Finally, three sets of data sets are used for experiments and qualitative and quantitative analysis.

实验证明,通过稀疏点云初始化深度信息,能够加快准确深度信息的快速传播,且能够较好的保持的场景的结构特征;通过基于场景线特征约束的平面先验辅助优化的多视密集匹配,能够在保持强纹理区域结构特征的前提下,有效去除弱纹理区域的异常深度信息,提高弱纹理区域的平整性,实验表明整体平均提高27.39%。因此本实施例方法,能够有效改善弱纹理区域的密集匹配精度。Experiments have shown that initializing depth information through sparse point clouds can speed up the rapid propagation of accurate depth information and better maintain the structural features of the scene; multi-view dense matching based on plane prior-assisted optimization based on scene line feature constraints can effectively remove abnormal depth information in weak texture areas while maintaining the structural features of strong texture areas, and improve the flatness of weak texture areas. Experiments show that the overall average improvement is 27.39%. Therefore, the method of this embodiment can effectively improve the dense matching accuracy of weak texture areas.

实施例2:为了执行上述实施例1对应的方法,以实现相应的功能和技术效果,下面提供了一种基于平面先验优化的多视密集匹配系统,包括:场景数据获取模块,用于获取待建模场景的稀疏点云和多张影像。不同影像的拍摄角度不同。Embodiment 2: In order to execute the method corresponding to the above embodiment 1 to achieve the corresponding functions and technical effects, a multi-view dense matching system based on plane prior optimization is provided below, including: a scene data acquisition module, which is used to acquire a sparse point cloud and multiple images of the scene to be modeled. Different images are shot at different angles.

当前参考影像确定模块,用于确定任一影像为当前参考影像。The current reference image determination module is used to determine any image as the current reference image.

邻居影像集确定模块,用于根据待建模场景的稀疏点云,从多张影像中确定当前参考影像的邻居影像集。The neighbor image set determination module is used to determine the neighbor image set of the current reference image from multiple images according to the sparse point cloud of the scene to be modeled.

初始化深度模块,用于利用稀疏点云的三角化处理,初始化当前参考图像中所有像素点的深度信息,得到当前参考影像初始化深度图。深度信息包括深度值和法线值。The initialization depth module is used to initialize the depth information of all pixels in the current reference image by triangulation of the sparse point cloud, and obtain the initialization depth map of the current reference image. The depth information includes depth value and normal value.

线特征集合提取模块,用于提取当前参考影像初始化深度图中的线特征集合。The line feature set extraction module is used to extract the line feature set in the depth map initialized by the current reference image.

线特征区域划分模块,用于根据线特征集合,将当前参考影像划分为线特征区域和非线特征区域。The line feature region division module is used to divide the current reference image into a line feature region and a non-line feature region according to a line feature set.

平面先验信息构建模块,用于根据线特征区域和非线特征区域,构建平面先验信息。The plane prior information construction module is used to construct plane prior information according to the line feature area and the non-line feature area.

邻域像素集确定模块,用于确定当前参考影像中每个像素的邻域像素集。The neighborhood pixel set determination module is used to determine the neighborhood pixel set of each pixel in the current reference image.

可见影像集确定模块,用于根据当前参考影像中每个像素的邻域像素集在当前参考影像的邻居影像集的可见性确定可见影像集。The visible image set determination module is used to determine the visible image set according to the visibility of the neighborhood pixel set of each pixel in the current reference image in the neighbor image set of the current reference image.

多视图匹配代价函数确定模块,用于利用概率图模型将平面先验信息、可见影像集和多个当前线特征构建新的多视图匹配代价函数。The multi-view matching cost function determination module is used to construct a new multi-view matching cost function by using a probabilistic graph model to combine plane prior information, a visible image set and multiple current line features.

子密集匹配结果确定模块,用于根据多视图匹配代价函数更新当前参考图像中所有像素点的深度信息,得到当前参考影像的密集匹配结果。The sub-dense matching result determination module is used to update the depth information of all pixels in the current reference image according to the multi-view matching cost function to obtain the dense matching result of the current reference image.

总密集匹配结果确定模块,用于更新当前参考影像并返回执行邻居影像集确定模块直至遍历所有影像,得到多张影像的密集匹配结果。The total dense matching result determination module is used to update the current reference image and return to execute the neighbor image set determination module until all images are traversed to obtain the dense matching results of multiple images.

多视密集匹配模块,用于对多张影像的密集匹配结果进行融合,得到待建模场景的多视密集匹配结果。The multi-view dense matching module is used to fuse the dense matching results of multiple images to obtain the multi-view dense matching results of the scene to be modeled.

实施例3:本实施例提供了一种电子设备,包括存储器及处理器,存储器用于存储计算机程序,处理器运行计算机程序以使电子设备执行实施例1所述的一种基于平面先验优化的多视密集匹配方法。其中,存储器为可读存储介质。Embodiment 3: This embodiment provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform a multi-view dense matching method based on plane prior optimization described in Embodiment 1. The memory is a readable storage medium.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

本实施例中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,本说明书内容不应理解为对本发明的限制。In this embodiment, specific examples are used to illustrate the principle and implementation of the present invention. The above description of the embodiment is only used to help understand the method and core idea of the present invention; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims (10)

1. The multi-view dense matching method based on plane prior optimization is characterized by comprising the following steps of:
acquiring sparse point clouds and a plurality of images of a scene to be modeled; the shooting angles of different images are different;
determining any image as a current reference image;
determining a neighbor image set of the current reference image from the plurality of images according to the sparse point cloud of the scene to be modeled;
initializing depth information of all pixel points in a current reference image by utilizing triangulation processing of sparse point cloud to obtain an initialized depth map of the current reference image; the depth information includes a depth value and a normal value;
extracting a line feature set in a current reference image initialization depth map;
dividing the current reference image into a line characteristic region and a non-line characteristic region according to the line characteristic set;
Constructing plane prior information according to the line characteristic region and the non-line characteristic region;
determining a neighborhood pixel set of each pixel in the current reference image;
determining a visible image set according to the visibility of the neighborhood pixel set of each pixel in the current reference image in the neighbor image set of the current reference image;
constructing a new multi-view matching cost function by using the probability map model through the plane prior information, the visible image set and the current line features;
updating the depth information of all pixel points in the current reference image according to the multi-view matching cost function to obtain a dense matching result of the current reference image;
updating the current reference image and returning to the step of determining a neighbor image set of the current reference image from the plurality of images according to the sparse point cloud of the scene to be modeled until all the images are traversed, so as to obtain a dense matching result of the plurality of images;
and fusing the dense matching results of the multiple images to obtain a multi-view dense matching result of the scene to be modeled.
2. The multi-view dense matching method based on planar prior optimization of claim 1, wherein determining a neighbor image set of a current reference image from a plurality of images according to a sparse point cloud of a scene to be modeled comprises:
Determining a visible sparse point set of the current reference image from a sparse point cloud of a scene to be modeled;
determining any image to be fixed as a current image to be fixed; the undetermined images are a plurality of images except the current reference image;
determining a visible sparse point set of the current undetermined image from a sparse point cloud of a scene to be modeled;
determining the intersection of the visible sparse point set of the current reference image and the visible sparse point set of the current undetermined image as a common visible sparse point set of the current reference image and the current undetermined image;
determining a correlation score of the current reference image and the current image to be determined according to the common visible sparse point set;
updating the current image to be determined, and returning to the step of determining a visible sparse point set of the current image to be determined from the sparse point cloud of the scene to be modeled until all the images to be determined are traversed, so as to obtain the relevance scores of the current reference image and all the images to be determined;
descending order of the images to be determined according to the relevance scores;
and determining the pre-set number of undetermined images as a neighbor image set of the current reference image.
3. The multi-view dense matching method based on plane prior optimization according to claim 2, wherein initializing depth information of all pixel points in a current reference image by using triangulation processing of sparse point cloud to obtain an initialized depth map of the current reference image comprises:
Projecting the visible sparse point set of the current reference image onto the current reference image to obtain a projection point set of the current reference image;
triangulating the projection point set of the current reference image by using a Delaunay algorithm to generate a two-dimensional grid;
constructing a three-dimensional grid according to sparse depth information of a projection point set of the current reference image;
determining the image pose of the current reference image by using sparse reconstruction;
determining any pixel point in the current reference image as a current pixel point;
calculating the current projection light corresponding to the current pixel point according to the image pose;
projecting the current projection light to the three-dimensional grid, and determining a triangular patch intersecting the current projection light in the three-dimensional grid as a current triangular patch;
determining a plane equation of the current triangular patch according to the 3 vertex coordinates of the current triangular patch;
determining the depth value and the normal value of the current pixel point according to the coefficient of the plane equation of the current triangular patch;
updating the current pixel point and returning to the step of calculating the current projection light corresponding to the current pixel point according to the pose of the image until all the pixel points in the current reference image are traversed, and obtaining the initialization depth map of the current reference image.
4. The multi-view dense matching method based on planar prior optimization of claim 1, wherein extracting a line feature set in a current reference image initialization depth map comprises:
extracting a plurality of line features in the initialization depth map of the current reference image by using an LSD linear detection method to obtain an initial line feature set; the line features are line segments;
deleting line features with lengths smaller than a length threshold value in the initial line feature set;
connecting collinear line features in the initial line feature set;
determining any line feature in the initial line feature set as a current line feature;
determining a plurality of line features except the current line feature in the initial line feature set as line features to be matched;
determining any line feature to be matched as the current line feature to be matched;
determining an included angle between the current line characteristic and the current line characteristic to be matched as a current included angle;
when the current included angle is larger than or equal to the included angle threshold value, updating the current line feature to be matched, and returning to the step of determining that the included angle between the current line feature and the current line feature to be matched is the current included angle;
when the current included angle is smaller than the included angle, determining that the current line characteristic and the current to-be-matched line characteristic are current approximate parallel line characteristic pairs;
Constructing a linear equation of the current line feature to be matched according to two end point coordinates of the current line feature to be matched;
determining the distance from one end point of the current line characteristic to be matched as a first distance according to a linear equation of the current line characteristic to be matched;
determining the distance from the other end point of the current line characteristic to be matched as a second distance according to a linear equation of the current line characteristic to be matched;
determining the average value of the first distance and the second distance as the vertical distance of the current approximate parallel line feature pair;
when the vertical distance is smaller than the vertical distance threshold, fitting the current approximate parallel line characteristic pair by using a least square method to obtain a fitting line characteristic;
replacing the current approximate parallel line feature pairs in the initial line feature set by fitting line features;
taking the fitting line characteristic as the current line characteristic, and returning to the step of determining any line characteristic to be matched as the current line characteristic to be matched until all line characteristics to be matched are traversed;
updating the current line characteristics, returning to the step of determining that a plurality of line characteristics except the current line characteristics in the initial line characteristic set are to-be-matched line characteristics until the initial line characteristic set is traversed, and determining the to-be-fixed line characteristic set.
5. The multi-view dense matching method based on planar prior optimization of claim 4, further comprising, after determining the set of features to be defined:
determining any line characteristic in the to-be-determined line characteristic set as a current line characteristic;
determining any endpoint of the current line feature as a current endpoint;
determining the end points of all line features except the current line feature in the to-be-determined line feature set as a current end point set;
determining a plurality of endpoints, of which the distances from the current endpoint in the current endpoint set are smaller than a distance threshold, as endpoints to be combined;
determining the current endpoint and a plurality of endpoints to be combined as a point set to be combined;
determining the line characteristics of the point set to be combined as the line characteristic set to be combined;
determining the coordinate mean value of the point set to be combined as the coordinate of the combining point;
all points in the point set to be combined are connected with the combining point to obtain combining line characteristics;
and replacing the to-be-merged line feature set in the to-be-determined line feature set by adopting the merged line feature, and returning to the step of determining any line feature in the to-be-determined line feature set as the current line feature until the to-be-determined line feature set is traversed, so as to obtain the line feature set in the initialization depth map of the current reference image.
6. The multi-view dense matching method based on planar prior optimization of claim 1, wherein constructing planar prior information from the line feature region and the non-line feature region comprises:
performing primary matching by using an ACMH method, and determining that a matching point with the confidence coefficient smaller than a first confidence coefficient threshold value in the current reference image is a pending structural point;
determining all undetermined structural points in the line characteristic area as selected structural points;
determining candidate structural points with the confidence coefficient smaller than a second confidence coefficient threshold value in the non-line characteristic region as selected structural points; the second confidence threshold is less than the first confidence threshold;
constructing a network by adopting a Delaunay algorithm based on a plurality of selected structure points to generate a plurality of triangle primitives;
determining any triangle primitive as the current triangle primitive;
determining current plane prior information according to 3 vertexes of the current triangle primitive;
constructing a plane equation of the current triangle primitive;
determining the prior information of the current plane as the prior information of the planes of all pixels in the current triangle primitive;
updating the current triangle primitive, and returning to the step of determining the prior information of the current plane according to the 3 vertexes of the current triangle primitive until all the triangle primitives are traversed, and determining the prior information of the planes of all the pixels in the current reference image.
7. The multi-view dense matching method based on plane prior optimization according to claim 4, wherein constructing a new multi-view matching cost function by using a probability map model from plane prior information, a visible image set and a plurality of current line features comprises:
determining any pixel as a current pixel;
determining the depth information of the current pixel and the depth information of each neighborhood pixel in the neighborhood pixel set of the current pixel as candidate hypothesis sets;
determining the luminosity consistency of the current pixel and the visible image when each candidate hypothesis in the candidate hypothesis set is selected to construct a matching cost matrix;
determining the final matching cost of each candidate hypothesis according to the matching cost matrix;
updating the current pixel and returning to the step of determining the depth information of the current pixel and the depth information of each neighborhood pixel in the neighborhood pixel set of the current pixel as a candidate hypothesis set to obtain the final matching cost of selecting different candidate hypotheses for each pixel;
and selecting final matching cost of different candidate hypotheses according to each pixel and plane prior information of each pixel, and constructing a plane optimization probability map model.
8. A multi-view dense matching system based on planar prior optimization, comprising:
The scene data acquisition module is used for acquiring sparse point clouds and a plurality of images of a scene to be modeled; the shooting angles of different images are different;
the current reference image determining module is used for determining any image as a current reference image;
the neighbor image set determining module is used for determining a neighbor image set of the current reference image from the plurality of images according to the sparse point cloud of the scene to be modeled;
the initialization depth module is used for initializing depth information of all pixel points in the current reference image by utilizing the triangulation processing of the sparse point cloud to obtain an initialization depth map of the current reference image; the depth information includes a depth value and a normal value;
the line feature set extraction module is used for extracting a line feature set in the initialization depth map of the current reference image;
the line characteristic region dividing module is used for dividing the current reference image into a line characteristic region and a non-line characteristic region according to the line characteristic set;
the plane prior information construction module is used for constructing plane prior information according to the line characteristic region and the non-line characteristic region;
the neighborhood pixel set determining module is used for determining a neighborhood pixel set of each pixel in the current reference image;
The visible image set determining module is used for determining a visible image set according to the visibility of the neighborhood pixel set of each pixel in the current reference image in the neighbor image set of the current reference image;
the multi-view matching cost function determining module is used for constructing a new multi-view matching cost function by utilizing the probability map model and utilizing the plane prior information, the visible image set and the current line features;
the sub-dense matching result determining module is used for updating the depth information of all pixel points in the current reference image according to the multi-view matching cost function to obtain a dense matching result of the current reference image;
the total dense matching result determining module is used for updating the current reference image and returning to the neighbor image set determining module until all images are traversed to obtain dense matching results of a plurality of images;
and the multi-view dense matching module is used for fusing dense matching results of the plurality of images to obtain a multi-view dense matching result of the scene to be modeled.
9. An electronic device comprising a memory for storing a computer program and a processor that runs the computer program to cause the electronic device to perform a multi-view dense matching method based on planar prior optimization as claimed in any one of claims 1 to 7.
10. The electronic device of claim 9, wherein the memory is a readable storage medium.
CN202410044496.6A 2024-01-12 2024-01-12 Multi-view dense matching method, system and equipment based on plane priori optimization Active CN117557617B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410044496.6A CN117557617B (en) 2024-01-12 2024-01-12 Multi-view dense matching method, system and equipment based on plane priori optimization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410044496.6A CN117557617B (en) 2024-01-12 2024-01-12 Multi-view dense matching method, system and equipment based on plane priori optimization

Publications (2)

Publication Number Publication Date
CN117557617A CN117557617A (en) 2024-02-13
CN117557617B true CN117557617B (en) 2024-04-09

Family

ID=89821929

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410044496.6A Active CN117557617B (en) 2024-01-12 2024-01-12 Multi-view dense matching method, system and equipment based on plane priori optimization

Country Status (1)

Country Link
CN (1) CN117557617B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118379520B (en) * 2024-06-25 2024-12-24 济宁学院 Plane prior optimization dense matching system and method considering texture and structural characteristics
CN118762135B (en) * 2024-09-06 2024-12-27 常熟理工学院 Sky artifact removal-based multi-view three-dimensional reconstruction method and device for building

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113392879A (en) * 2021-05-26 2021-09-14 中铁二院工程集团有限责任公司 Multi-view matching method for aerial image
CN114494395A (en) * 2022-02-11 2022-05-13 腾讯科技(深圳)有限公司 Method, Apparatus, Device and Storage Medium for Depth Map Generation Based on Plane Prior
CN115619974A (en) * 2022-10-28 2023-01-17 郑川江 Large scene three-dimensional reconstruction method, reconstruction device, equipment and storage medium based on improved PatchMatch network
CN116758223A (en) * 2023-07-06 2023-09-15 哈尔滨工业大学 Three-dimensional multispectral point cloud reconstruction method, system and equipment based on dual-angle multispectral images
CN117315169A (en) * 2023-09-05 2023-12-29 武汉大学 Live-action three-dimensional model reconstruction method and system based on deep learning multi-view dense matching

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9626590B2 (en) * 2015-09-18 2017-04-18 Qualcomm Incorporated Fast cost aggregation for dense stereo matching
CN108416840B (en) * 2018-03-14 2020-02-18 大连理工大学 A 3D scene dense reconstruction method based on monocular camera
KR102665543B1 (en) * 2021-02-22 2024-05-16 한국전자통신연구원 Apparatus and method for generating depth map from multi-view image

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113392879A (en) * 2021-05-26 2021-09-14 中铁二院工程集团有限责任公司 Multi-view matching method for aerial image
CN114494395A (en) * 2022-02-11 2022-05-13 腾讯科技(深圳)有限公司 Method, Apparatus, Device and Storage Medium for Depth Map Generation Based on Plane Prior
CN115619974A (en) * 2022-10-28 2023-01-17 郑川江 Large scene three-dimensional reconstruction method, reconstruction device, equipment and storage medium based on improved PatchMatch network
CN116758223A (en) * 2023-07-06 2023-09-15 哈尔滨工业大学 Three-dimensional multispectral point cloud reconstruction method, system and equipment based on dual-angle multispectral images
CN117315169A (en) * 2023-09-05 2023-12-29 武汉大学 Live-action three-dimensional model reconstruction method and system based on deep learning multi-view dense matching

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
IMAGE-GUIDED NON-LOCAL DENSE MATCHING WITH THREE-STEPS OPTIMIZATION;Xu Huang;《https://doi.org/10.5194/isprs-annals-III-3-67-2016》;20160603;全文 *
双目影像密集匹配方法的回顾与展望;沙洪俊;《武汉大学学报(信息科学版)》;20231130;第 48 卷(第11期);全文 *
多视密集匹配并行传播GPU-PatchMatch算法;邓非;颜青松;肖腾;;测绘学报;20200215(02);全文 *

Also Published As

Publication number Publication date
CN117557617A (en) 2024-02-13

Similar Documents

Publication Publication Date Title
Cabral et al. Piecewise planar and compact floorplan reconstruction from images
CN111508074B (en) Three-dimensional building model simplification method based on roof contour line
Remondino et al. State of the art in high density image matching
CN102938142B (en) Based on the indoor LiDAR missing data complementing method of Kinect
US9811880B2 (en) Backfilling points in a point cloud
CN117557617B (en) Multi-view dense matching method, system and equipment based on plane priori optimization
CN113066162B (en) A Rapid Modeling Method of Urban Environment for Electromagnetic Computation
CN103413133B (en) Automatically-extracting power line method in random laser point cloud data
CN102411778B (en) Automatic registration method of airborne laser point cloud and aerial image
CN103247045B (en) A kind of method obtaining artificial scene principal direction and image border from multi views
CN115564926B (en) Three-dimensional patch model construction method based on image building structure learning
CN108171780A (en) A kind of method that indoor true three-dimension map is built based on laser radar
CN107657659A (en) The Manhattan construction method for automatic modeling of scanning three-dimensional point cloud is fitted based on cuboid
CN106485690A (en) Cloud data based on a feature and the autoregistration fusion method of optical image
CN103942832B (en) A kind of indoor scene real-time reconstruction method based on online structural analysis
Zhang et al. Lidar-guided stereo matching with a spatial consistency constraint
CN115965712B (en) Building two-dimensional vector diagram construction method, system, equipment and storage medium
Becker et al. Refinement of building fassades by integrated processing of lidar and image data
Hou et al. Planarity constrained multi-view depth map reconstruction for urban scenes
Kim et al. Block world reconstruction from spherical stereo image pairs
CN116518864A (en) A full-field deformation detection method for engineering structures based on 3D point cloud comparative analysis
CN116721230A (en) Method, device, equipment and storage medium for constructing three-dimensional live-action model
Coorg Pose imagery and automated three-dimensional modeling of urban environments
CN106780577B (en) A Line Matching Method Based on Group Features
Widyaningrum et al. Extraction of building roof edges from LiDAR data to optimize the digital surface model for true orthophoto generation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant