digital image processing projects 数字图像处理 冈萨雷斯 第三章所有程序和报告

  • 格式:docx
  • 大小:949.58 KB
  • 文档页数:23

下载文档原格式

  / 23
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
imshow(I1);
title('log transformation');
【2】power-law transformation
I=imread('Fig3.08(a).jpg');
subplot(221);
imshow(I);
title('original');
J=double(I);
I1=im2uint8(mat2gray(J.^0.6));
Log transformation can diminish dቤተ መጻሕፍቲ ባይዱnamic range of the image.
Power-law transformation can change the contrast of the image.
Histogram Equalization
Exp. 6
Objective
【2】Z = imsubtract(X,Y)
subtracts each element in arrayYfrom the corresponding element in arrayXand returns the difference in the corresponding element of the output arrayZ.
Technical discussion
【1】J = histeq(I, n)
transforms the intensity imageI, returning inJan intensity image withndiscrete gray levels.
【2】imhist(I)
displays a histogram for the imageIabove a grayscale colorbar.
some arithmetic operations.
Requirements
Write a computer program capable ofperforming the four arithmeticoperations between two images. This project is generic, in the sense thatit will be used in otherprojects to follow. (See comments on pages 112and 116 regarding scaling). In addition to multiplying two images, yourmultiplication function must be able to handle multiplication of an image bya constant.
Spatial Filtering
Exp. 8
Objective
To understand what is special filtering and how the parameters of thefiltering mask affect the output of filters..
Requirements
Digital Image Processing
Projectchapter:Chapter 3
Project number:Proj03-01 ~ Proj03-06
Student's name:
Student's number:
Class:
Contents
Image Enhancement Using Intensity Transformations
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));
(b) Implement the histogram equalization technique discussed inSection 3.3.1.
(c) Download Fig. 3.8(a) and perform histogram equalization on it.
Figure133.8(a)
To manipulate a technique ofimage enhancement by histogramequalization.
Requirements
(a) Write a computer program for computing the histogram of animage.
Figure15Fig3.15(a)
Technical discussion
【1】Z = imadd(X,Y)
adds each element in arrayXwith the corresponding element in arrayYand returns the sum in the corresponding element of the output arrayZ.
Technical discussion
【1】I = mat2gray(A)
sets the values ofaminandamaxto the minimum and maximum values inA.
【2】I2 = im2uint8(I1)
converts the grayscale imageI1touint8, rescaling the data if necessary.
imshow(I5);
title('division');
Discussion of results
Figure16results of proj03_03
Analysis
Addition and subtraction are linear operations, while multiplication and division are nonlinear operations.
Program listings
I=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');
Figure17Fig3.37(a)
Technical discussion
【1】h = fspecial('average', hsize)
returns an averaging filterhof sizehsize.
Exp. 5
Objective
To manipulate a technique of image enhancementbyintensitytransformation or gray level transformation.
Requirements
The focus of this project is to experiment with intensity transformations toenhance an image. DownloadFig. 3.8(a)and enhance it using:
(a) The log transformation of Eq. (3.2-2):s=clog(1+r);
(b) A power-law transformation of the form shown in Eq. (3.2-3):s=crγ.
Figure9Fig 3.05(a)
Figure10Fig. 3.8(a)
I2=imadd(I,I1);
subplot(433);
imshow(I2);
title('addition');
subplot(434);
imshow(I2);
title('image 1');
subplot(435);
imshow(I);
title('image 2');
I3=imsubtract(I2,I);
subplot(436);
imshow(I3);
title('subtraction');
subplot(437);
imshow(I);
title('image 1');
subplot(438);
imshow(I1);
title('image 2');
I4=immultiply(I,I1);
subplot(439);
Write program to perform spatial filtering of an image (see Section 3.5regarding implementation). You can fix the size of the spatial mask at 3 x3, but the coefficients need to be variables that can be input into yourprogram. This project is generic, in the sense that it will be used in otherprojects to follow.
subplot(224);
imshow(I3);
title('power-law:\gamma=0.3');
Discussion of results
Figure11results of log transformation
Figure12results of power-law transformation
Discussion of results
Figure14the results of project 03-02
Analysis
We can see more details in the dark part.
Arithmetic Operations
Exp. 7
Objective
To know how to do arithmetic operations on an image and the functions of
Program listings
I=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);
imshow(I4);
title('multiplication');
subplot(4,3,10);
imshow(I4);
title('image 1');
subplot(4,3,11);
imshow(I1);
title('image 2');
I5=imdivide(I4,I1);
subplot(4,3,12);
【3】Z = immultiply(X,Y)
multiplies each element in arrayXby the corresponding element in arrayYand returns the product in the corresponding element of the output arrayZ.
Program listings
【1】log transformation
I=imread('Fig3.05(a).jpg');
subplot(121);
imshow(I);
title('original');
I1=im2uint8(mat2gray(log(1+double(I))));
subplot(122);
【4】Z = imdivide(X,Y)
divides each element in the arrayXby the corresponding element in arrayYand returns the result in the corresponding element of the output arrayZ.