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/common/toolbox/lagrcv/calcGradientPyrMex.cc | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 SD-VBS/common/toolbox/lagrcv/calcGradientPyrMex.cc (limited to 'SD-VBS/common/toolbox/lagrcv/calcGradientPyrMex.cc') diff --git a/SD-VBS/common/toolbox/lagrcv/calcGradientPyrMex.cc b/SD-VBS/common/toolbox/lagrcv/calcGradientPyrMex.cc new file mode 100755 index 0000000..d94130b --- /dev/null +++ b/SD-VBS/common/toolbox/lagrcv/calcGradientPyrMex.cc @@ -0,0 +1,45 @@ + +/* compile with +rm liblagrcv.a +gcc -c lagrcv.cpp +ar rc liblagrcv.a lagrcv.o +ranlib liblagrcv.a +mex7 calcTextureMex.cc -L/home/ikkjin/LagrMatlab/opencv/matlab -llagrcv -I/home/ikkjin/LagrMatlab/opencv/matlab/ +*/ + +#include "mex.h" +#include "lagrcv.h" +#include +#include + +// TODO: add number of corners parameter +void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { + // usage: [dxPye dyPyr] = + // calcGradientPyrMex(imagePyr) + + const int *cellDims = mxGetDimensions(prhs[0]); + double *image; + const mxArray* imgArray; + mxArray *dxArray, *dyArray; + double *dx, *dy; + const int *imdims; + + plhs[0] = mxCreateCellArray(1, cellDims); + plhs[1] = mxCreateCellArray(1, cellDims); + + for(int i=0; i