From cdeae0b80c9722861b14c81198488590762b8467 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Thu, 26 Apr 2012 08:02:36 +0200 Subject: harris: Use M_1_PI for 1/pi --- harris.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 #include #include @@ -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; -- cgit