/2D_ipp_CFAR

wo-Dimensional (2D) Intel Integrated Performance Primitives (IPP) Constant False Alarm Rate (CFAR) Detector

Primary LanguageC++MIT LicenseMIT

Two-Dimensional (2D) Intel Integrated Performance Primitives (IPP) Constant False Alarm Rate (CFAR) Detector

Using's Intel's Integrated Performance Primitives (IPP) we make a two-dimensional Constant False Alarm Rate (CFAR) detector. This is code is useful when detecting relatively bright and small objects in a image. For example, if you wanted to detect the locations of stars in an image, but that image had a non-uniform background so a simple threshold hold will not work.

Setup

IPP needs to be installed. A standalone installation of IPP is used. A getting started guide is here with some example code which is copied to ipp_getting_started_example.cpp with the @ characters removed (g++ did not compile with unicode).

To compile:

source /opt/intel/oneapi/ipp/latest/env/vars.sh
g++ ipp_getting_started_example.cpp -o ipp_getting_started_example -I $IPPROOT/include -L $IPPROOT/lib/linux -lippcore

Finally, execute ./ipp_getting_started_example. You should see a print out of a table with features and their support.

OpenCV is used to read in images. It's built from source. A function to test loading and displaying an image can be built and ran with

 g++ open_image.cpp -o open_image `pkg-config --cflags --libs opencv4` && ./open_image 

The above code uses this star image the open source image from pixabay.

Main Program

add IPP headers and libraies to path

source /opt/intel/oneapi/ipp/latest/env/vars.sh 

Build and run with

g++ main.cpp -o main -I $IPPROOT/include -L $IPPROOT/lib/intel64 -lippi -lipps -lippcore -lippcv `pkg-config --cflags --libs opencv4` && ./main 

Build and check for memory leaks with:

g++ main.cpp -g -oo -Wextra -pedantic -Wshadow -I $IPPROOT/include -L $IPPROOT/lib/intel64 -lippi -lipps -lippcore -lippcv `pkg-config --cflags --libs opencv4` -o main && valgrind --leak-check=full --show-leak-kinds=all -s ./main