Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Basis of data compression and digital image. 2 outline Data compression Information and Entropy Digital image DCT (discrete cosine transformation) DWT.

Similar presentations


Presentation on theme: "1 Basis of data compression and digital image. 2 outline Data compression Information and Entropy Digital image DCT (discrete cosine transformation) DWT."— Presentation transcript:

1 1 Basis of data compression and digital image

2 2 outline Data compression Information and Entropy Digital image DCT (discrete cosine transformation) DWT (discrete wavelet transformation)

3 3 Data compression 資料壓縮 — 用來減少表示一個訊息所需要 的訊息空間量的程序。 訊息空間量可分為: 1. 訊息所佔用的實體空間 2. 傳送訊息所花費的時間 3. 傳送訊息所使用的頻寬

4 4 Data compression 壓縮什麼資料 ? 文書 語音、音訊和心電圖 影像資料 視訊會議及高品質電視

5 5 Data compression Data redundancy— 資料能被壓縮的主因 常見的 Data redundancy : Coding redundancy Inter-sample redundancy Inter-frame redundancy

6 6 Data compression SiSi P(S i )Code 1L 1 (S i )Code 2L 2 (S i ) 00.190003112 10.250013012 20.210103102 30.1601130013 40.08100300014 50.061013000015 60.0311030000016 70.0211130000006

7 7 Data compression Coding redundancy 平均編碼長度 l(s i ) : s i 編碼長度 p(s i ) : s i 的出現機率 code1 的 L avg =3 bit code2 的 L avg =2(0.19)+2(0.25)+2(0.21)+3(0.16)+4(0.08) +5(0.06)+6(0.03)+6(0.02)=2.7 bit

8 8 Data compression Inter-sample redundancy 取樣點間所存在的關聯性。 Inter-frame redundancy 相鄰的畫面間,存在極大的相似性。

9 9 Data compression 資料壓縮的種類 lossless data compression 僅去掉 redundancy 的部份,壓縮過的資料可回復 。 lossy data compression 去掉 redundancy 和一部分的資料,資料無法回復。 資料壓縮比

10 10 Information and Entropy 用來估算資訊量的函數 —Information 通常收到一個機率較低的符號,會比較驚訝, 得到資 訊量也較多。 用來估算符號的編碼長度

11 11 Information and Entropy 符號 S i 的所得的資訊量為 I(S i ) 平均所得的資訊量 =P i I(S i )=P i log 2 (1/P i ) 對整個符號源平均所得的資訊量 =H 2 (S)

12 12 Digital image Digital image 資料格式 spatial domain : 由 pixel 組成 利用二維陣列儲存 每個 pixel 可呈現不同顏色 ex :灰階影像,一個 pixel 佔 8- bit ,則可表示 0~255 ,共 256 個灰階。 Frequency domain : 經空間域轉換所得 常用的轉換法為 DCT 和 DWT 重要的資訊存在低頻的部份

13 13 Digital image 數位影像的應用 影像壓縮 數位影像浮水印 數位權益保障 量測影像失真的工具

14 14 Discrete Cosine Transformation 將空間域轉成頻率域的一種方法 空間域轉頻率域 —FDCT 頻率域轉空間域 —IDCT 經 FDCT 和 IDCT 處理過的圖應該相等,或 是誤差很小

15 15 Discrete Cosine Transformation 空間域影像 頻率域影像 (X,Y) (i,j) f(x,y)=O(x,y)-128 O(x,y)=f(x,y)+128 FDCT( f(x,y) | x=0 to N-1 ; y=0 to N-1) IDCT( D(i,j) | i=0 to N-1 ; j=0 to N-1) Pixel 對應位置基 頻波的倍數

16 16 Discrete Cosine Transformation FDCT 公式 IDCT 公式 其中

17 17 Discrete Wavelet Transformation Haar 函數的離散小波轉換 1. 將所有像素視為獨立的數值,做相加相減的運算。 2. 相加後的值越大,表示越重要,為影像的低頻部份。 3. 相減代表像素間的差距,為高頻的部份。 DWT 運算步驟 1. 水平分割 2. 垂直分割

18 18 Discrete Wavelet Transformation 水平分割 ABCD A+BC+DA-BC-D LH

19 19 Discrete Wavelet Transformation 垂直分割 AC BD L H A+BC+D LLHL A-BC-D LHHH

20 20 Discrete Wavelet Transformation LL1HL1 LH1HH1 LL2HL2 HL1 LH2 HH2 LH1HH1 HL2 HL1 LH2HH2 LH1HH1 LL3HL3 LH3HH3 第一階第二階 第三階

21 21 Discrete Wavelet Transformation DWT 係數的掃描順序 改善使用列的方式傳送影像所造成的問題 1. 使用頻率域影像的特性 2. 先傳送低頻的部份 3. 再傳送中頻和高頻的部份 利用以上三點以達到漸進式影像的目的

22 22 Discrete Wavelet Transformation LL3HL3 HL2 HL1 LH3HH3 LH2HH2 LH1HH1


Download ppt "1 Basis of data compression and digital image. 2 outline Data compression Information and Entropy Digital image DCT (discrete cosine transformation) DWT."

Similar presentations


Ads by Google