This project implements BMP image processing in three versions: sequential, MPI parallel, and OpenMP parallel.
The program processes images in three steps:
- Median Filter: Removes noise using an N×N filter (3×3, 5×5, 7×7, etc.)
- Grayscale Conversion: Converts color images to grayscale
- Histogram Equalization: Improves image contrast
make allRequirements:
- GCC with C11 support
- OpenMP (usually included with GCC)
- MPI (OpenMPI or MPICH)
./bin/sequential <mask_size> <input_file>mpirun -np <num_processes> ./bin/mpi_version <mask_size> <input_file>./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.bmpParameters:
mask_size: Filter size (must be odd: 3, 5, 7, etc.)num_processes(MPI): Number of MPI processesnum_threads(OpenMP): Number of OpenMP threadsinput_file: Path to input BMP file
Run automated performance tests:
./test_performance.sh data/img.bmpThis tests all versions with different mask sizes and calculates speedup and efficiency metrics. Results are saved to performance_results.txt and performance_metrics.csv.
Processed images are saved in the output/ directory:
sequential_<mask>_output.bmpmpi_<mask>_output.bmpopenmp_<mask>_output.bmp
make cleanRemoves compiled binaries and output images.
- 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