Skip to content

moksh-401-511/RGB2oSeg

Repository files navigation

RGB2oSeg

RGB based 2nd order Image Segmentation.

  • Segmenting image in top 'n' colors present ['n' is given by user].
  • Using RGB image format and KMeans clustering algo.
  • Sub-labelling dissconnected pixel sections belonging to same Cluster.

RGB based 2nd order Segmentation shown with Labelling

RGB2oSeg

Usage

Note: Run the following codes in command terminal.

1. Clone the repository

git clone https://github.com/moksh-401-511/RGB2oSeg.git

2. Running Segmentation

Paste image into 'Image' directory present in RGB2oSeg dir
In command terminal, move to RGB2oSeg directory.

# -i : (test_image.png) input image name
# -c : (2/3/4..) number of clusters to segment image
# -s : (1/0) whether to perform sub-segmentation
python RGB-sub-segmentation.py -i test_image.png -c 3 -s 1

Segmented images will be stored in 'Segmented_images' directory and corresponding labeled matrices (for both segmentation and sub-segmentation) are stored as numpy-binary file in 'labeled_img_matrix' directory. More info about how to read these numpy-binary files, refer code snippet.

3. Example

Some example outputs of Images are given in Segmented_images directory.

About

RGB based 2nd order Image Segmentation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages