《digital image processing projects 数字图像处理 冈萨雷斯 第三章所有程序和报告》由会员分享,可在线阅读,更多相关《digital image processing projects 数字图像处理 冈萨雷斯 第三章所有程序和报告(23页珍藏版)》请在金锄头文库上搜索。
1、1Digital Image ProcessingProject chapter: Chapter 3 Project number: Proj03-01 Proj03-06 Students name: Students number: Class: 2ContentsIMAGE ENHANCEMENT USING INTENSITY TRANSFORMATIONS .1HISTOGRAM EQUALIZATION .7ARITHMETIC OPERATIONS .10SPATIAL FILTERING.14ENHANCEMENT USING THE LAPLACIAN.17UNSHARP
2、MASKING .203Image Enhancement Using Intensity TransformationsExp. 5,PROJECT 03-01ObjectiveTo manipulate a technique of image enhancement by intensity transformation or gray level transformation.RequirementsThe focus of this project is to experiment with intensity transformations to enhance an image.
3、 Download Fig. 3.8(a) and enhance it using:(a) The log transformation of Eq. (3.2-2): s=c log(1+r);(b) A power-law transformation of the form shown in Eq. (3.2-3): s=cr .Figure 1 Fig 3.05(a)4Figure 2 Fig. 3.8(a)Technical discussion 【1】I = mat2gray(A) sets the values of amin and amax to the minimum a
4、nd maximum values in A.【2】I2 = im2uint8(I1) converts the grayscale image I1 to uint8, rescaling the data if necessary.Program listings【1】log transformationI=imread(Fig3.05(a).jpg);subplot(121);imshow(I);title(original);I1=im2uint8(mat2gray(log(1+double(I);subplot(122);imshow(I1);5title(log transform
5、ation);【2】power-law transformationI=imread(Fig3.08(a).jpg);subplot(221);imshow(I);title(original);J=double(I);I1=im2uint8(mat2gray(J.0.6);subplot(222);imshow(I1);title(power-law:gamma=0.6);I2=im2uint8(mat2gray(J.0.4);subplot(223);imshow(I2);title(power-law:gamma=0.4);I3=im2uint8(mat2gray(J.0.3);subp
6、lot(224);imshow(I3);title(power-law:gamma=0.3);Discussion of results original log transformationFigure 3 results of log transformation6original power-law:=0.6power-law:=0.4 power-law:=0.3Figure 4 results of power-law transformationAnalysis Log transformation can diminish dynamic range of the image.P
7、ower-law transformation can change the contrast of the image.7Histogram EqualizationExp. 6,PROJECT 03-02 Multiple UsesObjectiveTo manipulate a technique of image enhancement by histogram equalization.Requirements(a) Write a computer program for computing the histogram of an image.(b) Implement the h
8、istogram equalization technique discussed in Section 3.3.1.(c) Download Fig. 3.8(a) and perform histogram equalization on it.Figure 5 3.8(a)8Technical discussion 【1】J = histeq(I, n)transforms the intensity image I, returning in J an intensity image with n discrete gray levels.【2】imhist(I) displays a
9、 histogram for the image I above a grayscale colorbar.Program listingsI=imread(Fig3.08(a).jpg);subplot(221);imshow(I);subplot(222);imhist(I);I1=histeq(I,256);subplot(223)imshow(I1);subplot(224);imhist(I1);9Discussion of results 0500010000150000 100 2000500010000150000 100 200Figure 6 the results of
10、project 03-02Analysis We can see more details in the dark part.10Arithmetic OperationsExp. 7,PROJECT 03-03 Multiple UsesObjectiveTo know how to do arithmetic operations on an image and the functions ofsome arithmetic operations.RequirementsWrite a computer program capable of performing the four arit
11、hmetic operations between two images. This project is generic, in the sense that it will be used in other projects to follow. (See comments on pages 112 and 116 regarding scaling). In addition to multiplying two images, your multiplication function must be able to handle multiplication of an image b
12、y a constant.Figure 7 Fig3.15(a)Technical discussion 【1】Z = imadd(X,Y)11adds each element in array X with the corresponding element in array Y and returns the sum in the corresponding element of the output array Z.【2】Z = imsubtract(X,Y) subtracts each element in array Y from the corresponding elemen
13、t in array X and returns the difference in the corresponding element of the output array Z.【3】Z = immultiply(X,Y)multiplies each element in array X by the corresponding element in array Y and returns the product in the corresponding element of the output array Z.【4】Z = imdivide(X,Y) divides each ele
14、ment in the array X by the corresponding element in array Y and returns the result in the corresponding element of the output array Z.Program listingsI=imread(Fig3.15(a)1top.jpg);subplot(431);imshow(I);title(image 1);I1=imread(Fig3.15(a)2.jpg);subplot(432);imshow(I1);title(image 2);I2=imadd(I,I1);subplot(433);imshow(I2);title(addition);subplot(434);imshow(I2);title(image 1);subplot(43