Skip to content

Parallel implementation of Image Segmentation using Mean Shift algorithm employing OpenMP and CUDA

Notifications You must be signed in to change notification settings

RINO-GAELICO/ImageSegmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Segmentation and Border Highlighting

This C++ program performs image segmentation using mean-shift algorithm and highlights the borders of the segmented regions.

OpenMeanShift SERIAL

This repository contains an implementation of the Mean Shift algorithm in SERIAL. The code is designed to run on a CPU, and the following steps guide you through the process of building and running the program.

Prerequisites

  • C++ compiler

Compile the program on Perlmutter:

module load cpu salloc --nodes 1 --qos interactive --time 00:30:00 --constraint cpu --account=m3930 mkdir build cd build cmake .. make

Run

After successfully building the project, you can run the executable. Inside build run the following command:

main/main "<input image> <area> <sigmaS> <sigmaR> <implementation>

Example:

main/main ../data/512_cat.png 200 16 16 "SERIAL"

OpenMeanShift OPEN_MP

Prerequisites

  • C++ compiler with OpenMP support

Compile the program on Perlmutter:

Same as Serial but add this command for # of Threads:

export OMP_NUM_THREADS=4

Change the number before running the executable.

Run

After successfully building the project, you can run the executable.

main/main "<input image> <area> <sigmaS> <sigmaR> "OPEN_MP"

OpenMeanShift CUDA

Prerequisites

Before you start, make sure you have access to an environment with NVIDIA GPU.

salloc --nodes 1 --qos interactive --time 00:30:00 --constraint gpu --account=m3930

Set up the environment like this:

    module load PrgEnv-nvidia
    export CC=cc
    export CXX=CC 

Then, once your environment is set up, then:

    mkdir build  
    cd build  
    cmake ../  
    make

Run

After successfully building the project, you can run the executable. Depending on the program arguments, the application switches between different implementations of the Mean Shift algorithm.

main/main "<input image> <area> <sigmaS> <sigmaR> <implementation>

About

Parallel implementation of Image Segmentation using Mean Shift algorithm employing OpenMP and CUDA

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published