Implement Watershed Algorithm using OpenCV for image segmentation.
First of all clone repository.
git clone https://github.com/ravirajsinh45/image_segmentation_using_opencv.git
change working directoy
cd image_segmentation_using_opencv/
I'm using python 3.7.9 for this project
Install all requirements
pip install -r requirements.txt
You can also create virtual environment for this if you want.
-
Open segmentation_using_watershed_algo notebook.
-
Add path of any image you want to segment and run all cell of notebook.
-
It will open 3 windows
- Image
- Segments
- segmented_boundries
-
In Image window add marker by following below steps
-
when you click like wise segmentation done in segments window and boundry creation on segmented_boundry.
-
If you want to clear segmentation click C key from keyoard.
-
If you want to exit click Esc key from keyoard.