290 likes | 458 Views
『 數位影像處理介紹 』 醫學影像成像原理. 什麼是影像處理. 幾何處理 影像增強 影像壓縮 影像切割 影像辨識 影像加密 影像描述. 影像增強技術. 定義 點處理的增強 影像濾波. 定義. 對影像上之任意像素 f (i,j ) 之新值, g(i,j) , 以像素之周圍層階值局部運算所得,並經由對整個影像作處理以達到邊緣強調和雜訊去除的目的。. 640. i. f(i,j ). 480. j. L-1. T(r). s. 0. r. L-1. 點處理的增強. 灰階反轉. 點處理的增強. 對比度擴展. L-1.
E N D
什麼是影像處理 • 幾何處理 • 影像增強 • 影像壓縮 • 影像切割 • 影像辨識 • 影像加密 • 影像描述
影像增強技術 • 定義 • 點處理的增強 • 影像濾波
定義 • 對影像上之任意像素f(i,j)之新值,g(i,j),以像素之周圍層階值局部運算所得,並經由對整個影像作處理以達到邊緣強調和雜訊去除的目的。 640 i f(i,j) 480 j
L-1 T(r) s 0 r L-1 點處理的增強 • 灰階反轉
點處理的增強 • 對比度擴展 L-1 (r2,s2) s T(r) (r1,s1) 0 r L-1
影像濾波 • g(x,y)=T[f(x,y)] • 銳化濾波器 • 影像之線或邊緣強調 • 平滑化濾波器 • 影像之雜訊去除及影像之平滑化
銳化濾波器 • 以同一像素近旁之層階值微分或差分運算 • 一次空間微分差分濾波器 • 2 X 2遮罩 • 3 X 3遮罩 • Sobel 濾波器 • 二次空間微分差分濾波器
銳化濾波器 • 一次空間微分差分濾波器 m1=0 m2=1 n1=0 n2=1 m1=-1 m2=0 n1=-1 n2=0 m1=-1 m2=1 n1=-1 n2=1 m1=-1 m2=1 n1=0 n2=2
銳化濾波器 • 線性一次空間微分濾波器 • 2 * 2 mask i方向一次微分: j方向一次微分: -1 1 -1 -1 -1 1 1 1
銳化濾波器 • 線性一次空間微分濾波器 • 3 * 3 mask -1 0 1 -1 -1 -1 -1 0 1 0 0 0 -1 0 1 1 1 1 i方向一次微分 j方向一次微分
銳化濾波器 • 線性一次空間微分濾波器 • Sobel filter -1 0 1 -1 -2 -1 -2 0 2 0 0 0 -1 0 1 1 2 1 i方向一次微分 j方向一次微分
銳化濾波器 • 二次空間微分線性濾波器 • 拉布拉辛(Laplacian) 濾波器 1 1 1 0 1 0 1 -4 1 1 -8 1 1 0 0 1 1 1 4近旁 8近旁
int Mask[9] = { 0 , -1, 0 , -1, 4, -1 , 0 , -1, 0 }; for(k=0 ; k<pDoc->cttmp1->m_nFrame ; k++) for(i=1 ; i<pDoc->cttmp1->m_nHeight-1 ; i++) for(j=1 ; j<pDoc->cttmp1->m_nWidth-1 ; j++) { array[0] = pDoc->cttmp1->m_nVoxel[k][i-1][j-1]; array[1] = pDoc->cttmp1->m_nVoxel[k][i-1][j]; array[2] = pDoc->cttmp1->m_nVoxel[k][i-1][j+1]; array[3] = pDoc->cttmp1->m_nVoxel[k][i][j-1]; array[4] = pDoc->cttmp1->m_nVoxel[k][i][j]; array[5] = pDoc->cttmp1->m_nVoxel[k][i][j+1]; array[6] = pDoc->cttmp1->m_nVoxel[k][i+1][j-1]; array[7] = pDoc->cttmp1->m_nVoxel[k][i+1][j]; array[8] = pDoc->cttmp1->m_nVoxel[k][i+1][j+1]; sum = 0; for(l=0; l<9; l++) sum += Mask[l] * array[l]; l_truth = abs(sum); if (l_truth >= 255) { pDoc->cttmp2->m_nVoxel[k][i][j] = 255; } else { pDoc->cttmp2->m_nVoxel[k][i][j] = l_truth; } if (pDoc->cttmp2->m_nVoxel[k][i][j] > max_l) { max_l=pDoc->cttmp2->m_nVoxel[k][i][j]; } }
平滑化濾波器 • 線性平滑化濾波器 • Low-pass filter • 非線性平滑化濾波器 • Median filter
平滑化濾波器 • 線性平滑化濾波器 • Low-pass filter 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1
平滑化濾波器 • 非線性平滑化濾波器 • 最小值濾波器 • 最大值濾波器 • 中間值濾波器(Median filter)
影像切割技術 • 邊緣偵測運算子 • 平滑運算子 • 閾質分割 (Thresholding)
結論 • 遮罩的運用 • 銳化 • 平滑 • 運算子的運用 • 頻域特性 • 閾質分割 (Thresholding)