diff options
Diffstat (limited to 'SD-VBS/benchmarks/sift/src/c/diffss.c')
| -rw-r--r-- | SD-VBS/benchmarks/sift/src/c/diffss.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/sift/src/c/diffss.c b/SD-VBS/benchmarks/sift/src/c/diffss.c new file mode 100644 index 0000000..683cbe7 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/c/diffss.c | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /******************************** | ||
| 2 | Author: Sravanthi Kota Venkata | ||
| 3 | ********************************/ | ||
| 4 | |||
| 5 | #include "sift.h" | ||
| 6 | |||
| 7 | /** | ||
| 8 | DIFFSS Difference of scale space | ||
| 9 | Returns a scale space DSS obtained by subtracting | ||
| 10 | consecutive levels of the scale space SS. | ||
| 11 | |||
| 12 | In SIFT, this function is used to compute the difference of | ||
| 13 | Gaussian scale space from the Gaussian scale space of an image. | ||
| 14 | **/ | ||
| 15 | |||
| 16 | F2D** diffss(F2D** ss, int num, int intervals) | ||
| 17 | { | ||
| 18 | F2D** dss; | ||
| 19 | int o, sizeM, sizeN, s, i, j; | ||
| 20 | F2D *current, *in1, *in2; | ||
| 21 | |||
| 22 | dss = malloc(num*intervals*sizeof(F2D*)); | ||
| 23 | |||
| 24 | for(o=0; o<num; o++) | ||
| 25 | { | ||
| 26 | for(s=0; s<(intervals-1); s++) | ||
| 27 | { | ||
| 28 | sizeM = ss[o*intervals+s]->height; | ||
| 29 | sizeN = ss[o*intervals+s]->width; | ||
| 30 | |||
| 31 | dss[o*intervals+s] = fMallocHandle(sizeM, sizeN); | ||
| 32 | |||
| 33 | current = dss[o*intervals+s]; | ||
| 34 | in1 = ss[o*intervals+s+1]; | ||
| 35 | in2 = ss[o*intervals+s]; | ||
| 36 | |||
| 37 | for(i=0; i<sizeM; i++) | ||
| 38 | { | ||
| 39 | for(j=0; j<sizeN; j++) | ||
| 40 | { | ||
| 41 | subsref(current,i,j) = subsref(in1,i,j) - subsref(in2,i,j); | ||
| 42 | } | ||
| 43 | } | ||
| 44 | } | ||
| 45 | } | ||
| 46 | |||
| 47 | return dss; | ||
| 48 | |||
| 49 | } | ||
| 50 | |||
| 51 | |||
| 52 | |||
| 53 | |||
