summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-04-26 08:02:36 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-04-26 08:02:36 +0200
commitcdeae0b80c9722861b14c81198488590762b8467 (patch)
treea970d6073d5e5b9e1598a962ac17478eaf662371
parent59e2caae78dfab3fa2afb8aa63572b70cf6b94e7 (diff)
downloadcv-cdeae0b80c9722861b14c81198488590762b8467.zip
cv-cdeae0b80c9722861b14c81198488590762b8467.tar.gz
cv-cdeae0b80c9722861b14c81198488590762b8467.tar.bz2
harris: Use M_1_PI for 1/pi
-rw-r--r--harris.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/harris.c b/harris.c
index fab5141..502e976 100644
--- a/harris.c
+++ b/harris.c
@@ -1,3 +1,4 @@
+#define _BSD_SOURCE
#include <stdlib.h>
#include <string.h>
#include <math.h>
@@ -119,7 +120,7 @@ calc_window_sum(struct mat2 *m, int width, int height, int wsize)
for (j = -wsize/2; j < wsize/2; ++j) {
v = &m[(CLAMP(y+i, 0, height-1) * width
+ CLAMP(x+j, 0, width-1))];
- w = (1.0 / (2 * 3.14 * 0.16) *
+ w = (M_1_PI * 1.0 / (2.0 * 0.16) *
exp(- i*i - j*j / 0.16));
r->a1 += w * v->a1;