better peak extraction
authorTomas Musil <tomik.musil@gmail.com>
Tue, 25 Dec 2012 21:12:30 +0000 (22:12 +0100)
committerTomas Musil <tomik.musil@gmail.com>
Tue, 25 Dec 2012 21:12:30 +0000 (22:12 +0100)
linef.py
makefile
pso.py

index dae08e3..4e35781 100644 (file)
--- a/linef.py
+++ b/linef.py
@@ -43,11 +43,11 @@ def find_lines(image, show_all, do_something, verbose):
     if show_all:
         do_something(im_hough, "hough transform")
 
-    im_hough = filters.peaks(im_hough)
-    if show_all:
-        do_something(im_hough, "peak extraction")
+   # im_hough = filters.peaks(im_hough)
+   # if show_all:
+   #     do_something(im_hough, "peak extraction")
                
-    im_h2 = filters.high_pass(im_hough, 120)
+    im_h2 = filters.high_pass(im_hough, 96)
     if show_all:
         do_something(im_h2, "second high pass filters")
 
index db25815..0192f0c 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,4 +1,4 @@
 install: pcf.c
-       gcc -shared -I/usr/include/python2.7/ -lpython2.7 -o pcf.so pcf.c
+       gcc -Ofast -shared -I/usr/include/python2.7/ -lpython2.7 -o pcf.so pcf.c
 clean:
        rm -f pcf.so
diff --git a/pso.py b/pso.py
index 9149167..c30bcfd 100644 (file)
--- a/pso.py
+++ b/pso.py
@@ -26,7 +26,7 @@ def move(particle, omega, phi_p, phi_g, v_max, global_best, func_d):
 
 def optimize(dimension, boundary, function_d, n_parts, n_turns):
     pool = multiprocessing.Pool(None)
-    v_max = 30.
+    v_max = boundary
     particles = [particle(dimension, boundary, v_max, function_d)
                  for _ in xrange(n_parts)]
     gl_best = max(particles)