【初学者必看】图像处理入门,局部不变特征Local Invariant Features

对应点 Correspondences are Key

通过在一个场景的两个(或多个)图像之间找到对应的点,可以处理各种各样的计算机视觉问题。
•对应点(又称同源点) homologous points是同一三维点在场景不同视图中的投影。
•建立对应关系可能比较困难,因为在不同的视图中,同源点可能看起来不同,例如,由于视角的变化和/或光线的变化
viewpoint variations and/or lighting changes.

Mosaicing

通过对齐同一场景的两个图像来创建更大的图像。
Create a larger image by aligning two images of the same scene.
-通过估计单应性,这两幅图像可以对齐,这至少需要4个对应(越多越好)。
The two images may be aligned by estimating a homography,which requires at least 4 correspondences (more is better).
-在两幅图像中分别找出“显著点”。
-计算局部“描述”以识别要点。
-比较描述,以区分要点。

Local Invariant Features Paradigm

Detection of salient points (aka keypoints, interest points, features …).
Description - Computation of a suitable descriptor based on a
neighbourhood around a keypoint.
Matching descriptors between images.

Properties of good detectors/descriptors

Detector

Repeatability: it should find the same keypoints in different views of the scene despite the tranformations undergone by the images.
Distinctiveness: it should find keypoints surrounded by informative patterns of intensities, which would render them amenable to be told apart by the matching process.

Descriptor

Repeatability: the descriptions computed at homologous points should be as similar as possible.
Distinctiveness/informativeness: the description algorithm should
capture the salient information around a keypoint, so to keep important tokens and disregard changes due to nuisances (e,g. light changes) and
noise.
Compactness简洁型: the description should be as concise as possibile, to minimize memory occupancy and allow for efficient matching.
concise 简明的

Performance of the matching process

Harris Corner Detector

due to the shift being infinitesimal we can deploy Taylor’s expansion of the intensilty function at (x,y):
在这里插入图片描述
在这里插入图片描述
M encodes the local image structure around the considered pixel. To understand why, let us hypothesize that M is a diagonal matrix:
M矩阵的特征值决定了角点的性质,之前的考虑将M作为实对称矩阵,因此可以用旋转矩阵对角化
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
可以总结如下:
1.计算 C 每个像素
2.选择比阈值大的像素点
3.只检测那些局部最大值为C的像素

invariance properties

rotation invariance Yes Eignvalue of M invaiant
invariance to intensity change? Limit
scale invariance ? No

Scale Invariance

an image contains features at different scales

homography

Any two images of the same planar surface in space are related by a homography (assuming a pinhole camera model). This has many practical applications, such as image rectification, image registration, or computation of camera motion—rotation and translation—between two images. Once camera rotation and translation have been extracted from an estimated homography matrix, this information may be used for navigation, or to insert models of 3D objects into an image or video, so that they are rendered with the correct perspective and appear to have been part of the original scene (see Augmented reality).

空间中同一平面的任意两幅图像都由单应性(假设是针孔相机模型)关联。这有许多实际应用,如图像校正,图像配准,或计算相机的运动-旋转和平移-之间的两个图像。一旦提取相机旋转和翻译估计单应性矩阵,这些信息可以用于导航,或者插入3 d对象的模型图像或视频,所以他们呈现正确的角度和似乎是原始场景的一部分(见增强现实)。

Augmented reality (AR)

Augmented reality (AR) is an interactive experience of a real-world environment where the objects that reside in the real-world are enhanced by computer-generated perceptual information.The overlaid sensory information can be constructive (i.e. additive to the natural environment), or destructive (i.e. masking of the natural environment).This experience is seamlessly interwoven with the physical world such that it is perceived as an immersive aspect of the real environment.In this way, augmented reality alters one’s ongoing perception of a real-world environment, whereas virtual reality completely replaces the user’s real-world environment with a simulated one. Augmented reality is related to two largely synonymous terms: mixed reality and computer-mediated reality.
增强现实(AR)是一种真实世界环境的交互体验,其中驻留在真实世界中的对象通过计算机生成的感知信息得到增强。叠加的感官信息可以是建设性的(即对自然环境的补充),也可以是破坏性的(即对自然环境的掩蔽)。这种体验与物理世界无缝地交织在一起,因此它被视为真实环境的一个身临其境的方面。通过这种方式,增强现实改变了人们对真实世界环境的持续感知,而虚拟现实则完全用模拟环境取代了用户的真实世界环境。增强现实与两个基本同义的术语有关:混合现实和计算机介导的现实。

The primary value of augmented reality is the manner in which components of the digital world blend into a person’s perception of the real world, not as a simple display of data, but through the integration of immersive sensations, which are perceived as natural parts of an environment.
增强现实技术的主要价值在于,数字世界的各个组成部分以何种方式融入到一个人对现实世界的感知中,而不是作为简单的数据显示,而是通过融合身临其境的感觉,这种感觉被视为环境的自然组成部分
Augmented reality is used to enhance natural environments or situations and offer perceptually enriched experiences. With the help of advanced AR technologies (e.g. adding computer vision and object recognition) the information about the surrounding real world of the user becomes interactive and digitally manipulated. Information about the environment and its objects is overlaid on the real world. This information can be virtual or real,
增强现实是用来增强自然环境或情境,并提供感知丰富的经验。在先进的增强现实技术的帮助下(如添加计算机视觉和对象识别),用户周围真实世界的信息变得交互式和数字化操作。关于环境及其对象的信息覆盖在真实世界上。这些信息可以是虚拟的,也可以是真实的。

Find salient points

RANSAC - Random Sample Consensus I

RANSAC是“RANdom SAmple Consensus(随机抽样一致)”的缩写。它可以从一组包含“局外点”的观测数据集中,通过迭代方式估计数学模型的参数。它是一种不确定的算法——它有一定的概率得出一个合理的结果;为了提高概率必须提高迭代次数。该算法最早由Fischler和Bolles于1981年提出。

RANSAC的基本假设是:

(1)数据由“局内点”组成,例如:数据的分布可以用一些模型参数来解释;
(2)“局外点”是不能适应该模型的数据;
(3)除此之外的数据属于噪声。
局外点产生的原因有:噪声的极值;错误的测量方法;对数据的错误假设。
RANSAC也做了以下假设:给定一组(通常很小的)局内点,存在一个可以估计模型参数的过程;而该模型能够解释或者适用于局内点。

一、示例
一个简单的例子是从一组观测数据中找出合适的2维直线。假设观测数据中包含局内点和局外点,其中局内点近似的被直线所通过,而局外点远离于直线。简单的最小二乘法不能找到适应于局内点的直线,原因是最小二乘法尽量去适应包括局外点在内的所有点。相反,RANSAC能得出一个仅仅用局内点计算出模型,并且概率还足够高。但是,RANSAC并不能保证结果一定正确,为了保证算法有足够高的合理概率,我们必须小心的选择算法的参数。
A simple example is to find the appropriate 2-dimensional line from a set of observations. It is assumed that the observation data includes intra- and extra-office points, wherein the intra-point is approximated by a straight line, and the extra-point is far from the straight line. The simple least squares method cannot find a straight line that fits into the intra-point, because the least squares method tries to adapt to all points including the extra-point. Instead, RANSAC can derive a model that uses only intra-points and the probability is high enough. However, RANSAC does not guarantee that the result is correct. In order to ensure that the algorithm has a sufficiently high probability, we must carefully select the parameters of the algorithm.

左图:包含很多局外点的数据集 右图:RANSAC找到的直线(局外点并不影响结果)

二、概述
RANSAC算法的输入是一组观测数据,一个可以解释或者适应于观测数据的参数化模型,一些可信的参数。
RANSAC通过反复选择数据中的一组随机子集来达成目标。被选取的子集被假设为局内点,并用下述方法进行验证:
1.有一个模型适应于假设的局内点,即所有的未知参数都能从假设的局内点计算得出。
2.用1中得到的模型去测试所有的其它数据,如果某个点适用于估计的模型,认为它也是局内点。
3.如果有足够多的点被归类为假设的局内点,那么估计的模型就足够合理。
4.然后,用所有假设的局内点去重新估计模型,因为它仅仅被初始的假设局内点估计过。
5.最后,通过估计局内点与模型的错误率来评估模型。
这个过程被重复执行固定的次数,每次产生的模型要么因为局内点太少而被舍弃,要么因为比现有的模型更好而被选用。

三、算法
伪码形式的算法如下所示:
输入:
data —— 一组观测数据
model —— 适应于数据的模型
n —— 适用于模型的最少数据个数
k —— 算法的迭代次数
t —— 用于决定数据是否适应于模型的阀值
d —— 判定模型是否适用于数据集的数据数目
输出:
best_model —— 跟数据最匹配的模型参数(如果没有找到好的模型,返回null)
best_consensus_set —— 估计出模型的数据点
best_error —— 跟数据相关的估计出的模型错误

iterations = 0
best_model = null
best_consensus_set = null
best_error = 无穷大
while ( iterations < k )
maybe_inliers = 从数据集中随机选择n个点
maybe_model = 适合于maybe_inliers的模型参数
consensus_set = maybe_inliers

for ( 每个数据集中不属于maybe_inliers的点 )
    if ( 如果点适合于maybe_model,且错误小于t )
        将点添加到consensus_set
if ( consensus_set中的元素数目大于d )
    已经找到了好的模型,现在测试该模型到底有多好
    better_model = 适合于consensus_set中所有点的模型参数
    this_error = better_model究竟如何适合这些点的度量
    if ( this_error < best_error )
        我们发现了比以前好的模型,保存该模型直到更好的模型出现
        best_model =  better_model
        best_consensus_set = consensus_set
        best_error =  this_error
增加迭代次数

返回 best_model, best_consensus_set, best_error

RANSAC算法的可能变化包括以下几种:
(1)如果发现了一种足够好的模型(该模型有足够小的错误率),则跳出主循环。这样可能会节约计算额外参数的时间。
(2)直接从maybe_model计算this_error,而不从consensus_set重新估计模型。这样可能会节约比较两种模型错误的时间,但可能会对噪声更敏感。

四、参数
我们不得不根据特定的问题和数据集通过实验来确定参数t和d。然而参数k(迭代次数)可以从理论结果推断。当我们从估计模型参数时,用p表示一些迭代过程中从数据集内随机选取出的点均为局内点的概率;此时,结果模型很可能有用,因此p也表征了算法产生有用结果的概率。用w表示每次从数据集中选取一个局内点的概率,如下式所示:
w = 局内点的数目 / 数据集的数目
通常情况下,我们事先并不知道w的值,但是可以给出一些鲁棒的值。假设估计模型需要选定n个点,wn是所有n个点均为局内点的概率;1 − wn是n个点中至少有一个点为局外点的概率,此时表明我们从数据集中估计出了一个不好的模型。 (1 − wn)k表示算法永远都不会选择到n个点均为局内点的概率,它和1-p相同。因此,
1 − p = (1 − wn)k
我们对上式的两边取对数,得出

值得注意的是,这个结果假设n个点都是独立选择的;也就是说,某个点被选定之后,它可能会被后续的迭代过程重复选定到。这种方法通常都不合理,由此推导出的k值被看作是选取不重复点的上限。例如,要从上图中的数据集寻找适合的直线,RANSAC算法通常在每次迭代时选取2个点,计算通过这两点的直线maybe_model,要求这两点必须唯一。
为了得到更可信的参数,标准偏差或它的乘积可以被加到k上。k的标准偏差定义为:

五、优点与缺点
RANSAC的优点是它能鲁棒的估计模型参数。例如,它能从包含大量局外点的数据集中估计出高精度的参数。RANSAC的缺点是它计算参数的迭代次数没有上限;如果设置迭代次数的上限,得到的结果可能不是最优的结果,甚至可能得到错误的结果。RANSAC只有一定的概率得到可信的模型,概率与迭代次数成正比。RANSAC的另一个缺点是它要求设置跟问题相关的阀值。
RANSAC只能从特定的数据集中估计出一个模型,如果存在两个(或多个)模型,RANSAC不能找到别的模型。

六、应用
RANSAC算法经常用于计算机视觉,例如同时求解相关问题与估计立体摄像机的基础矩阵。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

和你在一起^_^

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值