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/Makefile | 3 + SD-VBS/benchmarks/tracking/data/Makefile | 3 + SD-VBS/benchmarks/tracking/data/cif/1.bmp | Bin 0 -> 304182 bytes SD-VBS/benchmarks/tracking/data/cif/2.bmp | Bin 0 -> 304182 bytes SD-VBS/benchmarks/tracking/data/cif/3.bmp | Bin 0 -> 304182 bytes SD-VBS/benchmarks/tracking/data/cif/4.bmp | Bin 0 -> 304182 bytes SD-VBS/benchmarks/tracking/data/cif/5.bmp | Bin 0 -> 304182 bytes SD-VBS/benchmarks/tracking/data/cif/Makefile | 7 + SD-VBS/benchmarks/tracking/data/cif/expected.m | 2 + SD-VBS/benchmarks/tracking/data/cif/expected_C.txt | 2 + SD-VBS/benchmarks/tracking/data/fullhd/1.bmp | Bin 0 -> 6220854 bytes SD-VBS/benchmarks/tracking/data/fullhd/2.bmp | Bin 0 -> 6220854 bytes SD-VBS/benchmarks/tracking/data/fullhd/3.bmp | Bin 0 -> 6220854 bytes SD-VBS/benchmarks/tracking/data/fullhd/4.bmp | Bin 0 -> 6220854 bytes SD-VBS/benchmarks/tracking/data/fullhd/Makefile | 7 + SD-VBS/benchmarks/tracking/data/fullhd/expected.m | 2 + .../benchmarks/tracking/data/fullhd/expected_C.txt | 2 + SD-VBS/benchmarks/tracking/data/qcif/1.bmp | Bin 0 -> 76086 bytes SD-VBS/benchmarks/tracking/data/qcif/10.bmp | Bin 0 -> 76086 bytes SD-VBS/benchmarks/tracking/data/qcif/2.bmp | Bin 0 -> 76086 bytes SD-VBS/benchmarks/tracking/data/qcif/3.bmp | Bin 0 -> 76086 bytes SD-VBS/benchmarks/tracking/data/qcif/4.bmp | Bin 0 -> 76086 bytes SD-VBS/benchmarks/tracking/data/qcif/5.bmp | Bin 0 -> 76086 bytes SD-VBS/benchmarks/tracking/data/qcif/6.bmp | Bin 0 -> 76086 bytes SD-VBS/benchmarks/tracking/data/qcif/7.bmp | Bin 0 -> 76086 bytes SD-VBS/benchmarks/tracking/data/qcif/8.bmp | Bin 0 -> 76086 bytes SD-VBS/benchmarks/tracking/data/qcif/9.bmp | Bin 0 -> 76086 bytes SD-VBS/benchmarks/tracking/data/qcif/Makefile | 7 + SD-VBS/benchmarks/tracking/data/qcif/expected.m | 2 + .../benchmarks/tracking/data/qcif/expected_C.txt | 2 + SD-VBS/benchmarks/tracking/data/sim/1.bmp | Bin 0 -> 6966 bytes SD-VBS/benchmarks/tracking/data/sim/2.bmp | Bin 0 -> 6966 bytes SD-VBS/benchmarks/tracking/data/sim/3.bmp | Bin 0 -> 6966 bytes SD-VBS/benchmarks/tracking/data/sim/4.bmp | Bin 0 -> 6966 bytes SD-VBS/benchmarks/tracking/data/sim/Makefile | 6 + SD-VBS/benchmarks/tracking/data/sim/expected.m | 2 + SD-VBS/benchmarks/tracking/data/sim/expected_C.txt | 2 + SD-VBS/benchmarks/tracking/data/sim_fast/1.bmp | Bin 0 -> 3126 bytes SD-VBS/benchmarks/tracking/data/sim_fast/2.bmp | Bin 0 -> 3126 bytes SD-VBS/benchmarks/tracking/data/sim_fast/3.bmp | Bin 0 -> 3126 bytes SD-VBS/benchmarks/tracking/data/sim_fast/4.bmp | Bin 0 -> 3126 bytes SD-VBS/benchmarks/tracking/data/sim_fast/Makefile | 6 + .../benchmarks/tracking/data/sim_fast/expected.m | 2 + .../tracking/data/sim_fast/expected_C.txt | 2 + SD-VBS/benchmarks/tracking/data/sqcif/1.bmp | Bin 0 -> 36918 bytes SD-VBS/benchmarks/tracking/data/sqcif/2.bmp | Bin 0 -> 36918 bytes SD-VBS/benchmarks/tracking/data/sqcif/3.bmp | Bin 0 -> 36918 bytes SD-VBS/benchmarks/tracking/data/sqcif/4.bmp | Bin 0 -> 36918 bytes SD-VBS/benchmarks/tracking/data/sqcif/Makefile | 6 + SD-VBS/benchmarks/tracking/data/sqcif/expected.m | 2 + .../benchmarks/tracking/data/sqcif/expected_C.txt | 2 + SD-VBS/benchmarks/tracking/data/test/1.bmp | Bin 0 -> 822 bytes SD-VBS/benchmarks/tracking/data/test/2.bmp | Bin 0 -> 822 bytes SD-VBS/benchmarks/tracking/data/test/3.bmp | Bin 0 -> 822 bytes SD-VBS/benchmarks/tracking/data/test/4.bmp | Bin 0 -> 822 bytes SD-VBS/benchmarks/tracking/data/test/Makefile | 5 + SD-VBS/benchmarks/tracking/data/test/expected.m | 2 + .../benchmarks/tracking/data/test/expected_C.txt | 2 + SD-VBS/benchmarks/tracking/data/test/time.txt | 1 + SD-VBS/benchmarks/tracking/data/vga/1.bmp | Bin 0 -> 921654 bytes SD-VBS/benchmarks/tracking/data/vga/2.bmp | Bin 0 -> 921654 bytes SD-VBS/benchmarks/tracking/data/vga/3.bmp | Bin 0 -> 921654 bytes SD-VBS/benchmarks/tracking/data/vga/4.bmp | Bin 0 -> 921654 bytes SD-VBS/benchmarks/tracking/data/vga/Makefile | 7 + SD-VBS/benchmarks/tracking/data/vga/expected.m | 2 + SD-VBS/benchmarks/tracking/data/vga/expected_C.txt | 2 + SD-VBS/benchmarks/tracking/src/c/calcAreaSum.c | 81 +++++++ SD-VBS/benchmarks/tracking/src/c/calcGoodFeature.c | 78 ++++++ SD-VBS/benchmarks/tracking/src/c/calcPyrLKTrack.c | 179 ++++++++++++++ SD-VBS/benchmarks/tracking/src/c/fillFeatures.c | 67 ++++++ SD-VBS/benchmarks/tracking/src/c/getANMS.c | 156 ++++++++++++ .../tracking/src/c/getInterpolatePatch.c | 43 ++++ SD-VBS/benchmarks/tracking/src/c/script_tracking.c | 263 +++++++++++++++++++++ SD-VBS/benchmarks/tracking/src/c/tracking.h | 20 ++ 74 files changed, 977 insertions(+) create mode 100644 SD-VBS/benchmarks/tracking/Makefile create mode 100644 SD-VBS/benchmarks/tracking/data/Makefile create mode 100644 SD-VBS/benchmarks/tracking/data/cif/1.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/cif/2.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/cif/3.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/cif/4.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/cif/5.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/cif/Makefile create mode 100644 SD-VBS/benchmarks/tracking/data/cif/expected.m create mode 100644 SD-VBS/benchmarks/tracking/data/cif/expected_C.txt create mode 100644 SD-VBS/benchmarks/tracking/data/fullhd/1.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/fullhd/2.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/fullhd/3.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/fullhd/4.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/fullhd/Makefile create mode 100644 SD-VBS/benchmarks/tracking/data/fullhd/expected.m create mode 100644 SD-VBS/benchmarks/tracking/data/fullhd/expected_C.txt create mode 100644 SD-VBS/benchmarks/tracking/data/qcif/1.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/qcif/10.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/qcif/2.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/qcif/3.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/qcif/4.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/qcif/5.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/qcif/6.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/qcif/7.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/qcif/8.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/qcif/9.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/qcif/Makefile create mode 100644 SD-VBS/benchmarks/tracking/data/qcif/expected.m create mode 100644 SD-VBS/benchmarks/tracking/data/qcif/expected_C.txt create mode 100644 SD-VBS/benchmarks/tracking/data/sim/1.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/sim/2.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/sim/3.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/sim/4.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/sim/Makefile create mode 100644 SD-VBS/benchmarks/tracking/data/sim/expected.m create mode 100644 SD-VBS/benchmarks/tracking/data/sim/expected_C.txt create mode 100644 SD-VBS/benchmarks/tracking/data/sim_fast/1.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/sim_fast/2.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/sim_fast/3.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/sim_fast/4.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/sim_fast/Makefile create mode 100644 SD-VBS/benchmarks/tracking/data/sim_fast/expected.m create mode 100644 SD-VBS/benchmarks/tracking/data/sim_fast/expected_C.txt create mode 100644 SD-VBS/benchmarks/tracking/data/sqcif/1.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/sqcif/2.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/sqcif/3.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/sqcif/4.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/sqcif/Makefile create mode 100644 SD-VBS/benchmarks/tracking/data/sqcif/expected.m create mode 100644 SD-VBS/benchmarks/tracking/data/sqcif/expected_C.txt create mode 100644 SD-VBS/benchmarks/tracking/data/test/1.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/test/2.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/test/3.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/test/4.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/test/Makefile create mode 100644 SD-VBS/benchmarks/tracking/data/test/expected.m create mode 100644 SD-VBS/benchmarks/tracking/data/test/expected_C.txt create mode 100644 SD-VBS/benchmarks/tracking/data/test/time.txt create mode 100644 SD-VBS/benchmarks/tracking/data/vga/1.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/vga/2.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/vga/3.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/vga/4.bmp create mode 100644 SD-VBS/benchmarks/tracking/data/vga/Makefile create mode 100644 SD-VBS/benchmarks/tracking/data/vga/expected.m create mode 100644 SD-VBS/benchmarks/tracking/data/vga/expected_C.txt create mode 100644 SD-VBS/benchmarks/tracking/src/c/calcAreaSum.c create mode 100644 SD-VBS/benchmarks/tracking/src/c/calcGoodFeature.c create mode 100644 SD-VBS/benchmarks/tracking/src/c/calcPyrLKTrack.c create mode 100644 SD-VBS/benchmarks/tracking/src/c/fillFeatures.c create mode 100644 SD-VBS/benchmarks/tracking/src/c/getANMS.c create mode 100644 SD-VBS/benchmarks/tracking/src/c/getInterpolatePatch.c create mode 100644 SD-VBS/benchmarks/tracking/src/c/script_tracking.c create mode 100644 SD-VBS/benchmarks/tracking/src/c/tracking.h (limited to 'SD-VBS/benchmarks/tracking') diff --git a/SD-VBS/benchmarks/tracking/Makefile b/SD-VBS/benchmarks/tracking/Makefile new file mode 100644 index 0000000..60cc0ec --- /dev/null +++ b/SD-VBS/benchmarks/tracking/Makefile @@ -0,0 +1,3 @@ +include ../../common/makefiles/Makefile.include +include $(MAKEFILE_COMMON_DIR)/Makefile.recurse + diff --git a/SD-VBS/benchmarks/tracking/data/Makefile b/SD-VBS/benchmarks/tracking/data/Makefile new file mode 100644 index 0000000..ba33d35 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/Makefile @@ -0,0 +1,3 @@ +include ../../../common/makefiles/Makefile.include +include $(MAKEFILE_COMMON_DIR)/Makefile.recurse + diff --git a/SD-VBS/benchmarks/tracking/data/cif/1.bmp b/SD-VBS/benchmarks/tracking/data/cif/1.bmp new file mode 100644 index 0000000..6744178 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/cif/1.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/cif/2.bmp b/SD-VBS/benchmarks/tracking/data/cif/2.bmp new file mode 100644 index 0000000..8c2ac57 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/cif/2.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/cif/3.bmp b/SD-VBS/benchmarks/tracking/data/cif/3.bmp new file mode 100644 index 0000000..b7195fb Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/cif/3.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/cif/4.bmp b/SD-VBS/benchmarks/tracking/data/cif/4.bmp new file mode 100644 index 0000000..9f0525a Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/cif/4.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/cif/5.bmp b/SD-VBS/benchmarks/tracking/data/cif/5.bmp new file mode 100644 index 0000000..2f88c26 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/cif/5.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/cif/Makefile b/SD-VBS/benchmarks/tracking/data/cif/Makefile new file mode 100644 index 0000000..1be9797 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/cif/Makefile @@ -0,0 +1,7 @@ +INPUT=cif +include ../../../../common/makefiles/Makefile.include + +BMARK=tracking +include $(MAKEFILE_COMMON_DIR)/Makefile.common + + diff --git a/SD-VBS/benchmarks/tracking/data/cif/expected.m b/SD-VBS/benchmarks/tracking/data/cif/expected.m new file mode 100644 index 0000000..679cea9 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/cif/expected.m @@ -0,0 +1,2 @@ +269.915165 175.828888 195.635312 172.654409 268.516358 289.931921 267.230697 190.086741 +147.986242 145.928399 148.067509 130.441486 124.919389 64.008098 131.967361 162.460857 diff --git a/SD-VBS/benchmarks/tracking/data/cif/expected_C.txt b/SD-VBS/benchmarks/tracking/data/cif/expected_C.txt new file mode 100644 index 0000000..7830dcf --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/cif/expected_C.txt @@ -0,0 +1,2 @@ +268.790955 174.657776 196.000320 105.132706 172.262695 267.902679 288.945984 266.680359 190.432159 +146.301788 144.757889 146.543549 105.004868 130.337677 123.515228 63.038971 130.751785 160.921051 diff --git a/SD-VBS/benchmarks/tracking/data/fullhd/1.bmp b/SD-VBS/benchmarks/tracking/data/fullhd/1.bmp new file mode 100644 index 0000000..3db2ad6 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/fullhd/1.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/fullhd/2.bmp b/SD-VBS/benchmarks/tracking/data/fullhd/2.bmp new file mode 100644 index 0000000..9ff8e9c Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/fullhd/2.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/fullhd/3.bmp b/SD-VBS/benchmarks/tracking/data/fullhd/3.bmp new file mode 100644 index 0000000..ec53ae6 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/fullhd/3.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/fullhd/4.bmp b/SD-VBS/benchmarks/tracking/data/fullhd/4.bmp new file mode 100644 index 0000000..c45c5e9 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/fullhd/4.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/fullhd/Makefile b/SD-VBS/benchmarks/tracking/data/fullhd/Makefile new file mode 100644 index 0000000..2b37182 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/fullhd/Makefile @@ -0,0 +1,7 @@ +INPUT=fullhd +include ../../../../common/makefiles/Makefile.include + +BMARK=tracking +include $(MAKEFILE_COMMON_DIR)/Makefile.common + + diff --git a/SD-VBS/benchmarks/tracking/data/fullhd/expected.m b/SD-VBS/benchmarks/tracking/data/fullhd/expected.m new file mode 100644 index 0000000..eb034f0 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/fullhd/expected.m @@ -0,0 +1,2 @@ +1487.193453 720.553084 1481.188344 382.962678 +308.382612 306.797105 323.948844 369.542919 diff --git a/SD-VBS/benchmarks/tracking/data/fullhd/expected_C.txt b/SD-VBS/benchmarks/tracking/data/fullhd/expected_C.txt new file mode 100644 index 0000000..5608349 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/fullhd/expected_C.txt @@ -0,0 +1,2 @@ +1486.424561 732.003601 1482.234131 380.614441 +307.157501 334.762909 319.129578 367.587006 diff --git a/SD-VBS/benchmarks/tracking/data/qcif/1.bmp b/SD-VBS/benchmarks/tracking/data/qcif/1.bmp new file mode 100644 index 0000000..140ace2 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/qcif/1.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/qcif/10.bmp b/SD-VBS/benchmarks/tracking/data/qcif/10.bmp new file mode 100644 index 0000000..61518bc Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/qcif/10.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/qcif/2.bmp b/SD-VBS/benchmarks/tracking/data/qcif/2.bmp new file mode 100644 index 0000000..8e1f7cc Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/qcif/2.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/qcif/3.bmp b/SD-VBS/benchmarks/tracking/data/qcif/3.bmp new file mode 100644 index 0000000..95fe31f Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/qcif/3.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/qcif/4.bmp b/SD-VBS/benchmarks/tracking/data/qcif/4.bmp new file mode 100644 index 0000000..464608a Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/qcif/4.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/qcif/5.bmp b/SD-VBS/benchmarks/tracking/data/qcif/5.bmp new file mode 100644 index 0000000..71eb1b7 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/qcif/5.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/qcif/6.bmp b/SD-VBS/benchmarks/tracking/data/qcif/6.bmp new file mode 100644 index 0000000..83e5379 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/qcif/6.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/qcif/7.bmp b/SD-VBS/benchmarks/tracking/data/qcif/7.bmp new file mode 100644 index 0000000..95b4015 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/qcif/7.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/qcif/8.bmp b/SD-VBS/benchmarks/tracking/data/qcif/8.bmp new file mode 100644 index 0000000..8847887 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/qcif/8.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/qcif/9.bmp b/SD-VBS/benchmarks/tracking/data/qcif/9.bmp new file mode 100644 index 0000000..4301f11 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/qcif/9.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/qcif/Makefile b/SD-VBS/benchmarks/tracking/data/qcif/Makefile new file mode 100644 index 0000000..fb48d25 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/qcif/Makefile @@ -0,0 +1,7 @@ +INPUT=qcif +include ../../../../common/makefiles/Makefile.include + +BMARK=tracking +include $(MAKEFILE_COMMON_DIR)/Makefile.common + + diff --git a/SD-VBS/benchmarks/tracking/data/qcif/expected.m b/SD-VBS/benchmarks/tracking/data/qcif/expected.m new file mode 100644 index 0000000..65c5984 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/qcif/expected.m @@ -0,0 +1,2 @@ +142.858025 145.068198 102.770607 141.110282 90.859800 135.351851 80.185357 113.844268 117.388158 142.126183 80.877169 +70.993874 35.205162 77.320628 62.895414 38.040784 78.853200 86.164881 63.301686 74.036975 46.176383 92.916465 diff --git a/SD-VBS/benchmarks/tracking/data/qcif/expected_C.txt b/SD-VBS/benchmarks/tracking/data/qcif/expected_C.txt new file mode 100644 index 0000000..7796dba --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/qcif/expected_C.txt @@ -0,0 +1,2 @@ +133.082275 144.054230 100.963028 140.279068 89.887512 134.336441 69.720207 114.998512 116.348083 141.124100 79.836075 +55.176003 34.147427 76.485626 61.329086 37.049969 77.030098 83.134308 54.533726 73.046341 45.200169 91.896271 diff --git a/SD-VBS/benchmarks/tracking/data/sim/1.bmp b/SD-VBS/benchmarks/tracking/data/sim/1.bmp new file mode 100644 index 0000000..825ea49 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/sim/1.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/sim/2.bmp b/SD-VBS/benchmarks/tracking/data/sim/2.bmp new file mode 100644 index 0000000..d3451be Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/sim/2.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/sim/3.bmp b/SD-VBS/benchmarks/tracking/data/sim/3.bmp new file mode 100644 index 0000000..b060b06 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/sim/3.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/sim/4.bmp b/SD-VBS/benchmarks/tracking/data/sim/4.bmp new file mode 100644 index 0000000..137accc Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/sim/4.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/sim/Makefile b/SD-VBS/benchmarks/tracking/data/sim/Makefile new file mode 100644 index 0000000..42e2aa9 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/sim/Makefile @@ -0,0 +1,6 @@ +INPUT=sim +include ../../../../common/makefiles/Makefile.include + +BMARK=tracking +include $(MAKEFILE_COMMON_DIR)/Makefile.common + diff --git a/SD-VBS/benchmarks/tracking/data/sim/expected.m b/SD-VBS/benchmarks/tracking/data/sim/expected.m new file mode 100644 index 0000000..6f90559 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/sim/expected.m @@ -0,0 +1,2 @@ +24.422544 21.868191 40.786198 37.742716 30.302637 16.079615 30.062715 35.344185 +14.131628 32.266282 37.315204 24.606535 32.839030 14.301861 22.509506 15.748797 diff --git a/SD-VBS/benchmarks/tracking/data/sim/expected_C.txt b/SD-VBS/benchmarks/tracking/data/sim/expected_C.txt new file mode 100644 index 0000000..b3e4b48 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/sim/expected_C.txt @@ -0,0 +1,2 @@ +23.679535 20.567358 39.823669 36.499676 30.898752 13.758733 28.141140 34.485920 +12.935260 31.359093 36.248371 23.564877 30.130877 11.027717 22.152441 14.522795 diff --git a/SD-VBS/benchmarks/tracking/data/sim_fast/1.bmp b/SD-VBS/benchmarks/tracking/data/sim_fast/1.bmp new file mode 100644 index 0000000..272897c Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/sim_fast/1.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/sim_fast/2.bmp b/SD-VBS/benchmarks/tracking/data/sim_fast/2.bmp new file mode 100644 index 0000000..414d2cb Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/sim_fast/2.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/sim_fast/3.bmp b/SD-VBS/benchmarks/tracking/data/sim_fast/3.bmp new file mode 100644 index 0000000..340e885 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/sim_fast/3.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/sim_fast/4.bmp b/SD-VBS/benchmarks/tracking/data/sim_fast/4.bmp new file mode 100644 index 0000000..c347859 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/sim_fast/4.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/sim_fast/Makefile b/SD-VBS/benchmarks/tracking/data/sim_fast/Makefile new file mode 100644 index 0000000..12bcfa5 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/sim_fast/Makefile @@ -0,0 +1,6 @@ +INPUT=sim_fast +include ../../../../common/makefiles/Makefile.include + +BMARK=tracking +include $(MAKEFILE_COMMON_DIR)/Makefile.common + diff --git a/SD-VBS/benchmarks/tracking/data/sim_fast/expected.m b/SD-VBS/benchmarks/tracking/data/sim_fast/expected.m new file mode 100644 index 0000000..f944bf8 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/sim_fast/expected.m @@ -0,0 +1,2 @@ +25.330446 17.728868 14.459743 +16.949109 9.076394 22.247495 diff --git a/SD-VBS/benchmarks/tracking/data/sim_fast/expected_C.txt b/SD-VBS/benchmarks/tracking/data/sim_fast/expected_C.txt new file mode 100644 index 0000000..7d624d7 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/sim_fast/expected_C.txt @@ -0,0 +1,2 @@ +15.689241 12.913590 +8.660824 21.268520 diff --git a/SD-VBS/benchmarks/tracking/data/sqcif/1.bmp b/SD-VBS/benchmarks/tracking/data/sqcif/1.bmp new file mode 100644 index 0000000..06a8c3d Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/sqcif/1.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/sqcif/2.bmp b/SD-VBS/benchmarks/tracking/data/sqcif/2.bmp new file mode 100644 index 0000000..fd5c01f Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/sqcif/2.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/sqcif/3.bmp b/SD-VBS/benchmarks/tracking/data/sqcif/3.bmp new file mode 100644 index 0000000..14ab860 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/sqcif/3.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/sqcif/4.bmp b/SD-VBS/benchmarks/tracking/data/sqcif/4.bmp new file mode 100644 index 0000000..7afba08 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/sqcif/4.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/sqcif/Makefile b/SD-VBS/benchmarks/tracking/data/sqcif/Makefile new file mode 100644 index 0000000..c47a0fd --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/sqcif/Makefile @@ -0,0 +1,6 @@ +INPUT=sqcif +include ../../../../common/makefiles/Makefile.include + +BMARK=tracking +include $(MAKEFILE_COMMON_DIR)/Makefile.common + diff --git a/SD-VBS/benchmarks/tracking/data/sqcif/expected.m b/SD-VBS/benchmarks/tracking/data/sqcif/expected.m new file mode 100644 index 0000000..db8a05c --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/sqcif/expected.m @@ -0,0 +1,2 @@ +65.833985 96.386766 76.545247 96.006777 62.175348 60.185245 31.941927 68.970416 85.550211 109.931998 72.298306 74.080821 +25.209999 70.490525 41.265387 59.869753 52.207516 62.050369 30.542002 70.430274 63.040458 45.825585 49.742089 63.956939 diff --git a/SD-VBS/benchmarks/tracking/data/sqcif/expected_C.txt b/SD-VBS/benchmarks/tracking/data/sqcif/expected_C.txt new file mode 100644 index 0000000..51c3af8 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/sqcif/expected_C.txt @@ -0,0 +1,2 @@ +64.883919 96.402344 76.013298 86.118828 60.236912 59.199661 105.921989 32.250725 52.158295 119.325455 83.300941 69.831062 73.092682 106.911362 +24.166391 67.989792 39.654747 42.183876 60.438770 61.022652 18.258587 32.598579 46.195374 35.623253 56.018707 48.722729 62.872787 51.833832 diff --git a/SD-VBS/benchmarks/tracking/data/test/1.bmp b/SD-VBS/benchmarks/tracking/data/test/1.bmp new file mode 100644 index 0000000..72079a8 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/test/1.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/test/2.bmp b/SD-VBS/benchmarks/tracking/data/test/2.bmp new file mode 100644 index 0000000..d13e26c Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/test/2.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/test/3.bmp b/SD-VBS/benchmarks/tracking/data/test/3.bmp new file mode 100644 index 0000000..10eb499 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/test/3.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/test/4.bmp b/SD-VBS/benchmarks/tracking/data/test/4.bmp new file mode 100644 index 0000000..6536ea7 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/test/4.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/test/Makefile b/SD-VBS/benchmarks/tracking/data/test/Makefile new file mode 100644 index 0000000..963bebc --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/test/Makefile @@ -0,0 +1,5 @@ +INPUT=test +include ../../../../common/makefiles/Makefile.include + +BMARK=tracking +include $(MAKEFILE_COMMON_DIR)/Makefile.common diff --git a/SD-VBS/benchmarks/tracking/data/test/expected.m b/SD-VBS/benchmarks/tracking/data/test/expected.m new file mode 100644 index 0000000..139597f --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/test/expected.m @@ -0,0 +1,2 @@ + + diff --git a/SD-VBS/benchmarks/tracking/data/test/expected_C.txt b/SD-VBS/benchmarks/tracking/data/test/expected_C.txt new file mode 100644 index 0000000..139597f --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/test/expected_C.txt @@ -0,0 +1,2 @@ + + diff --git a/SD-VBS/benchmarks/tracking/data/test/time.txt b/SD-VBS/benchmarks/tracking/data/test/time.txt new file mode 100644 index 0000000..4cc9ce3 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/test/time.txt @@ -0,0 +1 @@ +0 68705406 diff --git a/SD-VBS/benchmarks/tracking/data/vga/1.bmp b/SD-VBS/benchmarks/tracking/data/vga/1.bmp new file mode 100644 index 0000000..9695b0c Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/vga/1.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/vga/2.bmp b/SD-VBS/benchmarks/tracking/data/vga/2.bmp new file mode 100644 index 0000000..937d03a Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/vga/2.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/vga/3.bmp b/SD-VBS/benchmarks/tracking/data/vga/3.bmp new file mode 100644 index 0000000..faedea3 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/vga/3.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/vga/4.bmp b/SD-VBS/benchmarks/tracking/data/vga/4.bmp new file mode 100644 index 0000000..2be82b8 Binary files /dev/null and b/SD-VBS/benchmarks/tracking/data/vga/4.bmp differ diff --git a/SD-VBS/benchmarks/tracking/data/vga/Makefile b/SD-VBS/benchmarks/tracking/data/vga/Makefile new file mode 100644 index 0000000..e3fa1c2 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/vga/Makefile @@ -0,0 +1,7 @@ +INPUT=vga +include ../../../../common/makefiles/Makefile.include + +BMARK=tracking +include $(MAKEFILE_COMMON_DIR)/Makefile.common + + diff --git a/SD-VBS/benchmarks/tracking/data/vga/expected.m b/SD-VBS/benchmarks/tracking/data/vga/expected.m new file mode 100644 index 0000000..05d987c --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/vga/expected.m @@ -0,0 +1,2 @@ +470.825057 292.917830 182.675337 492.818305 276.157171 504.514201 +216.367613 229.865854 255.912628 150.704991 276.525215 149.690554 diff --git a/SD-VBS/benchmarks/tracking/data/vga/expected_C.txt b/SD-VBS/benchmarks/tracking/data/vga/expected_C.txt new file mode 100644 index 0000000..2c17eed --- /dev/null +++ b/SD-VBS/benchmarks/tracking/data/vga/expected_C.txt @@ -0,0 +1,2 @@ +469.870941 285.200348 178.385620 159.507050 491.550690 272.205200 502.454071 +215.952835 273.082672 297.375244 132.275696 149.652573 273.382935 148.502777 diff --git a/SD-VBS/benchmarks/tracking/src/c/calcAreaSum.c b/SD-VBS/benchmarks/tracking/src/c/calcAreaSum.c new file mode 100644 index 0000000..40f03dc --- /dev/null +++ b/SD-VBS/benchmarks/tracking/src/c/calcAreaSum.c @@ -0,0 +1,81 @@ +/******************************** +Author: Sravanthi Kota Venkata +********************************/ + +#include "tracking.h" + +/** Compute the sum of pixels over pixel neighborhood. + Neighborhood = winSize*winSize + This will be useful when we compute the displacement + of the neighborhood across frames instead of tracking each pixel. + + Input: src Image + # rows, cols, size of window + Output: windowed-sum image, ret. + + Example: + + winSize = 4, cols = 8, rows = 16 + nave_half = 2, nave = 4 + Say, the first row of the image is: + 3 8 6 2 4 8 9 5 + a1 = 0 0 3 8 6 2 4 8 9 5 0 0 (append nave_half zeros to left and right border) + asum = (sum the first nave # pixels - 0 0 3 8 ) = 11 + ret(0,0) = 11 + For ret(0,1), we need to move the window to the right by one pixel and subtract + from a1sum the leftmost pixel. So, we add value 6 and subtract value at a1(0,0), = 0 here. + ret(0,1) = 17 = a1sum + For ret(0,2), a1sum - a1(0,1) + a1(2+nave) = 17 - 0 + 2 = 19 = a1sum + For ret(0,3), a1sum - a1(0,2) + a1(3+nave) = 19 - 3 + 4 = 20 = a1sum + + We proceed this way for all the rows and then perform summantion across all cols. +**/ +F2D* calcAreaSum(F2D* src, int cols, int rows, int winSize) +{ + int nave, nave_half, i, j, k; + F2D *ret, *a1; + float a1sum; + + nave = winSize; + nave_half = floor((nave+1)/2); + + ret = fMallocHandle(rows, cols); + a1 = fSetArray(1, cols+nave,0); + + for(i=0; iheight; + subsref(imgDims,0,1) = previousImageBlur_level1->width; + subsref(imgDims,1,0) = previousImageBlur_level2->height; + subsref(imgDims,1,1) = previousImageBlur_level2->width; + + pLevel = 2; + rate = fMallocHandle(1, 6); + + asubsref(rate,0) = 1; + asubsref(rate,1) = 0.5; + asubsref(rate,2) = 0.25; + asubsref(rate,3) = 0.125; + asubsref(rate,4) = 0.0625; + asubsref(rate,5) = 0.03125; + + winSizeSq = 4*winSize*winSize; + valid = iSetArray(1,nFeatures, 1); + + /** For each feature passed from previous frame, compute the dx and dy, the displacements **/ + for(i=0; i=0; level--) + { + x = x+x; + y = y+y; + dX = dX + dX; + dY = dY + dY; + imgSize_1 = subsref(imgDims,level,0); + imgSize_2 = subsref(imgDims,level,1); + + c_xx = 0; + c_xy = 0; + c_yy = 0; + + if((x-winSize)<0 || (y-winSize)<0 || (y+winSize+1)>=imgSize_1 || (x+winSize+1)>=imgSize_2) + { + asubsref(valid,i) = 0; + break; + } + + /** Perform interpolation. Use co-ord from previous + frame and use the images from current frame **/ + + if(level ==0) + { + iPatch = getInterpolatePatch(previousImageBlur_level1, imgSize_2, x, y, winSize); + iDxPatch = getInterpolatePatch(vertEdge_level1, imgSize_2, x, y, winSize); + iDyPatch = getInterpolatePatch(horzEdge_level1, imgSize_2, x, y, winSize); + } + if(level ==1) + { + iPatch = getInterpolatePatch(previousImageBlur_level2, imgSize_2, x, y, winSize); + iDxPatch = getInterpolatePatch(vertEdge_level2, imgSize_2, x, y, winSize); + iDyPatch = getInterpolatePatch(horzEdge_level2, imgSize_2, x, y, winSize); + } + + /** Compute feature strength in similar way as calcGoodFeature **/ + for(idx=0; idx=imgSize_1 || (x+dX+winSize+1)>=imgSize_2) + { + asubsref(valid,i) = 0; + break; + } + + if(level == 0) + jPatch = getInterpolatePatch(currentImageBlur_level1, imgSize_2, x+dX, y+dY, winSize); + if(level == 1) + jPatch = getInterpolatePatch(currentImageBlur_level2, imgSize_2, x+dX, y+dY, winSize); + + eX = 0; + eY = 0; + for(idx=0; idxheight; + 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; +} diff --git a/SD-VBS/benchmarks/tracking/src/c/getANMS.c b/SD-VBS/benchmarks/tracking/src/c/getANMS.c new file mode 100644 index 0000000..7ecce8b --- /dev/null +++ b/SD-VBS/benchmarks/tracking/src/c/getANMS.c @@ -0,0 +1,156 @@ +/******************************** +Author: Sravanthi Kota Venkata +********************************/ + +#include "tracking.h" + +/** ANMS - Adaptive Non-Maximal Suppression + This function takes features as input and suppresses those which + are close to each other (within the SUPPRESSION_RADIUS) and have + similar feature strength +**/ +F2D *getANMS (F2D *points, float r) +{ + float MAX_LIMIT = 100000; + F2D *suppressR; + float C_ROBUST = 1.0; + F2D *srtdPnts; + int n; + I2D *srtdVIdx, *supId; + float t, t1, r_sq; + F2D *tempF, *srtdV, *interestPnts; + int i, j, validCount, cnt, end, k; + int iter, rows, cols; + F2D *temp; + int supIdPtr = 0; + + /** Concatenate x,y,v to form points matrix **/ + r_sq = r * r; + n = points->height; + + srtdVIdx = iMallocHandle(points->height, 1); + for (i = 0; i < srtdVIdx->height; i++) { + asubsref(srtdVIdx,i) = i; + } + srtdPnts = fMallocHandle (srtdVIdx->height, points->width); + for (i = 0; i < srtdVIdx->height; i++) { + for(j=0; jwidth; j++) { + subsref(srtdPnts,i,j) = subsref(points, asubsref(srtdVIdx,i), j); + } + } + temp = fSetArray (1, 3, 0); + suppressR = fSetArray(n, 1, MAX_LIMIT); + validCount = n; + iter = 0; + + /** Allocate supId for #validCount and fill the values of + supId with the indices where suppressR>r_sq **/ + k = 0; + supId = iMallocHandle(validCount, 1); + for (i = 0; i < (suppressR->height*suppressR->width); i++) + { + if ( asubsref(suppressR,i) > r_sq) + { + asubsref(supId,k++) = i; + } + } + + /** While number of features not-inspected is >0, **/ + while (validCount > 0) + { + F2D *tempp, *temps; + + /** Inspect the strongest feature point in srtdPnts + The index of that feature is in supId and the + index values in supId are arranged in descending order **/ + asubsref(temp,0) = subsref(srtdPnts, asubsref(supId,0), 0); + asubsref(temp,1) = subsref(srtdPnts, asubsref(supId,0), 1); + asubsref(temp,2) = subsref(srtdPnts, asubsref(supId,0), 2); + + /** Stacking up the interestPnts matrix with top features + post suppression **/ + if(iter == 0) + interestPnts = fDeepCopy(temp); + else + { + tempp = fDeepCopy(interestPnts); + fFreeHandle(interestPnts); + interestPnts = ffVertcat(tempp, temp); + fFreeHandle(tempp); + } + iter++; + + tempp = fDeepCopy(srtdPnts); + temps = fDeepCopy(suppressR); + + fFreeHandle(srtdPnts); + fFreeHandle(suppressR); + + /** Remove the feature that has been added to interestPnts **/ + srtdPnts = fMallocHandle(supId->height-1, 3); + suppressR = fMallocHandle(supId->height-1, 1); + k=0; + + for(i=1; i<(supId->height); i++) /** Filling srtdPnts after removing the feature that was added to interestPnts**/ + { + subsref(srtdPnts,(i-1),0) = subsref(tempp, asubsref(supId,i) ,0); + subsref(srtdPnts,(i-1),1) = subsref(tempp, asubsref(supId,i) ,1); + subsref(srtdPnts,(i-1),2) = subsref(tempp, asubsref(supId,i) ,2); + subsref(suppressR,(i-1),0) = subsref(temps, asubsref(supId,i) ,0); + } + + fFreeHandle(tempp); + fFreeHandle(temps); + rows = interestPnts->height-1; + cols = interestPnts->width; + + /** For each feature, find how robust it is compared to the one in interestPnts **/ + for (i = 0; i < srtdPnts->height; i++) + { + t = 0; + t1 = 0; + + if ((C_ROBUST * subsref(interestPnts,rows,2)) >= subsref(srtdPnts, i,2)) + { + t = subsref(srtdPnts, i,0) - subsref(interestPnts,rows,0); + t1 = subsref(srtdPnts, i,1) - subsref(interestPnts,rows,1); + t = t * t + t1 * t1; + t1 = 0; + } + + if ((C_ROBUST * subsref(interestPnts,rows,2)) < subsref(srtdPnts, i,2)) + t1 = 1 * MAX_LIMIT; + + if ( asubsref(suppressR, i) > (t + t1)) + { + asubsref(suppressR, i) = t + t1; + } + } + + /** Inspect the new suppressR to find how many valid features left **/ + validCount=0; + for (i = 0; i < suppressR->height; i++) { + if ( asubsref(suppressR,i) > r_sq) { + validCount++; + } + } + k = 0; + iFreeHandle(supId); + /** Allocate supId for #validCount and fill the values of + supId with the indices where suppressR>r_sq **/ + supId = iMallocHandle(validCount, 1); + for (i = 0; i < suppressR->height*suppressR->width; i++) { + if ( asubsref(suppressR,i) > r_sq) + asubsref(supId,k++) = i; + } + } + + iFreeHandle(supId); + iFreeHandle(srtdVIdx); + fFreeHandle(srtdPnts); + fFreeHandle(temp); + fFreeHandle(suppressR); + + return interestPnts; +} + diff --git a/SD-VBS/benchmarks/tracking/src/c/getInterpolatePatch.c b/SD-VBS/benchmarks/tracking/src/c/getInterpolatePatch.c new file mode 100644 index 0000000..99e95f9 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/src/c/getInterpolatePatch.c @@ -0,0 +1,43 @@ +/******************************** +Author: Sravanthi Kota Venkata +********************************/ + +#include "tracking.h" + +/** Perform simple interpolation around 2*winSize*2*winSize neighbourhood **/ +F2D* getInterpolatePatch(F2D* src, int cols, float centerX, float centerY, int winSize) +{ + F2D *dst; + float a, b, a11, a12, a21, a22; + int i, j, k, srcIdx, dstIdx; + int srcIdxx, dstIdxx; + + a = centerX - floor(centerX); + b = centerY - floor(centerY); + + a11 = (1-a)*(1-b); + a12 = a*(1-b); + a21 = (1-a)*b; + a22 = a*b; + + dst = fSetArray(1,2*winSize*2*winSize, 0); + + + for(i=-winSize; i +#include "extra.h" +#define TRACKING_MEM 1<<29 + +int main(int argc, char* argv[]) +{ + SET_UP + mallopt(M_TOP_PAD, TRACKING_MEM); + mallopt(M_MMAP_MAX, 0); + int i, j, k, N_FEA, WINSZ, LK_ITER, rows, cols; + int endR, endC; + F2D *blurredImage, *previousFrameBlurred_level1, *previousFrameBlurred_level2, *blurred_level1, *blurred_level2; + F2D *verticalEdgeImage, *horizontalEdgeImage, *verticalEdge_level1, *verticalEdge_level2, *horizontalEdge_level1, *horizontalEdge_level2, *interestPnt; + F2D *lambda, *lambdaTemp, *features; + I2D *Ic, *status; + float SUPPRESION_RADIUS; + F2D *newpoints; + + int numFind, m, n; + F2D *np_temp; + + char im1[100]; + int counter=2; + float accuracy = 0.03; + int count; + + + N_FEA = 1600; + WINSZ = 4; + SUPPRESION_RADIUS = 10.0; + LK_ITER = 20; + + #ifdef test + WINSZ = 2; + N_FEA = 100; + LK_ITER = 2; + counter = 2; + accuracy = 0.1; + #endif + #ifdef sim_fast + WINSZ = 2; + N_FEA = 100; + LK_ITER = 2; + counter = 4; + #endif + #ifdef sim + WINSZ = 2; + N_FEA = 200; + LK_ITER = 2; + counter = 4; + #endif + #ifdef sqcif + WINSZ = 8; + N_FEA = 500; + LK_ITER = 15; + counter = 2; + #endif + #ifdef qcif + WINSZ = 12; + N_FEA = 400; + LK_ITER = 15; + counter = 4; + #endif + #ifdef cif + WINSZ = 20; + N_FEA = 500; + LK_ITER = 20; + counter = 4; + #endif + #ifdef vga + WINSZ = 32; + N_FEA = 400; + LK_ITER = 20; + counter = 4; + #endif + #ifdef wuxga + WINSZ = 64; + N_FEA = 500; + LK_ITER = 20; + counter = 4; + #endif + #ifdef fullhd + WINSZ = 48; + N_FEA = 500; + LK_ITER = 20; + counter = 4; + #endif + + I2D* images[counter]; + /** Read input image **/ + for(count=1; count<=counter; count++) + { + /** Read image **/ + printf("Input image %d: ", count); + scanf("%s", im1); + images[count - 1] = readImage(im1); + if(count == 1) Ic = readImage(im1); + } + + + rows = Ic->height; + cols = Ic->width; + + printf("start\n"); + for_each_job{ + + /** IMAGE PRE-PROCESSING **/ + + /** Blur the image to remove noise - weighted avergae filter **/ + blurredImage = imageBlur(Ic); + + /** Scale down the image to build Image Pyramid. We find features across all scales of the image **/ + blurred_level1 = blurredImage; /** Scale 0 **/ + blurred_level2 = imageResize(blurredImage); /** Scale 1 **/ + + + /** Edge Images - From pre-processed images, build gradient images, both horizontal and vertical **/ + verticalEdgeImage = calcSobel_dX(blurredImage); + horizontalEdgeImage = calcSobel_dY(blurredImage); + + /** Edge images are used for feature detection. So, using the verticalEdgeImage and horizontalEdgeImage images, we compute feature strength + across all pixels. Lambda matrix is the feature strength matrix returned by calcGoodFeature **/ + + lambda = calcGoodFeature(verticalEdgeImage, horizontalEdgeImage, verticalEdgeImage->width, verticalEdgeImage->height, WINSZ); + endR = lambda->height; + endC = lambda->width; + lambdaTemp = fReshape(lambda, endR*endC, 1); + + /** We sort the lambda matrix based on the strengths **/ + /** Fill features matrix with top N_FEA features **/ + fFreeHandle(lambdaTemp); + lambdaTemp = fillFeatures(lambda, N_FEA, WINSZ); + features = fTranspose(lambdaTemp); + + /** Suppress features that have approximately similar strength and belong to close neighborhood **/ + interestPnt = getANMS(features, SUPPRESION_RADIUS); + + /** Refill interestPnt in features matrix **/ + fFreeHandle(features); + features = fSetArray(2, interestPnt->height, 0); + for(i=0; i<2; i++) { + for(j=0; jheight; j++) { + subsref(features,i,j) = subsref(interestPnt,j,i); + } + } + + + fFreeHandle(verticalEdgeImage); + fFreeHandle(horizontalEdgeImage); + fFreeHandle(interestPnt); + fFreeHandle(lambda); + fFreeHandle(lambdaTemp); + /** Until now, we processed base frame. The following for loop processes other frames **/ + for(count=1; count<=counter; count++) + { + /** Read image **/ + //sprintf(im1, "%s/%d.bmp", argv[1], count); + //Ic = readImage(im1); + I2D* Icc = images[count-1]; + rows = Icc->height; + cols = Icc->width; + + + /** Blur image to remove noise **/ + blurredImage = imageBlur(Icc); + previousFrameBlurred_level1 = fDeepCopy(blurred_level1); + previousFrameBlurred_level2 = fDeepCopy(blurred_level2); + + fFreeHandle(blurred_level1); + fFreeHandle(blurred_level2); + + /** Image pyramid **/ + blurred_level1 = blurredImage; + blurred_level2 = imageResize(blurredImage); + + /** Gradient image computation, for all scales **/ + verticalEdge_level1 = calcSobel_dX(blurred_level1); + horizontalEdge_level1 = calcSobel_dY(blurred_level1); + + verticalEdge_level2 = calcSobel_dX(blurred_level2); + horizontalEdge_level2 = calcSobel_dY(blurred_level2); + + newpoints = fSetArray(2, features->width, 0); + + /** Based on features computed in the previous frame, find correspondence in the current frame. "status" returns the index of corresponding features **/ + status = calcPyrLKTrack(previousFrameBlurred_level1, previousFrameBlurred_level2, verticalEdge_level1, verticalEdge_level2, horizontalEdge_level1, horizontalEdge_level2, blurred_level1, blurred_level2, features, features->width, WINSZ, accuracy, LK_ITER, newpoints); + fFreeHandle(verticalEdge_level1); + fFreeHandle(verticalEdge_level2); + fFreeHandle(horizontalEdge_level1); + fFreeHandle(horizontalEdge_level2); + fFreeHandle(previousFrameBlurred_level1); + fFreeHandle(previousFrameBlurred_level2); + //printf("height = %d, width = %d, numFind = %d\n", newpoints->height, newpoints->width); + + /** Populate newpoints with features that had correspondence with previous frame features **/ + np_temp = fDeepCopy(newpoints); + if(status->width > 0 ) + { + k = 0; + numFind=0; + for(i=0; iwidth; i++) + { + if( asubsref(status,i) == 1) + numFind++; + } + fFreeHandle(newpoints); + newpoints = fSetArray(2, numFind, 0); + + for(i=0; iwidth; i++) + { + if( asubsref(status,i) == 1) + { + subsref(newpoints,0,k) = subsref(np_temp,0,i); + subsref(newpoints,1,k++) = subsref(np_temp,1,i); + } + } + } + + iFreeHandle(status); + fFreeHandle(np_temp); + fFreeHandle(features); + + /** Populate newpoints into features **/ + features = fDeepCopy(newpoints); + fFreeHandle(newpoints); + } + } + printf("end..\n"); +#ifdef CHECK + /* Self checking */ + { + int ret=0; + float tol = 2.0; +#ifdef GENERATE_OUTPUT + fWriteMatrix(features, argv[1]); +#endif + ret = fSelfCheck(features, "expected_C.txt", tol); + if (ret == -1) + printf("Error in Tracking Map\n"); + } +#endif + + fFreeHandle(blurred_level1); + fFreeHandle(blurred_level2); + fFreeHandle(features); + + for(count=1; count<=counter; count++) + { + free(images[count - 1] ); + } + iFreeHandle(Ic); + WRITE_TO_FILE + return 0; + +} + + + diff --git a/SD-VBS/benchmarks/tracking/src/c/tracking.h b/SD-VBS/benchmarks/tracking/src/c/tracking.h new file mode 100644 index 0000000..24b8b2d --- /dev/null +++ b/SD-VBS/benchmarks/tracking/src/c/tracking.h @@ -0,0 +1,20 @@ +/******************************** +Author: Sravanthi Kota Venkata +********************************/ + +#ifndef _SCRIPT_TRACK_ +#define _SCRIPT_TRACK_ + +#include "sdvbs_common.h" + +F2D* calcAreaSum(F2D* src, int cols, int rows, int winSize); +F2D* calcGoodFeature(F2D* dX, F2D* dY, int cols, int rows, int winSize); +I2D* calcPyrLKTrack(F2D* ip1, F2D* ip2, F2D* idxp1, F2D* idxp2, F2D* idyp1, F2D* idyp2, F2D* jp1, F2D* jp2, F2D* fPnt, int nFeatures, int winSize, float accuracy, int maxIter, F2D* newPnt); +F2D *getANMS (F2D *points, float r); +F2D* getInterpolatePatch(F2D* src, int cols, float centerX, float centerY, int winSize); +float polynomial(int d, F2D* a, F2D* b, int dim); +I2D* sortInd(F2D* input, int dim); +F2D* fillFeatures(F2D* lambda, int N_FEA, int win); + +#endif + -- cgit v1.2.2 From 163c440444c74a4e0bbe0a8db3d1ca725413994b Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Thu, 22 Oct 2020 03:17:31 -0400 Subject: Make SD-VBS compatible with run_bench.sh and cleanup SD-VBS: - Run silently - Fix some whitespace errors - Don't duplicate extra.h - Auto-detect if building with LITMUS-RT - Disable result checking - Add helper symlinks Misc: - Remove unused code from libextra - Set some missing rt_param fields in libextra - Disable CSV info dump from computeSMTslowdown.sh - Widen scope of .gitignore on .txt files - Include list of 2MB DIS pair benchmarks and inputs --- SD-VBS/benchmarks/tracking/src/c/script_tracking.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'SD-VBS/benchmarks/tracking') diff --git a/SD-VBS/benchmarks/tracking/src/c/script_tracking.c b/SD-VBS/benchmarks/tracking/src/c/script_tracking.c index bb48ace..2938126 100644 --- a/SD-VBS/benchmarks/tracking/src/c/script_tracking.c +++ b/SD-VBS/benchmarks/tracking/src/c/script_tracking.c @@ -96,19 +96,16 @@ int main(int argc, char* argv[]) for(count=1; count<=counter; count++) { /** Read image **/ - printf("Input image %d: ", count); - scanf("%s", im1); + scanf("%s", im1); images[count - 1] = readImage(im1); - if(count == 1) Ic = readImage(im1); + if(count == 1) Ic = readImage(im1); } rows = Ic->height; cols = Ic->width; - printf("start\n"); - for_each_job{ - + for_each_job { /** IMAGE PRE-PROCESSING **/ /** Blur the image to remove noise - weighted avergae filter **/ @@ -230,8 +227,8 @@ int main(int argc, char* argv[]) fFreeHandle(newpoints); } } - printf("end..\n"); -#ifdef CHECK + +#ifdef CHECK /* Self checking */ { int ret=0; -- cgit v1.2.2