Practical Image Processing

download Practical Image Processing

If you can't read please download the document

description

Practical Image Processing for (i=0; i

Transcript of Practical Image Processing

Practical Image Processing
Chap 3Area processing convolution (mask) operation weighted sum of pixels in a neighborhood of source pixel (convolution window) : convolution window * convoltion mask ) convolution mask Practical Image Processing Practical Image Processing
for (i=0; i max) max = diff; diff = abs(ptrSorce[j][i]- ptrSorce[j][i]);if (diff > max) max = diff; diff = abs(ptrSorce[j][i+1]- ptrSorce[j][i]);if (diff > max) max = diff; diff = abs(ptrSorce[j+1][i-1]- ptrSorce[j][i]); if (diff > max) max = diff; diff = abs(ptrSorce[j+1][i]- ptrSorce[j][i]);if (diff > max) max = diff; diff = abs(ptrSorce[j+1][i+1]- ptrSorce[j][i]);if (diff > max) max = diff; ptrDest[j][i] = max; } Practical Image Processing Practical Image Processing
Difference operator (fig c) subtract surrounding pixels from their opposing counterparts and choose the maximum Practical Image Processing Practical Image Processing
void CImageFiltering::Edge_difference() { int i, j, max; CPixelPtr ptrSorce(m_pImage->GetUndoHandle()); CPixelPtr ptrDest(*m_pImage); CPixel p; for(j=1 ; j max) max = diff; diff = abs(ptrSorce[j-1][i+1]- ptrSorce[j+1][i-1]);if (diff > max) max = diff; diff = abs(ptrSorce[j][i+1]- ptrSorce[j][i-1]); if (diff > max) max = diff;; ptrDest[j][i] = max; } Practical Image Processing Practical Image Processing
thresholding an edge map (fig. 3.15) may use single threshold or double threshold single threshold g(x) = 255 if x >= threshold 0 otherwise double threshold g(x) = 255 if x >= high_threshold 0 if x GetUndoHandle()); CPixelPtr ptrDest_Mag(*m_pImage); CPixelPtr ptrDest_Phase(*m_pImage); CPixel p; for(j=1 ; j