数字图像处理
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
0 1 2 3 4
1 2 3 4 5
2 3 4 5 6
3 4 5 6 7
4 5 6 7 0
Bit-plane 2(MSB) Bit-plane 1 Bit-plane 0(LSB)
Image with 8 gray-levels
3 Bit-planes representation
Dr. JI ZHEN
1 TL ≤ A(i, j ) ≤ TU B(i, j ) = otherwise 0
Where A(i,j) and B(i,j) denote respectively the gray-level of input image A and output image B at point (i,j) and TL andTU denote the lower and upper threshold as shown below gout
Dr. JI ZHEN
12
Bit-plane Slicing
The image is thought of as a stack of bit-planes and each bit-plane represents the contribution made by a particular bit to the overall image appearance.
gout
1
T(gin)
TL
TU
gin
Dr. JI ZHEN
11
Gray-level slicing
load imdemos A=double(alumgrns)/255; B= (img>0.5)& (img<0.8); AA= (1-(img>0.5)& (img<0.8)).*img; imshow(AA) imshow(AA+B);
Dr. JI ZHEN
2
Displaying Gray-Level Information
(b) Profile information The gray-level/color values along a line or a multi-segment path in an image can be displayed and computed using Matlab function improfile.
gout
top
1
gamma<1 gamma>1
bottom low high 1
Dr. JI ZHEN
gin
8
Gray-level slicing
The essentially perform a double thresholding operation to highlight a particular range of gray-levels in an image. Two approaches are possible depending on whether it is desirable to remove other features in the image. (a) Double thresholding with background removed This approach produces a binary image with all gray levels in the range of interest mapped to white and all other gray levels mapped to black. That is
1
T(gin)
Tl
TU
Dr. JI ZHEN
gin
9
Gray-level slicing
load imdemos imshow(alumgrns) imhist(alumgrns) imshow((alumgrns>128)& (alumgrns<192))
Dr. JI ZHEN
10
Gray-level slicing
数字图像处理 Digital Image Processing
灰度变换 Gray-Level Transformation
纪震博士Dr.Ji Zhen Faculty of Information Engineering, SZU 2003.01
1
Displaying Gray-Level Information
gin
Dr. JI ZHEN
6
Gray-Level Transformation
The transformation function can be either a continuous function or piecewise continuous function with different expressions over different intervals. For example, if the contrast of an image in the middle range is to be stretched at the expense of compressing the contrast for high and low gray-levels, then
Dr. JI ZHEN
5
Gray-Level Transformation
if the slope of the transformation function is greater or less than 1 , then
T(gin) with slope>1 gout T(gin) with slope<1
TL ≤ A(i, j ) ≤ TU 1 B(i, j ) = other B(i,j) denote respectively the gray-level of input image A and output image B at point (i,j) and TL and TU denote the lower and upper threshold as shown below
T(gin) gout gout T(gin)
gin
gin
continuous transformation function piecewise transformation function Gray-levels transformations can be easily implemented in hardware or software using a look-up table (occupying 256 bytes of memory) with the original gray-level values as the addresses of the table elements and the new gray-level values as the table contents.
1000
800
600
400
200
0
0
50
100
150
200
250
Dr. JI ZHEN
4
Gray-Level Transformation
The principal objective of image enhancement is to create a better image representation with unwanted information suppressed/removed and wanted information enhanced. This can be achieved in the spatial domain by graylevel transformation which maps the original set of gray-levels in an image Where T denotes the transformation or mapping function which can be either a linear or non-linear function. It is useful to visualize the transformation in two dimensions with the x-axis representing the old gray-levels and the y-axis the new gray-levels. For example, if the slope of the transformation function equals 1 , then gout T(gin) gin
190
180
170
160
150
140
130
120
110
100
0
10
20
30 40 Dis tance along profile
50
60
70
Dr. JI ZHEN
3
Displaying Gray-Level Information
(c) Image Information The distribution of the gray-level/color values in an image can be displayed and computed using Matlab function imhist
(b) Double thresholding with background preserved This approach brightness all gray levels in the range of interest with all other gray levels remained at their original values. That is
13
Bit-plane Slicing
load imdemos c7=bitand(flower,128); imshow(c7) c76=bitand(flower,192); imshow(c76) c765=bitand(flower,224); imshow(c765)
It is seen that the most significant bits tend to convey the structural information of the image and the least significant bits tend to convey the detail information of the image
γ Gout = cGin
where c is constant, and γ is an exponent (known as the gamma of the system) varying in practice between about 0.5 to nearly 3 The camera, the display and the eye all have non-unity gammas. In Matlab, the effect can be inversely compensated by using B = IMADJUST(A,[LOW_IN HIGH_IN],[LOW_OUT HIGH_OUT],GAMMA)
There are a number of useful Matlab functions for displaying the graylevel/color information of an image (a) Pixel information An interactive display of pixel co-ordinate and gray/color information in the current figure can be turned on or off by entering pixval on and pixval off
Dr. JI ZHEN
7
Gamma Correction
The input-output relationship of an image acquisition or display system is generally non-linear and is frequently of the form