Artifact cfc3845f7a3fdc88a052ebcd688c939c47d94010:
- File
demos/mean.tcl
— part of check-in
[cb6683b4d3]
at
2010-10-30 22:12:01
on branch ak-experimental
— New functionality, a mean filter. Like a median filter, except each
pixel is replaced by the mean value of its window.
The implementation uses summed area tables, i.e. integral images, to calculate the sum of pixels in all windows, making it very fast as the summation is independent of the filter radius, i.e. window size. (user: andreask size: 462) [more...]
def op_mean { label {Mean Filter} setup_image { # Create a series of mean-filtered images from the base, # with different kernel radii. set g [crimp convert 2grey8 [base]] # radius => window # 1 - 3x3 # 2 - 5x5 # 3 - 7x7 # 10 - 21x21 # 20 - 41x41 show_slides [list \ $g \ [crimp filter mean $g 1] \ [crimp filter mean $g 2] \ [crimp filter mean $g] \ [crimp filter mean $g 10] \ [crimp filter mean $g 20]] } }