1 / 106

Digital Image Processing Chapter 10: Image Segmentation 13 July 2005

Digital Image Processing Chapter 10: Image Segmentation 13 July 2005. Element of Image Analysis. ISAN-DSP GROUP. Preprocess Image acquisition, restoration, and enhancement. Intermediate process Image segmentation and feature extraction. High level process

Télécharger la présentation

Digital Image Processing Chapter 10: Image Segmentation 13 July 2005

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Digital Image Processing Chapter 10: Image Segmentation 13 July 2005

  2. Element of Image Analysis ISAN-DSP GROUP Preprocess Image acquisition, restoration, and enhancement Intermediate process Image segmentation and feature extraction High level process Image interpretation and recognition

  3. Importance of Image Segmentation Image segmentation is used to separate an image into constituent parts based on some image attributes. Image segmentation is an important step in image analysis Benefit 1. Image segmentation reduces huge amount of unnecessary data while retaining only importance data for image analysis 2. Image segmentation converts bitmap data into better structured data which is easier to be interpreted

  4. Image Attributes for Image Segmentation 1. Similarity properties of pixels inside the object are used to group pixels into the same set. 2. Discontinuity of pixel properties at the boundary between object and background is used to distinguish between pixels belonging to the object and those of background. Discontinuity: Intensity change at boundary Similarity: Internal pixels share the same intensity

  5. Spatial Filtering Application to Shape Detection • One application of spatial filtering is shape detection: finding locations of objects with the desired shape. • Unlike frequency selective masks that are designed based • on the concept of frequency, shape detection masks are • derived from the shapes to be detected themselves. • A mask for shape detection usually contains the shape or a part • of the shape to be detected. • The location that ismost correlated to the mask is the • location where the highest filter response occurs. The • shape is most likely to exist there.

  6. Point Detection 0 -1 -1 -1 -1 0 -1 -1 4 8 -1 -1 -1 0 -1 -1 -1 0 • We can use Laplacian masks for point detection. • Laplacian masks have the largest • coefficient at the center of the mask • while neighbor pixels have an • opposite sign. • This mask will give the high response to the object that has the • similar shape as the mask such as isolated points. • Notice that sum of all coefficients of the mask is equal to zero. • This is due to the need that the response of the filter must be zero • inside a constant intensity area

  7. Point Detection Point detection can be done by applying the thresholding function: Location of porosity X-ray image of the turbine blade with porosity Laplacian image After thresholding (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  8. Line Detection • Similar to point detection, line detection can be performed • using the mask the has the shape look similar to a part of a line • There are several directions that the line in a digital image can be. • For a simple line detection, 4 directions that are mostly used are • Horizontal, +45 degree, vertical and –45 degree. Line detection masks (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  9. Line Detection Example Binary wire bond mask image Absolute value of result after processing with -45 line detector Result after thresholding Notice that –45 degree lines are most sensitive (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  10. Edges Ideal step edge Ideal ramp edge Blurred edge Generally, objects and background have different intensities. Therefore, Edges of the objects are the areas where abrupt intensity changes occur. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  11. Ideal Ramp Edges and its Derivatives Edge Original image (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  12. Smoothed Step Edge and Its Derivatives 1.2 1 0.8 0.6 0.4 0.2 0 -0.2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 0.06 0.04 0.02 0 -0.02 -0.04 -0.06 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 -3 x 10 5 4 3 2 1 0 -1 -2 -3 -4 -5 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 Edge Edge Gray level profile Intensity Minimum point The 1st derivative Maximum point Zero crossing + + The 2nd derivative - -

  13. Derivative Based Edge Detection • From the previous slide, we can conclude that: • Local maxima of the absolute of the 1st derivative and Zero crossing • of the 2nd derivative occur at edges. • Therefore, for detecting edges, we can apply zero crossing detection • to the 2nd derivative image or thresholding the absolute of the • 1st derivative image. • Nevertheless, derivative operator is very sensitive to noise as we • will see in the next slide.

  14. Noisy Edges and Derivatives Derivative operator is a highpass filter and thus enhances noise. f(x) AWGN s = 0.1 Edge responses are buried by noise. AWGN s = 1.0 AWGN s = 10 (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  15. Masks for Estimating Partial Derivatives Normally, the mask for estimating partial derivative is anti-symmetry with respect to the orthogonal axis For example, the Sobel mask for computing is anti-symmetry with respect to the y-axis. It has the positive sign on the right side and negative sign on the left side. Notice that sum of all coefficients is equal to zero to make sure that the response of a constant intensity area is zero. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  16. Masks for Detecting Diagonal Edges The mask for detecting -45-degree edges is anti-symmetry with respect to the –45-degree lineswhile the mask for detecting 45-degree edges is anti-symmetry with respect to the 45-degree lines. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  17. Example of Image Gradient (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  18. Example of Image Gradient Note: the original image is smoothed by a 5x5 moving average mask first. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  19. Example of Diagonal Edges Using -45-degree mask Using 45-degree mask Note: the original image is smoothed by a 5x5 moving average mask first. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  20. Laplacian Masks The Laplacian masks are used to estimate the Laplacian image: Ideally, the Laplacian mask must be directional invariant: symmetry in all direction (radially symmetry ). However, for 3x3 masks, there are Only 8 possible directions. Hence, we can use the following masks: (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  21. Laplacian Masks For a large scale Laplacian mask, we can use a Laplacian of Gaussian (LOG) as a mask: Surface plot of LOG, Looks like a “Mexican hat” LOG image 5x5 LOG mask Cross section of LOG (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  22. Example of Laplacian Image The angiogram image (blood vessels) We can compute the Laplacian image by: 1. Smooth the image by the Gaussian mask 2. Compute the Laplacian image using the mask 1 2 Threshold of The left image Zero crossing (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  23. Pixel Oriented Image Segmentation: Thresholding เป็นวิธีการแยกองค์ประกอบของรูปภาพโดยดูจากความเหมือนกันของคุณสมบัติของพิกเซลภายใน พื้นที่เพียงอย่างเดียว เช่นวิธีการ Intensity Thresholding ใช้ได้ดีกับภาพที่วัตถุกับฉากหลังแยกกันชัดเจนสังเกตได้ จาก Histogram ของภาพเป็นแบบ multimodal T = 102 สีของฉากหลัง สีของแบคทีเรีย After thresholding

  24. Intensity Thresholding Example (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  25. Automatic Threshold Level Selection The major problem of intensity thresholding is to find a good threshold level Algorithm: effective for bimodal histogram • Set initial value of T • 2. • 3. • 4. • 5. Repeat step 2

  26. Automatic Threshold Level Selection Example (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  27. Multilevel Intensity Thresholding ในบางกรณีที่มีวัตถุที่มีความเข้มต่างกันอาจจำเป็นต้องใช้ Threshold Level หลายค่า Histogram T1 = 158 T2 = 196 T3 = 228 T1< P <T2 T2< P <T3 P > T3

  28. Noise Problem เมื่อใช้กับภาพที่มีสัญญาณรบกวน จะทำให้ได้ภาพที่ไม่ต่อเนื่อง peak ไม่ชัดเจน Histogram Image degraded by Gaussian noise (s =12) T1 = 158 T2 = 196 T3 = 228 T1< P <T2 T2< P <T3 P > T3

  29. Nonuniform Illumination Problem An image can be expressed as Reflectance Function r(x,y) i(x,y) = illumination component r(x,y) = reflectance component Histogram Illumination Function i(x,y) Image histogram f(x,y) (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  30. Nonuniform Illumination and Global Thresholding Global threshold level Global thresholding of nonuniform illumination image can cause huge errors! Histogram Nonuniform illumination image Global thresholding result (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  31. Nonuniform Illumination and Local Thresholding • Local thresholding: • Divide an image into subimages. • Threshold each subimage independently • 2.1 Compute histogram of each subimage and select a suitable • threshold value for each subimage • 2.2 threshold each subimage using a threshold value in 2.1 • 2.3 Combine all local thresholding results Error 16 subimages Result of local thresholding

  32. Histogram of Subimages and Local Thresholding If areas of object and background are not balanced, a histogram will be unimodal. If areas of object and background are nearly equal, a histogram will be bimodal (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  33. Example of Nonuniform Illumination Problem ISAN-DSP GROUP เมื่อใช้ภาพที่ความสว่างไม่เท่ากันตลอดภาพ จะทำให้ผลลัพธ์ผิดไปอย่างมาก T=0.4 Error บริเวณขอบภาพ

  34. Optimum Thresholding Background p1(z) = PDF of object pixels p2(z) = PDF of background pixels Object Error due to background pixels classified as object pixels is : Error due to object pixels classified as background pixels is: Total error = P1 = Probability of occurrence of object pixels P2 = Probability of occurrence of background pixels (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  35. Optimum Thresholding

  36. Optimum Thresholding (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  37. Optimum Thresholding (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  38. Pixel Oriented Image Segmentation for Color Images RGB, CMY color models: Thresholding based on distance in the color space. HSI color model: Thresholding based on H and S component mainly. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  39. Color Segmentation in HSI Color Space Color image Hue 1 2 3 4 Saturation Intensity (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  40. Color Segmentation in HSI Color Space (cont.) Binary thresholding of S component with T = 10% Product of and 2 5 5 6 Red pixels 7 8 Segmentation of red color pixels Histogram of 6 (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  41. Color Segmentation in HSI Color Space (cont.) Color image Segmented results of red pixels (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  42. Color Segmentation in RGB Vector Space (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition. 1. Each point with (R,G,B) coordinate in the vector space represents one color. 2. Segmentation is based on distance thresholding in a vector space cT = color to be segmented. D(u,v) = distance function c(x,y) = RGB vector at pixel (x,y). (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  43. Example: Segmentation in RGB Vector Space Color image Reference color cT to be segmented Results of segmentation in RGB vector space with Threshold value T = 1.25 times the SD of R,G,B values In the box (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  44. Color Image Segmentation Example (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  45. 1 0.5 Blue 0 1 0.2 0.8 0.4 0.6 0.6 0.4 0.8 0.2 Green 1 Red Pixel Oriented Image Segmentation for Multispectral Images หลักการของ pixel oriented image segmentation สามารถนำไปใช้กับภาพแบบ multispectrum เช่นภาพสี ได้ โดยการแบ่ง partition ใน Feature space หรือ การแยกองค์ประกอบตามสีของพิกเซลนั้นเอง Image Domain ภาพถ่ายเมือง Munich จากอวกาศ Partition Boundary From www.jpl.nasa.gov/radar/ sircxsar/munch.html Feature Space (RGB)

  46. Self Organizing Map for Color Image Segmentation เราสามารถใช้ Self Organizing Map(SOM) ในการคำนวณหาสีที่เหมาะสมที่จะใช้ ในการแยกองค์ประกอบตามสีของพิกเซลได้ ขั้นตอนการหาสีหลัก 1. กำหนดจำนวนสีหลักที่จะใช้แบ่ง 2. กำหนดค่าเริ่มต้นให้กับสีหลักทุกสี 3. สำหรับพิกเซลแต่ละพิกเซล นำค่า (R,G,B) มาคำนวณหาระยะทางระหว่างสีหลัก ทุกสี กับสีของพิกเซลที่ได้ 4. หาสีหลักที่ระยะทางในข้อ 3 ต่ำที่สุด (สีหลักที่ชนะ) สีหลักที่ได้จะเป็นสีที่ใกล้เคียง กับสีของพิกเซลมากที่สุด ทำการปรับค่าสีของสีหลักสีนั้นในทิศทางเข้าสู่สีของพิกเซล 5. กลับไปทำข้อ 3-4 จนกระทั่งค่าสีของสีหลักไม่เปลี่ยนแปลงมาก ขั้นตอนการแยกองค์ประกอบ 1. สำหรับพิกเซลแต่ละพิกเซล นำค่า (R,G,B) มาคำนวณหาระยะทางระหว่างสีหลัก ทุกสี กับสีของพิกเซลที่ได้ 2. หาสีหลักที่ระยะทางในข้อ 1 ต่ำที่สุด (สีหลักที่ชนะ) จัดให้พิกเซลนั้นอยู่ในกลุ่มของสีหลักที่ชนะ

  47. Self Organizing Map for Color Image Segmentation ISAN-DSP GROUP ภาพเมือง Munich ประกอบด้วย สีขาว พื้นที่สิ่งก่อสร้างในเมือง สีม่วง พื้นที่ป่าทึบ สีเขียวแก่ พื้นที่การเกษตรหนาแน่น สีดำ พื้นที่แหล่งน้ำ สีผสม พื้นที่การเกษตรเบาบาง ผลของการแยกองค์ประกอบตามสี ของรูปภาพโดยใช้ SOM

  48. ISAN-DSP GROUP Advantages and Disadvantage of Pixel Oriented Image Segmentation ข้อดี เนื่องจากวิธีการนี้ใช้ข้อมูลของคุณสมบัติของพิกเซลเพียงอย่างเดียว ทำให้ไม่ต้องมีการคำนวณมาก และใช้เวลารวดเร็ว ข้อเสีย ไม่สามารถใช้กับภาพที่มีสัญญาณรบกวน และภาพที่มีความสว่าง ไม่คงที่ และผลลัพธ์มักได้ภาพที่ไม่ต่อเนื่อง

  49. Region Oriented Image Segmentation เป็นวิธีการแยกองค์ประกอบของภาพโดยดูจากตำแหน่งของพิกเซลและความเหมือนกันของ คุณสมบัติของพิกเซลภายในพื้นที่ โดยถ้าพิกเซลที่อยู่ติดกันและมีคุณสมบัติเหมือนกันจะถูกจัด ให้เข้ากลุ่มเดียวกัน ข้อดีของการทำเช่นนี้จะได้พื้นที่ที่ต่อเนื่อง ตัวอย่างวิธีการ Region oriented image segmentation 1. Region Growing 2. Region Splitting and Merging P Connected pixels Pixel P and its neighbors

  50. Region Growing Algorithm ISAN-DSP GROUP เริ่มจาก seed pixel ทำการรวมกลุ่มพิกเซลข้าง เคียงที่มีคุณสมบัติเหมือนกันให้พื้นที่โตขึ้นเรื่อยๆ พื้นที่เริ่มขยายตัว การทำงานจะหยุดเมื่อไม่สามารถขยายพื้นที่ออก ไปได้มากกว่านี้ (เมื่อชนกับขอบของวัตถุ)

More Related