diff options
author | Thomas White <taw@physics.org> | 2010-01-08 18:22:35 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2010-01-08 18:22:35 +0100 |
commit | 5cd70513c3c00820a76ce11059774ef08e8e5118 (patch) | |
tree | 7b5c9a20ae8c2c5ea4e8bc9fcafc62891ed3903a | |
parent | 6d76e907d01ea5cbc537574bda07404887dcfa63 (diff) |
Improve peak search more
-rw-r--r-- | src/dirax.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/dirax.c b/src/dirax.c index 88a818ae..ff136ae5 100644 --- a/src/dirax.c +++ b/src/dirax.c @@ -404,8 +404,12 @@ static void search_peaks(struct image *image) double max; unsigned int did_something = 1; + /* Overall threshold */ if ( data[x+width*y] < 800 ) continue; + /* Ignore streak */ + if ( abs(x-image->x_centre) < 15 ) continue; + /* Get gradients */ dx1 = data[x+width*y] - data[(x+1)+width*y]; dx2 = data[(x-1)+width*y] - data[x+width*y]; @@ -419,7 +423,7 @@ static void search_peaks(struct image *image) /* Calculate overall gradient */ grad = dxs + dys; - if ( grad < 200000 ) continue; + if ( grad < 2000000 ) continue; mask_x = x; mask_y = y; @@ -459,6 +463,7 @@ static void search_peaks(struct image *image) assert(mask_x>=0); assert(mask_y>=0); + /* Too far from foot point? */ if ( distance(mask_x, mask_y, x, y) > 50.0 ) continue; /* Check for a feature at exactly the @@ -475,8 +480,8 @@ static void search_peaks(struct image *image) /* Map and record reflection */ printf("%i %i\n", x, y); - image_add_feature(image->features, x, y, - image, 1.0); + image_add_feature(image->features, + mask_x, mask_y, image, 1.0); map_position(image, x, y, &rx, &ry, &rz); fprintf(fh, "%10f %10f %10f %8f\n", rx/1e10, ry/1e10, rz/1e10, 1.0); |