Wednesday, January 12, 2011

Watershed, Inpainting and Mean-Shift Segmentation

Watershed


Watershed Sample

  • The clever part (choosing the markers) is done by human.
  • Put markers at different color regions instead-of / in-additional-to local minima of intensity.
  • Single marker is meaningless.

Watershed Code

  • c_diff() macro hints that the color pixel comparison is based on max of the component differences.
  • 4-connected neighbor flooding


Other Techniques: Mixing segment results with original(color) by adding them together with weights of 0.5 each.


Inpainting


Inpainting Code

  • Uses Fast Marching Method (FMM) for both Telea and NS options to inpaint points going inwards from boundary of the omega region.
  • Telea method inpaints by calculating the weighted sum of neighboring pixels with regard to direction, distance and level.

Inpainting Sample

  • (Observation) Telea introduces less artifacts when the omega region is big comparing to NS, using fruits.jpg as example.


Mean-shift Segmentation
Mean-shift Segmentation Sample

  • Spatial Radius slows down processing the most.
  • Increasing the Pyramid Level helps remove the white speckles (light reflections) off the orange (fruits.jpg). At the same time blurry strip appear at bottom and right edge. The strip thickness increases with pyramid levels.
  • Increasing color radius also helps remove the white speckles, without introducing the edge strips, at the expense of the boundaries between segments (fruits). Those are now more blurry.
  • Too big a spatial radius also distorts the segment boundaries.
  • Output looks similar to output from a median filter

No comments:

Post a Comment