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/tracking/src/c/fillFeatures.c | 67 +++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 SD-VBS/benchmarks/tracking/src/c/fillFeatures.c (limited to 'SD-VBS/benchmarks/tracking/src/c/fillFeatures.c') diff --git a/SD-VBS/benchmarks/tracking/src/c/fillFeatures.c b/SD-VBS/benchmarks/tracking/src/c/fillFeatures.c new file mode 100644 index 0000000..42de169 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/src/c/fillFeatures.c @@ -0,0 +1,67 @@ +/******************************** + +Author: Sravanthi Kota Venkata +********************************/ + +#include "tracking.h" + +/** Find the position and values of the top N_FEA features + from the lambda matrix **/ + +F2D* fillFeatures(F2D* lambda, int N_FEA, int win) +{ + int i, j, k, l; + int rows = lambda->height; + int cols = lambda->width; + F2D* features; + + features = fSetArray(3, N_FEA, 0); + + /** init array **/ + for(i=0; i currLambdaVal) + continue; + + for (k=0; kk; l--) + { + subsref(features, 0, l) = subsref(features, 0, l-1); + subsref(features, 1, l) = subsref(features, 1, l-1); + subsref(features, 2, l) = subsref(features, 2, l-1); + } + + subsref(features, 0, k) = j * 1.0; + subsref(features, 1, k) = i * 1.0; + subsref(features, 2, k) = currLambdaVal; + break; + } + } + } + } + + return features; +} -- cgit v1.2.2