diff options
author | Thomas White <taw@physics.org> | 2010-03-18 11:33:29 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2010-03-18 11:33:29 +0100 |
commit | f02e06759844c327b91cc5b88dd43536114005a0 (patch) | |
tree | a6e7926832c687c4b06a18f9d09f1cc569fbc217 /src/filters.c | |
parent | d871454363b0f19e1188da783cd4c931cd587cb2 (diff) |
Perform intensity extraction on the image as it was before noise filtering
Diffstat (limited to 'src/filters.c')
-rw-r--r-- | src/filters.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/src/filters.c b/src/filters.c index 172be222..17792b85 100644 --- a/src/filters.c +++ b/src/filters.c @@ -61,7 +61,25 @@ static void clean_panel(struct image *image, int sx, int sy) } -static void noise_filter(struct image *image) +/* Pre-processing to make life easier */ +void filter_cm(struct image *image) +{ + int px, py; + + if ( (image->width != 1024) || (image->height != 1024) ) return; + + for ( px=0; px<2; px++ ) { + for ( py=0; py<8; py++ ) { + + clean_panel(image, 512*px, 128*py); + + } + } + +} + + +void filter_noise(struct image *image, float *old) { int x, y; @@ -71,6 +89,10 @@ static void noise_filter(struct image *image) int dx, dy; int val = image->data[x+image->width*y]; + if ( old != NULL ) old[x+image->width*y] = val; + + /* FIXME: This isn't really the right thing to do + * at the edges. */ if ( (x==0) || (x==image->width-1) || (y==0) || (y==image->height-1) ) { if ( val < 0 ) val = 0; @@ -94,27 +116,3 @@ static void noise_filter(struct image *image) } } } - - -/* Pre-processing to make life easier */ -void filter_cm(struct image *image) -{ - int px, py; - - if ( (image->width != 1024) || (image->height != 1024) ) return; - - for ( px=0; px<2; px++ ) { - for ( py=0; py<8; py++ ) { - - clean_panel(image, 512*px, 128*py); - - } - } - -} - - -void filter_noise(struct image *image) -{ - noise_filter(image); -} |