CN104851089A - Static scene foreground segmentation method and device based on three-dimensional light field - Google Patents
Static scene foreground segmentation method and device based on three-dimensional light field Download PDFInfo
- Publication number
- CN104851089A CN104851089A CN201510209026.1A CN201510209026A CN104851089A CN 104851089 A CN104851089 A CN 104851089A CN 201510209026 A CN201510209026 A CN 201510209026A CN 104851089 A CN104851089 A CN 104851089A
- Authority
- CN
- China
- Prior art keywords
- straight line
- scene
- depth
- epipolar
- 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.)
- Pending
Links
Landscapes
- Image Analysis (AREA)
Abstract
本发明公开了一种基于三维光场的静态场景前景分割方法和装置,所述方法包括步骤:通过相机在一条一维直线上等间隔拍摄一场景的序列图像以构建三维光场,并生成场景的对极平面图;使用直线检测算法提取所述对极平面图中的直线特征并计算斜率信息,由所述斜率信息恢复场景中不同物体的深度信息,并使用快速插值算法生成整个场景的深度图像;对所述深度图像中的不同物体设定对应的深度阈值,并根据所述深度阈值对不同物体进行快速分割;本发明在复杂户外场景的分割中,能够准确恢复场景中多个物体之间的空间关系,较好地克服了现有基于区域聚类和数学形态学等方法在复杂场景应用中存在的过分割问题,在针对特定目标提取时有较高的分割效率。
The invention discloses a static scene foreground segmentation method and device based on a three-dimensional light field. The method includes the steps of: taking a sequence of images of a scene at equal intervals on a one-dimensional straight line with a camera to construct a three-dimensional light field, and generating the scene the epipolar plane; using a straight line detection algorithm to extract the straight line features in the epipolar plane and calculating slope information, recovering the depth information of different objects in the scene from the slope information, and using a fast interpolation algorithm to generate a depth image of the entire scene; Set corresponding depth thresholds for different objects in the depth image, and quickly segment different objects according to the depth thresholds; in the segmentation of complex outdoor scenes, the present invention can accurately restore the distance between multiple objects in the scene. Spatial relationship, which overcomes the over-segmentation problem existing in complex scene applications based on regional clustering and mathematical morphology methods, and has high segmentation efficiency when extracting specific targets.
Description
技术领域 technical field
本发明涉及图像处理技术领域,特别是指一种基于三维光场的静态场景前景分割方法和装置。 The present invention relates to the technical field of image processing, in particular to a static scene foreground segmentation method and device based on a three-dimensional light field.
背景技术 Background technique
图像分割指把图像中具有特殊涵义的不同区域区分开来。分割产生的每一个区域都是连通的,区域内像素满足特定的一致性准则,而不同的图像区域互不相交,彼此之间存在差异性。在分割概念基础上,可以将图像抽象为“前景”和“背景”两个类别。其中,图像“前景”的概念是相对于“背景”而言的,通常指图片场景中的人们感兴趣的区域。有效的前景分割是虚拟场景构建、智能视频监控和自然人机交互等高层次应用的前提和基础。 Image segmentation refers to distinguishing different regions with special meaning in the image. Each region generated by the segmentation is connected, and the pixels in the region satisfy a specific consistency criterion, while different image regions do not intersect each other, and there are differences between them. Based on the concept of segmentation, images can be abstracted into two categories, "foreground" and "background". Wherein, the concept of image "foreground" is relative to "background", and usually refers to an area of interest to people in a picture scene. Effective foreground segmentation is the premise and basis for high-level applications such as virtual scene construction, intelligent video surveillance, and natural human-computer interaction.
现有静态场景中的前景分割方法主要分为基于阈值、基于边缘、基于区域以及结合其他特定理论的方法等几个类别。其中,L.Vincent等提出的分水岭算法把图像看作拓扑地貌,以灰度的局部最小点为中心构建集水区,能够得到连续的分割边界,但在实际应用中常会出现过分割问题;Felzenszwalb等提出采用贪婪搜索策略的图分割方法,该方法能用成对区域比较方法获得全局最优解;Chan等基于水平集设计了几何主动轮廓模型,较好地实现了单目标轮廓提取,但在边缘定位仍然不够精确。 The existing foreground segmentation methods in static scenes are mainly divided into threshold-based, edge-based, region-based and methods combined with other specific theories. Among them, the watershed algorithm proposed by L.Vincent regards the image as a topological landform, constructs a watershed area centered on the local minimum point of the gray level, and can obtain continuous segmentation boundaries, but over-segmentation problems often occur in practical applications; Felzenszwalb proposed a graph segmentation method using a greedy search strategy, which can obtain the global optimal solution by using a paired region comparison method; Chan et al. designed a geometric active contour model based on level sets, which achieved a good single-target contour extraction, but in Edge positioning is still imprecise.
发明内容 Contents of the invention
有鉴于此,本发明的目的在于提出一种能够有效、高效实现图像分割的基于三维光场的静态场景前景分割方法和装置。 In view of this, the object of the present invention is to propose a static scene foreground segmentation method and device based on a three-dimensional light field that can effectively and efficiently realize image segmentation.
基于上述目的本发明提供的一种基于三维光场的静态场景前景分割方法,包括以下步骤: A kind of static scene foreground segmentation method based on three-dimensional light field that the present invention provides based on above-mentioned purpose, comprises the following steps:
通过相机在一条一维直线上等间隔拍摄一场景的序列图像以构建三维光场,并生成场景的对极平面图; A sequence of images of a scene is taken at equal intervals on a one-dimensional straight line by the camera to construct a three-dimensional light field and generate an epipolar plan view of the scene;
使用直线检测算法提取所述对极平面图中的直线特征并计算斜率信息,由所述斜率信息恢复场景中不同物体的深度信息,并使用快速插值算法生成整个场景的深度图像; Using a straight line detection algorithm to extract the straight line features in the epipolar plan and calculating slope information, recovering the depth information of different objects in the scene from the slope information, and using a fast interpolation algorithm to generate a depth image of the entire scene;
对所述深度图像中的不同物体设定对应的深度阈值,并根据所述深度阈值对不同物体进行快速分割。 Corresponding depth thresholds are set for different objects in the depth image, and different objects are quickly segmented according to the depth thresholds.
优选的,在所述三维光场中,任意一条光线L表示为: Preferably, in the three-dimensional light field, any light L is expressed as:
L=LF(x,y,t) L=LF(x,y,t)
其中,t为光线的起点,即所述相机在所述一维直线上的坐标;(x,y)代表光线的方向,对应于图像中的二维坐标值; Wherein, t is the starting point of the ray, that is, the coordinates of the camera on the one-dimensional straight line; (x, y) represents the direction of the ray, corresponding to the two-dimensional coordinate value in the image;
所述对极平面图为所述序列图像在相同y值条件下横向像素的堆叠,即垂直于y坐标的(x,t)切面;场景中同一物体的像素点在所述对极平面图中形成一条直线轨迹,且物体与相机直线运动轨迹之间的空间距离正比于该物体在所述对极平面图中对应直线的斜率。 The epipolar plan is the stack of horizontal pixels of the sequence image under the same y value condition, that is, the (x, t) section perpendicular to the y coordinate; the pixels of the same object in the scene form a line in the epipolar plan The linear trajectory, and the spatial distance between the object and the camera linear motion trajectory is proportional to the slope of the corresponding straight line of the object in the epipolar plan view.
优选的,生成所述深度图像的步骤进一步包括: Preferably, the step of generating the depth image further includes:
选取所述序列图像的一幅作为深度恢复和前景分割的目标图像; Select one of the sequence images as the target image for depth recovery and foreground segmentation;
使用直线检测算法从所述对极平面图中提取直线并确定所有直线区域; extracting straight lines from said epipolar plan using a straight line detection algorithm and determining all straight line regions;
根据所述直线区域,在所述目标图像生成直线特征点的斜率分布; Generating a slope distribution of straight line feature points in the target image according to the straight line area;
根据所述直线特征点的斜率分布,采用插值算法生成所述目标图像所有像素点的斜率分布; According to the slope distribution of the feature points of the straight line, an interpolation algorithm is used to generate the slope distribution of all pixels of the target image;
将所述目标图像所有像素点的斜率分布变换深度分布,再线性映射到灰度区间上,最终生成所述深度图像。 The slope distribution of all pixels of the target image is transformed into a depth distribution, and then linearly mapped to a gray scale interval, to finally generate the depth image.
优选的,使用直线检测算法提取直线前,对所述对极平面图进行高斯缩放,缩放比为0.9。 Preferably, before using the straight line detection algorithm to extract the straight line, Gaussian scaling is performed on the epipolar plan with a scaling ratio of 0.9.
优选的,确定所述直线区域的步骤包括: Preferably, the step of determining the straight line area includes:
对所述对极平面图中的每一个像素点,计算其相对颜色一致的临近点方向和水平方向的夹角,该夹角相近的像素点构成直线候选区; For each pixel point in the epipolar plan view, calculate the angle between the adjacent point direction and the horizontal direction with the same relative color, and the pixel points with similar angles constitute a straight line candidate area;
用近似的矩形覆盖每一个所述直线候选区,构造噪声模型对所述直线候选区执行验证,得出所述直线候选区构成直线的概率; Covering each of the straight line candidate areas with an approximate rectangle, constructing a noise model to perform verification on the straight line candidate areas, and obtaining the probability that the straight line candidate areas form a straight line;
设定直线判定的概率阈值,最终确定所述直线区域。 A probability threshold for straight line determination is set, and the straight line area is finally determined.
优选的,从所述对极平面图中提取直线的步骤后,还包括对提取结果的筛选处理步骤: Preferably, after the step of extracting straight lines from the epipolar plan view, the step of screening the extraction results is also included:
仅提取端点落在所述对极平面图在y轴方向上前十个像素内的直线; Only extracting the straight lines whose endpoints fall within the first ten pixels of the epipolar plane in the y-axis direction;
将没有与所述对极平面图上边界直接相交的直线延长,计算推测交点; Extending the straight line that does not directly intersect with the upper boundary of the epipolar plan, and calculating the estimated intersection point;
剔除推测交点超出图像边界的直线,将由于延长而出现的两条重合直线合并为单条直线。 Eliminate straight lines whose inferred intersection point exceeds the boundary of the image, and merge two coincident straight lines that appear due to extension into a single straight line.
本发明还提供了一种基于三维光场的静态场景前景分割装置,包括: The present invention also provides a static scene foreground segmentation device based on a three-dimensional light field, including:
构建模块,用于通过相机在一条一维直线上等间隔拍摄一场景的序列图像以构建三维光场,并生成场景的对极平面图; The building block is used to take a sequence of images of a scene at equal intervals on a one-dimensional straight line through the camera to construct a three-dimensional light field, and generate an epipolar plan view of the scene;
深度恢复模块,用于使用直线检测算法提取所述对极平面图中的直线特征并计算斜率信息,由所述斜率信息恢复场景中不同物体的深度信息,并使用快速插值算法生成整个场景的深度图像; The depth recovery module is used to extract the straight line features in the epipolar plane using a straight line detection algorithm and calculate slope information, restore the depth information of different objects in the scene from the slope information, and use a fast interpolation algorithm to generate a depth image of the entire scene ;
分割模块,用于对所述深度图像中的不同物体设定对应的深度阈值,并根据所述深度阈值对不同物体进行快速分割。 The segmentation module is configured to set corresponding depth thresholds for different objects in the depth image, and quickly segment different objects according to the depth thresholds.
优选的,所述构建模块生成的所述三维光场中,任意一条光线L表示为: Preferably, in the three-dimensional light field generated by the building block, any light L is expressed as:
L=LF(x,y,t) L=LF(x,y,t)
其中,t为光线的起点,即所述相机在所述一维直线上的坐标;(x,y)代表光线的方向,对应于图像中的二维坐标值; Wherein, t is the starting point of the ray, that is, the coordinates of the camera on the one-dimensional straight line; (x, y) represents the direction of the ray, corresponding to the two-dimensional coordinate value in the image;
所述对极平面图为所述序列图像在相同y值条件下横向像素的堆叠,即垂直于y坐标的(x,t)切面;场景中同一物体的像素点在所述对极平面图中形成一条直线轨迹,且物体与相机直线运动轨迹之间的空间距离正比于该物体在所述对极平面图中对应直线的斜率。 The epipolar plan is the stack of horizontal pixels of the sequence image under the same y value condition, that is, the (x, t) section perpendicular to the y coordinate; the pixels of the same object in the scene form a line in the epipolar plan The linear trajectory, and the spatial distance between the object and the camera linear motion trajectory is proportional to the slope of the corresponding straight line of the object in the epipolar plan view.
优选的,所述深度恢复模块进一步用于:选取所述序列图像的一幅作为深度恢复和前景分割的目标图像;使用直线检测算法从所述对极平面图中提取直线并确定所有直线区域;根据所述直线区域,在所述目标图像生成直线特征点的斜率分布;根据所述直线特征点的斜率分布,采用插值算法生成所述目标图像所有像素点的斜率分布;将所述目标图像所有像素点的斜率分布变换深度分布,再线性映射到灰度区间上,最终生成所述深度图像。 Preferably, the depth recovery module is further used to: select one of the sequence images as a target image for depth recovery and foreground segmentation; use a line detection algorithm to extract lines from the epipolar plan and determine all line areas; In the straight line area, the slope distribution of the straight line feature points is generated in the target image; according to the slope distribution of the straight line feature points, an interpolation algorithm is used to generate the slope distribution of all pixels of the target image; all pixels of the target image are The slope distribution of the points is transformed into the depth distribution, and then linearly mapped to the gray scale interval to finally generate the depth image.
优选的,所述深度恢复模块还包括用于在使用直线检测算法提取直线前,对所述对极平面图进行高斯缩放的缩放模块,所述缩放模块进行缩放的缩放比为0.9。 Preferably, the depth restoration module further includes a scaling module for performing Gaussian scaling on the epipolar plan before using a straight line detection algorithm to extract straight lines, and the scaling ratio of the scaling module is 0.9.
从上面所述可以看出,本发明提供的基于三维光场的静态场景前景分割方法和装置,通过在一条直线等间距的不同视点上拍摄场景的序列图像构建三维光场,用直线检测算法从对极平面图中分析提取出场景边缘及其深度信息;借助快速插值算法恢复整个场景的深度信息,最终通过阈值法实现对不同深度的前景物体的分割。本发明能够较准确地恢复场景中多个物体之间的空间关系,前景分割结果较好地克服了现有基于区域聚类和数学形态学等方法在复杂场景应用中存在的过分割问题,在针对特定目标提取时有较高的分割效率。 As can be seen from the above, the static scene foreground segmentation method and device based on a three-dimensional light field provided by the present invention constructs a three-dimensional light field by shooting sequence images of the scene at different viewpoints at equal intervals on a straight line, and uses a straight line detection algorithm from The edge of the scene and its depth information are extracted by analysis in the epipolar plane; the depth information of the entire scene is restored with the help of a fast interpolation algorithm, and finally the segmentation of foreground objects at different depths is realized through the threshold method. The present invention can more accurately restore the spatial relationship between multiple objects in the scene, and the result of foreground segmentation can better overcome the over-segmentation problem existing in complex scene applications based on methods such as area clustering and mathematical morphology. It has high segmentation efficiency when extracting specific objects.
附图说明 Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。 In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为本发明优选实施例的基于三维光场的静态场景前景分割方法流程图; Fig. 1 is the flowchart of the static scene foreground segmentation method based on the three-dimensional light field of the preferred embodiment of the present invention;
图2为本发明优选实施例的三维光场描述示意图; FIG. 2 is a schematic diagram of a three-dimensional light field description in a preferred embodiment of the present invention;
图3为本发明优选实施例中物体、成像平面、成像中心路径之间的几何关系示意图; Fig. 3 is a schematic diagram of the geometric relationship between the object, the imaging plane, and the imaging center path in a preferred embodiment of the present invention;
图4(a)为本发明优选实施例确定直线区域步骤中的原始图像像素; Fig. 4 (a) determines the original image pixel in the straight line region step in the preferred embodiment of the present invention;
图4(b)为本发明优选实施例确定直线区域步骤中的计算过夹角的像素点; Fig. 4 (b) is the pixel point of the calculated included angle in the step of determining the straight line area in the preferred embodiment of the present invention;
图4(c)为本发明优选实施例确定直线区域步骤中的直线候选区; Fig. 4 (c) is the straight line candidate area in the step of determining the straight line area in the preferred embodiment of the present invention;
图5(a)为本发明优选实施例中高斯缩放比为0.5时的直线检测结果; Fig. 5 (a) is the straight line detection result when the Gaussian scaling ratio is 0.5 in the preferred embodiment of the present invention;
图5(b)为本发明优选实施例中高斯缩放比为0.9时的直线检测结果; Fig. 5 (b) is the straight line detection result when the Gaussian scaling ratio is 0.9 in the preferred embodiment of the present invention;
图5(c)为本发明优选实施例中高斯缩放比为1.5时的直线检测结果; Fig. 5 (c) is the straight line detection result when Gaussian scaling ratio is 1.5 in the preferred embodiment of the present invention;
图6(a)为本发明优选实施例中的原始场景图像; Fig. 6 (a) is the original scene image in the preferred embodiment of the present invention;
图6(b)为本发明优选实施例中的EPI; Fig. 6 (b) is the EPI in the preferred embodiment of the present invention;
图6(c)为本发明优选实施例中的深度图像; Fig. 6 (c) is the depth image in the preferred embodiment of the present invention;
图7为“Mansion”场景深度图像直方图统计; Figure 7 shows the histogram statistics of the depth image of the "Mansion" scene;
图8(a)为对“Church”场景应用本发明的方法进行分割的分割结 果; Fig. 8 (a) is the segmentation result of applying the method of the present invention to the "Church" scene;
图8(b)为对“Mansion”场景应用本发明的方法进行分割的分割结果; Fig. 8 (b) is the segmentation result of applying the method of the present invention to the "Mansion" scene;
图8(c)为对“Statue”场景应用本发明的方法进行分割的分割结果; Fig. 8 (c) is the segmentation result of applying the method of the present invention to the "Statue" scene;
图9(a)为对“Church”、“Mansion”、“Statue”三个场景使用分水岭分割算法的分割结果; Figure 9(a) shows the segmentation results of the three scenes of "Church", "Mansion" and "Statue" using the watershed segmentation algorithm;
图9(b)为对“Church”、“Mansion”、“Statue”三个场景使用Graph Cut分割算法的分割结果; Figure 9(b) shows the segmentation results using the Graph Cut segmentation algorithm for the three scenes of "Church", "Mansion", and "Statue";
图9(c)基于K-means聚类的分割算法的)为对“Church”、“Mansion”、“Statue”三个场景使分割结果; Figure 9(c) of the segmentation algorithm based on K-means clustering) is the segmentation result for the three scenes of "Church", "Mansion" and "Statue";
图10为本发明实施例的基于三维光场的静态场景前景分割装置结构示意图。 FIG. 10 is a schematic structural diagram of a static scene foreground segmentation device based on a three-dimensional light field according to an embodiment of the present invention.
具体实施方式 Detailed ways
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明进一步详细说明。 In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be described in further detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
本发明实施例提供了一种基于三维光场的静态场景前景分割方法,该方法通过在一条直线等间距的不同视点上拍摄场景的序列图像构建三维光场,用直线检测算法从对极平面图中分析提取出场景边缘及其深度信息;借助快速插值算法恢复整个场景的深度信息,最终通过阈值法实现对不同深度的前景物体的分割。其中,光场(Light Fields)是对空间中所有光线的描述。现实世界中的场景包含丰富的三维信息,单张二维图像不能完全描述物体之间的空间关系。使用稠密的序列图像能够用来刻画静态场景。快速采样的序列图像中时间连续性大致等同于场景的空间连续性,同时采用“对极平面图”(Epipolar Plane Image,EPI)这种描述方法来分析三维场景。以下,通过本发明的优选实施例来进一步说明所述的基于三维光场的静态场景前景分割方法。 An embodiment of the present invention provides a static scene foreground segmentation method based on a three-dimensional light field. The method constructs a three-dimensional light field by taking sequential images of the scene at different viewpoints at equal intervals on a straight line, and uses a straight line detection algorithm to obtain Analyze and extract the edge of the scene and its depth information; restore the depth information of the entire scene with the help of a fast interpolation algorithm, and finally realize the segmentation of foreground objects at different depths through the threshold method. Among them, the light field (Light Fields) is a description of all the light in the space. Scenes in the real world contain rich 3D information, and a single 2D image cannot fully describe the spatial relationship between objects. Using a dense sequence of images can be used to characterize static scenes. The temporal continuity in the fast-sampling sequence images is roughly equivalent to the spatial continuity of the scene, and the description method of "Epipolar Plane Image (EPI)" is used to analyze the three-dimensional scene. Hereinafter, the method for segmenting the foreground of a static scene based on a three-dimensional light field will be further described through a preferred embodiment of the present invention.
参考图1,为本发明优选实施例的基于三维光场的静态场景前景分割方法流程图。 Referring to FIG. 1 , it is a flowchart of a static scene foreground segmentation method based on a three-dimensional light field according to a preferred embodiment of the present invention.
本发明优选实施例的基于三维光场的静态场景前景分割方法包括以下步骤: The static scene foreground segmentation method based on the three-dimensional light field of the preferred embodiment of the present invention comprises the following steps:
步骤1:通过相机在一条一维直线上等间隔拍摄一场景的序列图像以构建三维光场,并生成场景的对极平面图; Step 1: Take a sequence of images of a scene at equal intervals on a one-dimensional straight line through the camera to construct a three-dimensional light field, and generate an epipolar plan view of the scene;
步骤2:使用直线检测算法提取所述对极平面图中的直线特征并计算斜率信息,由所述斜率信息恢复场景中不同物体的深度信息,并使用快速插值算法生成整个场景的深度图像; Step 2: using a straight line detection algorithm to extract the straight line features in the epipolar plan and calculating slope information, recovering the depth information of different objects in the scene from the slope information, and using a fast interpolation algorithm to generate a depth image of the entire scene;
步骤3:对所述深度图像中的不同物体设定对应的深度阈值,并根据所述深度阈值对不同物体进行快速分割。 Step 3: Set corresponding depth thresholds for different objects in the depth image, and quickly segment different objects according to the depth thresholds.
(1)步骤1的具体实施 (1) The specific implementation of step 1
于步骤1中,首先建立三维光场。典型的光场构建过程通常需要对同一个场景在不同视角下拍摄大量图像,然后采用合适的几何模型描述光线在空间中的分布情况。针对本实施例中的场景前景分割的应用背景,研究考察图像序列的成像中心在一条水平直线上情形,即通过在一条一维直线上获取有序二维图像来建立三维光场。 In step 1, a three-dimensional light field is established first. A typical light field construction process usually needs to take a large number of images of the same scene under different viewing angles, and then use a suitable geometric model to describe the distribution of light in space. Aiming at the application background of the scene foreground segmentation in this embodiment, the case where the imaging center of the image sequence is on a horizontal straight line is studied, that is, the three-dimensional light field is established by acquiring ordered two-dimensional images on a one-dimensional straight line.
参考图2,为本发明优选实施例的三维光场描述示意图。 Referring to FIG. 2 , it is a schematic diagram illustrating a three-dimensional light field in a preferred embodiment of the present invention.
图像的生成可以看作是光线在成像平面上的投射过程。对空间中的任意一条光线L描述如下: Image generation can be regarded as the projection process of light on the imaging plane. The description of any ray L in space is as follows:
L=LF(x,y,t) L=LF(x,y,t)
其中,t为光线的起点,即所述相机在所述一维直线上的坐标;(x,y)代表光线的方向,对应于图像中的二维坐标值。在由LF描述的三维光场中,垂直于t坐标的(x,y)切面对应了不同视角下的场景图像,而垂直于y坐标的(x,t)切面对应的就是对极平面图,即EPI。 Wherein, t is the starting point of the ray, that is, the coordinates of the camera on the one-dimensional straight line; (x, y) represents the direction of the ray, corresponding to the two-dimensional coordinate value in the image. In the three-dimensional light field described by LF, the (x, y) section perpendicular to the t coordinate corresponds to the scene image under different viewing angles, and the (x, t) section perpendicular to the y coordinate corresponds to the epipolar plane, that is epi.
直观来看,EPI对应于序列图像在相同y值条件下横向像素的堆叠。为了后续处理的便捷性,本实施例假定任意相邻两幅序列图像光心(光心也即相机位置)间距一致,光心是成像的中心,相机位置等间距可以保证光心等间距,即保证所形成的EPI中同一物体对应像素点的连续性。当采样图像数量足够多时,场景中同一物体像素点在EPI中形成一条直线轨迹。通过对直线的几何特征分析即可得到场景中物体的空间信息。 Intuitively, EPI corresponds to the stacking of horizontal pixels of sequence images under the same y value. For the convenience of subsequent processing, this embodiment assumes that the distance between the optical centers (optical centers, that is, camera positions) of any two adjacent sequential images is the same, the optical center is the center of imaging, and the equal distance between the camera positions can ensure the equal distance between the optical centers, that is Ensure the continuity of pixels corresponding to the same object in the formed EPI. When the number of sampled images is large enough, the pixels of the same object in the scene form a straight line trajectory in the EPI. The spatial information of objects in the scene can be obtained by analyzing the geometric features of straight lines.
参考图3,为本发明优选实施例中物体、成像平面、成像中心路径之间的几何关系示意图。 Referring to FIG. 3 , it is a schematic diagram of the geometric relationship among the object, the imaging plane, and the imaging center path in a preferred embodiment of the present invention.
如图3所示,假定成像平面到成像中心距离为h,物体P到镜头中心路径的距离为D,x1,x2分别为P在图像中像素的横坐标,Δt为成像中心移动 距离。 As shown in Figure 3, assume that the distance from the imaging plane to the imaging center is h, the distance from the object P to the center of the lens is D, x 1 and x 2 are the abscissas of P’s pixels in the image, and Δt is the moving distance of the imaging center.
由三角相似关系可得: From the triangular similarity relation, we can get:
消去t,可得: Eliminate t to get:
其中,Δx=|x1-x2|。 Wherein, Δx=|x 1 −x 2 |.
在EPI中,正比于直线斜率k,则可知物体与相机之间的空间距离D与EPI中直线斜率k也是正比例关系。在得到场景各像素对应斜率的基础上,可以进一步对其中的深度信息做出估计。 In EPI, Proportional to the slope k of the straight line, it can be seen that the spatial distance D between the object and the camera is also proportional to the slope k of the straight line in the EPI. On the basis of obtaining the corresponding slope of each pixel in the scene, the depth information in it can be further estimated.
(2)步骤2的具体实施 (2) The specific implementation of step 2
作为优选实施例,生成所述深度图像的步骤具体包括: As a preferred embodiment, the step of generating the depth image specifically includes:
选取所述序列图像的一幅作为深度恢复和前景分割的目标图像; Select one of the sequence images as the target image for depth restoration and foreground segmentation;
使用直线检测算法从所述对极平面图中提取直线并确定所有直线区域; extracting straight lines from said epipolar plan using a straight line detection algorithm and determining all straight line regions;
根据所述直线区域,在所述目标图像生成直线特征点的斜率分布; Generating a slope distribution of straight line feature points in the target image according to the straight line area;
根据所述直线特征点的斜率分布,采用插值算法生成所述目标图像所有像素点的斜率分布; According to the slope distribution of the feature points of the straight line, an interpolation algorithm is used to generate the slope distribution of all pixels of the target image;
将所述目标图像所有像素点的斜率分布变换深度分布,再线性映射到灰度区间上,最终生成所述深度图像。 The slope distribution of all pixels of the target image is transformed into a depth distribution, and then linearly mapped to a gray scale interval, to finally generate the depth image.
具体的,首先进行直线检测。在EPI中直线检测的数目和质量是估计场景物体深度的关键。场景物体边界通常存在颜色的快速变化,在EPI中则表现为明显的直线特征。本实施例中的直线检测采用LSD(Line Segment Detection)方法,并针对EPI图像的具体特征进行筛选和处理。 Specifically, line detection is performed first. The number and quality of line detections in EPI are critical for estimating the depth of scene objects. There are usually rapid changes in color at the boundary of scene objects, which are manifested as obvious straight line features in EPI. The line detection in the present embodiment adopts the LSD (Line Segment Detection) method, and screens and processes the specific features of the EPI image.
对于每一个像素点,本实施例计算其相对颜色一致的临近点方向和水平方向的夹角α。夹角α相近的像素点构成了直线候选区(Line Support Regions),亦即可能的直线区域。参考图4(a)、图4(b)、图4(c),其分别为本优选实施例中的原始图像像素、计算过夹角的像素点、直线候选区。 For each pixel, this embodiment calculates the angle α between the direction of the adjacent point with the same relative color and the horizontal direction. Pixels with a similar angle α constitute a line candidate region (Line Support Regions), that is, a possible line area. Referring to Fig. 4(a), Fig. 4(b), and Fig. 4(c), they are the original image pixels, the pixel points with calculated included angles, and the straight line candidate areas in this preferred embodiment, respectively.
对于每一个直线候选区,用近似的矩形覆盖此区域像素。选取矩形中像素水平夹角α的众数α′为矩形主方向,对每一个矩形执行直线验证过程。给定偏差容忍度τ(角度,取值0~π),与矩形主方向夹角β=|α-α′|小于τ的 像素作为直线近似点。则对于矩形区域的任意一个像素点,其属于直线的概率所有像素夹角β独立且满足二项分布: For each line candidate area, an approximate rectangle is used to cover the area pixels. Select the mode α' of the horizontal angle α of the pixels in the rectangle as the main direction of the rectangle, and perform a straight line verification process for each rectangle. Given a deviation tolerance τ (angle, value 0~π), the pixel whose angle β=|α-α'| with the main direction of the rectangle is smaller than τ is used as a straight line approximation point. Then for any pixel in the rectangular area, the probability that it belongs to a straight line All pixel angles β are independent and satisfy the binomial distribution:
β~B(n,s,p) β~B(n,s,p)
其中,n为矩形区域中总像素点数,s为直线近似点数。通过构造噪声模型(Noise Model)对矩形区域执行验证过程,得出矩形区域构成直线的概率Q。设定直线判定的概率阈值,最终确定直线区域。 Among them, n is the total number of pixels in the rectangular area, and s is the number of linear approximation points. The verification process is performed on the rectangular area by constructing a noise model (Noise Model), and the probability Q that the rectangular area forms a straight line is obtained. Set the probability threshold for straight line judgment, and finally determine the straight line area.
进一步的,由于图像处理过程中的缩放比例能够显著影响EPI直线检测的效果,本实施例在不同的高斯缩放比例下做了测试和对比。参考图5(a)、图5(b)、图5(c),其分别是高斯缩放比为0.5、0.9、1.5时的直线检测结果。从上述几图中看出,高斯缩放比较低时直线检测结果较为稀疏,丢失了部分直线特征;缩放比较高时则出现较多的干扰直线。在实际试验中综合深度信息恢复效果考虑,本实施例选取的缩放比为0.9。 Further, since the scaling ratio in the image processing process can significantly affect the effect of the EPI straight line detection, tests and comparisons are made in different Gaussian scaling ratios in this embodiment. Referring to FIG. 5(a), FIG. 5(b), and FIG. 5(c), they are the straight line detection results when the Gaussian scaling ratio is 0.5, 0.9, and 1.5, respectively. It can be seen from the above figures that when the Gaussian zoom ratio is low, the line detection results are relatively sparse, and part of the straight line features are lost; when the zoom ratio is high, more interfering straight lines appear. Considering the depth information restoration effect in the actual test, the scaling ratio selected in this embodiment is 0.9.
需要说明的是,在本发明的其他实施例中,对EPI进行直线检测时,还可以使用:基于Hough变换的直线提取、基于Canny边缘检测的直线提取、基于链码的直线提取或是其他的能够进行准确的直线检测的方法。 It should be noted that, in other embodiments of the present invention, when performing line detection on EPI, you can also use: line extraction based on Hough transform, line extraction based on Canny edge detection, line extraction based on chain code or other A method that enables accurate straight line detection.
基于上述对于EPI的直线检测获得的直线区域,接下来进行恢复深度图像。本实施例选取序列图像的第一幅作为深度恢复和前景分割的目标图像。EPI集合了所有图像序列的场景信息,由于视角改变,后续场景中可能不断出现新的物体;由于图像获取时间不一致,拍摄后续场景某帧中闪现的物体(如行人等)会在EPI中形成噪点。此外,LSD直线检测仍然存在局限性,如直线中断和无法提取的情形。针对上述问题,本实施例对直线提取结果做出进一步筛选和处理,执行以下步骤: Based on the straight line area obtained by the above straight line detection for EPI, the depth image is restored next. In this embodiment, the first sequence image is selected as the target image for depth restoration and foreground segmentation. EPI collects the scene information of all image sequences. Due to the change of perspective, new objects may appear in subsequent scenes; due to the inconsistency of image acquisition time, objects (such as pedestrians, etc.) that flash in a frame of subsequent scenes will form noise in EPI. . In addition, LSD line detection still has limitations, such as line breaks and unextractable situations. In view of the above problems, this embodiment further screens and processes the straight line extraction results, and performs the following steps:
①仅提取端点落在所述对极平面图在y轴方向上前十个像素内的直线; 1. Only extract the straight lines whose endpoints fall within the first ten pixels of the epipolar plane in the y-axis direction;
②将没有与所述对极平面图上边界直接相交的直线延长,计算推测交点; ② Extend the straight line that does not directly intersect with the upper boundary of the epipolar plan, and calculate the estimated intersection point;
③剔除推测交点超出图像边界的直线,将由于延长而出现的两条重合直线合并为单条直线。 ③ Eliminate the straight lines whose estimated intersection points exceed the image boundary, and merge the two overlapping straight lines that appear due to the extension into a single straight line.
对于给定y值,对应的EPIy经过以上处理可以产生有序二元数组(u,k)。其中,u表示EPI直线与上边界交点坐标,即目标图像在纵坐标y下相应的横坐标值,k表示在此横坐标上的相应斜率。遍历所有y值,即可获 得目标图像在坐标(u,y,k)处的斜率值,即在目标图像生成直线特征点的斜率分布;所述的直线特征点即(u,y),其为在EPI中表现为直线特征的像素点在目标图像(原始图像)中的坐标位置;在目标图像中,直线特征点显示为离散分布的若干像素点。 For a given value of y, the corresponding EPI y can generate an ordered binary array (u, k) after the above processing. Among them, u represents the coordinates of the intersection point of the EPI line and the upper boundary, that is, the corresponding abscissa value of the target image under the ordinate y, and k represents the corresponding slope on this abscissa. By traversing all the y values, the slope value of the target image at the coordinates (u, y, k) can be obtained, that is, the slope distribution of the straight line feature points generated in the target image; the straight line feature points are (u, y), which is the coordinate position of the pixel point in the target image (original image) that appears as a straight line feature in the EPI; in the target image, the straight line feature point is displayed as a number of discretely distributed pixel points.
为了获得稠密的深度信息,本实施例通过插值映射在x轴方向得到完整的斜率表示。采用插值方法的合理性缘于如下几点: In order to obtain dense depth information, this embodiment obtains a complete slope representation in the x-axis direction through interpolation mapping. The rationale for using the interpolation method is due to the following points:
1)原图像中深度变化较大的像素点颜色值变化显著,在EPI中可形成明显的直线特征; 1) The color value of pixels with large depth changes in the original image changes significantly, and can form obvious straight line features in EPI;
2)EPI中的直线可以被LSD算法较完整地检出,对检出直线对应像素可以估算较为准确的深度信息; 2) The straight lines in the EPI can be detected relatively completely by the LSD algorithm, and more accurate depth information can be estimated for the pixels corresponding to the detected straight lines;
3)两条EPI直线在原图像对应点之间的深度值变化连续且平滑。 3) The depth value changes between the corresponding points of the two EPI straight lines in the original image are continuous and smooth.
因此,插值方法的选择就应当满足: Therefore, the choice of interpolation method should satisfy:
1)为了保证已经检测到的深度值的准确性,插值函数f必须经过给定的控制点,即满足f(u)=k; 1) In order to ensure the accuracy of the detected depth value, the interpolation function f must pass through a given control point, that is, satisfy f(u)=k;
2)插值函数f能够得到所有像素点处的估计深度值,即f在[0,Xmax]的定义域上连续; 2) The interpolation function f can obtain the estimated depth values at all pixel points, that is, f is continuous on the domain of definition [0, X max ];
3)插值函数f在两个控制点之间平滑过渡,即对于给定的u1,u2, x2∈[u1,u2],下式成立: 3) The interpolation function f makes a smooth transition between two control points, that is, for a given u 1 , u 2 , x 2 ∈[u 1 ,u 2 ], the following formula holds:
f(x1)′×f(x2)′>0 f(x 1 )′×f(x 2 )′>0
综合以上考虑,本实施例采用Pchip(Piecewise Cubic Hermite Interpolating Polynomial)作为插值方法,用以获取原图中任意像素点(x,y)处的斜率估计值k。 Based on the above considerations, this embodiment uses Pchip (Piecewise Cubic Hermite Interpolating Polynomial) as an interpolation method to obtain the estimated slope value k at any pixel point (x, y) in the original image.
由于Pchip插值方法本身的特点,在靠近[0,Xmax]两端的像素斜率估计值经常会出现过大或过小的情形,此时进一步设定[0,kmax]的区间作为界限规范化离群值。根据物体与相机之间的空间距离正比于该物体在所述对极平面图中对应直线的斜率的对应关系,可采用线性映射将斜率分布(x,y,k)变换为深度分布(x,y,d),再次线性映射到灰度区间上,最终得到深度图像的直观输出。提取深度图像的直观过程参考图6(a)、6(b)、6(c)所示。上述各图中的红线标识了EPI在原图中的对应位置。 Due to the characteristics of the Pchip interpolation method itself, the estimated value of the slope of the pixel near the two ends of [0, X max ] is often too large or too small. group value. According to the correspondence between the spatial distance between the object and the camera is proportional to the slope of the corresponding straight line of the object in the epipolar plan view, linear mapping can be used to transform the slope distribution (x, y, k) into a depth distribution (x, y ,d), which is linearly mapped to the gray-scale interval again, and finally the intuitive output of the depth image is obtained. The intuitive process of extracting the depth image is shown in Fig. 6(a), 6(b) and 6(c). The red lines in the above figures indicate the corresponding position of EPI in the original figure.
在本发明的其他实施例中,进行上述的深度恢复时,还可以使用:线性 插值方法、拉格朗日插值方法、样条插值方法、牛顿插值方法或其他插值方法。 In other embodiments of the present invention, when carrying out above-mentioned depth recovery, can also use: linear interpolation method, Lagrangian interpolation method, spline interpolation method, Newton interpolation method or other interpolation methods.
(3)步骤3的具体实施 (3) The specific implementation of step 3
现实场景中物体的区分常常表现为空间位置上的不连续性,本文中获取的场景深度信息为前景分割过程提供了第三维数据的支撑。在深度图图像基础上,对于不同空间层次的物体,设定相对应深度阈值即可实现对于物体对象的快速提取。 The distinction of objects in real scenes often manifests as discontinuity in spatial position. The scene depth information obtained in this paper provides the support of third-dimensional data for the foreground segmentation process. Based on the depth map image, for objects of different spatial levels, setting the corresponding depth threshold can realize the rapid extraction of objects.
图7为从图8(b)中“Mansion”场景深度图像统计得到的图像直方图。灰度直方图中横轴代表灰度级数(一般为0~255共256级),纵轴表示灰度值处于当前灰阶的像素点个数。对灰度图像中所有像素点做统计,可形成如图7所示的灰度直方图分布。观察可知直方图显现出了较为明显的深度分布特征,在斜率轴上选定恰当阈值点即可区分场景中的不同物体。 Fig. 7 is the image histogram obtained from the statistics of the depth image of the "Mansion" scene in Fig. 8(b). The horizontal axis in the grayscale histogram represents the number of grayscale levels (generally 0 to 255, a total of 256 levels), and the vertical axis represents the number of pixels whose grayscale value is in the current grayscale. By making statistics on all the pixels in the grayscale image, the grayscale histogram distribution shown in Figure 7 can be formed. Observation shows that the histogram shows a more obvious depth distribution feature, and selecting an appropriate threshold point on the slope axis can distinguish different objects in the scene.
基于上述本发明优选实施例的方法,接下来通过分割结果的评估以及与现有的常用分割方法的分割结果比较来进一步说明的本发明的有益效果。 Based on the method of the above-mentioned preferred embodiment of the present invention, the beneficial effect of the present invention will be further described through the evaluation of the segmentation results and the comparison with the segmentation results of the existing common segmentation methods.
本发明实施例研究的适用情形是静态场景中基于物体的分割,数据要求使用在同一水平直线的不同角度拍摄的大量照片序列。实验采用图像分割处理现有技术中构造的常用数据集进行评估和对比。本发明主要选取了“Church”、“Mansion”、“Statue”三个场景作为实验对象,其中每个场景数据集包含了在由计算机控制的滑动平台上对同一静态场景在不同成像点处拍摄的101幅图像,图像均已经过矫正和对齐预处理。 The applicable situation studied by the embodiment of the present invention is object-based segmentation in a static scene, and the data requires the use of a large number of photo sequences taken at different angles on the same horizontal line. The experiment uses image segmentation to process commonly used data sets constructed in the prior art for evaluation and comparison. The present invention mainly selects three scenes of "Church", "Mansion" and "Statue" as the experimental objects, wherein each scene data set includes images taken at different imaging points of the same static scene on a sliding platform controlled by a computer. 101 images, all of which have been rectified and pre-aligned.
分别在三个数据集中进行前景分割测试。针对不同的目标物体设定相应的灰度阈值,绘制分割结果,参考图8(a)、8(b)、8(c)所示,分别为对“Church”、“Mansion”、“Statue”三个场景应用本发明的方法进行分割的分割结果。图8(a)中的三张图片依次为“Church”场景中电线杆和花丛、塔、树的分割结果;8(b)中的三张图片依次为“Mansion”场景中树、栅栏、房屋的分割结果;8(c)中的三张图片依次为“Statue”场景中雕像、草丛、雕像和汽车的分割结果。直观上看,本发明的方法对景物细节上有着较好的分割效果。且在Church数据集中,对场景里的树木、塔与房屋这类颜色特征相近的物体,也实现了较好地分割。 Foreground segmentation tests are performed on the three datasets separately. Set corresponding grayscale thresholds for different target objects, and draw the segmentation results, as shown in Figure 8(a), 8(b), and 8(c), respectively for "Church", "Mansion", and "Statue" Three scenes are segmented by applying the method of the present invention. The three pictures in Figure 8(a) are the segmentation results of utility poles, flower bushes, towers, and trees in the "Church" scene; the three pictures in Figure 8(b) are the trees, fences, and houses in the "Mansion" scene in order The segmentation results of ; the three pictures in 8(c) are the segmentation results of statues, bushes, statues and cars in the "Statue" scene in turn. Intuitively, the method of the present invention has a better segmentation effect on scene details. And in the Church dataset, objects with similar color characteristics such as trees, towers and houses in the scene are also better segmented.
采用现有技术中定义的查全率和查准率两个量化指标分析分割结果。其 中查全率表示分割正确的像素数与标准分割像素数的比值,查准率表示分割图像中分割正确像素数和分割总像素数的比值。其中,用于比对的标准分割图像由人工标定获得。分别对“Church”中的塔、“Mansion”中的树和“Statue”中的雕像分割情况计算如表1所示。 The segmentation result is analyzed by using two quantitative indicators of recall rate and precision rate defined in the prior art. The recall rate represents the ratio of the number of correctly segmented pixels to the number of standard segmented pixels, and the precision rate represents the ratio of the number of correctly segmented pixels in the segmented image to the total number of segmented pixels. Among them, the standard segmented images used for comparison are obtained by manual calibration. Table 1 shows the calculations for the tower in "Church", the tree in "Mansion" and the statue in "Statue".
表1使用本发明方法分割结果的量化评估 Table 1 uses the quantitative evaluation of the segmentation result of the method of the present invention
为了进一步验证在复杂静态场景中本发明方法前景分割的有效性,选取分水岭分割算法、Graph Cut分割算法和基于K-means聚类的分割算法与本发明的方法作直观对比。 In order to further verify the effectiveness of the method foreground segmentation of the present invention in complex static scenes, the watershed segmentation algorithm, the Graph Cut segmentation algorithm and the segmentation algorithm based on K-means clustering are selected for visual comparison with the method of the present invention.
参考图9(a)、9(b)、9(c),分别为对“Church”、“Mansion”、“Statue”三个场景使用分水岭分割算法、Graph Cut分割算法和基于K-means聚类的分割算法的分割结果。由于复杂场景中颜色(灰度)特征复杂多变,同一物体可能有对比反差较大的几个颜色(如Mansion场景中的树木)、不同物体也可能有相近的颜色(如Church场景中的树木),上述几种常用方法会产生比较明显的过分割问题,通常需要后续的处理过程才能形成针对特定目标物体的分割结果。相比之下,本发明的方法更为简便有效。 Referring to Figures 9(a), 9(b), and 9(c), the watershed segmentation algorithm, Graph Cut segmentation algorithm, and K-means-based clustering are used for the three scenes of "Church", "Mansion", and "Statue" respectively The segmentation result of the segmentation algorithm. Due to the complex and changeable color (grayscale) features in complex scenes, the same object may have several colors with high contrast (such as trees in the Mansion scene), and different objects may also have similar colors (such as trees in the Church scene). ), the above-mentioned commonly used methods will produce obvious over-segmentation problems, and usually require subsequent processing to form segmentation results for specific target objects. In contrast, the method of the present invention is more convenient and effective.
本发明实施例还提供了一种基于三维光场的静态场景前景分割装置,参考图10,为本发明实施例的基于三维光场的静态场景前景分割装置结构示意图。所述装置包括: The embodiment of the present invention also provides a static scene foreground segmentation device based on a three-dimensional light field. Referring to FIG. 10 , it is a schematic structural diagram of a static scene foreground segmentation device based on a three-dimensional light field according to an embodiment of the present invention. The devices include:
构建模块101,用于通过相机在一条一维直线上等间隔拍摄一场景的序列图像以构建三维光场,并生成场景的对极平面图; The construction module 101 is used to take a sequence of images of a scene at equal intervals on a one-dimensional straight line by the camera to construct a three-dimensional light field, and generate an epipolar plan view of the scene;
深度恢复模块102,用于使用直线检测算法提取所述对极平面图中的直线特征并计算斜率信息,由所述斜率信息恢复场景中不同物体的深度信息,并使用快速插值算法生成整个场景的深度图像; The depth restoration module 102 is used to extract the straight line features in the epipolar plane using a straight line detection algorithm and calculate slope information, restore the depth information of different objects in the scene from the slope information, and generate the depth of the entire scene using a fast interpolation algorithm image;
分割模块103,用于对所述深度图像中的不同物体设定对应的深度阈值,并根据所述深度阈值对不同物体进行快速分割。 The segmentation module 103 is configured to set corresponding depth thresholds for different objects in the depth image, and quickly segment different objects according to the depth thresholds.
具体的,所述构建模块101生成的所述三维光场中,任意一条光线L表 示为: Specifically, in the three-dimensional light field generated by the building block 101, any light L is expressed as:
L=LF(x,y,t) L=LF(x,y,t)
其中,t为光线的起点,即所述相机在所述一维直线上的坐标;(x,y)代表光线的方向,对应于图像中的二维坐标值; Wherein, t is the starting point of the ray, that is, the coordinates of the camera on the one-dimensional straight line; (x, y) represents the direction of the ray, corresponding to the two-dimensional coordinate value in the image;
所述对极平面图为所述序列图像在相同y值条件下横向像素的堆叠,即垂直于y坐标的(x,t)切面;场景中同一物体的像素点在所述对极平面图中形成一条直线轨迹,且物体与相机直线运动轨迹之间的空间距离正比于该物体在所述对极平面图中对应直线的斜率。 The epipolar plan is the stack of horizontal pixels of the sequence image under the same y value condition, that is, the (x, t) section perpendicular to the y coordinate; the pixels of the same object in the scene form a line in the epipolar plan The linear trajectory, and the spatial distance between the object and the camera linear motion trajectory is proportional to the slope of the corresponding straight line of the object in the epipolar plan view.
作为优选实施例,所述深度恢复模块102进一步用于:选取所述序列图像的一幅作为深度恢复和前景分割的目标图像;使用直线检测算法从所述对极平面图中提取直线并确定所有直线区域;根据所述直线区域,在所述目标图像生成直线特征点的斜率分布;根据所述直线特征点的斜率分布,采用插值算法生成所述目标图像所有像素点的斜率分布;将所述目标图像所有像素点的斜率分布变换深度分布,再线性映射到灰度区间上,最终生成所述深度图像。 As a preferred embodiment, the depth recovery module 102 is further configured to: select one of the sequence images as a target image for depth recovery and foreground segmentation; use a line detection algorithm to extract lines from the epipolar plan and determine all lines area; according to the straight line area, the slope distribution of the straight line feature points is generated in the target image; according to the slope distribution of the straight line feature points, an interpolation algorithm is used to generate the slope distribution of all pixels of the target image; the target The slope distribution of all pixels in the image is transformed into the depth distribution, and then linearly mapped to the gray scale interval, and finally the depth image is generated.
在优选实施例中,所述深度恢复模块102还包括用于在使用直线检测算法提取直线前,对所述对极平面图进行高斯缩放的缩放模块,所述缩放模块进行缩放的缩放比为0.9。 In a preferred embodiment, the depth recovery module 102 further includes a scaling module for performing Gaussian scaling on the epipolar plan before using a straight line detection algorithm to extract straight lines, and the scaling ratio of the scaling module is 0.9.
在优选实施例中,所述深度恢复模块102确定所述直线区域时,首先对所述对极平面图中的每一个像素点,计算其相对颜色一致的临近点方向和水平方向的夹角,该夹角相近的像素点构成直线候选区;再用近似的矩形覆盖每一个所述直线候选区,构造噪声模型对所述直线候选区执行验证,得出所述直线候选区构成直线的概率;设定直线判定的概率阈值,最终确定所述直线区域。 In a preferred embodiment, when the depth recovery module 102 determines the straight line region, firstly, for each pixel in the epipolar plan view, it calculates the angle between the direction of the adjacent point with the same relative color and the horizontal direction, the Pixels with close angles form a line candidate area; then cover each line candidate area with an approximate rectangle, construct a noise model to perform verification on the line candidate area, and obtain the probability that the line candidate area forms a line; set Determine the probability threshold for straight line determination, and finally determine the straight line area.
在优选实施例中,所述深度恢复模块102还用于对极平面图中提取直线的结果进行筛选处理,具体包括: In a preferred embodiment, the depth recovery module 102 is also used to filter the result of extracting straight lines in the polar plan view, specifically including:
仅提取端点落在所述对极平面图在y轴方向上前十个像素内的直线; Only extracting the straight lines whose endpoints fall within the first ten pixels of the epipolar plane in the y-axis direction;
将没有与所述对极平面图上边界直接相交的直线延长,计算推测交点; Extending the straight line that does not directly intersect with the upper boundary of the epipolar plan, and calculating the estimated intersection point;
剔除推测交点超出图像边界的直线,将由于延长而出现的两条重合直线合并为单条直线。 Eliminate straight lines whose inferred intersection point exceeds the boundary of the image, and merge two coincident straight lines that appear due to extension into a single straight line.
综上所述,本发明通过相机在一维直线轨迹上等间隔拍摄序列图像构建三维光场,在EPI分析中估算场景物体深度信息,通过快速插值方法恢复了整个深度图像,并在此基础上实现了一种前景对象的分割方法。在复杂户外场景的分割中,比较有效地克服了传统方法的过分割问题,在针对特定目标提取时有较高的分割效率。 In summary, the present invention constructs a three-dimensional light field by shooting sequence images at equal intervals on a one-dimensional linear trajectory with a camera, estimates scene object depth information in EPI analysis, restores the entire depth image through a fast interpolation method, and based on this Implemented a segmentation method for foreground objects. In the segmentation of complex outdoor scenes, it effectively overcomes the over-segmentation problem of traditional methods, and has higher segmentation efficiency when extracting specific objects.
所属领域的普通技术人员应当理解:以上所述仅为本发明的具体实施例而已,并不用于限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 Those of ordinary skill in the art should understand that: the above descriptions are only specific embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present invention etc., should be included within the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510209026.1A CN104851089A (en) | 2015-04-28 | 2015-04-28 | Static scene foreground segmentation method and device based on three-dimensional light field |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510209026.1A CN104851089A (en) | 2015-04-28 | 2015-04-28 | Static scene foreground segmentation method and device based on three-dimensional light field |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104851089A true CN104851089A (en) | 2015-08-19 |
Family
ID=53850716
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510209026.1A Pending CN104851089A (en) | 2015-04-28 | 2015-04-28 | Static scene foreground segmentation method and device based on three-dimensional light field |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104851089A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105184808A (en) * | 2015-10-13 | 2015-12-23 | 中国科学院计算技术研究所 | Automatic segmentation method for foreground and background of optical field image |
CN106257537A (en) * | 2016-07-18 | 2016-12-28 | 浙江大学 | A kind of spatial depth extracting method based on field information |
CN107977938A (en) * | 2017-11-24 | 2018-05-01 | 北京航空航天大学 | A Kinect Depth Image Restoration Method Based on Light Field |
CN108171674A (en) * | 2018-01-15 | 2018-06-15 | 西北工业大学 | For the vision correcting method of visual angle projector image |
CN109033972A (en) * | 2018-06-27 | 2018-12-18 | 上海数迹智能科技有限公司 | A kind of object detection method, device, equipment and storage medium |
CN110036410A (en) * | 2016-10-18 | 2019-07-19 | 弗托斯传感与算法公司 | For obtaining the device and method of range information from view |
CN110232684A (en) * | 2019-06-13 | 2019-09-13 | 大连理工大学 | Three-dimensional medical image automatic segmentation method based on spectral analysis |
CN111754561A (en) * | 2020-06-10 | 2020-10-09 | 江南大学 | Method and system for depth recovery of light field images based on self-supervised deep learning |
CN112233162A (en) * | 2020-10-06 | 2021-01-15 | 武汉烽火凯卓科技有限公司 | Measuring method and device for plane image analysis based on structural illumination characteristics |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110069152A1 (en) * | 2009-09-24 | 2011-03-24 | Shenzhen Tcl New Technology Ltd. | 2D to 3D video conversion |
CN102223553A (en) * | 2011-05-27 | 2011-10-19 | 山东大学 | Method for converting two-dimensional video into three-dimensional video automatically |
CN102308320A (en) * | 2009-02-06 | 2012-01-04 | 香港科技大学 | Generating three-dimensional models from images |
-
2015
- 2015-04-28 CN CN201510209026.1A patent/CN104851089A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102308320A (en) * | 2009-02-06 | 2012-01-04 | 香港科技大学 | Generating three-dimensional models from images |
US20110069152A1 (en) * | 2009-09-24 | 2011-03-24 | Shenzhen Tcl New Technology Ltd. | 2D to 3D video conversion |
CN102223553A (en) * | 2011-05-27 | 2011-10-19 | 山东大学 | Method for converting two-dimensional video into three-dimensional video automatically |
Non-Patent Citations (1)
Title |
---|
魏巍 等: "基于三维光场的静态场景分割", 《中国学术期刊(网络版)》 * |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105184808A (en) * | 2015-10-13 | 2015-12-23 | 中国科学院计算技术研究所 | Automatic segmentation method for foreground and background of optical field image |
CN105184808B (en) * | 2015-10-13 | 2018-09-07 | 中国科学院计算技术研究所 | Scape automatic division method before and after a kind of light field image |
CN106257537A (en) * | 2016-07-18 | 2016-12-28 | 浙江大学 | A kind of spatial depth extracting method based on field information |
CN106257537B (en) * | 2016-07-18 | 2019-04-09 | 浙江大学 | A spatial depth extraction method based on light field information |
CN110036410A (en) * | 2016-10-18 | 2019-07-19 | 弗托斯传感与算法公司 | For obtaining the device and method of range information from view |
CN110036410B (en) * | 2016-10-18 | 2023-06-30 | 弗托斯传感与算法公司 | Apparatus and method for obtaining distance information from a view |
CN107977938A (en) * | 2017-11-24 | 2018-05-01 | 北京航空航天大学 | A Kinect Depth Image Restoration Method Based on Light Field |
CN108171674A (en) * | 2018-01-15 | 2018-06-15 | 西北工业大学 | For the vision correcting method of visual angle projector image |
CN108171674B (en) * | 2018-01-15 | 2020-07-14 | 西北工业大学 | Visual Correction Method for Projector Image from Any Viewing Angle |
CN109033972A (en) * | 2018-06-27 | 2018-12-18 | 上海数迹智能科技有限公司 | A kind of object detection method, device, equipment and storage medium |
CN110232684A (en) * | 2019-06-13 | 2019-09-13 | 大连理工大学 | Three-dimensional medical image automatic segmentation method based on spectral analysis |
CN110232684B (en) * | 2019-06-13 | 2023-05-23 | 大连理工大学 | A method for automatic segmentation of 3D medical images based on spectral analysis |
CN111754561A (en) * | 2020-06-10 | 2020-10-09 | 江南大学 | Method and system for depth recovery of light field images based on self-supervised deep learning |
CN111754561B (en) * | 2020-06-10 | 2024-07-26 | 江南大学 | Light field image depth recovery method and system based on self-supervision deep learning |
CN112233162A (en) * | 2020-10-06 | 2021-01-15 | 武汉烽火凯卓科技有限公司 | Measuring method and device for plane image analysis based on structural illumination characteristics |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104851089A (en) | Static scene foreground segmentation method and device based on three-dimensional light field | |
WO2020052530A1 (en) | Image processing method and device and related apparatus | |
KR101856401B1 (en) | Method, apparatus, storage medium, and device for processing lane line data | |
US11521311B1 (en) | Collaborative disparity decomposition | |
Zhu et al. | Concrete column recognition in images and videos | |
CN105989604A (en) | Target object three-dimensional color point cloud generation method based on KINECT | |
WO2021155558A1 (en) | Road marking identification method, map generation method and related product | |
CN105761308A (en) | Ground LiDAR and image data fused occlusion region building facade reconstruction method | |
CN107862698A (en) | Light field foreground segmentation method and device based on K mean cluster | |
US20150138193A1 (en) | Method and device for panorama-based inter-viewpoint walkthrough, and machine readable medium | |
WO2019071976A1 (en) | Panoramic image saliency detection method based on regional growth and eye movement model | |
CN103984942A (en) | Object recognition method and mobile terminal | |
CN110378995B (en) | Method for three-dimensional space modeling by using projection characteristics | |
CN106599776A (en) | People counting method based on trajectory analysis | |
CA3236016A1 (en) | Three-dimensional building model generation based on classification of image elements | |
CN101620672B (en) | A method for identifying three-dimensional buildings on the ground using three-dimensional landmark positioning | |
CN103679699B (en) | A kind of based on notable figure translation and the solid matching method of combined measure | |
CN106780577B (en) | A Line Matching Method Based on Group Features | |
CN105844666B (en) | One kind being based on the matched vehicle speed measuring method of single camera video sequence and its system | |
CN103903301B (en) | Urban landscape modeling method based on colored image identification | |
Kochi et al. | 3D modeling of architecture by edge-matching and integrating the point clouds of laser scanner and those of digital camera | |
CN107578419A (en) | A Stereo Image Segmentation Method Based on Consistent Contour Extraction | |
CN103473787B (en) | A Method for Detection of Moving Objects on Bridges Based on Spatial Geometric Relationships | |
Zou et al. | Automatic inpainting by removing fence-like structures in RGBD images | |
Lv et al. | Semantically guided multi-view stereo for dense 3d road mapping |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20150819 |
|
WD01 | Invention patent application deemed withdrawn after publication |