diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-04-26 08:02:36 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-04-26 08:02:36 +0200 |
commit | cdeae0b80c9722861b14c81198488590762b8467 (patch) | |
tree | a970d6073d5e5b9e1598a962ac17478eaf662371 | |
parent | 59e2caae78dfab3fa2afb8aa63572b70cf6b94e7 (diff) | |
download | cv-cdeae0b80c9722861b14c81198488590762b8467.tar.gz cv-cdeae0b80c9722861b14c81198488590762b8467.tar.bz2 cv-cdeae0b80c9722861b14c81198488590762b8467.zip |
harris: Use M_1_PI for 1/pi
-rw-r--r-- | harris.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |