- watershed() implements a marker-based method based on "Color Image Segmentation" by F. Meyer
- Some basic idea of Watershed itself (grayscale, marker-based):
- 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
- 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.
- 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.
- Wikipedia: http://en.wikipedia.org/wiki/Inpainting
- Restore corrupted data or intentionally blur parts of the image (like faces on Google Street View?)
- Remove caption from video/image.
- 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.
- (Observation) Telea introduces less artifacts when the omega region is big comparing to NS, using fruits.jpg as example.
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