Skip to content

gabs-vieira/mpi-openmp-hist-equalization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Processing - Sequential, MPI, and OpenMP

This project implements BMP image processing in three versions: sequential, MPI parallel, and OpenMP parallel.

What it does

The program processes images in three steps:

  1. Median Filter: Removes noise using an N×N filter (3×3, 5×5, 7×7, etc.)
  2. Grayscale Conversion: Converts color images to grayscale
  3. Histogram Equalization: Improves image contrast

Build

make all

Requirements:

  • GCC with C11 support
  • OpenMP (usually included with GCC)
  • MPI (OpenMPI or MPICH)

Usage

Sequential

./bin/sequential <mask_size> <input_file>

MPI

mpirun -np <num_processes> ./bin/mpi_version <mask_size> <input_file>

OpenMP

./bin/openmp_version <mask_size> <num_threads> <input_file>

Examples:

./bin/sequential 3 data/img.bmp
mpirun -np 4 ./bin/mpi_version 3 data/img.bmp
./bin/openmp_version 3 4 data/img.bmp

Parameters:

  • mask_size: Filter size (must be odd: 3, 5, 7, etc.)
  • num_processes (MPI): Number of MPI processes
  • num_threads (OpenMP): Number of OpenMP threads
  • input_file: Path to input BMP file

Performance Testing

Run automated performance tests:

./test_performance.sh data/img.bmp

This tests all versions with different mask sizes and calculates speedup and efficiency metrics. Results are saved to performance_results.txt and performance_metrics.csv.

Output

Processed images are saved in the output/ directory:

  • sequential_<mask>_output.bmp
  • mpi_<mask>_output.bmp
  • openmp_<mask>_output.bmp

Clean

make clean

Removes compiled binaries and output images.

Notes

  • Supports 24-bit BMP images (uncompressed)
  • Mask size must be odd (3, 5, 7, 9, etc.)
  • Processing time is displayed at the end of execution

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors