This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via b0ae037dbd8678fe2eade3de055b7d120b6dc8d9 (commit) via 6983b8143445758e54e41dfa0ae8c779324aa1ed (commit) from 4da03cd71c2d22bc18b3d33e8a804de206beb57a (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/b0ae037dbd8678fe2eade3de055b7d120b6dc...
commit b0ae037dbd8678fe2eade3de055b7d120b6dc8d9 Author: Cyril Hrubis metan@ucw.cz Date: Fri Sep 27 23:16:20 2013 +0200
doc: filters: Further example generator changes
* Apply filter function on small image directly (do not use resized big image)
* Add edge_sharpening filter
* change filters and python filters docs accordingly
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/doc/Makefile b/doc/Makefile index 3f3ebd5..8c2aca6 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -31,8 +31,11 @@ $(PAGES): asciidoc.conf # # Dependencies # -filters_python.html: images/blur/images.txt images/median/images.txt -filters.html: images/median/images.txt +IMG_INCLUDES=images/blur/images.txt images/median/images.txt+ images/edge_sharpening/images.txt + +filters_python.html: $(IMG_INCLUDES) +filters.html: $(IMG_INCLUDES)
# # Check if we have all the needed tools diff --git a/doc/filters.txt b/doc/filters.txt index 9c8f681..c7ed191 100644 --- a/doc/filters.txt +++ b/doc/filters.txt @@ -813,6 +813,9 @@ GP_Context *GP_FilterEdgeSharpeningAlloc(const GP_Context *src, float w, Laplace based edge sharpening filter, subtracts weighted second derivative from the original image.
+The w paramerter is multiplicative weight applied on the second derivative. +Reasonable results are when the parameter is between '0.1' and '1'. + [latex, laplacian_edge_sharpening.png, 140] ------------------------------------------------------------------------------- [ @@ -820,19 +823,7 @@ O(x,y) = I(x,y) - w * I''(x,y) ] -------------------------------------------------------------------------------
-.Original Image; Edge Sharpening w=0.1, w=0.3, w=0.5 -image:images/dither/lenna_small.png[ - "Original Image", - link="images/dither/lenna.png"] -image:images/edge_sharpening/lenna_small_w_0_1.png[ - "Edge Sharpening w=0.1", - link="images/edge_sharpening/lenna_w_0_1.png"] -image:images/edge_sharpening/lenna_small_w_0_3.png[ - "Edge Sharpening w=0.5", - link="images/edge_sharpening/lenna_w_0_3.png"] -image:images/edge_sharpening/lenna_small_w_0_5.png[ - "Edge Sharpening w=0.5", - link="images/edge_sharpening/lenna_w_0_5.png"] +include::images/edge_sharpening/images.txt[]
Gaussian Blur ^^^^^^^^^^^^^ @@ -876,6 +867,8 @@ The sigma values can be set for vertical and horizontal direction independently which may be useful when Gaussian blur is used as a low pass filter before image is resampled non proportionally.
+include::images/blur/images.txt[] + Interpolation filters ~~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/filters_python.txt b/doc/filters_python.txt index 7de21f2..f29cb44 100644 --- a/doc/filters_python.txt +++ b/doc/filters_python.txt @@ -11,6 +11,38 @@ image is passed automatically as a first parameter. If filter has been aborted from callback 'OSError' with 'errno' set to 'ECANCELED' is raised.
+ +Laplacian Edge Sharpening +~~~~~~~~~~~~~~~~~~~~~~~~~ + +[source,python] +------------------------------------------------------------------------------- +import gfxprim.core as core +import gfxprim.filters as filters + + # Does in-place Edge Sharpening + filters.EdgeSharpening(img, img, 0.2, callback=None) + + # Returns newly allocated sharpened image + res = img.filters.EdgeSharpening(0.2, callback=None) + +------------------------------------------------------------------------------- + +Laplace based edge sharpening filter, subtracts weighted second derivative +from the original image. + +The float paramerter is multiplicative weight applied on the second +derivative. Reasonable results are when the parameter is between '0.1' and +'1'. + +//// +Generated in filters.txt +//// +image:laplacian_edge_sharpening.png["Laplacian Edge Sharpening"] + +include::images/edge_sharpening/images.txt[] + + Blurs ~~~~~
diff --git a/doc/images/Makefile b/doc/images/Makefile index 419e864..adc0fe2 100644 --- a/doc/images/Makefile +++ b/doc/images/Makefile @@ -1,11 +1,11 @@ -SUBDIRS=blur median +SUBDIRS=blur median edge_sharpening
TARGETS=$(addsuffix /images.txt,$(SUBDIRS)) IMGS=$(addsuffix /*.png,$(SUBDIRS))
all: $(TARGETS)
-$(TARGETS): +$(TARGETS): ./regen.py @./regen.py
clean: diff --git a/doc/images/blur/lenna_small_0_4.png b/doc/images/blur/lenna_small_0_4.png index ad3e5a2..942601b 100644 Binary files a/doc/images/blur/lenna_small_0_4.png and b/doc/images/blur/lenna_small_0_4.png differ diff --git a/doc/images/blur/lenna_small_10_10.png b/doc/images/blur/lenna_small_10_10.png index 63493dd..6c899cf 100644 Binary files a/doc/images/blur/lenna_small_10_10.png and b/doc/images/blur/lenna_small_10_10.png differ diff --git a/doc/images/blur/lenna_small_2_2.png b/doc/images/blur/lenna_small_2_2.png index ad82e72..8a00c0c 100644 Binary files a/doc/images/blur/lenna_small_2_2.png and b/doc/images/blur/lenna_small_2_2.png differ diff --git a/doc/images/blur/lenna_small_4_0.png b/doc/images/blur/lenna_small_4_0.png index 9fe4a10..fbfd683 100644 Binary files a/doc/images/blur/lenna_small_4_0.png and b/doc/images/blur/lenna_small_4_0.png differ diff --git a/doc/images/blur/lenna_small_4_4.png b/doc/images/blur/lenna_small_4_4.png index 49c0140..1da3e30 100644 Binary files a/doc/images/blur/lenna_small_4_4.png and b/doc/images/blur/lenna_small_4_4.png differ diff --git a/doc/images/edge_sharpening/images.txt b/doc/images/edge_sharpening/images.txt new file mode 100644 index 0000000..8066f2e --- /dev/null +++ b/doc/images/edge_sharpening/images.txt @@ -0,0 +1,20 @@ +.Example Images: Original Image; Edge Sharpening 0.1, 0.3, 0.5, 0.8, 1.0 +image:images/orig/lenna_small.png[ + "Original Image", + link="images/orig/lenna.png"] +image:images/edge_sharpening/lenna_small_0.1.png[ + "Edge Sharpening 0.1", + link="images/edge_sharpening/lenna_0.1.png"] +image:images/edge_sharpening/lenna_small_0.3.png[ + "Edge Sharpening 0.3", + link="images/edge_sharpening/lenna_0.3.png"] +image:images/edge_sharpening/lenna_small_0.5.png[ + "Edge Sharpening 0.5", + link="images/edge_sharpening/lenna_0.5.png"] +image:images/edge_sharpening/lenna_small_0.8.png[ + "Edge Sharpening 0.8", + link="images/edge_sharpening/lenna_0.8.png"] +image:images/edge_sharpening/lenna_small_1.0.png[ + "Edge Sharpening 1.0", + link="images/edge_sharpening/lenna_1.0.png"] + diff --git a/doc/images/edge_sharpening/lenna_0.1.png b/doc/images/edge_sharpening/lenna_0.1.png new file mode 100644 index 0000000..bc7a3d0 Binary files /dev/null and b/doc/images/edge_sharpening/lenna_0.1.png differ diff --git a/doc/images/edge_sharpening/lenna_0.3.png b/doc/images/edge_sharpening/lenna_0.3.png new file mode 100644 index 0000000..29dd3ae Binary files /dev/null and b/doc/images/edge_sharpening/lenna_0.3.png differ diff --git a/doc/images/edge_sharpening/lenna_0.5.png b/doc/images/edge_sharpening/lenna_0.5.png new file mode 100644 index 0000000..0d2167f Binary files /dev/null and b/doc/images/edge_sharpening/lenna_0.5.png differ diff --git a/doc/images/edge_sharpening/lenna_0.8.png b/doc/images/edge_sharpening/lenna_0.8.png new file mode 100644 index 0000000..aeb4f57 Binary files /dev/null and b/doc/images/edge_sharpening/lenna_0.8.png differ diff --git a/doc/images/edge_sharpening/lenna_1.0.png b/doc/images/edge_sharpening/lenna_1.0.png new file mode 100644 index 0000000..bc03132 Binary files /dev/null and b/doc/images/edge_sharpening/lenna_1.0.png differ diff --git a/doc/images/edge_sharpening/lenna_small_0.1.png b/doc/images/edge_sharpening/lenna_small_0.1.png new file mode 100644 index 0000000..38516e9 Binary files /dev/null and b/doc/images/edge_sharpening/lenna_small_0.1.png differ diff --git a/doc/images/edge_sharpening/lenna_small_0.3.png b/doc/images/edge_sharpening/lenna_small_0.3.png new file mode 100644 index 0000000..8752f59 Binary files /dev/null and b/doc/images/edge_sharpening/lenna_small_0.3.png differ diff --git a/doc/images/edge_sharpening/lenna_small_0.5.png b/doc/images/edge_sharpening/lenna_small_0.5.png new file mode 100644 index 0000000..82b2804 Binary files /dev/null and b/doc/images/edge_sharpening/lenna_small_0.5.png differ diff --git a/doc/images/edge_sharpening/lenna_small_0.8.png b/doc/images/edge_sharpening/lenna_small_0.8.png new file mode 100644 index 0000000..0c6908b Binary files /dev/null and b/doc/images/edge_sharpening/lenna_small_0.8.png differ diff --git a/doc/images/edge_sharpening/lenna_small_1.0.png b/doc/images/edge_sharpening/lenna_small_1.0.png new file mode 100644 index 0000000..de57fcf Binary files /dev/null and b/doc/images/edge_sharpening/lenna_small_1.0.png differ diff --git a/doc/images/edge_sharpening/lenna_small_w_0_1.png b/doc/images/edge_sharpening/lenna_small_w_0_1.png deleted file mode 100644 index 848ccea..0000000 Binary files a/doc/images/edge_sharpening/lenna_small_w_0_1.png and /dev/null differ diff --git a/doc/images/edge_sharpening/lenna_small_w_0_3.png b/doc/images/edge_sharpening/lenna_small_w_0_3.png deleted file mode 100644 index a311e36..0000000 Binary files a/doc/images/edge_sharpening/lenna_small_w_0_3.png and /dev/null differ diff --git a/doc/images/edge_sharpening/lenna_small_w_0_5.png b/doc/images/edge_sharpening/lenna_small_w_0_5.png deleted file mode 100644 index 46891b2..0000000 Binary files a/doc/images/edge_sharpening/lenna_small_w_0_5.png and /dev/null differ diff --git a/doc/images/edge_sharpening/lenna_w_0_1.png b/doc/images/edge_sharpening/lenna_w_0_1.png deleted file mode 100644 index 405291f..0000000 Binary files a/doc/images/edge_sharpening/lenna_w_0_1.png and /dev/null differ diff --git a/doc/images/edge_sharpening/lenna_w_0_3.png b/doc/images/edge_sharpening/lenna_w_0_3.png deleted file mode 100644 index 4417327..0000000 Binary files a/doc/images/edge_sharpening/lenna_w_0_3.png and /dev/null differ diff --git a/doc/images/edge_sharpening/lenna_w_0_5.png b/doc/images/edge_sharpening/lenna_w_0_5.png deleted file mode 100644 index 0a9e7c9..0000000 Binary files a/doc/images/edge_sharpening/lenna_w_0_5.png and /dev/null differ diff --git a/doc/images/median/lenna_small_12_12.png b/doc/images/median/lenna_small_12_12.png index 5663569..a727df5 100644 Binary files a/doc/images/median/lenna_small_12_12.png and b/doc/images/median/lenna_small_12_12.png differ diff --git a/doc/images/median/lenna_small_3_3.png b/doc/images/median/lenna_small_3_3.png index 1849e60..6ce9247 100644 Binary files a/doc/images/median/lenna_small_3_3.png and b/doc/images/median/lenna_small_3_3.png differ diff --git a/doc/images/median/lenna_small_5_5.png b/doc/images/median/lenna_small_5_5.png index 992dbe9..8b7a30f 100644 Binary files a/doc/images/median/lenna_small_5_5.png and b/doc/images/median/lenna_small_5_5.png differ diff --git a/doc/images/median/lenna_small_7_7.png b/doc/images/median/lenna_small_7_7.png index 1b92359..8c23717 100644 Binary files a/doc/images/median/lenna_small_7_7.png and b/doc/images/median/lenna_small_7_7.png differ diff --git a/doc/images/median/lenna_small_9_9.png b/doc/images/median/lenna_small_9_9.png index af39ba1..b749a8c 100644 Binary files a/doc/images/median/lenna_small_9_9.png and b/doc/images/median/lenna_small_9_9.png differ diff --git a/doc/images/regen.py b/doc/images/regen.py index 21cfd70..cc0e944 100755 --- a/doc/images/regen.py +++ b/doc/images/regen.py @@ -52,7 +52,7 @@ class ImgGen: res = func(self.img, *i) res.loaders.Save('../' + fname)
- res = res.filters.ResizeAlloc(self.img_small.w, self.img_small.h, 2) + res = func(self.img_small, *i) res.loaders.Save('../' + fname_small)
self.write_asciidoc_tail() @@ -68,5 +68,9 @@ def main(): [[3, 3], [5, 5], [7, 7], [9, 9], [12, 12]], 'images/median/', 'Median')
+ imggen.gen(filters.EdgeSharpeningAlloc, + [[0.1], [0.3], [0.5], [0.8], [1.0]], + 'images/edge_sharpening/', 'Edge Sharpening') + if __name__ == '__main__': main()
http://repo.or.cz/w/gfxprim.git/commit/6983b8143445758e54e41dfa0ae8c779324aa...
commit 6983b8143445758e54e41dfa0ae8c779324aa1ed Author: Cyril Hrubis metan@ucw.cz Date: Fri Sep 27 22:56:08 2013 +0200
doc: filters: Rewrite the example image generator
The example image generator is now generic, yay!
* generate median images automatically
* update the parent asciidoc docs accordingly
* update python filters docs
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/doc/Makefile b/doc/Makefile index dee519e..3f3ebd5 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -31,8 +31,8 @@ $(PAGES): asciidoc.conf # # Dependencies # -filters_python.html: images/blur/images.txt - +filters_python.html: images/blur/images.txt images/median/images.txt +filters.html: images/median/images.txt
# # Check if we have all the needed tools diff --git a/doc/filters.txt b/doc/filters.txt index ef6b123..9c8f681 100644 --- a/doc/filters.txt +++ b/doc/filters.txt @@ -946,27 +946,11 @@ GP_Context *GP_FilterMedianAlloc(const GP_Context *src, GP_ProgressCallback *callback); -------------------------------------------------------------------------------
-Constant time median filters (the computational complexity is independent of +Constant time median filter (the computational complexity is independent of radius size).
The xmed and ymed are radius values for x and y. The algorithm uses xmed respectively ymed pixel neighbors from each side so the result is median of rectangle of 2 * xmed + 1 x 2 * ymed + 1 pixels.
-.Original Image; Median 3x3, 5x5, 7x7, 9x9 -image:images/dither/lenna_small.png[ - "Original Image", - link="images/dither/lenna.png"] -image:images/median/lenna_small_med_3_3.png[ - "Median 3x3", - link="images/median/lenna_med_3_3.png"] -image:images/median/lenna_small_med_5_5.png[ - "Median 5x5", - link="images/median/lenna_med_5_5.png"] -image:images/median/lenna_small_med_7_7.png[ - "Median 7x7", - link="images/median/lenna_med_7_7.png"] -image:images/median/lenna_small_med_9_9.png[ - "Median 9x9", - link="images/median/lenna_med_9_9.png"] - +include::images/median/images.txt[] diff --git a/doc/filters_python.txt b/doc/filters_python.txt index 324f160..7de21f2 100644 --- a/doc/filters_python.txt +++ b/doc/filters_python.txt @@ -8,6 +8,9 @@ The filter functions could be called directly as +filters.Foo(img, ..)+ or from submodule as +img.filters.Foo(..)+. Note that in the second case the image is passed automatically as a first parameter.
+If filter has been aborted from callback 'OSError' with 'errno' set to +'ECANCELED' is raised. + Blurs ~~~~~
@@ -56,3 +59,27 @@ For more information and example images see link:filters_dithering.html[C dithering documentation].
TIP: See link:example_py_dithering.html[dithering example]. + +Median +~~~~~~ + +[source,python] +------------------------------------------------------------------------------- +import gfxprim.core as core +import gfxprim.filters as filters + + # Returns result of median filter over a rectangle of a side 2 * 3 + 1 pixels + res = img.filters.MedianAlloc(3, 3, callback=None) + + # Applies median filter in-place + img.filters.Median(3, 3, callback=None) +------------------------------------------------------------------------------- + +Constant time median filter (the computational complexity is independent of +radius size). + +The parameters are radius values for x and y. The algorithm uses x +respectively y pixel neighbors from each side so the result is median of +rectangle of +2 * x + 1+ x +2 * y + 1+ pixels. + +include::images/median/images.txt[] diff --git a/doc/images/Makefile b/doc/images/Makefile new file mode 100644 index 0000000..419e864 --- /dev/null +++ b/doc/images/Makefile @@ -0,0 +1,12 @@ +SUBDIRS=blur median + +TARGETS=$(addsuffix /images.txt,$(SUBDIRS)) +IMGS=$(addsuffix /*.png,$(SUBDIRS)) + +all: $(TARGETS) + +$(TARGETS): + @./regen.py + +clean: + rm -f $(TARGETS) $(IMGS) diff --git a/doc/images/blur/Makefile b/doc/images/blur/Makefile deleted file mode 100644 index 4c642ec..0000000 --- a/doc/images/blur/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: images.txt - -images.txt: regen.py - @./regen.py - -clean: - rm -f *.png images.txt diff --git a/doc/images/blur/images.txt b/doc/images/blur/images.txt index b9d7434..74697da 100644 --- a/doc/images/blur/images.txt +++ b/doc/images/blur/images.txt @@ -1,17 +1,20 @@ -.Example Images: Original Image; Gaussian Blur 2 2, 0 4, 4 0, 10 10 +.Example Images: Original Image; Gaussian Blur 2 2, 0 4, 4 0, 4 4, 10 10 image:images/orig/lenna_small.png[ "Original Image", link="images/orig/lenna.png"] image:images/blur/lenna_small_2_2.png[ - "Gaussian Blur x_sig=2 y_sig=2", + "Gaussian Blur 2 2", link="images/blur/lenna_2_2.png"] image:images/blur/lenna_small_0_4.png[ - "Gaussian Blur x_sig=4 y_sig=4", + "Gaussian Blur 0 4", link="images/blur/lenna_0_4.png"] image:images/blur/lenna_small_4_0.png[ - "Gaussian Blur x_sig=0 y_sig=0", + "Gaussian Blur 4 0", link="images/blur/lenna_4_0.png"] +image:images/blur/lenna_small_4_4.png[ + "Gaussian Blur 4 4", + link="images/blur/lenna_4_4.png"] image:images/blur/lenna_small_10_10.png[ - "Gaussian Blur x_sig=10 y_sig=10", + "Gaussian Blur 10 10", link="images/blur/lenna_10_10.png"]
diff --git a/doc/images/blur/lenna_4_4.png b/doc/images/blur/lenna_4_4.png new file mode 100644 index 0000000..581e749 Binary files /dev/null and b/doc/images/blur/lenna_4_4.png differ diff --git a/doc/images/blur/lenna_small_4_4.png b/doc/images/blur/lenna_small_4_4.png new file mode 100644 index 0000000..49c0140 Binary files /dev/null and b/doc/images/blur/lenna_small_4_4.png differ diff --git a/doc/images/blur/regen.py b/doc/images/blur/regen.py deleted file mode 100755 index 13e9d39..0000000 --- a/doc/images/blur/regen.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python - -import sys - -import gfxprim.core as core -import gfxprim.loaders as loaders -import gfxprim.filters as filters - -orig_path='images/orig/' -self_path='images/blur/' - -def write_asciidoc_head(f): - f.write('.Example Images: Original Image; Gaussian Blur 2 2, 0 4, 4 0, 10 10n') - f.write('image:' + orig_path + 'lenna_small.png[n') - f.write('t"Original Image",n') - f.write('tlink="' + orig_path + 'lenna.png"]n') - -def write_img_asciidoc(f, name, fname): - f.write('image:' + self_path + 'lenna_small_' + fname + '.png[n') - f.write('t"' + name + '",n') - f.write('tlink="' + self_path + 'lenna_' + fname + '.png"]n') - -def write_asciidoc_tail(f): - f.write('n') - -def gen_blur(f, img, img_small, x_sigma, y_sigma): - print("Generating Blur %s %s" % (x_sigma, y_sigma)) - name = '%s_%s' % (x_sigma, y_sigma) - res = img.filters.GaussianBlurAlloc(x_sigma, y_sigma); - res.loaders.Save('lenna_' + name + '.png') - res = res.filters.ResizeAlloc(img_small.w, img_small.h, 2) - res.loaders.Save('lenna_small_' + name + '.png') - write_img_asciidoc(f, 'Gaussian Blur x_sig=%s y_sig=%s' % (y_sigma, y_sigma), name) - -def main(): - lenna = loaders.Load('../../' + orig_path + 'lenna.png') - lenna_small = loaders.Load('../../' + orig_path + 'lenna_small.png') - - f = open('images.txt', 'w') - - write_asciidoc_head(f) - - gen_blur(f, lenna, lenna_small, 2, 2) - gen_blur(f, lenna, lenna_small, 0, 4) - gen_blur(f, lenna, lenna_small, 4, 0) - gen_blur(f, lenna, lenna_small, 10, 10) - - write_asciidoc_tail(f) - - f.close() - -if __name__ == '__main__': - main() diff --git a/doc/images/median/images.txt b/doc/images/median/images.txt new file mode 100644 index 0000000..968ef8a --- /dev/null +++ b/doc/images/median/images.txt @@ -0,0 +1,20 @@ +.Example Images: Original Image; Median 3 3, 5 5, 7 7, 9 9, 12 12 +image:images/orig/lenna_small.png[ + "Original Image", + link="images/orig/lenna.png"] +image:images/median/lenna_small_3_3.png[ + "Median 3 3", + link="images/median/lenna_3_3.png"] +image:images/median/lenna_small_5_5.png[ + "Median 5 5", + link="images/median/lenna_5_5.png"] +image:images/median/lenna_small_7_7.png[ + "Median 7 7", + link="images/median/lenna_7_7.png"] +image:images/median/lenna_small_9_9.png[ + "Median 9 9", + link="images/median/lenna_9_9.png"] +image:images/median/lenna_small_12_12.png[ + "Median 12 12", + link="images/median/lenna_12_12.png"] + diff --git a/doc/images/median/lenna_12_12.png b/doc/images/median/lenna_12_12.png new file mode 100644 index 0000000..550b8fd Binary files /dev/null and b/doc/images/median/lenna_12_12.png differ diff --git a/doc/images/median/lenna_5_5.png b/doc/images/median/lenna_5_5.png new file mode 100644 index 0000000..ae5830a Binary files /dev/null and b/doc/images/median/lenna_5_5.png differ diff --git a/doc/images/median/lenna_7_7.png b/doc/images/median/lenna_7_7.png new file mode 100644 index 0000000..37e7d3e Binary files /dev/null and b/doc/images/median/lenna_7_7.png differ diff --git a/doc/images/median/lenna_9_9.png b/doc/images/median/lenna_9_9.png new file mode 100644 index 0000000..ce90ae1 Binary files /dev/null and b/doc/images/median/lenna_9_9.png differ diff --git a/doc/images/median/lenna_med_3_3.png b/doc/images/median/lenna_med_3_3.png deleted file mode 100644 index b1263d7..0000000 Binary files a/doc/images/median/lenna_med_3_3.png and /dev/null differ diff --git a/doc/images/median/lenna_med_5_5.png b/doc/images/median/lenna_med_5_5.png deleted file mode 100644 index 3a70498..0000000 Binary files a/doc/images/median/lenna_med_5_5.png and /dev/null differ diff --git a/doc/images/median/lenna_med_9_9.png b/doc/images/median/lenna_med_9_9.png deleted file mode 100644 index 94a62f1..0000000 Binary files a/doc/images/median/lenna_med_9_9.png and /dev/null differ diff --git a/doc/images/median/lenna_small_12_12.png b/doc/images/median/lenna_small_12_12.png new file mode 100644 index 0000000..5663569 Binary files /dev/null and b/doc/images/median/lenna_small_12_12.png differ diff --git a/doc/images/median/lenna_small_3_3.png b/doc/images/median/lenna_small_3_3.png new file mode 100644 index 0000000..1849e60 Binary files /dev/null and b/doc/images/median/lenna_small_3_3.png differ diff --git a/doc/images/median/lenna_small_5_5.png b/doc/images/median/lenna_small_5_5.png new file mode 100644 index 0000000..992dbe9 Binary files /dev/null and b/doc/images/median/lenna_small_5_5.png differ diff --git a/doc/images/median/lenna_small_7_7.png b/doc/images/median/lenna_small_7_7.png new file mode 100644 index 0000000..1b92359 Binary files /dev/null and b/doc/images/median/lenna_small_7_7.png differ diff --git a/doc/images/median/lenna_small_9_9.png b/doc/images/median/lenna_small_9_9.png new file mode 100644 index 0000000..af39ba1 Binary files /dev/null and b/doc/images/median/lenna_small_9_9.png differ diff --git a/doc/images/median/lenna_small_med_3_3.png b/doc/images/median/lenna_small_med_3_3.png deleted file mode 100644 index c8703bc..0000000 Binary files a/doc/images/median/lenna_small_med_3_3.png and /dev/null differ diff --git a/doc/images/median/lenna_small_med_5_5.png b/doc/images/median/lenna_small_med_5_5.png deleted file mode 100644 index 8dbb616..0000000 Binary files a/doc/images/median/lenna_small_med_5_5.png and /dev/null differ diff --git a/doc/images/median/lenna_small_med_7_7.png b/doc/images/median/lenna_small_med_7_7.png deleted file mode 100644 index e06ddf5..0000000 Binary files a/doc/images/median/lenna_small_med_7_7.png and /dev/null differ diff --git a/doc/images/median/lenna_small_med_9_9.png b/doc/images/median/lenna_small_med_9_9.png deleted file mode 100644 index 2fa7997..0000000 Binary files a/doc/images/median/lenna_small_med_9_9.png and /dev/null differ diff --git a/doc/images/regen.py b/doc/images/regen.py new file mode 100755 index 0000000..21cfd70 --- /dev/null +++ b/doc/images/regen.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python + +import sys + +import gfxprim.core as core +import gfxprim.loaders as loaders +import gfxprim.filters as filters + +class ImgGen: + def __init__(self, orig_path): + self.orig_path = orig_path + self.img = loaders.Load('../' + orig_path + 'lenna.png') + self.img_small = loaders.Load('../' + orig_path + 'lenna_small.png') + + + def write_asciidoc_head(self, dst_path, heading): + self.f = open('../' + dst_path + 'images.txt', 'w') + f = self.f + f.write('.Example Images: Original Image; ' + heading + 'n') + f.write('image:' + self.orig_path + 'lenna_small.png[n') + f.write('t"Original Image",n') + f.write('tlink="' + self.orig_path + 'lenna.png"]n') + + def write_img_asciidoc(self, desc, fname, fname_small): + f = self.f + f.write('image:' + fname_small + '[n') + f.write('t"' + desc + '",n') + f.write('tlink="' + fname + '"]n') + + def write_asciidoc_tail(self): + self.f.write('n') + self.f.close() + + def gen(self, func, func_params_arr, dst_path, func_name): + + print("Generating " + func_name) + + self.write_asciidoc_head(dst_path, func_name + ' ' + + ', '.join(map(lambda x: ' '.join([str(i) for i in x]), func_params_arr))) + + for i in func_params_arr: + str_i = [str(x) for x in i] + desc = func_name + ' ' + ' '.join(str_i) + + print(' > ' + desc) + + fname = dst_path + 'lenna_' + '_'.join(str_i) + '.png' + fname_small = dst_path + 'lenna_small_' + '_'.join(str_i) + '.png' + + self.write_img_asciidoc(desc, fname, fname_small) + + res = func(self.img, *i) + res.loaders.Save('../' + fname) + + res = res.filters.ResizeAlloc(self.img_small.w, self.img_small.h, 2) + res.loaders.Save('../' + fname_small) + + self.write_asciidoc_tail() + +def main(): + imggen = ImgGen('images/orig/') + + imggen.gen(filters.GaussianBlurAlloc, + [[2, 2], [0, 4], [4, 0], [4, 4], [10, 10]], + 'images/blur/', 'Gaussian Blur') + + imggen.gen(filters.MedianAlloc, + [[3, 3], [5, 5], [7, 7], [9, 9], [12, 12]], + 'images/median/', 'Median') + +if __name__ == '__main__': + main()
-----------------------------------------------------------------------
Summary of changes: doc/Makefile | 5 +- doc/filters.txt | 39 ++-------- doc/filters_python.txt | 59 +++++++++++++++ doc/images/Makefile | 12 +++ doc/images/blur/Makefile | 7 -- doc/images/blur/images.txt | 13 ++-- doc/images/blur/lenna_4_4.png | Bin 0 -> 178703 bytes doc/images/blur/lenna_small_0_4.png | Bin 25526 -> 19492 bytes doc/images/blur/lenna_small_10_10.png | Bin 17520 -> 10638 bytes doc/images/blur/lenna_small_2_2.png | Bin 26436 -> 18849 bytes doc/images/blur/lenna_small_4_0.png | Bin 25437 -> 18565 bytes doc/images/blur/lenna_small_4_4.png | Bin 0 -> 14816 bytes doc/images/blur/regen.py | 53 -------------- doc/images/edge_sharpening/images.txt | 20 +++++ doc/images/edge_sharpening/lenna_0.1.png | Bin 0 -> 429050 bytes doc/images/edge_sharpening/lenna_0.3.png | Bin 0 -> 475903 bytes doc/images/edge_sharpening/lenna_0.5.png | Bin 0 -> 512405 bytes doc/images/edge_sharpening/lenna_0.8.png | Bin 0 -> 555001 bytes doc/images/edge_sharpening/lenna_1.0.png | Bin 0 -> 576361 bytes doc/images/edge_sharpening/lenna_small_0.1.png | Bin 0 -> 34905 bytes doc/images/edge_sharpening/lenna_small_0.3.png | Bin 0 -> 38697 bytes doc/images/edge_sharpening/lenna_small_0.5.png | Bin 0 -> 40867 bytes doc/images/edge_sharpening/lenna_small_0.8.png | Bin 0 -> 42885 bytes doc/images/edge_sharpening/lenna_small_1.0.png | Bin 0 -> 43692 bytes doc/images/edge_sharpening/lenna_small_w_0_1.png | Bin 127188 -> 0 bytes doc/images/edge_sharpening/lenna_small_w_0_3.png | Bin 143643 -> 0 bytes doc/images/edge_sharpening/lenna_small_w_0_5.png | Bin 156274 -> 0 bytes doc/images/edge_sharpening/lenna_w_0_1.png | Bin 429215 -> 0 bytes doc/images/edge_sharpening/lenna_w_0_3.png | Bin 476119 -> 0 bytes doc/images/edge_sharpening/lenna_w_0_5.png | Bin 514664 -> 0 bytes doc/images/median/images.txt | 20 +++++ doc/images/median/lenna_12_12.png | Bin 0 -> 174531 bytes .../median/{lenna_med_7_7.png => lenna_3_3.png} | Bin 259580 -> 259580 bytes doc/images/median/lenna_5_5.png | Bin 0 -> 224934 bytes doc/images/median/lenna_7_7.png | Bin 0 -> 204463 bytes doc/images/median/lenna_9_9.png | Bin 0 -> 190419 bytes doc/images/median/lenna_med_3_3.png | Bin 337110 -> 0 bytes doc/images/median/lenna_med_5_5.png | Bin 289966 -> 0 bytes doc/images/median/lenna_med_9_9.png | Bin 239185 -> 0 bytes doc/images/median/lenna_small_12_12.png | Bin 0 -> 15174 bytes doc/images/median/lenna_small_3_3.png | Bin 0 -> 20584 bytes doc/images/median/lenna_small_5_5.png | Bin 0 -> 18652 bytes doc/images/median/lenna_small_7_7.png | Bin 0 -> 17299 bytes doc/images/median/lenna_small_9_9.png | Bin 0 -> 16276 bytes doc/images/median/lenna_small_med_3_3.png | Bin 90434 -> 0 bytes doc/images/median/lenna_small_med_5_5.png | Bin 78931 -> 0 bytes doc/images/median/lenna_small_med_7_7.png | Bin 72126 -> 0 bytes doc/images/median/lenna_small_med_9_9.png | Bin 67725 -> 0 bytes doc/images/regen.py | 76 ++++++++++++++++++++ 49 files changed, 207 insertions(+), 97 deletions(-) create mode 100644 doc/images/Makefile delete mode 100644 doc/images/blur/Makefile create mode 100644 doc/images/blur/lenna_4_4.png create mode 100644 doc/images/blur/lenna_small_4_4.png delete mode 100755 doc/images/blur/regen.py create mode 100644 doc/images/edge_sharpening/images.txt create mode 100644 doc/images/edge_sharpening/lenna_0.1.png create mode 100644 doc/images/edge_sharpening/lenna_0.3.png create mode 100644 doc/images/edge_sharpening/lenna_0.5.png create mode 100644 doc/images/edge_sharpening/lenna_0.8.png create mode 100644 doc/images/edge_sharpening/lenna_1.0.png create mode 100644 doc/images/edge_sharpening/lenna_small_0.1.png create mode 100644 doc/images/edge_sharpening/lenna_small_0.3.png create mode 100644 doc/images/edge_sharpening/lenna_small_0.5.png create mode 100644 doc/images/edge_sharpening/lenna_small_0.8.png create mode 100644 doc/images/edge_sharpening/lenna_small_1.0.png delete mode 100644 doc/images/edge_sharpening/lenna_small_w_0_1.png delete mode 100644 doc/images/edge_sharpening/lenna_small_w_0_3.png delete mode 100644 doc/images/edge_sharpening/lenna_small_w_0_5.png delete mode 100644 doc/images/edge_sharpening/lenna_w_0_1.png delete mode 100644 doc/images/edge_sharpening/lenna_w_0_3.png delete mode 100644 doc/images/edge_sharpening/lenna_w_0_5.png create mode 100644 doc/images/median/images.txt create mode 100644 doc/images/median/lenna_12_12.png rename doc/images/median/{lenna_med_7_7.png => lenna_3_3.png} (100%) create mode 100644 doc/images/median/lenna_5_5.png create mode 100644 doc/images/median/lenna_7_7.png create mode 100644 doc/images/median/lenna_9_9.png delete mode 100644 doc/images/median/lenna_med_3_3.png delete mode 100644 doc/images/median/lenna_med_5_5.png delete mode 100644 doc/images/median/lenna_med_9_9.png create mode 100644 doc/images/median/lenna_small_12_12.png create mode 100644 doc/images/median/lenna_small_3_3.png create mode 100644 doc/images/median/lenna_small_5_5.png create mode 100644 doc/images/median/lenna_small_7_7.png create mode 100644 doc/images/median/lenna_small_9_9.png delete mode 100644 doc/images/median/lenna_small_med_3_3.png delete mode 100644 doc/images/median/lenna_small_med_5_5.png delete mode 100644 doc/images/median/lenna_small_med_7_7.png delete mode 100644 doc/images/median/lenna_small_med_9_9.png create mode 100755 doc/images/regen.py
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.