實(shí)驗三圖像處理_第1頁
實(shí)驗三圖像處理_第2頁
實(shí)驗三圖像處理_第3頁
實(shí)驗三圖像處理_第4頁
實(shí)驗三圖像處理_第5頁
已閱讀5頁,還剩3頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、通信與信息工程學(xué)院MATLAB實(shí)驗報告班 級:電子信息科學(xué)與技術(shù)12級02班姓 名:徐明學(xué) 號:1107080232設(shè)計時間:2014.3.3 - 2014.4.30通信與信息工程學(xué)院二一四年實(shí)驗三 圖像處理【實(shí)驗內(nèi)容】1. MATLAB中關(guān)于圖像處理的部分語句表1 MATLAB圖像處理工具箱中常用的語句命令功能圖像顯示imagesubimageimagescimshowtruesize建立并顯示圖像在一個圖形窗口中顯示多個圖像調(diào)整數(shù)據(jù)并顯示成圖像圖像顯示調(diào)整圖像顯示大小圖像文件輸入輸出imreadimwriteiminfoloadsave圖像文件讀入圖像寫出查看圖像文件信息將以mat為擴(kuò)展名

2、的圖像文件調(diào)入到內(nèi)存將內(nèi)存變量中的圖像保存到以mat為擴(kuò)展名的文件中圖像幾何運(yùn)算imcropimresizeimrotate圖像剪裁圖像大小調(diào)整圖像旋轉(zhuǎn)圖像像素值及統(tǒng)計imhistmean2std2corr2求圖像數(shù)據(jù)直方圖求均值求標(biāo)準(zhǔn)差求相關(guān)系數(shù)圖橡增強(qiáng)及平滑imadjusthisteqimnoise medfilt2對比度調(diào)整直方圖均衡給圖像增加噪聲二維中值濾波器圖像變換fft2ifft2dct2idct2dctmtx計算二維FFT計算二維逆FFT計算2D離散余弦變換計算2D反離散余弦變換計算DCT矩陣其它c(diǎn)onv2convmtx2xcorr2二維卷積計算二維卷積矩陣二維互相關(guān)1-1 讀取

3、RGB彩色圖像,采用rgb2gray( ) 函數(shù)將其轉(zhuǎn)化為灰度圖像語法:I = rgb2gray(RGB) converts the truecolor image RGB to the grayscale intensity image I.程序:I=imread('lenna_color.tiff');G = rgb2gray(I);subplot(1,2,1);imshow(I);subplot(1,2,2);imshow(G);1-2 讀取tougu.bmp和fei.bmp灰度圖像,分別采用imhist( ) 函數(shù)繪制它們的圖像直方圖,并采用直方圖均勻化histeq()

4、函數(shù)進(jìn)行增強(qiáng)處理。語法:1、直方圖函數(shù) imhist(I,n)imhist(I,n) displays a histogram with n bins for the intensity image I above a grayscale colorbar of length n. If you omit the argument, imhist uses a default value of n = 256 if I is a grayscale image, or n = 2 if I is a binary image.2、直方圖均衡化函數(shù) J = histeq(I, hgram)J =

5、 histeq(I, hgram) transforms the intensity image I so that the histogram of the output intensity image J with length(hgram) bins approximately matches hgram. The vector hgram should contain integer counts for equally spaced bins with intensity values in the appropriate range: 0, 1 for images of clas

6、s double, 0, 255 for images of class uint8, and 0, 65535 for images of class uint16. histeq automatically scales hgram so that sum(hgram) = prod(size(I). The histogram of J will better match hgram when length(hgram) is much smaller than the number of discrete levels in I.程序:A=imread('source.BMP&

7、#39;);B=imread('rice.bmp');K=histeq(A);V=histeq(B);subplot(2,3,1),imshow(A);subplot(2,3,2), imhist(A);subplot(2,3,3),imshow(K);subplot(2,3,4),imshow(B);subplot(2,3,5), imhist(B);subplot(2,3,6),imshow(V);實(shí)驗結(jié)果:1-3 讀取灰度圖像,分別對圖像進(jìn)行二維快速傅里葉變換和二維快速傅里葉反變換,二維離散余弦變換和二維離散余弦反變換。并分別顯示出變換后的圖像。語法:1、二維快速傅里葉變

8、換 Y = fft2(X)Y = fft2(X) returns the two-dimensional discrete Fourier transform (DFT) of X, computed with a fast Fourier transform (FFT) algorithm. The result Y is the same size as X.2、二維快速傅里葉反變換 Y = ifft2(X)Y = ifft2(X) returns the two-dimensional inverse discrete Fourier transform (DFT) of X, comp

9、uted with a fast Fourier transform (FFT) algorithm. The result Y is the same size as X.3、二維離散余弦變換 B = dct2(A)B = dct2(A) returns the two-dimensional discrete cosine transform of A. The matrix B is the same size as A and contains the discrete cosine transform coefficients B(k1,k2).4、二維離散余弦反變換 B = idc

10、t2(A)B = idct2(A) returns the two-dimensional inverse discrete cosine transform (DCT) of A.程序:I=imread('finger.bmp');X = fft2(I);Y = ifft2(I);Z= dct2(I);B = idct2(I);subplot(2,3,1);imshow(I);subplot(2,3,2);imshow(X);subplot(2,3,3);imshow(Y);subplot(2,3,4);imshow(Z);subplot(2,3,5);imshow(B);

11、1-4 讀取灰度圖像,采用imnoise()函數(shù)對圖像進(jìn)行加噪處理并顯示噪聲圖像,同時采用中值濾波函數(shù)medfilt2()對噪聲圖像進(jìn)行去噪處理并顯示去噪后圖像。語法:1、圖像加噪函數(shù) J = imnoise(I,type)J = imnoise(I,type) adds noise of given type to the intensity image I. type is a string that can have one of these values: 'gaussian' for Gaussian white noise 'localvar' for zero-mean Gaussian white noise with an intensity-dependent variance 'poisson' for Poisson noise 'salt & pepper' for "on and off" pixels 'speckle' for multiplicative noise。2、二維中值過濾函數(shù) B = medfilt2(A)B = medfilt2(A) performs median filtering of t

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論