数学建模--数字图像处理(1)--亮度变换与空间滤波

来源:互联网 发布:便携设备数据恢复软件 编辑:程序博客网 时间:2024/04/28 19:06

数学建模–数字图像处理–亮度变换与空间滤波

在数学建模竞赛中,还存在一类大的模块就是数字图像处理相关算法的使用以及图像的显示。最近正好也在学数字图像处理这一课程,基于两者利用Matlab编程给出一些示例

原文:
http://blog.csdn.net/qq_34861102/article/details/77914486


亮度变换工具:

g = imadjust(f,[low_in;high_in],[low_out;high_out],gamma)
uiopen('D:\Users\Outlier\Desktop\test.jpg',1)g = imadjust(test,[0;1],[1;0]);subplot(1,2,1)imshow(test)subplot(1,2,2)imshow(g)

这里写图片描述


线性空间滤波器:

fspecial('laplacian',a)

实现一个拉普拉算子掩膜

这里写图片描述

uiopen('D:\Users\Outlier\Desktop\test.jpg',1)h1 = fspecial('laplacian',0);g1 = test - imfilter(test,h1);   %原图像中减去拉普拉算子处理的结果h2 = [1 1 1;1 -8 1; 1 1 1];g2 = test - imfilter(test,h2);subplot(1,3,1)imshow(test)subplot(1,3,2)imshow(g1)subplot(1,3,3)imshow(g2)

非线性空间滤波器:

工具函数:ordfilt2

g = ordilt2(f,m*n,ones(m,n));

这里写图片描述

I = imread('eight.tif');J = imnoise(I,'salt & pepper',0.02);K = medfilt2(J);subplot(1,3,1)imshow(I)subplot(1,3,2)imshow(J)subplot(1,3,3)imshow(K)
原创粉丝点击