summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks')
-rw-r--r--SD-VBS/benchmarks/disparity/src/c/script_disparity.c18
-rw-r--r--SD-VBS/benchmarks/localization/src/c/script_localization.c20
-rw-r--r--SD-VBS/benchmarks/mser/src/c/script_mser.c15
-rw-r--r--SD-VBS/benchmarks/multi_ncut/src/c/script_multi_ncut.c10
-rw-r--r--SD-VBS/benchmarks/sift/src/c/script_sift.c9
-rw-r--r--SD-VBS/benchmarks/stitch/src/c/script_stitch.c11
-rw-r--r--SD-VBS/benchmarks/svm/src/c/script_svm.c23
-rw-r--r--SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c8
-rw-r--r--SD-VBS/benchmarks/tracking/src/c/script_tracking.c13
9 files changed, 50 insertions, 77 deletions
diff --git a/SD-VBS/benchmarks/disparity/src/c/script_disparity.c b/SD-VBS/benchmarks/disparity/src/c/script_disparity.c
index 431c02c..7d45ada 100644
--- a/SD-VBS/benchmarks/disparity/src/c/script_disparity.c
+++ b/SD-VBS/benchmarks/disparity/src/c/script_disparity.c
@@ -28,9 +28,7 @@ int main(int argc, char* argv[])
28 int WIN_SZ=8, SHIFT=64; 28 int WIN_SZ=8, SHIFT=64;
29 FILE* fp; 29 FILE* fp;
30 30
31 printf("Image 1: ");
32 scanf("%s", im1); 31 scanf("%s", im1);
33 printf("Image 2: ");
34 scanf("%s", im2); 32 scanf("%s", im2);
35#ifdef CHECK 33#ifdef CHECK
36 char checkFile[100] = "./expected_C.txt"; 34 char checkFile[100] = "./expected_C.txt";
@@ -86,17 +84,15 @@ int main(int argc, char* argv[])
86 Iright_moved = iSetArray(paddedRows, paddedCols, 0); 84 Iright_moved = iSetArray(paddedRows, paddedCols, 0);
87 85
88 range = iMallocHandle(1, 2); 86 range = iMallocHandle(1, 2);
89 printf("starting..\n"); 87 for_each_job {
90 for_each_job{ 88 retDisparity = getDisparity(imleft, imright, WIN_SZ, SHIFT,
91 retDisparity = getDisparity(imleft, imright, WIN_SZ, SHIFT, 89 minSAD, retDisp, halfWin,
92 minSAD, retDisp, halfWin, 90 IrightPadded, IleftPadded, Iright_moved,
93 IrightPadded, IleftPadded, Iright_moved, 91 retSAD, SAD, integralImg,
94 retSAD, SAD, integralImg, 92 range);
95 range);
96 } 93 }
97 printf("ending\n");
98 94
99#ifdef CHECK 95#ifdef CHECK
100 /** Self checking - use expected.txt from data directory **/ 96 /** Self checking - use expected.txt from data directory **/
101 { 97 {
102 int tol, ret=0; 98 int tol, ret=0;
diff --git a/SD-VBS/benchmarks/localization/src/c/script_localization.c b/SD-VBS/benchmarks/localization/src/c/script_localization.c
index 3392320..ed37132 100644
--- a/SD-VBS/benchmarks/localization/src/c/script_localization.c
+++ b/SD-VBS/benchmarks/localization/src/c/script_localization.c
@@ -41,7 +41,6 @@ int main(int argc, char* argv[])
41 41
42 char im1[100]; 42 char im1[100];
43 43
44 printf("Input txt File: ");
45 scanf("%s", im1); 44 scanf("%s", im1);
46 45
47 fid = readFile(im1); 46 fid = readFile(im1);
@@ -83,11 +82,10 @@ int main(int argc, char* argv[])
83 F2D *randn; 82 F2D *randn;
84 83
85 randn = randWrapper(n,3); 84 randn = randWrapper(n,3);
86 printf("start\n"); 85 for_each_job {
87 for_each_job{ 86 fResetArray(pos,n, 3, 0);
88 fResetArray(pos,n, 3, 0); 87 fResetArray(vel,n, 3, 0);
89 fResetArray(vel,n, 3, 0); 88 fResetArray(ones,n,1,1);
90 fResetArray(ones,n,1,1);
91 89
92 { 90 {
93 int j; 91 int j;
@@ -95,7 +93,7 @@ int main(int argc, char* argv[])
95 for(j=0; j<3; j++) 93 for(j=0; j<3; j++)
96 subsref(vel, i, j) += subsref(randn,i,j) * STDDEV_ODOVel; 94 subsref(vel, i, j) += subsref(randn,i,j) * STDDEV_ODOVel;
97 95
98 } 96 }
99 97
100 98
101 99
@@ -486,17 +484,15 @@ int main(int argc, char* argv[])
486 subsref(resultMat,1,icount) = velOut; 484 subsref(resultMat,1,icount) = velOut;
487 subsref(resultMat,2,icount) = posOut; 485 subsref(resultMat,2,icount) = posOut;
488 } 486 }
489 487
490 fFreeHandle(sData); 488 fFreeHandle(sData);
491 489
492
493 if (asubsref(isEOF,0) == 1) 490 if (asubsref(isEOF,0) == 1)
494 break; 491 break;
495 } 492 }
496 } 493 }
497 printf("end..\n");
498 494
499#ifdef CHECK 495#ifdef CHECK
500 496
501 // Self checking - use expected.txt from data directory 497 // Self checking - use expected.txt from data directory
502 { 498 {
diff --git a/SD-VBS/benchmarks/mser/src/c/script_mser.c b/SD-VBS/benchmarks/mser/src/c/script_mser.c
index d4a98cd..3e98f86 100644
--- a/SD-VBS/benchmarks/mser/src/c/script_mser.c
+++ b/SD-VBS/benchmarks/mser/src/c/script_mser.c
@@ -33,7 +33,6 @@ int main(int argc, char* argv[])
33 33
34 int ndims, nel, gdl, nmer; 34 int ndims, nel, gdl, nmer;
35 35
36 printf("Input Image: ");
37 scanf("%s", im1); 36 scanf("%s", im1);
38 37
39 I = readImage(im1); 38 I = readImage(im1);
@@ -74,19 +73,17 @@ int main(int argc, char* argv[])
74 73
75 74
76 out = iMallocHandle(1, nmer); 75 out = iMallocHandle(1, nmer);
77 printf("start\n"); 76 for_each_job {
78 for_each_job{
79 idx = mser(It, 2, subs_pt, nsubs_pt, strides_pt, visited_pt, dims, 77 idx = mser(It, 2, subs_pt, nsubs_pt, strides_pt, visited_pt, dims,
80 joins_pt, 78 joins_pt,
81 regions_pt, 79 regions_pt,
82 pairs_pt, 80 pairs_pt,
83 forest_pt, 81 forest_pt,
84 acc_pt, ell_pt, 82 acc_pt, ell_pt,
85 out); 83 out);
86 } 84 }
87 printf("end..\n"); 85
88 86#ifdef CHECK
89#ifdef CHECK
90 /** Self checking - use expected.txt from data directory **/ 87 /** Self checking - use expected.txt from data directory **/
91 { 88 {
92 int tol, ret=0; 89 int tol, ret=0;
diff --git a/SD-VBS/benchmarks/multi_ncut/src/c/script_multi_ncut.c b/SD-VBS/benchmarks/multi_ncut/src/c/script_multi_ncut.c
index e4f7912..77c6b71 100644
--- a/SD-VBS/benchmarks/multi_ncut/src/c/script_multi_ncut.c
+++ b/SD-VBS/benchmarks/multi_ncut/src/c/script_multi_ncut.c
@@ -28,7 +28,6 @@ int main(int argc, char* argv[])
28 28
29 F2D *imageOut, *tempOut; 29 F2D *imageOut, *tempOut;
30 F2D *edgeWeights, *in; 30 F2D *edgeWeights, *in;
31 printf("Input image: ");
32 scanf("%s", im1); 31 scanf("%s", im1);
33 im = readImage(im1); 32 im = readImage(im1);
34 33
@@ -50,13 +49,12 @@ int main(int argc, char* argv[])
50 u->elts = (uni_elt*)malloc(sizeof(uni_elt)*num_vertices); 49 u->elts = (uni_elt*)malloc(sizeof(uni_elt)*num_vertices);
51 output = iMallocHandle(height, width); 50 output = iMallocHandle(height, width);
52 51
53 printf("start\n");
54 for_each_job{ 52 for_each_job{
55 seg = segment_image(im, sigma, k, min_size, num_ccs, segments, edges, imageOut, tempOut, kernel, edgeWeights, in, ind, u, output); 53 seg = segment_image(im, sigma, k, min_size, num_ccs, segments, edges, imageOut, tempOut, kernel, edgeWeights, in, ind, u, output);
56 out = seg; 54 out = seg;
57 } 55 }
58 printf("end..\n"); 56
59#ifdef CHECK 57#ifdef CHECK
60 /** Self checking - use expected.txt from data directory **/ 58 /** Self checking - use expected.txt from data directory **/
61 { 59 {
62 int ret=0; 60 int ret=0;
diff --git a/SD-VBS/benchmarks/sift/src/c/script_sift.c b/SD-VBS/benchmarks/sift/src/c/script_sift.c
index 0b2f106..ab39ae3 100644
--- a/SD-VBS/benchmarks/sift/src/c/script_sift.c
+++ b/SD-VBS/benchmarks/sift/src/c/script_sift.c
@@ -45,7 +45,6 @@ int main(int argc, char* argv[])
45 unsigned int* startTime, *endTime, *elapsed; 45 unsigned int* startTime, *endTime, *elapsed;
46 46
47 char imSrc[100]; 47 char imSrc[100];
48 printf("Input image: ");
49 scanf("%s", imSrc); 48 scanf("%s", imSrc);
50 im = readImage(imSrc); 49 im = readImage(imSrc);
51 image = fiDeepCopy(im); 50 image = fiDeepCopy(im);
@@ -53,16 +52,14 @@ int main(int argc, char* argv[])
53 cols = image->width; 52 cols = image->width;
54 53
55 54
56 printf("start\n");
57 for_each_job{ 55 for_each_job{
58 image = fiDeepCopy(im); 56 image = fiDeepCopy(im);
59 normalizeImage(image); 57 normalizeImage(image);
60 /** Extract sift features for the normalized image **/ 58 /** Extract sift features for the normalized image **/
61 frames = sift(image); 59 frames = sift(image);
62 } 60 }
63 printf("end..\n"); 61
64 62#ifdef CHECK
65#ifdef CHECK
66 { 63 {
67 int ret=0; 64 int ret=0;
68 float tol = 0.2; 65 float tol = 0.2;
diff --git a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c
index 00c9a93..b7611f1 100644
--- a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c
+++ b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c
@@ -16,16 +16,13 @@ int main(int argc, char* argv[])
16 I2D *Icur; 16 I2D *Icur;
17 int i, j; 17 int i, j;
18 char im1[100], im2[100]; 18 char im1[100], im2[100];
19
20 19
21 printf("Input image: ");
22 scanf("%s", im1); 20 scanf("%s", im1);
23 Icur = readImage(im1); 21 Icur = readImage(im1);
24 rows = Icur->height; 22 rows = Icur->height;
25 cols = Icur->width; 23 cols = Icur->width;
26 24
27 printf("start\n"); 25 for_each_job {
28 for_each_job{
29 v = harris(Icur); 26 v = harris(Icur);
30 interestPnts = getANMS(v, 24); 27 interestPnts = getANMS(v, 24);
31 int1 = fMallocHandle(interestPnts->height, 1); 28 int1 = fMallocHandle(interestPnts->height, 1);
@@ -38,10 +35,8 @@ int main(int argc, char* argv[])
38 35
39 Fcur = extractFeatures(Icur, int1, int2); 36 Fcur = extractFeatures(Icur, int1, int2);
40 } 37 }
41 printf("end..\n");
42
43 38
44#ifdef CHECK 39#ifdef CHECK
45 /** Self checking - use expected.txt from data directory **/ 40 /** Self checking - use expected.txt from data directory **/
46 { 41 {
47 int ret=0; 42 int ret=0;
diff --git a/SD-VBS/benchmarks/svm/src/c/script_svm.c b/SD-VBS/benchmarks/svm/src/c/script_svm.c
index 62a264d..f1ce963 100644
--- a/SD-VBS/benchmarks/svm/src/c/script_svm.c
+++ b/SD-VBS/benchmarks/svm/src/c/script_svm.c
@@ -70,24 +70,23 @@ int main(int argc, char* argv[])
70 #endif 70 #endif
71 71
72 72
73 printf("trn file 1: "); 73 // trn file 1
74 scanf("%s", im1); 74 scanf("%s", im1);
75 trn1 = readFile(im1); 75 trn1 = readFile(im1);
76 76
77 printf("trn file 2: "); 77 // trn file 2
78 scanf("%s", im1); 78 scanf("%s", im1);
79 trn2 = readFile(im1); 79 trn2 = readFile(im1);
80 80
81 printf("tst file 1: "); 81 // tst file 1
82 scanf("%s", im1); 82 scanf("%s", im1);
83 tst1 = readFile(im1); 83 tst1 = readFile(im1);
84 84
85 printf("tst file 2: "); 85 // tst file 2
86 scanf("%s", im1); 86 scanf("%s", im1);
87 tst2 = readFile(im1); 87 tst2 = readFile(im1);
88 88
89 printf("start.\n"); 89 for_each_job {
90 for_each_job{
91 alpha = getAlphaFromTrainSet(N, trn1, trn2, iter); 90 alpha = getAlphaFromTrainSet(N, trn1, trn2, iter);
92 a_result = alpha->a_result; 91 a_result = alpha->a_result;
93 b_result = alpha->b_result; 92 b_result = alpha->b_result;
@@ -135,8 +134,8 @@ int main(int argc, char* argv[])
135 asubsref(result,n) = maxs; 134 asubsref(result,n) = maxs;
136 } 135 }
137 } 136 }
138 printf("end..\n"); 137
139#ifdef CHECK 138#ifdef CHECK
140 /** Self checking - use expected.txt from data directory **/ 139 /** Self checking - use expected.txt from data directory **/
141 { 140 {
142 int ret=0; 141 int ret=0;
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c b/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c
index 01ddefd..2ebb423 100644
--- a/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c
+++ b/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c
@@ -27,11 +27,10 @@ int main(int argc, char **argv)
27 image = fiDeepCopy(im); 27 image = fiDeepCopy(im);
28 init_params(data); 28 init_params(data);
29 29
30 printf("start.\n"); 30 for_each_job {
31 for_each_job{
32 create_texture(image, data); 31 create_texture(image, data);
33 } 32 }
34 printf("end..\n"); 33
35#ifdef CHECK 34#ifdef CHECK
36{ 35{
37 int ret=0; 36 int ret=0;
@@ -59,7 +58,6 @@ I2D* parse_flags(int argc, char ** argv)
59 I2D* image; 58 I2D* image;
60 char fileNm[256]; 59 char fileNm[256];
61 60
62 printf("Input image: ");
63 scanf("%s", fileNm); 61 scanf("%s", fileNm);
64 image = readImage(fileNm); 62 image = readImage(fileNm);
65 WIDTHin = image->width; 63 WIDTHin = image->width;
@@ -122,7 +120,7 @@ I2D* parse_flags(int argc, char ** argv)
122 localx = 5; 120 localx = 5;
123 localy = 5; 121 localy = 5;
124#endif 122#endif
125 printf("Input size\t\t- (%dx%d)\n", HEIGHTin, WIDTHin); 123// printf("Input size\t\t- (%dx%d)\n", HEIGHTin, WIDTHin);
126 124
127// xloopin = malloc(2*WIDTHin*sizeof(int)); 125// xloopin = malloc(2*WIDTHin*sizeof(int));
128// yloopin = malloc(2*HEIGHTin*sizeof(int)); 126// yloopin = malloc(2*HEIGHTin*sizeof(int));
diff --git a/SD-VBS/benchmarks/tracking/src/c/script_tracking.c b/SD-VBS/benchmarks/tracking/src/c/script_tracking.c
index bb48ace..2938126 100644
--- a/SD-VBS/benchmarks/tracking/src/c/script_tracking.c
+++ b/SD-VBS/benchmarks/tracking/src/c/script_tracking.c
@@ -96,19 +96,16 @@ int main(int argc, char* argv[])
96 for(count=1; count<=counter; count++) 96 for(count=1; count<=counter; count++)
97 { 97 {
98 /** Read image **/ 98 /** Read image **/
99 printf("Input image %d: ", count); 99 scanf("%s", im1);
100 scanf("%s", im1);
101 images[count - 1] = readImage(im1); 100 images[count - 1] = readImage(im1);
102 if(count == 1) Ic = readImage(im1); 101 if(count == 1) Ic = readImage(im1);
103 } 102 }
104 103
105 104
106 rows = Ic->height; 105 rows = Ic->height;
107 cols = Ic->width; 106 cols = Ic->width;
108 107
109 printf("start\n"); 108 for_each_job {
110 for_each_job{
111
112 /** IMAGE PRE-PROCESSING **/ 109 /** IMAGE PRE-PROCESSING **/
113 110
114 /** Blur the image to remove noise - weighted avergae filter **/ 111 /** Blur the image to remove noise - weighted avergae filter **/
@@ -230,8 +227,8 @@ int main(int argc, char* argv[])
230 fFreeHandle(newpoints); 227 fFreeHandle(newpoints);
231 } 228 }
232 } 229 }
233 printf("end..\n"); 230
234#ifdef CHECK 231#ifdef CHECK
235 /* Self checking */ 232 /* Self checking */
236 { 233 {
237 int ret=0; 234 int ret=0;