This project demonstrates the Euclidean Distance Transform (EDT) using the Nvidia Performance Primitives (NPP+) library. The Euclidean Distance Transform calculates the shortest distance from each pixel in a binary image to the nearest object or boundary, which is a key task in image segmentation and object detection.
- Euclidean Distance Transform: Determines the Euclidean distance between image elements and the nearest object or boundary.
- Image Segmentation: Separates an image into distinct regions based on object boundaries or other criteria.
This example is optimized for the following Nvidia GPU architectures:
- Linux
- Windows
- x86_64
To get started with this project, you will need to download and install the latest version of the NPP+ library:
This project uses key functions from the NPP+ library to efficiently compute the Euclidean distance transform on Nvidia GPUs.
This project consists of the following main component:
- Euclidean Distance Transform (EDT): Computes the Euclidean distance between pixels and the nearest object or boundary.
Before building and running the project, ensure that your system meets the following requirements:
- A Linux or Windows system with an Nvidia GPU.
- The latest NVIDIA drivers installed.
- CUDA 12.0 Toolkit and above installed.
$ mkdir build
$ cd build
$ cmake .. -DNPP_PLUS_PATH=/usr/lib/x86_64-linux-gnu
$ make
$ mkdir build
$ cd build
$ cmake -DCMAKE_GENERATOR_PLATFORM=x64 ..
$ Open distanceTransform.sln project in Visual Studio 15 2017 and build
./distanceTransform -h
Usage: ./distanceTransform
Parameters:
number-of-images : Use 2 number of images
Sample Output:
$ ./distanceTransform
./distanceTransform
NPP Library Version 0.9.0 CUDA Driver Version: 12.7 CUDA Runtime Version: 12.6
Input file load succeeded. Input file load succeeded. Done!