From d17b33131c14864bd1eae275f49a3f148e21cf29 Mon Sep 17 00:00:00 2001 From: Leo Chan Date: Thu, 22 Oct 2020 01:53:21 -0400 Subject: Squashed commit of the sb-vbs branch. Includes the SD-VBS benchmarks modified to: - Use libextra to loop as realtime jobs - Preallocate memory before starting their main computation - Accept input via stdin instead of via argc Does not include the SD-VBS matlab code. Fixes libextra execution in LITMUS^RT. --- SD-VBS/benchmarks/stitch/src/c/script_stitch.c | 65 ++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 SD-VBS/benchmarks/stitch/src/c/script_stitch.c (limited to 'SD-VBS/benchmarks/stitch/src/c/script_stitch.c') 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 @@ +/******************************** +Author: Sravanthi Kota Venkata +********************************/ + +#include "stitch.h" +#include +#include "extra.h" +#define STITCH_MEM 1<<30 +int main(int argc, char* argv[]) +{ + SET_UP + mallopt(M_TOP_PAD, STITCH_MEM); + mallopt(M_MMAP_MAX, 0); + int rows, cols; + F2D *x, *y, *v, *interestPnts, *Fcur, *int1, *int2; + I2D *Icur; + int i, j; + char im1[100], im2[100]; + + + printf("Input image: "); + scanf("%s", im1); + Icur = readImage(im1); + rows = Icur->height; + cols = Icur->width; + + printf("start\n"); + for_each_job{ + v = harris(Icur); + interestPnts = getANMS(v, 24); + int1 = fMallocHandle(interestPnts->height, 1); + int2 = fSetArray(interestPnts->height, 1, 0); + for(i=0; iheight; i++) + { + asubsref(int1,i) = subsref(interestPnts,i,0); + asubsref(int2,i) = subsref(interestPnts,i,1); + } + + Fcur = extractFeatures(Icur, int1, int2); + } + printf("end..\n"); + + +#ifdef CHECK + /** Self checking - use expected.txt from data directory **/ + { + int ret=0; + float tol = 0.02; +#ifdef GENERATE_OUTPUT + fWriteMatrix(Fcur, argv[1]); +#endif + ret = fSelfCheck(Fcur, "expected_C.txt", tol); + if (ret == -1) + printf("Error in Stitch\n"); + } +#endif + iFreeHandle(Icur); + fFreeHandle(v); + fFreeHandle(interestPnts); + fFreeHandle(int1); + fFreeHandle(int2); + fFreeHandle(Fcur); + WRITE_TO_FILE + return 0; +} -- cgit v1.2.2