This project focuses on the implementation of two image processing algorithms, namely Variable Threshold and Multiple Threshold, utilizing CUDA (Compute Unified Device Architecture) for parallel computation. Image segmentation is a critical step in computer vision and graphics, aiding in the extraction of meaningful information from images by dividing them into regions of interest.
The Variable Threshold algorithm involves determining optimal thresholds for image segmentation based on pixel intensities. It dynamically adjusts the threshold values, enhancing adaptability to varying image characteristics.
The project is implemented in the C programming language, leveraging the power of CUDA for parallel processing on NVIDIA GPUs.
Ensure you have the following prerequisites installed before using this project:
-
CUDA Toolkit: The project leverages CUDA for parallel computing, so make sure you have the CUDA Toolkit installed on your system.
-
Visual Studio: The project is developed using Visual Studio. You can use the Community edition, which is free and suitable for CUDA development.
-
NVIDIA GPU: A CUDA-compatible NVIDIA GPU is required to execute the parallelized code efficiently.
- Clone the Repository
git https://github.com/nsimona/cuda-threshold.git
cd cuda-threshold
- Open in Visual Studio
Open the project solution file (.sln) in Visual Studio.
- Build and Run
Build the solution in Visual Studio, ensuring that the CUDA-enabled GPU is selected. Run the project to execute the image segmentation algorithms.
The test-images
directory contains three sample images that showcase the results of the implemented algorithms (+ 2 additional images in /results
):
original.jpg
: The original input image.threshold-result.jpg
: Result of the Threshold algorithm.variable-threshold-result.jpg
: Result of the Variable Threshold algorithm.