Skip to content

Latest commit

 

History

History
 
 

Background_Subtractor

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Background Subtraction using OpenCV.

This python script lets you remove background form image by keeping only foreground in focus. By using Grabcut Algorithm it makes easy to do the task.

We make use of OpenCV, numpy libraries of Python.

This Script:

  1. Takes image as input and
  2. Asks user to select ROI by dragging mouse pointer.
  3. Performs background subtraction.
  4. Displaying the updated image.
  5. Saving the processed image in your current directory.

Gif

Setting up:

  • Create a virtual environment and activate it.

  • Install the requirements

  $ pip install -r requirements.txt

Running the script:

  $ python BG_Subtractor.py
  1. Enter valid file location/path.
  2. Select ROI by using mouse pointer on the window BG Subractor.
  3. Then script will process the image.
  4. Image Bg_removed.jpg will be stored in your current directory.

Gif

Output:

Image

Author

🛡 Akhil Bhalerao 🛡

Credits