哈工大數(shù)字信號(hào)處理_matlab用于數(shù)字圖像處理_第1頁
哈工大數(shù)字信號(hào)處理_matlab用于數(shù)字圖像處理_第2頁
哈工大數(shù)字信號(hào)處理_matlab用于數(shù)字圖像處理_第3頁
哈工大數(shù)字信號(hào)處理_matlab用于數(shù)字圖像處理_第4頁
哈工大數(shù)字信號(hào)處理_matlab用于數(shù)字圖像處理_第5頁
已閱讀5頁,還剩20頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、filename = I:IMG_5681.JPG; %文件路徑imgRgb = imread(filename); % 讀入一幅圖像imshow(imgRgb);imfinfo(filename) % 查看圖像文件信息 圖像的讀入與顯示ans = Filename: I:IMG_5672.JPGFileModDate: 05-Apr-2013 09:48:18FileSize: 7746921Format: jpgFormatVersion: Width: 5184 Height: 3456BitDepth: 24ColorType: truecolorFormatSignature: Nu

2、mberOfSamples: 3CodingMethod: HuffmanCodingProcess: SequentialComment: 圖像壓縮I = imread(cameraman.tif); % 輸入圖像I = im2double(I); % 數(shù)據(jù)類型轉(zhuǎn)換T = dctmtx(8); % 計(jì)算二維離散DCT矩陣dct = (x)T * x * T; % 設(shè)置函數(shù)句柄B = blkproc(I,8 8,dct); % 圖像塊處理mask = 1 1 1 1 0 0 0 0 % 掩膜 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0

3、 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;B2 = blkproc(B,8 8,(x)mask.* x); % 圖像塊處理invdct = (x)T * x * T; % 設(shè)置函數(shù)句柄I2 = blkproc(B2,8 8,invdct); % 圖像塊處理 subplot(1,2,1),imshow(I);title(原圖);subplot(1,2,2), imshow(I2);title(壓縮后); % 顯示原始圖像和壓縮重構(gòu)圖像 真彩色增強(qiáng)clear;rgb=imread(I:d9049f163bfc7d2c4

4、b90a7c2.jpg);h=ones(5,5)/25;rgb2=imfilter(rgb,h);subplot(1,2,1);imshow(rgb);title(原圖);subplot(1,2,2);imshow(rgb2);title(真彩色增強(qiáng)); 灰度調(diào)整I=imread(I:0.jpg);J=imadjust(I,.2 .3 0; .6 .7 1,0 1);K=imadjust(I,.1 .9,0 1);figure(1),imshow(I);title(原圖);figure(2),imshow(J);title(調(diào)整1);figure(3),imshow(K);title(調(diào)整2)

5、; 提取圖像的RGB分量rgb_image=imread(peppers.png);subplot(2,2,1),imshow(rgb_image)title(原圖);fR=rgb_image(:,:,1);subplot(2,2,2),imshow(fR);title(紅色分量);fG=rgb_image(:,:,2);subplot(2,2,3),imshow(fG)title(綠色分量);fB=rgb_image(:,:,3);subplot(2,2,4),imshow(fB)title(藍(lán)色分量); 由RGB分量得到圖像rgb_image=imread(peppers.png);sub

6、plot(2,2,1),imshow(rgb_image);title(原圖);fR=rgb_image(:,:,1);fG=rgb_image(:,:,2);fB=rgb_image(:,:,3);rgb_red=cat(3,fR,zeros(size(fR),zeros(size(fR);subplot(2,2,2),imshow(rgb_red);title(紅色分量圖);rgb_green=cat(3,zeros(size(fR),fG,zeros(size(fR);subplot(2,2,3),imshow(rgb_green)title(綠色分量圖);rgb_blue=cat(3,

7、zeros(size(fR),zeros(size(fR),fB);subplot(2,2,4),imshow(rgb_blue)title(藍(lán)色分量圖); RGB分量不同組合的圖像rgb_image=imread(peppers.png);subplot(2,2,1),imshow(rgb_image)title(原圖);fR=rgb_image(:,:,1);fG=rgb_image(:,:,2);fB=rgb_image(:,:,3);rgb_1=cat(3,fB,fR, fG);subplot(2,2,2),imshow(rgb_1)title(藍(lán)紅綠);rgb_2=cat(3,fR,

8、fR,fB);subplot(2,2,3),imshow(rgb_2)title(紅紅藍(lán));rgb_3=cat(3,fR,fR,fR);subplot(2,2,4),imshow(rgb_3)title(紅紅紅); 索引圖像處理 減少顏色數(shù)目近似顯示clear;X, map = imread(trees.tif);imshow(X,map);title(原圖);figure;Y, newmap = imapprox(X, map, 16,nodither);imshow(Y, newmap);title(原圖的16色逼近);figure;X, map = imread(trees.tif);i

9、mshow(X,map);title(原圖);figure;Y, newmap = imapprox(X, map, 16,dither);imshow(Y, newmap);title(采用抖動(dòng)原圖的16色逼近); 將黑白圖像(二值圖像、灰度圖像) 轉(zhuǎn)為彩色圖像(RGB圖像、索引圖像)gray_image=imread(cameraman.tif);subplot(2,2,1),subimage(gray_image)X=grayslice(gray_image,16);subplot(2,2,2),subimage(X,gray(16)X=grayslice(gray_image,32);

10、subplot(2,2,3),subimage(X,hot)X=grayslice(gray_image,64);subplot(2,2,4),subimage(X,jet) 將黑白圖像(二值圖像、灰度圖像) 轉(zhuǎn)為彩色圖像(RGB圖像、索引圖像)f=imread(cell.tif);imshow(f);map=zeros(8,3);map(2,3)=1;map(3,2)=1;map(4,2:3)=1;map(5,1)=1;map(6,1:2:3)=1;map(7,1:2)=1;map(8,1:3)=1;X=grayslice(f,8);figure;imshow(X,map) RGB彩色圖像空間濾波 理論上,RGB

溫馨提示

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

最新文檔

評(píng)論

0/150

提交評(píng)論