/image-segmentation

Utilize max-flow min-cut graph theory to segment images into foreground and background pixels

Primary LanguageHTML

Image Segmentation

Website

For a detailed report, please visit https://julie-jiang.github.io/image-segmentation/.

Usage

python imagesegmentation.py filename

A new window will pop up showing your image. Use your cursor to mark object seeds, which would be shown in red. Once you're done, press esc. Then do the same to mark background seeds, which would be shown in green.

Dependencies

  • Python 2
  • OpenCV 3.3
  • NumPy

Examples

  1. test1.jpg

Original, seeded, and segmented image

test1.jpg test1seeded.jpg test1cut.jpg

  1. test2.jpg

Original, seeded, and segmented image

test2.jpgtest2seeded.jpgtest2cut.jpg

  1. test3.jpg

Original, seeded, and segmented image

test3.jpgtest3seeded.jpgtest3cut.jpg

  1. baby.jpg

Original, seeded, and segmented image

baby.jpgbabyseeded.jpgbabycut.jpg