




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、通信與信息工程學院MATLAB實驗報告班 級:電子信息科學與技術12級02班姓 名:徐明學 號:1107080232設計時間:2014.3.3 - 2014.4.30通信與信息工程學院二一四年實驗三 圖像處理【實驗內容】1. MATLAB中關于圖像處理的部分語句表1 MATLAB圖像處理工具箱中常用的語句命令功能圖像顯示imagesubimageimagescimshowtruesize建立并顯示圖像在一個圖形窗口中顯示多個圖像調整數據并顯示成圖像圖像顯示調整圖像顯示大小圖像文件輸入輸出imreadimwriteiminfoloadsave圖像文件讀入圖像寫出查看圖像文件信息將以mat為擴展名
2、的圖像文件調入到內存將內存變量中的圖像保存到以mat為擴展名的文件中圖像幾何運算imcropimresizeimrotate圖像剪裁圖像大小調整圖像旋轉圖像像素值及統計imhistmean2std2corr2求圖像數據直方圖求均值求標準差求相關系數圖橡增強及平滑imadjusthisteqimnoise medfilt2對比度調整直方圖均衡給圖像增加噪聲二維中值濾波器圖像變換fft2ifft2dct2idct2dctmtx計算二維FFT計算二維逆FFT計算2D離散余弦變換計算2D反離散余弦變換計算DCT矩陣其它conv2convmtx2xcorr2二維卷積計算二維卷積矩陣二維互相關1-1 讀取
3、RGB彩色圖像,采用rgb2gray( ) 函數將其轉化為灰度圖像語法: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( ) 函數繪制它們的圖像直方圖,并采用直方圖均勻化histeq()
4、函數進行增強處理。語法:1、直方圖函數 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、直方圖均衡化函數 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);實驗結果:1-3 讀取灰度圖像,分別對圖像進行二維快速傅里葉變換和二維快速傅里葉反變換,二維離散余弦變換和二維離散余弦反變換。并分別顯示出變換后的圖像。語法: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()函數對圖像進行加噪處理并顯示噪聲圖像,同時采用中值濾波函數medfilt2()對噪聲圖像進行去噪處理并顯示去噪后圖像。語法:1、圖像加噪函數 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、二維中值過濾函數 B = medfilt2(A)B = medfilt2(A) performs median filtering of t
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 選3 2.2動物細胞工程課件-高三生物一輪復習
- 高中生物競賽課件 -組成細胞的分子基礎課時10
- 《課件概述:教學設計與演示技巧》
- 《人體運動機制》課件
- 數學教學攻略
- 《華南滬教版》課件
- 《構建智慧家庭網絡》課件
- 2025地區授權合同范本
- 2025標準個人車輛抵押借款合同協議書
- 2025版合同:我國消費者權益保護示范文本
- 2024年甘肅省大數據中心招聘工作人員筆試真題
- 崇左市人民檢察院招聘機關文員筆試真題2024
- 電器供貨協議合同協議
- (二模)2025年4月濰坊市高三高考模擬考試地理試卷(含答案)
- 2025年上半年福建福州廣播電視臺招聘易考易錯模擬試題(共500題)試卷后附參考答案
- 2025年北師大版物理中考一輪備考復習:光現象、透鏡作圖專題(一)(含解析)
- 高二下學期感恩母親節主題班會課件
- 產業招商培訓課件
- 高一信息技術Python編程課程講解
- 軟件項目團隊管理制度
- 2024年秦皇島市市屬事業單位考試真題
評論
0/150
提交評論