Amazing-Python-Scripts

Форк
0

README.md

Image 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 🛡

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.