summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/stitch/src/c/script_stitch.c
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/stitch/src/c/script_stitch.c')
-rw-r--r--SD-VBS/benchmarks/stitch/src/c/script_stitch.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c
new file mode 100644
index 0000000..00c9a93
--- /dev/null
+++ b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c
@@ -0,0 +1,65 @@
1/********************************
2Author: Sravanthi Kota Venkata
3********************************/
4
5#include "stitch.h"
6#include <malloc.h>
7#include "extra.h"
8#define STITCH_MEM 1<<30
9int main(int argc, char* argv[])
10{
11 SET_UP
12 mallopt(M_TOP_PAD, STITCH_MEM);
13 mallopt(M_MMAP_MAX, 0);
14 int rows, cols;
15 F2D *x, *y, *v, *interestPnts, *Fcur, *int1, *int2;
16 I2D *Icur;
17 int i, j;
18 char im1[100], im2[100];
19
20
21 printf("Input image: ");
22 scanf("%s", im1);
23 Icur = readImage(im1);
24 rows = Icur->height;
25 cols = Icur->width;
26
27 printf("start\n");
28 for_each_job{
29 v = harris(Icur);
30 interestPnts = getANMS(v, 24);
31 int1 = fMallocHandle(interestPnts->height, 1);
32 int2 = fSetArray(interestPnts->height, 1, 0);
33 for(i=0; i<int1->height; i++)
34 {
35 asubsref(int1,i) = subsref(interestPnts,i,0);
36 asubsref(int2,i) = subsref(interestPnts,i,1);
37 }
38
39 Fcur = extractFeatures(Icur, int1, int2);
40 }
41 printf("end..\n");
42
43
44#ifdef CHECK
45 /** Self checking - use expected.txt from data directory **/
46 {
47 int ret=0;
48 float tol = 0.02;
49#ifdef GENERATE_OUTPUT
50 fWriteMatrix(Fcur, argv[1]);
51#endif
52 ret = fSelfCheck(Fcur, "expected_C.txt", tol);
53 if (ret == -1)
54 printf("Error in Stitch\n");
55 }
56#endif
57 iFreeHandle(Icur);
58 fFreeHandle(v);
59 fFreeHandle(interestPnts);
60 fFreeHandle(int1);
61 fFreeHandle(int2);
62 fFreeHandle(Fcur);
63 WRITE_TO_FILE
64 return 0;
65}