matlab学习笔记(六)---空域变换增强-直方图处理

news/2024/7/7 12:56:26

1、直方图均衡化

函数histeq,实现对输入图像的直方图均衡化

语法格式:略

   I = imread('tire.tif');
   J = histeq(I);
   subplot(221),imshow(I),title('原始图像');
   subplot(222),imshow(J),title('直方图均衡图像');
   subplot(223),imhist(I),title('原始图像直方图');
   subplot(224),imhist(J),title('均衡化图像直方图');
   I=imread('tire.tif');
   [J,T]=histeq(I);
   figure,plot((0:1:255),T);
效果图如下:




2、gamma校正

imadjust函数中有一个可选参数gamma,指定了变换曲线的形状。通常,当gamma>1时,图像变暗;当gamma<1时,图像变亮。

   [X,map]=imread('forest.tif');
   I=ind2gray(X,map);
   J1=imadjust(I,[],[],0.5);
   J2=imadjust(I,[],[],1);
   J3=imadjust(I,[],[],2);
   subplot(221),imshow(I),title('原始图像');
   subplot(222),imshow(J1),title('gamma为0.5的变换');
   subplot(223),imshow(J2),title('gamma为1的变换');
   subplot(224),imshow(J3),title('gamma为2的变换');
效果图如下:





3、直方图规定化

函数histeq(I,hgram),来实现直方图规定化

其中hgram是用户指定的 向量

   I = imread('tire.tif');
   hgram=0:255;
   J = histeq(I,hgram);
   subplot(221),imshow(I),title('原始图像');
   subplot(222),imshow(J),title('直方图规定化后图像');
   subplot(223),imhist(I),title('原始图像直方图');
   subplot(224),imhist(J),title('规定化后图像直方图');
效果图如下:





http://www.niftyadmin.cn/n/4464351.html

相关文章

kthread_create与kernel_thread的区别

kernel thread可以用kernel_thread创建&#xff0c;但是在执行函数里面必须用daemonize释放资源并挂到init下&#xff0c;还需要用completion等待这一过程的完成。 kthread_create是比较正牌的创建函数&#xff0c;这个不必要调用daemonize&#xff0c;用这个创建的kernel thre…

matlab学习笔记(七)---空域变换增强-图像间的代数运算

1、图像相加运算 1.1增强图像的亮度 I imread(rice.png);J imadd(I,50);subplot(1,2,1), imshow(I),title(原图像);subplot(1,2,2), imshow(J), title(增强图像的亮度);效果图如下&#xff1a;1.2图像叠加 I imread(rice.png);J imread(cameraman.tif);K imadd(I,J,uint1…

matlab学习笔记(八)---空域滤波增强

1、平滑滤波器 1.1线性平滑滤波器 1.1.1给图像加入椒盐噪声 Iimread(eight.tif); Jimnoise(I,salt & pepper,0.02); subplot(121),imshow(I),title(原始图像); subplot(122),imshow(J),title(加入椒盐噪声的图像);效果图如下&#xff1a;1.1.2对一个图像进行不同大小模板…

va_start va_end

C语言中可变参数的用法 我们在C语言编程中会遇到一些参数个数可变的函数,例如printf() 这个函数,它的定义是这样的: int printf( const char* format, ...); 它除了有一个参数format固定以外,后面跟的参数的个数和类型是 可变的,例…

添加系统调用 http://docs.huihoo.com/joyfire.net/6-1.html

第一步:1.找到linux 内核代码所在地,一般在你的系统这个位置(你下载代码放其他地方我不反对) /usr/src/linux/ 但是也可能是这个位置 /usr/src/linux-2.4/或者其他 找到后cd /usr/src/linux*/ 转到该目录下. linux*表示代码所在的文件夹2.修改内核代码 a.添加源文件 假设新加…

matlab学习笔记(九)---频域增强

1、低通滤波 1.1对图像eight.tif加入椒盐噪声后&#xff0c;实现Butterworth低通滤波。 clear; I1imread(eight.tif); subplot(221),imshow(I1),title(原始图像); I2imnoise(I1,salt & pepper); %加入椒盐噪声 subplot(222),imshow(I2),title(噪声图像); fdouble(I2)…

matlab学习笔记(十)---边缘检测

分别采用roberts、sobel、prewitt、canny、log算子来检测图像的边缘并比较 Iimread(rice.png); B1edge(I,roberts); B2edge(I,sobel); B3edge(I,prewitt); B4edge(I,canny); B5edge(I,log); subplot(231),imshow(I),title(原始图像); subplot(232),imshow(B1),title(roberts算子…

2.6.8内核中通过模块添加系统调用,不用编译内核

我在2.6.8中通过模块添加系统调用&#xff0c;发现了两个问题&#xff1a;1.是sys_call_table的符号不可以被解析2.除了283 所有的系统调用号都已经被占用 &#xff0c;且没有空余。&#xff08;要是想添加的系统调用号大于283,我们就要先改变unistd.h中的NR_syscalls 改的大一…