数字图像处理学习1

# 第一次整理,先不按顺序

# Aug 27

## gamma transformations {

数字图像处理学习1

s=crγ数字图像处理学习1

我的复现

数字图像处理学习1

代码:

数字图像处理学习1

}

 

##image enhancement (Chapter 3 in DIP) {

Image enhancement has two categories: spatial domain method and frequency domain method. Here, we only talk about the first one.

Spatial domain method can be denoted by the expression:

gx,y=T(fx,y)数字图像处理学习1

T is an operation on f, defined over neighborhood of (x,y).

 

when the neighborhood is of size 1*1, In this case, g depends only on the value of f at (x, y), and T becomes a gray-level (also called an intensity or mapping) transformation function of the form

s=T(r)数字图像处理学习1

Large neighborhood -> mask processing or filtering

 

Gray-level transformations: linear (negative and identity transformation), logarithmic (log and inverse-log transformations) and power-law (nth power and nth root transformations).

 

Negative transformation is denoted by an expression:

s=L-1-r数字图像处理学习1

数字图像处理学习1

我的复现:

数字图像处理学习1

Code:

数字图像处理学习1

Log transformation

s=clog(1+r)数字图像处理学习1

Where c is a constant and r>=0.

数字图像处理学习1

数字图像处理学习1

数字图像处理学习1

 

Mat2gray 和 rgb2gray 效果不一样

数字图像处理学习1

原图 mat2gray rgb2gray

 

Contrast manipulation

数字图像处理学习1

数字图像处理学习1

数字图像处理学习1

 

Histogram

数字图像处理学习1

数字图像处理学习1

 

数字图像处理学习1

数字图像处理学习1

 

Histogram equation 没看明白,以后再说吧,先看别的。

 

imshow(A,[])是将A的最大值(max(A))和最小值(min(A))分别作为纯白(255)和纯黑(0),中间的K值相应地映射为0到255之间的标准灰度值,这样就可以正常显示了。。。,相当于将double型的矩阵A拉伸成为了0-255的uint8型的矩阵,因此就可以正常显示

 

slide 4 p22-p23

数字图像处理学习1

数字图像处理学习1

 

数字图像处理学习1

数字图像处理学习1

>> subplot(1,3,1)

>> imshow(f)

>> subplot(1,3,2)

>> mask=[-1,-2,-1;0,0,0;1,2,1]

>> ans=imfilter(f,mask2);

>> imshow(ans);

>> subplot(1,3,3)

>> mask2=[-1,0,1;-2,0,2;-1,0,1]

>> ans2=imfilter(f,mask2);

>> imshow(ans2)