L1

影像可根據其能源來源進行分類:

  • 電磁波 (EM)、聲波、超音波等
  • 其中電磁波是最主要的能源來源

電磁波

由高能量至低能量排列

  1. Gamma-Ray
    • Nuclear medicine (核醫學): 骨骼掃描、PET
    • 天文觀測
  2. X-ray
    • 醫療檢查: 胸腔 X 光、血管攝影、電腦斷層 CT
    • 工業檢測: 電路板檢測
  3. Ultraviolet Band 紫外線
    • 螢光顯微鏡
      • 當紫外線光子碰撞螢光物質時,會激發電子並釋放出能量較低的可見光
  4. Visible and Infrared Bands 可見光 & 紅外線
    • 光學顯微鏡觀察
    • 遙測應用
  5. Microwave Band 微波
    • 影像雷達
    • 能在任何時間、天氣及光照條件下採集數據 (類似具備主動照明功能)
  6. Radio Band 無線電波
    • 核磁共振造影 (MRI)

Ultrasound 超音波

  • 醫療診斷: 產前檢查、內臟器官檢查

L2

人類視覺感知

視覺是由分布在視網膜 (Retina) 表面的離散光受體產生的

  • 錐狀細胞 (Cones): 6 to 7 millions
    • 集中於中央小凹 (Fovea)
    • 負責明視覺 (Photopic vision)
    • 有色彩感知、高解析度
    • 對光較不敏感
  • 桿狀細胞 (Rods): 75 to 150 millions
    • 分布於視網膜表面
    • 負責暗視覺 (Scotopic vision)
    • 無色彩感知、低解析度
    • 對光極其敏感 (夜視)
  • 眼睛的焦距約在 14mm 至 17mm 之間
  • 感知是透過光感受器的相對激發而發生的,光感受器將輻射能 (radiant energy)轉換為電脈衝 (electrical impulses)

亮度適應與辨別

眼睛的亮度適應範圍極廣: 明視覺的範圍就約有 10610^6

  • Brightness adaptation 亮度適應
    • 眼睛無法同時在整個範圍內運作,而是透過改變其當前靈敏度級別來適應特定的亮度背景
    • BaB_aBbB_b 之間
  • Weber Ratio
    • ΔIc/I\Delta I_c/I: 反映亮度辨別能力
    • 在低照明水平下,亮度辨別能力較差

視覺錯覺

  • Mach Band Effect
    • 感知強度並非實際強度的簡單函數,在強度變化的邊界會出現視覺增益
  • Simultaneous Contrast
    • 相同的內部區域在不同背景亮度下,看起來會有不同的亮度感知

影像形成模型

  • Binary images: 僅有黑白兩色
  • Gray scale images: 黑白影像,通常為 256 個強度等級 (0-255)
  • Color images: 可以在數學上描述為三個灰階影像

影像函數 f(x,y)f(x,y) 可表示為 i(x,y)×r(x,y)i(x,y) \times r(x,y)

  • i(x,y)i (x,y) 為 illumination function (照明)
  • r(x,y)r (x,y) 為 reflection function (反射)
  • $ 0 < i(x,y) < \infty$ and 0<r(x,y)<10 <r(x,y)< 1

Image Sampling and Quantization

  • Sampling (取樣): 將二維空間座標值數位化

  • Quantization (量化): 將振幅 (亮度等級) 數位化

  • Saturation (飽和): 超過了感測器的捕捉能力,造成死白

  • Noise (雜訊)

Resolution

  • Spatail Resolution: 由取樣點數決定
  • Intensity Resolution: 由量化等級決定
    • 等級過低會產生偽輪廓現象 (False contouring)

Interpolation

  • Zooming: 放大圖片
    • Nearest neighbor interpolation
      • 選取距離該座標最近的原始像素點的值作為新像素的值
    • Bilinear interpolation
      • 考慮目標點周圍 4 個鄰近像素
      • 水平內插兩次接著垂直內插
      • v(x,y)=ax+by+cxy+dv(x,y)=ax+by+cxy+d
    • Bicubic interpolation
      • 考慮目標點周圍 16 個鄰近像素
  • Shrinking: 縮小圖片

Relationships Between Pixels

  • Neighbors of a pixel
    • N4(p)N_4(p) 4-neighbors: 上下左右
    • ND(p)N_D(p) diagonal neighbors: 對角線
    • N8(p)N_8(p) 8-neighbors: 周圍
  • Adjacency: 兩點為 Neighbors 且有相同 grey-level (或一定範圍內)
    • 4-adjacent, diagonally adjacent, 8-adjacent
    • m-adjacency (mixed adjacency)
      • 4-adjacent
      • or diagonally adjacent 且沒有共同的 4-adjacent neighbors
      • 兩點不能同時成立
    • 8-adjacent & m-adjacency 比較
  • Path:

    • (x0,y0),(x1,y1),,(xn,yn)(x_0,y_0), (x_1,y_1),…, (x_n,y_n) 相鄰兩點為 adjacent
    • (x0,y0)=(xn,yn)(x_0,y_0) = (x_n,y_n): closed path
  • Connectivity in a subset S of an image

    • 兩點間有在 S 內部的 Path
  • Connected component of S

    • Set 裡面任意兩點皆 connected
  • Connected Set:

    • only one connected component
  • Region of an image

    • Subset R is a connected set
  • Regions are adjacent

    • If their union forms a connected set
  • Boundary/Contour (Inner Border)

    • 與 R 的補集 (背景) 相鄰的點所構成的集合
  • Outer Border

    • 背景區域的 Boundary
  • Distance measures

    • Euclidean Distance (DeD_e)
      • (xs)2+(yt)2\sqrt{(x-s)^2 + (y-t)^2}
    • City-block (Manhattan) distance (D4D_4)
      • xs+yt|x-s| + |y-t|
    • Chessboard distance (D8D_8)
      • max(xs,yt)\max(|x-s|, |y-t|)

影像運算

Arithmetic Operations

  • Image Averaging: 降噪
  • Image Subtraction: 變化偵測、對比增強
  • Shading correction
  • Image Multiplication: 遮罩處理 (Masking)

Set and Logical Operations

Spatial Operations

  • Single-Pixel Operations
    • 每個像素獨立變換
    • 調整亮度,s=T(r)s = T(r)
  • Neighborhood Operations
    • 對一個像素周圍的鄰域進行統計計算
  • Geometric Spatial Transformations
    • 座標空間轉換 (平移、旋轉、縮放)
    • 強度內插

L3

  • Spatial Domain: 指影像平面,由離散的行列座標系組成,行列交點即為 Pixel,其值稱為 Intensity
  • Frequency Domain: 對空間域進行二維離散轉換後的結果
  • 數學表示式:g(x,y)=T[f(x,y)]g(x,y) = T[f(x,y)]
    • f(x,y)f(x,y) 為輸入影像
    • g(x,y)g(x,y) 為處理後影像
    • TT 是定義在 (x,y)(x,y) 鄰域上的算子

Intensity Transformation

  • Contrast-stretching: 擴展影像的動態範圍
  • Thresholding: 將影像轉為黑白兩色
  • Image Negatives (負片變換):
    • Gray level: [0,L1][0, L-1]
    • 公式: s=L1rs=L-1-r
  • Log Transformations
    • 公式: s=clog(1+r)s = c \log(1 + r)
    • 擴展低強度 (暗部) 值,壓縮高強度值
  • Power-Law (Gamma) Transformations
    • 公式: s=crγs = cr^\gamma
    • γ<1\gamma < 1 時可增亮暗部,當 γ>1\gamma > 1 時反之
  • Intensity-Level Slicing: 突顯特定的灰階範圍
  • Bit-Plane Slicing
    • 將 8 位元影像拆解為 8 個 1 位元平面
    • 最高位元平面包含多數視覺資訊,最低位元平面則包含細節或雜訊

Histogram Processing

Histogram Equalization

  • 提升影像對比度

  • 使像素值呈現均勻分佈

  • 轉換函數 T(r)T(r) 必須是 single-valued and monotonically increasing

    • 確保反函數存在
    • 保序性: 防止黑白倒置 (轉換前後亮暗比較相同)
  • 公式: s=T(r)=(L1)0rpr(w)dws = T(r) = (L-1) \int_0^r p_r(w) dw

    • 0rL10 \le r \le L-1

Histogram Matching

  • 將影像調整為指定的直方圖形狀
  • 流程:
    • 將原始影像 Equalization: s=T(r)s = T(r)
    • 假設目標影像也能被 Equalization: s=G(z)s = G(z)
    • z=G1(s)=G1(T(r))z = G^{-1}(s) = G^{-1}(T(r))
      • 如果多個 zz 值對應到相同的 ss,則取最小zz 值作為對應

Spatial Filtering

Linear filtering

  • Correlation
    • Same Correlation: 圖片大小不變
    • Full Correlation:
      • 若原圖大小為 N×NN \times N,kernel 為 k×kk \times k,輸出大小為 (Nk+1)×(Nk+1)(N-k+1) \times (N-k+1)
  • Convolution: 把 kernel 翻轉

Smoothing linear filters

  • Averaging filters
    • Box filter
    • Gaussian kernel filter

Order-statistic filters

Nonlinear spatial filtering

  • Median filter
    • 有效去除脈衝雜訊 (impulse noise): salt-and-pepper noise

Sharpening Spatial Filters

  • Sharpening filters 基於計算 spatial derivatives (導數)

  • The first-order derivative

    • Areas of constant intensity: zero
    • Onset of an intensity step or ramp: nonzero
    • Along ramps: nonzero
  • The second-order derivative

    • Areas of constant intensity: zero
    • Onset and end of an intensity step or ramp: nonzero
    • Along ramps: zero

對於一維 function f(x)f(x):

  • The first-order derivative: f(x+1)f(x)f(x+1) - f(x)
  • The second-order derivative: f(x+1)+f(x1)2f(x)f(x+1) + f(x-1) - 2f(x)

Laplacian method

二維計算:

  • The second-order derivative: [f(x+1,y)+f(x1,y)+f(x,y+1),f(x,y1)]4f(x,y)[f(x+1,y) + f(x-1,y) + f(x,y+1), f(x,y-1)] - 4f(x,y)

從原始影像減去拉普拉斯運算的結果

Unsharp Masking & Highboost Filtering

流程:

  • 模糊原圖得 f(x,y)\overline{f}(x,y)
  • 原圖減去模糊圖得到遮罩: gmask(x,y)=f(x,y)f(x,y)g_{mask}(x,y) = f(x,y) - \overline{f}(x,y)
  • 將遮罩加回原圖: g(x,y)=f(x,y)+kgmask(x,y)g(x,y) = f(x,y) + k * g_{mask}(x,y)
    • k=1k = 1: unsharp masking
    • k>1k > 1: highboost filtering

The Gradient

Other

L12

Image Pattern Classification

分類:

  • Prototype matching: 使特徵變得獨特且易於檢測,以簡化分類
  • Optimal statistical formulation: 選擇能產生統計意義上最佳分類性能的參數
  • Neural networks: 通常可直接使用原始數據,無需工程化的特徵

Perceptron

  • 單個 Perceptron (感知器) 單元可學習兩個線性可分模式類別之間的線性邊界
  • 在 n 維空間中邊界為 hyperplane (超平面)
    • 向量形式為 wTx+ωn+1=0w^T x + \omega_{n+1} = 0
    • 其中 ww 為權重向量,wn+1w_{n+1} 為偏置 (Bias)

Perceptron Training Algorithm

  • 權重更新規則:
    • 若分類錯誤 (例如 xc1x \in c_1wTx0w^T x \le 0)
    • 則更新權重 w(k+1)=w(k)+αx(k)w(k+1) = w(k) + \alpha x(k)
      • 其中 α\alpha 為學習率
  • Perceptron operations:

    • Sum of products
    • Activation function: a thresholding function
  • Epoch: 遍歷所有訓練模式的一次完整迭代