影像處理-期中
L1
影像可根據其能源來源進行分類:
- 電磁波 (EM)、聲波、超音波等
- 其中電磁波是最主要的能源來源
電磁波
由高能量至低能量排列
Gamma-RayNuclear medicine(核醫學): 骨骼掃描、PET- 天文觀測
X-ray- 醫療檢查: 胸腔 X 光、血管攝影、
電腦斷層 CT - 工業檢測: 電路板檢測
- 醫療檢查: 胸腔 X 光、血管攝影、
Ultraviolet Band紫外線- 螢光顯微鏡
- 當紫外線光子碰撞螢光物質時,會激發電子並釋放出能量較低的可見光
- 螢光顯微鏡
VisibleandInfraredBands 可見光 & 紅外線- 光學顯微鏡觀察
- 遙測應用
Microwave Band微波- 影像雷達
- 能在任何時間、天氣及光照條件下採集數據 (類似具備主動照明功能)
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)
亮度適應與辨別
眼睛的亮度適應範圍極廣: 明視覺的範圍就約有
- Brightness adaptation 亮度適應
- 眼睛
無法同時在整個範圍內運作,而是透過改變其當前靈敏度級別來適應特定的亮度背景 - 到 之間
- 眼睛
Weber Ratio- : 反映亮度辨別能力
- 在低照明水平下,亮度辨別能力較差
視覺錯覺
- Mach Band Effect
- 感知強度並非實際強度的簡單函數,在強度變化的邊界會出現視覺增益
- Simultaneous Contrast
- 相同的內部區域在不同背景亮度下,看起來會有不同的亮度感知
影像形成模型
- Binary images: 僅有黑白兩色
- Gray scale images: 黑白影像,通常為 256 個強度等級 (0-255)
- Color images: 可以在數學上描述為三個灰階影像
影像函數 可表示為
- 為 illumination function (照明)
- 為 reflection function (反射)
- $ 0 < i(x,y) < \infty$ and
Image Sampling and Quantization
-
Sampling (取樣): 將二維空間座標值數位化 -
Quantization (量化): 將振幅 (亮度等級) 數位化 -
Saturation (飽和): 超過了感測器的捕捉能力,造成死白 -
Noise (雜訊)
Resolution
- Spatail Resolution: 由取樣點數決定
- Intensity Resolution: 由量化等級決定
- 等級過低會產生
偽輪廓現象 (False contouring)
- 等級過低會產生
Interpolation
- Zooming: 放大圖片
Nearest neighborinterpolation- 選取距離該座標最近的原始像素點的值作為新像素的值
Bilinearinterpolation- 考慮目標點周圍 4 個鄰近像素
- 水平內插兩次接著垂直內插
Bicubicinterpolation- 考慮目標點周圍 16 個鄰近像素
- Shrinking: 縮小圖片
Relationships Between Pixels
Neighborsof a pixel- 4-neighbors: 上下左右
- diagonal neighbors: 對角線
- 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:- 相鄰兩點為 adjacent
- :
closed path
-
Connectivityin a subset S of an image- 兩點間有在 S 內部的 Path
-
Connected componentof S- Set 裡面任意兩點皆 connected
-
Connected Set:- only one connected component
-
Regionof an image- Subset R is a connected set
-
Regionsareadjacent- If their
unionforms a connected set
- If their
-
Boundary/Contour (Inner Border)- 與 R 的補集 (背景) 相鄰的點所構成的集合
-
Outer Border- 背景區域的 Boundary
-
Distance measures
Euclidean Distance()City-block (Manhattan) distance()Chessboard distance()
影像運算
Arithmetic Operations
- Image Averaging: 降噪
- Image Subtraction: 變化偵測、對比增強
- Shading correction
- Image Multiplication: 遮罩處理 (Masking)
Set and Logical Operations
Spatial Operations
- Single-Pixel Operations
- 每個像素獨立變換
- 調整亮度,
- Neighborhood Operations
- 對一個像素周圍的鄰域進行統計計算
- Geometric Spatial Transformations
- 座標空間轉換 (平移、旋轉、縮放)
- 強度內插
L3
Spatial Domain: 指影像平面,由離散的行列座標系組成,行列交點即為 Pixel,其值稱為 IntensityFrequency Domain: 對空間域進行二維離散轉換後的結果- 數學表示式:
- 為輸入影像
- 為處理後影像
- 是定義在 鄰域上的算子
Intensity Transformation
Contrast-stretching: 擴展影像的動態範圍Thresholding: 將影像轉為黑白兩色Image Negatives(負片變換):- Gray level:
- 公式:
Log Transformations- 公式:
- 擴展低強度 (暗部) 值,壓縮高強度值
Power-Law (Gamma) Transformations- 公式:
- 當 時可增亮暗部,當 時反之
Intensity-Level Slicing: 突顯特定的灰階範圍Bit-Plane Slicing- 將 8 位元影像拆解為 8 個 1 位元平面
- 最高位元平面包含多數視覺資訊,最低位元平面則包含細節或雜訊
Histogram Processing
Histogram Equalization
-
提升影像對比度
-
使像素值呈現均勻分佈
-
轉換函數 必須是
single-valuedandmonotonically increasing- 確保反函數存在
- 保序性: 防止黑白倒置 (轉換前後亮暗比較相同)
-
公式:
Histogram Matching
- 將影像調整為指定的直方圖形狀
- 流程:
- 將原始影像 Equalization:
- 假設目標影像也能被 Equalization:
- 則
- 如果多個 值對應到相同的 ,則取
最小的 值作為對應
- 如果多個 值對應到相同的 ,則取
Spatial Filtering
Linear filtering
- Correlation
- Same Correlation: 圖片大小不變
- Full Correlation:
- 若原圖大小為 ,kernel 為 ,輸出大小為
- 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 :
- The first-order derivative:
- The second-order derivative:
Laplacian method
二維計算:
- The second-order derivative:
從原始影像減去拉普拉斯運算的結果
Unsharp Masking & Highboost Filtering
流程:
- 模糊原圖得
- 原圖減去模糊圖得到遮罩:
- 將遮罩加回原圖:
- : unsharp masking
- : highboost filtering
The Gradient
Other
L12
Image Pattern Classification
分類:
Prototype matching: 使特徵變得獨特且易於檢測,以簡化分類Optimal statistical formulation: 選擇能產生統計意義上最佳分類性能的參數Neural networks: 通常可直接使用原始數據,無需工程化的特徵
Perceptron
- 單個
Perceptron (感知器)單元可學習兩個線性可分模式類別之間的線性邊界 - 在 n 維空間中邊界為
hyperplane (超平面)- 向量形式為
- 其中 為權重向量, 為偏置 (Bias)
Perceptron Training Algorithm
- 權重更新規則:
- 若分類錯誤 (例如 但 )
- 則更新權重
- 其中 為學習率
-
Perceptron operations:
- Sum of products
Activation function: a thresholding function
-
Epoch: 遍歷所有訓練模式的一次完整迭代