This project was developed as part of the course Mif02 - "Computer Graphics and Image Processing" for the Master's program in Computer Science at the University Claude Bernard Lyon 1, Villeurbanne, France.
The project focuses on image segmentation using the region-growing technique. For more detailed information, please refer to rapport.pdf.
.
├── ressources # contains input images
| ├── image_couche.png
| └── image_debout.png
├── src
| ├── GermsPositioning.hpp
| ├── GrowAndMerge.hpp
| ├── ImageProcessor.hpp
| ├── ImageUtil.hpp
| ├── main.cpp
| └── SegmentedRegion.hpp
├── CMakeLists.txt
├── README.md
└── rapport.pdf
This project relies on OpenCV. Please follow this link to install OpenCV on your system.
-
Using Visual Studio 17:
- Open PowerShell, navigate to the project directory, and run the following commands:
cmake -B build -G "Visual Studio 17 2022"
- Open the solution
RegionGrowing.sln
in Visual Studio. - Build the
seg
project and set it as the startup project. - Go to
Debug
->seg Debugging Properties
->Debugging
->Command Arguments
:- Add the following command-line arguments:
../ressources/<image to load> <0 or 1 for boundary display> <0 or 1 for colorization mode>
- Example:
../ressources/image_debout.png 0 1
- Add the following command-line arguments:
- Switch to
Release
mode and run the program.
- Open PowerShell, navigate to the project directory, and run the following commands:
-
Using CLion:
- Open the project in CLion as a
CMake
project. - Navigate to
CMake Profiles
->Edit CMake Profiles
- Add a
Release
profile using Visual Studio as theToolchain
.
- Add a
- Build the
seg
project and set it as the startup project. - Go to
Run
->Edit Configurations
->Debug
->Program Arguments
:- Add the following command-line arguments:
- Example:
../ressources/image_debout.png 0 1
- Example:
- Add the following command-line arguments:
- Select the
Release-Visual Studio
CMake profile and run the program.
- Open the project in CLion as a
- Navigate to the project directory and run:
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build/ -t seg
- Once the executable is created, you can run it with the following command:
- Example:
./build/seg ./ressources/image_debout.png 0 1
- Example:
The command follows this format: ./seg <path/to/your/image> <display mode> <colorization mode>
<path/to/your/image>
: Path to the image to be processed (mandatory).<display mode>
:- 0: Display complete regions.
- 1: Display only region boundaries.
<colorization mode>
:- 0: Colorization based on the original image.
- 1: Random colorization.