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/calcGoodFeature.c | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 SD-VBS/benchmarks/tracking/src/c/calcGoodFeature.c (limited to 'SD-VBS/benchmarks/tracking/src/c/calcGoodFeature.c') diff --git a/SD-VBS/benchmarks/tracking/src/c/calcGoodFeature.c b/SD-VBS/benchmarks/tracking/src/c/calcGoodFeature.c new file mode 100644 index 0000000..0ef1862 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/src/c/calcGoodFeature.c @@ -0,0 +1,78 @@ +/******************************** +Author: Sravanthi Kota Venkata +********************************/ + +#include "tracking.h" + +/** Computes lambda matrix, strength at each pixel + + det = determinant( [ IverticalEdgeSq IhorzVertEdge; IhorzVertEdge IhorizontalEdgeSq] ) ; + tr = IverticalEdgeSq + IhorizontalEdgeSq; + lamdba = det/tr; + + Lambda is the measure of the strength of pixel + neighborhood. By strength we mean the amount of + edge information it has, which translates to + sharp features in the image. + + Input: Edge images - vertical and horizontal + Window size (neighborhood size) + Output: Lambda, strength of pixel neighborhood + + Given the edge images, we compute strength based + on how strong the edges are within each neighborhood. + +**/ + +F2D* calcGoodFeature(F2D* verticalEdgeImage, F2D* horizontalEdgeImage, int cols, int rows, int winSize) +{ + int i, j, k, ind; + F2D *verticalEdgeSq, *horizontalEdgeSq, *horzVertEdge; + F2D *tr, *det, *lambda; + F2D *cummulative_verticalEdgeSq, *cummulative_horzVertEdge, *cummulative_horizontalEdgeSq; + + verticalEdgeSq = fMallocHandle(rows, cols); + horzVertEdge = fMallocHandle(rows, cols); + horizontalEdgeSq = fMallocHandle(rows, cols); + + for( i=0; i