From 14c854543b1a3cf344a371a5b45595657f95786b Mon Sep 17 00:00:00 2001 From: leochanj105 Date: Tue, 26 Oct 2021 13:22:32 -0400 Subject: add deadlines and costs --- SD-VBS/benchmarks/sift/src/c/imsmooth.c | 104 -------------------------------- 1 file changed, 104 deletions(-) delete mode 100644 SD-VBS/benchmarks/sift/src/c/imsmooth.c (limited to 'SD-VBS/benchmarks/sift/src/c/imsmooth.c') diff --git a/SD-VBS/benchmarks/sift/src/c/imsmooth.c b/SD-VBS/benchmarks/sift/src/c/imsmooth.c deleted file mode 100644 index d901418..0000000 --- a/SD-VBS/benchmarks/sift/src/c/imsmooth.c +++ /dev/null @@ -1,104 +0,0 @@ -/******************************** -Author: Sravanthi Kota Venkata -********************************/ - -#include "sift.h" -#include -#include -const double win_factor = 1.5 ; -const int nbins = 36 ; -const float threshold = 0.01; - -/** - This function is similar to imageBlur in common/c folder. - Here, we can specify the sigma value for the gaussian filter - function. -**/ - -void imsmooth(F2D* array, float dsigma, F2D* out) -{ - int M,N ; - int i,j,k; - float s ; - - /* ------------------------------------------------------------------ - ** Check the arguments - ** --------------------------------------------------------------- */ - - M = array->height; - N = array->width; - s = dsigma; - - /* ------------------------------------------------------------------ - ** Do the job - ** --------------------------------------------------------------- */ - if(s > threshold) - { - int W = (int) ceil(4*s) ; - float temp[2*W+1]; - F2D* buffer; - float acc = 0.0; - - buffer = fSetArray(M,N,0); - - for(j = 0 ; j < (2*W+1) ; ++j) - { - temp[j] = (float)(expf(-0.5 * (j - W)*(j - W)/(s*s))) ; - acc += temp[j]; - } - - for(j = 0 ; j < (2*W+1) ; ++j) - { - temp[j] /= acc ; - } - - /* - ** Convolve along the columns - **/ - - for(j = 0 ; j < M ; ++j) - { - for(i = 0 ; i < N ; ++i) - { - int startCol = MAX(i-W,0); - int endCol = MIN(i+W, N-1); - int filterStart = MAX(0, W-i); - - assert(j < array->height); - assert(j < buffer->height); - assert(i < buffer->width); - for(k=startCol; k<=endCol; k++) { - assert(k < array->width); - assert(filterStart < 2*W+1); - subsref(buffer,j,i) += subsref(array, j, k) * temp[filterStart++]; - } - } - } - - /* - ** Convolve along the rows - **/ - for(j = 0 ; j < M ; ++j) - { - for(i = 0 ; i < N ; ++i) - { - int startRow = MAX(j-W,0); - int endRow = MIN(j+W, M-1); - int filterStart = MAX(0, W-j); - for(k=startRow; k<=endRow; k++) - subsref(out,j,i) += subsref(buffer,k,i) * temp[filterStart++]; - } - } - - fFreeHandle(buffer); - - } - else - { - for(i=0;i