Filter and Digital Image Processing

本文为课堂笔记,严禁转载

本文为了方便自己复习记录,如有理解不对的地方还望指正。

Purpose of Digital Image Processing

Image procssing I

Image Enhancement (Improving subjective image quality e.g image contrast)
Image Restoration(Improving objective image quality e.g noise)
Image compression(Reducing number of bits)
Geometry(Interpolation)
Scaling
Rotation/Mirroring
Rectification
Warping

Image Processing

image acquistion
preprocessing
segments
Feature extraction(edge detection)
recognition/evalutation

Geometric Image Transformations

Coordinate transformation
(x,,y,)=T(x,y)+Interpolation

Translation

T=100010dxdy1

Rotation

T=cos(ϕ)sin(ϕ)0sin(ϕ)cos(ϕ)0001

Scaling

T=Sx000Sy0001

Shear

T=1uy0ux10001

xy1=dot(T,xy1)

Filter and Digital Image Processing

Application of Geometry

Image Transfromation
Image stitching
Rectification
Linear alignment/registration
Internal camera orientation

Point Operations

g(x,y)=T(f(x,y),x,y)
g(x,y):Value of output image
T:Operator function
f(x,y): Value of original image at postion(x,y)
x,y:
1.Imhomogeneous PO:T is dependent on (x,y)
2.Homogeneous PO: T is Not dependent on (x,y)

Inhomo PO

Background detection

Inhomo PO:
若有f1,f2,f3…fn张图片来自城市十字路口的摄像头,假设摄像头的拍摄角度不变,外界光线等一系列客观条件不变
a(x,y)=1NNi=0fi(x,y)
a(x,y)为图像背景
若得到了图像背景,反过来再有新的图片进来
gi(x,y)=T(f(x,y),x,y)=fi(x,y)a(x,y)
gi(x,y)就为图片中移动的物体

Pixel-dependent Brightness Correction

Inhmo PO:
以下过程的假设:
1.没有为0的错误函数
2.线性
3.降解过程稳定(个人理解为矩阵可以求逆)
最理想的状态:图像获取信息的敏感度和像素点位置无关
实际操作中:
不平的物体照明
传感器不同位置的敏感度
等都会造成问题
g(x,y)=e(x,y)f(x,y)
g(x,y)测量输出图像
e(x,y)调整系数
f(x,y)未降解图像
我们在计算调整系数的时候,需要一张参考图像
f(x,y)=c
fc(x,y)=e(x,y)c
e(x,y)=fc(x,y)c
所以我们需要的图像f(x,y)
f(x,y)=cg(x,y)fc(x,y)

Homo PO

Filter and Digital Image Processing

Id:g(x,y)=f(x,y)
log:g(x,y)=alog(f(x,y)+1)
sq-root:g(x,y)=255f(x,y)
sq:g(x,y)=f(x,y)2255
exp:g(x,y)=aexp(f(x,y)1)
Inverse:g(x,y)=255f(x,y)

灰度值标准化

g(x,y)=f(x,ymin(f(x,y)))max(f(x,y)min(f(x,y)))2˙55

Histogram Equalization

平均亮度值
填平附近的极小值

一下操作就是将原来的灰度值频率进行累加
累加后的值为1

f(x,y)=H(p)将该像素点的灰度值用该灰度值的频数表示
g(x,y):G(q)转换后该像素点的值
g(x,y)=T(f(x,y))
步骤如下:

1.标准化
255i=0H(i)=255j=0G(r)=1
2.
pi=0H(i)=q=T(p)j=0G(r)
3. Histogram Equalization
pi=0H(i)=qj=01256
4.
pi=0H(i)=(q+1)(˙1256)
5.
q=256(˙pi=0H(i))1
6.
q=256CumH˙(p)1
7.
q=CumH(p)=T(p)

效果图在这

从点到邻居

Temporal Avg

相同空间点不同时间
g(x,y)=1NNt=0fi(x,y)=forig(x,y)+1NNt=0nt(x,y)
最后一项当N无限大的时候趋向0
所以通常
g(x,y)=1NNt=0fi(x,y)

Spatial Avg

相同时间点不同空间(相邻)
该方法在边界容易出错而且容易出现重叠纹理
该方法可以用来降低图像噪音
γ(x,y)为图像中的一块区域
g(x,y)=1Nγ(x,y)f(xi,yi)=forig(x,y)+1Nγ(x,y)n(xi,yi)

Median Filtering

取区域内的中位数
该方法能够有效取出shot noise(符合泊松分布)
g(x,y)=medianϕ(x,y)f(xi,yi)

Convolution

g(x,y)=ϕ(x,y)hif(xi.yi)˙
hi=1N
hi=h(r,s)=1w2ones(w,w)
Filter and Digital Image Processing
公式在这里,注意这里不是矩阵乘法

Edge Detection

1st order Derivatives
Filter and Digital Image Processing
x方向检测y方向的线条
y方向检测x方向的线条
最后组合
2nd order Derivatives
Filter and Digital Image Processing
Filter and Digital Image Processing