This sample demonstrates how to detect and extract contours from an image using NVIDIA’s NPP library. It performs unified labeling, label compression, and geometric contour reconstruction on grayscale input images.
- Unified Framework (UF) Labeling
- Connected Component Analysis
- Image Contour Extraction using CUDA/NPP
- Operating System: Linux or Windows
- CPU Architecture: x86_64
- GPU Support: CUDA-enabled GPUs (SM 7.0, 7.2, 7.5, 8.0, and above)
- Toolkit: CUDA Toolkit 11.4 or later
- Libraries: NPP, CMake, and CUDA Runtime
mkdir build
cd build
cmake ..
makemkdir build
cd build
cmake -DCMAKE_GENERATOR_PLATFORM=x64 ..Then open findContour.sln in Visual Studio (2017 or later) and build the solution.
./findContourExample Output:
./build/findContour
Done. Compressed Labels: 274
CircuitBoard_2048x1024_8u.raw- Format: 8-bit unsigned grayscale
- Dimensions: 2048 x 1024
- File:
CircuitBoard_LabelMarkersUF_8Way_2048x1024_32u.raw - Generated by:
nppiLabelMarkersUF_8u32u_C1R_Ctx
- File:
CircuitBoard_CompressedMarkerLabelsUF_8Way_2048x1024_32u.raw - Generated by:
nppiCompressMarkerLabelsUF_32u_C1IR_Ctx
- File:
CircuitBoard_Contours_8Way_2048x1024_8u.raw - Generated by:
nppiCompressedMarkerLabelsUFInfo_32u_C1R_Ctx
- File:
CircuitBoard_ContoursReconstructed_8Way_2048x1024_8u.raw - Generated by:
nppiCompressedMarkerLabelsUFContoursOutputGeometryLists_C1R




