Changes between Version 6 and Version 7 of libpipi/research/filters
- Timestamp:
- 08/21/2008 01:39:43 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
libpipi/research/filters
v6 v7 2 2 3 3 = Gaussian filtering = 4 5 Current code:6 * [/browser/libpipi/trunk/pipi/filter/blur.c]7 * [/browser/libpipi/trunk/pipi/filter/convolution_template.h]8 * [/browser/libpipi/trunk/pipi/filter/convolution.c]9 4 10 5 The usual way to create a Gaussian kernel is to evaluate a Gaussian function at the center of each cell: … … 21 16 }}} 22 17 18 === Code === 19 * [/browser/libpipi/trunk/pipi/filter/blur.c] 20 * [/browser/libpipi/trunk/pipi/filter/convolution_template.h] 21 * [/browser/libpipi/trunk/pipi/filter/convolution.c] 22 23 23 = Median filtering = 24 25 Current code:26 * [/browser/libpipi/trunk/pipi/filter/median.c]27 24 28 25 There are several ways to optimise a median filter. … … 31 28 32 29 The second idea is to optimise the median selection. The most naive method is to bubble-sort the neighbourhood values and select the middle point, which has complexity O(n²). Improving on the sort algorithm by using eg. heapsort or quicksort, reduces the complexity to O(n.log2(n)). But since we’re only interested in the median and not in ordering the rest of the data, we can use an efficient median selection algorithm. This operation can be done in fewer than 3n tests ![1] but the practical implementation is extremely complex. 30 31 === Code === 32 * [/browser/libpipi/trunk/pipi/filter/median.c] 33 33 34 34 === Links === … … 42 42 43 43 = Dilate / erode = 44 45 Current code:46 * [/browser/libpipi/trunk/pipi/filter/dilate.c]47 44 48 45 Erosion and dilation already work, but only for nearest pixels. … … 63 60 }}} 64 61 62 === Code === 63 * [/browser/libpipi/trunk/pipi/filter/dilate.c] 64 65 65 === Links === 66 67 66 * [http://ostermiller.org/dilate_and_erode.html Efficiently Implementing Dilate and Erode Image Functions]