From f618466c25d43f3bae9e40920273bf77de1e1149 Mon Sep 17 00:00:00 2001 From: leochanj105 Date: Mon, 19 Oct 2020 23:09:30 -0400 Subject: initial sd-vbs initial sd-vbs add sd-vbs sd-vbs --- 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