本文链接:https://blog.csdn.net/Dooonald/article/details/78545461
算术均值

close all
clear all

f=imread('D:/testData/filtering.tif');

[w,h]=size(f);
image= f(:,:);
fsize1=3;
fsize2=5;
fsize3=9;

fssize1=(fsize1-1)/2;
fssize2=(fsize2-1)/2;
fssize3=(fsize3-1)/2;

figure();
subplot(1,2,1);
imshow(image);
xlabel('原图像');

resultImage = image;

for x=1+fssize1:1:w-fssize1
for y=1+fssize1:1:w-fssize1
is=f(x-fssize1:1:x+fssize1,y-fssize1:1:y+fssize1);
resultImage(x,y)=sum(is(:))/numel(is);
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('3*3算术均值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize2:1:w-fssize2
for y=1+fssize2:1:w-fssize2
is=f(x-fssize2:1:x+fssize2,y-fssize2:1:y+fssize2);
resultImage(x,y)=sum(is(:))/numel(is);

end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('5*5算术均值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize3:1:w-fssize3
for y=1+fssize3:1:w-fssize3
is=f(x-fssize3:1:x+fssize3,y-fssize3:1:y+fssize3);
resultImage(x,y)=sum(is(:))/numel(is);

end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('9*9算术均值');
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
几何均值

close all
clear all

f=imread('D:/testData/filtering.tif');

[w,h]=size(f);
image= f(:,:);
fsize1=3;
fsize2=5;
fsize3=9;

fssize1=(fsize1-1)/2;
fssize2=(fsize2-1)/2;
fssize3=(fsize3-1)/2;

figure();
subplot(1,2,1);
imshow(image);
xlabel('原图像');

resultImage = image;

for x=1+fssize1:1:w-fssize1
for y=1+fssize1:1:w-fssize1
is=f(x-fssize1:1:x+fssize1,y-fssize1:1:y+fssize1);
resultImage(x,y)=prod(prod(is(:)))^(1/numel(is));
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('3*3几何均值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize2:1:w-fssize2
for y=1+fssize2:1:w-fssize2
%遍历每个点的四周
is=f(x-fssize2:1:x+fssize2,y-fssize2:1:y+fssize2);
resultImage(x,y)=prod(prod(is(:)))^(1/numel(is));
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('5*5几何均值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize3:1:w-fssize3
for y=1+fssize3:1:w-fssize3
%遍历每个点的四周
is=f(x-fssize3:1:x+fssize3,y-fssize3:1:y+fssize3);
resultImage(x,y)=prod(prod(is(:)))^(1/numel(is));
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('9*9几何均值');
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
谐波均值

close all
clear all

f=imread('D:/testData/filtering.tif');

[w,h]=size(f);
image= f(:,:);
fsize1=3;
fsize2=5;
fsize3=9;

fssize1=(fsize1-1)/2;
fssize2=(fsize2-1)/2;
fssize3=(fsize3-1)/2;

figure();
subplot(1,2,1);
imshow(image);
xlabel('原图像');

resultImage = image;

for x=1+fssize1:1:w-fssize1
for y=1+fssize1:1:w-fssize1
is=f(x-fssize1:1:x+fssize1,y-fssize1:1:y+fssize1);
is=1./is;
resultImage(x,y)=numel(is)/sum(is(:));

end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('3*3谐波均值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize2:1:w-fssize2
for y=1+fssize2:1:w-fssize2
%遍历每个点的四周
is=f(x-fssize2:1:x+fssize2,y-fssize2:1:y+fssize2);
is=1./is;
resultImage(x,y)=numel(is)/sum(is(:));
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('5*5谐波均值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize3:1:w-fssize3
for y=1+fssize3:1:w-fssize3
%遍历每个点的四周
is=f(x-fssize3:1:x+fssize3,y-fssize3:1:y+fssize3);
is=1./is;
resultImage(x,y)=numel(is)/sum(is(:));
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('9*9谐波均值');
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
逆谐波

close all
clear all

f=imread('D:/testData/filtering.tif');

[w,h]=size(f);
image= f(:,:);
Q1 = 1.5;
fsize1=3;
fsize2=5;
fsize3=9;

fssize1=(fsize1-1)/2;
fssize2=(fsize2-1)/2;
fssize3=(fsize3-1)/2;

figure();
subplot(1,2,1);
imshow(image);
xlabel('原图像');

resultImage = image;

for x=1+fssize1:1:w-fssize1
for y=1+fssize1:1:w-fssize1
is=f(x-fssize1:1:x+fssize1,y-fssize1:1:y+fssize1);
resultImage(x,y) = sum(is(:).^(Q1+1))/sum(is(:).^(Q1));
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('3*3逆谐波均值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize2:1:w-fssize2
for y=1+fssize2:1:w-fssize2
%遍历每个点的四周
is=f(x-fssize2:1:x+fssize2,y-fssize2:1:y+fssize2);
resultImage(x,y) = sum(is(:).^(Q1+1))/sum(is(:).^(Q1));

end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('5*5逆谐波均值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize3:1:w-fssize3
for y=1+fssize3:1:w-fssize3
%遍历每个点的四周
is=f(x-fssize3:1:x+fssize3,y-fssize3:1:y+fssize3);
resultImage(x,y) = sum(is(:).^(Q1+1))/sum(is(:).^(Q1));
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('9*9逆谐波均值');
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
中值

close all
clear all

f=imread('D:/testData/filtering.tif');

[w,h]=size(f);
image= f(:,:);

fsize1=3;
fsize2=5;
fsize3=9;

fssize1=(fsize1-1)/2;
fssize2=(fsize2-1)/2;
fssize3=(fsize3-1)/2;

figure();
subplot(1,2,1);
imshow(image);
xlabel('原图像');

resultImage = image;

for x=1+fssize1:1:w-fssize1
for y=1+fssize1:1:w-fssize1
is=f(x-fssize1:1:x+fssize1,y-fssize1:1:y+fssize1);
temp = sort(is(:));
resultImage(x,y)= temp((numel(temp)-1)/2);
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('3*3中值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize2:1:w-fssize2
for y=1+fssize2:1:w-fssize2
%遍历每个点的四周
is=f(x-fssize2:1:x+fssize2,y-fssize2:1:y+fssize2);
temp = sort(is(:));
resultImage(x,y)= temp((numel(temp)-1)/2);
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('5*5中值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize3:1:w-fssize3
for y=1+fssize3:1:w-fssize3
%遍历每个点的四周
is=f(x-fssize3:1:x+fssize3,y-fssize3:1:y+fssize3);
temp = sort(is(:));
resultImage(x,y)= temp((numel(temp)-1)/2);
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('9*9中值');
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
最大值

close all
clear all

f=imread('D:/testData/filtering.tif');

[w,h]=size(f);
image= f(:,:);

fsize1=3;
fsize2=5;
fsize3=9;

fssize1=(fsize1-1)/2;
fssize2=(fsize2-1)/2;
fssize3=(fsize3-1)/2;

figure();
subplot(1,2,1);
imshow(image);
xlabel('原图像');

resultImage = image;

for x=1+fssize1:1:w-fssize1
for y=1+fssize1:1:w-fssize1
is=f(x-fssize1:1:x+fssize1,y-fssize1:1:y+fssize1);
temp = is(:);
resultImage(x,y)= max(temp);
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('3*3最大值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize2:1:w-fssize2
for y=1+fssize2:1:w-fssize2
%遍历每个点的四周
is=f(x-fssize2:1:x+fssize2,y-fssize2:1:y+fssize2);
temp = is(:);
resultImage(x,y)= max(temp);
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('5*5最大值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize3:1:w-fssize3
for y=1+fssize3:1:w-fssize3
%遍历每个点的四周
is=f(x-fssize3:1:x+fssize3,y-fssize3:1:y+fssize3);
temp = is(:);
resultImage(x,y)= max(temp);
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('9*9最大值');
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
最小值

close all
clear all

f=imread('D:/testData/filtering.tif');

[w,h]=size(f);
image= f(:,:);

fsize1=3;
fsize2=5;
fsize3=9;

fssize1=(fsize1-1)/2;
fssize2=(fsize2-1)/2;
fssize3=(fsize3-1)/2;

figure();
subplot(1,2,1);
imshow(image);
xlabel('原图像');

resultImage = image;

for x=1+fssize1:1:w-fssize1
for y=1+fssize1:1:w-fssize1
is=f(x-fssize1:1:x+fssize1,y-fssize1:1:y+fssize1);
temp = is(:);
resultImage(x,y)= min(temp);
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('3*3最小值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize2:1:w-fssize2
for y=1+fssize2:1:w-fssize2
%遍历每个点的四周
is=f(x-fssize2:1:x+fssize2,y-fssize2:1:y+fssize2);
temp = is(:);
resultImage(x,y)= min(temp);
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('5*5最小值');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize3:1:w-fssize3
for y=1+fssize3:1:w-fssize3
%遍历每个点的四周
is=f(x-fssize3:1:x+fssize3,y-fssize3:1:y+fssize3);
temp = is(:);
resultImage(x,y)= min(temp);
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('9*9最小值');
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
中点

close all
clear all

f=imread('D:/testData/filtering.tif');

[w,h]=size(f);
image= f(:,:);

fsize1=3;
fsize2=5;
fsize3=9;

fssize1=(fsize1-1)/2;
fssize2=(fsize2-1)/2;
fssize3=(fsize3-1)/2;

figure();
subplot(1,2,1);
imshow(image);
xlabel('原图像');

resultImage = image;

for x=1+fssize1:1:w-fssize1
for y=1+fssize1:1:w-fssize1
is=f(x-fssize1:1:x+fssize1,y-fssize1:1:y+fssize1);
temp = is(:);
resultImage(x,y)= (max(temp) + min(temp))/2;
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('3*3中点');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize2:1:w-fssize2
for y=1+fssize2:1:w-fssize2
%遍历每个点的四周
is=f(x-fssize2:1:x+fssize2,y-fssize2:1:y+fssize2);
temp = is(:);
resultImage(x,y)= (max(temp) + min(temp))/2;
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('5*5中点');

resultImage= f(:,:);
figure();
subplot(1,2,1);
imshow(f);
xlabel('原图像');

for x=1+fssize3:1:w-fssize3
for y=1+fssize3:1:w-fssize3
%遍历每个点的四周
is=f(x-fssize3:1:x+fssize3,y-fssize3:1:y+fssize3);
temp = is(:);
resultImage(x,y)= (max(temp) + min(temp))/2;
end
end

subplot(1,2,2);
imshow(resultImage);
xlabel('9*9中点');
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75

最新文章

  1. jQuery+HTML5弹出创意搜索框层
  2. C#:枚举
  3. 实现Ogre的脚本分离 - 天龙八部的源码分析(一)
  4. linux中comm命令用法
  5. 加快phpstorm、rubymine、pycharm系列IDE运行速度的方法
  6. Android开发UI之Fragment-Tabbed Activity的使用
  7. ruby hashtable散列表
  8. python无线网络安全入门案例
  9. Ubuntu上安装flashplayer
  10. hdu_1029_hash/map
  11. vuex入门
  12. 用keras实现人脸关键点检测(2)
  13. Hbase的集群安装
  14. 第三十一节,目标检测算法之 Faster R-CNN算法详解
  15. 发布WebApi项目时包含XML文档文件
  16. Django项目vue前端依赖框架过大,工程打开太卡的问题
  17. eos 空投列表网址 及 工具网站列表
  18. 【性能测试工具ab】ab工具使用
  19. ZooKeeper ACL权限设置
  20. xgboost 简单测试

热门文章

  1. 修改Linux命令的别名:alias
  2. poi 读取word 遍历表格和单元格中的图片
  3. k8s的Pod状态和生命周期管理
  4. Entity Framework的一个坑
  5. git 在不同服务器主机上同步 git 仓库
  6. linux 防火墙 firewall 设置
  7. jQuery实现点击复制效果
  8. 2019-2020-1 20199312《Linux内核原理与分析》第五周作业
  9. MySql更改用户密码
  10. python定义函数时的参数&调用函数时的传参