数图复习部分代码

  • 格式:docx
  • 大小:3.44 MB
  • 文档页数:10

第二章部分代码
1. FlipV
u=x
v=h-1-y
FlipH
U=w-1-x
V=y
代码test1
2.
byte[,] ScallingAt(byte[,]f,int x0,int y0,float K)
效果
.
byte[,] LocalScallingAt(byte[,]f,int x0,int y0,float R,float K)
效果
byte[,] LocalScallingAtPlus(byte[,]f,int x0,int y0,float R,float K)
效果
代码test2
3.加噪声
代码test3
4.图像移位sin与cos
1—》2-》3->4
代码test4
5.图像加减乘除


有阈值
代码test5
6. Bilinear Interpolation(插值)
i<=x<i+1,j<=y<j+1,
a = x-i,
b = y-j
f(x,j) = f[i,j]*(1-a)+f[i+1,j]*a;
f(x,j+1) = f[i,j+1]*(1-a)+f[i+1,j+1]*a;
f(x,y) = f(x,j)*(1-b)+f(x,j+1)*b;
f(i,j)f(x,j)f(i+1,j)
f(x,y)
f(i+1,j) f(x,j+1)f(i+1,j+1)
原始图像
不同内插方法
放大的图像
7.
.
代码test7
8.bool Is _4adjacent(int px,int py,int qx,int qy); bool Is _Dadjacent(int px,int py,int qx,int qy); Bool Is _8adjacent(int px,int py,int qx,int qy);
Is _4adjacent∪Is_Dadjacent
代码test8
9.Inner Border of Region
B(in) = {(x,y)|(x,y)∈R, (x,y) adjacent to (R) c}
10.距离
欧式
City-block D4(p, q) = │x-s│+ │y-t│; p:(x,y) , q(s,t)棋盘距离D8(p, q) = max (│x-s│, │y-t│)
代码Test 10
11. Averaging K different noisy images
代码Test 11
第三章部分代码
12. Spatial Filtering
均值滤波,高斯滤波
13.Some Basic Intensity Transform Functions
s = L-1-r
s = c log(1+r), r >=0
s=cγ
g[x,y] = S(f[x,y]+c)
g[x,y] = S(k f[x,y])
代码Test 13
14.Histogram Equalization
p(rk)= nk /MN
代码Test 14
15.Median Filter(中值滤波,椒盐)
Median Filters are particularly effective in the presence of impulse noise (also called salt-and pepper noise)
代码Test 15
16.拉普拉斯算子
代码Test 16 17 梯度算子 代码Test 17 18 sobel 算子
代码Test 18 第六章部分代码
19. RGB Image Processing
代码Test 19
20.
Pseudocolor Image Processing
代码Test 20
21Full Color Image Processing RGB to Gray
Brightness Adjust
Saturation Adjust
Color Balance
代码Test 21
第九章部分代码
22.Erosion A(-)B
Dilation A(+)B
Open: A(-)B(+)B Close: A(+)B(-)B
代码Test 22
第十章部分代码
23:Detection of Isolated Point
代码Test 23
bining the gradient with thresholding
代码Test 24
25.Connected-component labeling
Recursive function
void Label(byte [,] f, int x,int y,byte L) {
f[x,y] = L;
if (f[x+1,y]==255) Label(f,x+1,y,L);
if (f[x-1,y]==255) Label(f,x-1,y,L);
if (f[x,y+1]==255) Label(f,x,y+1,L);
if (f[x,y-1]==255) Label(f,x,y-1,L); }
代码Test 25
28
Moment Invariants(不变矩)。