Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JerrickLiu/Mask-generator
Various functions to generate masks for images and replace the background of images with some other image of your choosing
https://github.com/JerrickLiu/Mask-generator
Last synced: 3 months ago
JSON representation
Various functions to generate masks for images and replace the background of images with some other image of your choosing
- Host: GitHub
- URL: https://github.com/JerrickLiu/Mask-generator
- Owner: JerrickLiu
- Created: 2020-07-17T22:05:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-23T19:28:58.000Z (about 4 years ago)
- Last Synced: 2024-06-27T13:31:22.113Z (5 months ago)
- Language: Python
- Size: 718 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mask generator
Various functions to generate masks for images and replace the background of images with a color or some other image of your choosing## Usage and examples
All you need is Python's computer vision library OpenCV2 to run these functions. Specifiy the image folder where you want the mask applied to in the arguments and that's it.
Once done, the code first generates a mask for the image by thresholding. Certain values above a threshold turn to white pixels and other values below a threshold turn to black pixesl. Play around with the thresholding for your specific images.
Here are a few examples with a mask applied to an image of an apple then replacing all 0 valued pixels (black) to be a different color: