- watershed() implements a marker-based method based on "Color Image Segmentation" by F. Meyer
- Some basic idea of Watershed itself (grayscale, marker-based):
http://cmm.ensmp.fr/~beucher/wtshed.html
http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/KIM1/Seminars/Watershed/index.htm
http://en.wikipedia.org/wiki/Watershed_%28image_processing%29#Meyer.27s_flooding_algorithm - Flood (expand) the catchment-basin from each marker. Watersheds are boundaries at which flooding ends (local maxima). It will never spill over to another basin.
- Implies putting markers at local minima (significant ones) for grayscale images.
- Without markers: solve over-segmentation
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
- Wikipedia: http://en.wikipedia.org/wiki/Inpainting
- Usage:
- Restore corrupted data or intentionally blur parts of the image (like faces on Google Street View?)
- Remove caption from video/image.
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