1.边缘检测
2.图像去噪
3.图像增强
4.形态学操作
5.特征提取
6.python code
利用高斯分布,靠近卷积核中心的数值最大,使得像素值分布变得均匀来模糊图像去除显眼的噪音点
例如:以下是5*5的一个卷积核
$$ G=\frac{1}{275} * \left[ \matrix{ 1 & 4 & 7 & 4 & 1\ 4 &16&26&16&4\ 7&26&41&26&7\ 4&16&26&16&4\ 1&4&7&4&1 }
\right ] $$ 以下是效果展示:
利用soble算子得到最初始的边缘信息 $$ \theta=arctan(Gy/Gx) \ \ slope $$
$$
Sx=\left[
\matrix{
-1 & 0 &1\
-2 & 0& 2\
-1 & 0& 1
}
\right]
\ \ \ Sy=\left[
\matrix{
1 & 2 &1\
0 & 0& 0\
-1& -2& -1
}
\right]
$$
在进行sobel算子后边缘任然不是很确定,我们要对他们进行再一轮检测,对边缘内外梯度不是极大值的点进行消除

**线性插值法:设g1的梯度幅度M(g1),g2的梯度幅度M(g2),则dtmp1可以得到:M(dtmp1)=w * M(g2)+(1- w) * M(g1) ** 其中w=dist(dtmp1,g2)/dist(g1,g2) dist指的是两者的距离 对于每个像素点,进行非极大值抑制,对于非边缘像素我们要将其过滤掉,将模糊的边界变得清晰
对于在边缘领域内是极大值的我们保留,否则消去抑制
如果图像中像素点大于阈值上界则被认为是应该保留的(称为强边界),小于阈值下界的必然不是边界,两者之间被认为是候选项(称为弱边界),需要进一步处理


上面是低阈值图像
下面是高阈值图像
阈值太低会带有虚假的边界信息,阈值太高会失去一些真实的边界信息,需要适当选择阈值

利用滞后技术来跟踪边界。若某一像素位置和强边界相连的弱边界认为是边界,其他的弱边界则被删除(canny算子)
以下为原图:

简单平均卷积操作,就是使用对区域进行平均卷积操作来模糊图像,达到去除噪音点的效果,有归一化操作

基本和均值滤波一样,但是可以选择归一化也可以不选择,不选择归一化但是可能会出现溢出

溢出后:

符合高斯(正态)分布的滤波器,使用高斯卷积核来进行高斯模糊

在某个范围内选择中间数值作为该区域的数值

1.一阶导数的边缘检测算子,通过模板作为核与图像的每个像素点做卷积和运算,然后选取合适的阈值来提取图像的边缘,例如soble算子 2.依据于二阶导数过零点,常见的有Laplacian 算子,此类算子对噪声敏感。
分为水平Sobel算子和垂直Sobel算子
最后分别进行卷积运算,取绝对值, $$ G=\sqrt{Gx^2+Gy^2} $$
$$
Sx=\left[
\matrix{
-1 & 0 &1\
-2 & 0& 2\
-1 & 0& 1
}
\right]
\ \ \ Sy=\left[
\matrix{
1 & 2 &1\
0 & 0& 0\
-1& -2& -1
}
\right]
$$
和soble算子不一样的比例
$$
Sx=\left[
\matrix{
-3 & 0 &3\
-10 & 0& 10\
-3 & 0& 3
}
\right]
\ \ \ Sy=\left[
\matrix{
3 & 10 &3\
0 & 0& 0\
-3& -10& -3
}
\right]
$$
利用二阶微分进行锐化效果
$$
G=\left[
\matrix{
0 & 1 &0\
1 & -4& 1\
0 & 1& 0
}
\right]
$$
从做到右边是sobel,scharr,Laplacian算子实验图

以下是原图

利用直方图均衡化,使得高像素值的像素点降低,低像素值的点增大
利用累计函数(前缀和)实现 $$ F=\frac{n}{N} \其中n为该领域内某个像素的像素点数量\N是该领域内所有像素点数量 $$ 
在图像中,微分是锐化效果,积分是模糊效果
利用二阶导数的拉普拉斯算子实现图像锐化

Log函数可以实现低像素值像素点增强,高像素值像素点减弱
指数函数相反,高像素值像素点增强,低像素值像素点减弱
log2图像:

log10图像:

利用幂函数的特性,以x的一次方为界限分为,低像素值像素点增强和高像素值像素点增强

0.3:

0.5:

0.8:

2:

3:

4:

膨胀:填充连接作用
腐蚀:去除毛刺


$$ 开运算:先腐蚀后膨胀,将噪音点去除后再对图像加强\
闭运算:先膨胀后腐蚀,先实现加强保留部分噪音点,再去除加强后的噪音点 $$


$$ 顶帽=原始输入-开运算结果 \ (白顶帽变换) \
黑帽=闭运算-原始输入 \ (黑底帽变换) $$



特征提取过程分为:特征提取,特征描述和特征匹配
角点:向x与y方向移动变化很大的图像块 边界:沿着某一个方向变化小,另一方向移动变化大 $$ 角点响应R值: R=x1*x2-k(x1+x2)^2 \ R>0 角点 \ R约等于0 平坦区域 \ R<0 边界 $$ 

尺度空间的获取通常使用高斯模糊来实现 尺度不变特征变换匹配算法 *L(x,y,z)=G(x,y,z)I(x,y) G是高斯函数 SIFT特征对于旋转和尺度均具有不变性,并且对于噪声、视角变化和光照变化具有良好的鲁棒性 SIFT所查找到的关键点是一些十分突出,不会因光照、仿射变换和噪音等因素而变化的点,如角点、边缘点、暗区的亮点及亮区的暗点等。
不同的是角点检测会受到角度旋转的影响,而SIFT算法不会受到影响
图像的尺度空间是指图像的模糊程度,而非图像的大小。 近距离看一个物体和远距离看一个物体,模糊程度是不一样的;从近到远,图像越来越模糊的过程,也是图像的尺度越来越大的过程。
检测空间极值分为几个步骤:1.建立高斯金字塔 2.建立DOG高斯差分金字塔 3.DOG局部极值检测
以上方法检测到的极值点是离散空间的极值点, 以下通过拟合三维二次函数来精确确定关键点的位置和尺度, 同时去除低对比度的关键点和不稳定的边缘响应点(因为DOG算子会产生较强的边缘响应),以增强匹配稳定性、提高抗噪声能力。
分为:1.关键点的精确定位 (使用子像素插值法) 2.去除边缘效应

特征描述就类似于 我从这张图像上得到了一些数据,例如像素,我该怎么表示它的强度呢?我们就必须说 像素高或低形容,但是我们要可视化我们的口头描述,因此必须通过一些图像之类的方式进行统计,让我们一目了然我们想要表示的意思
特征描述常见的就是使用直方图来统计特征数据
直接用图像与我们的模板一对一匹配
缺点:显而易见的慢

就是利用最小二乘法进行多次操作,来确保准确性和算法时间复杂度
K对最佳匹配
从匹配器分出分支我们可以选择暴力多次匹配,但是我们可以选择拥有基于树壮的数据结构的Flannd模型,但是Flannd模型需要构造单应性矩阵
