summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;