Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pratishtha-abrol/chroma_keying
https://github.com/pratishtha-abrol/chroma_keying
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/pratishtha-abrol/chroma_keying
- Owner: pratishtha-abrol
- Created: 2022-01-15T08:38:27.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-17T08:08:07.000Z (almost 3 years ago)
- Last Synced: 2024-10-24T20:07:21.524Z (3 months ago)
- Language: Jupyter Notebook
- Size: 19.9 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chroma Keying using OpenCV
## Videos to Images and vice-versa
`cv2.VideoCapture` is a class for video capturing from video files, image sequences or cameras. We set the frame rate to be 0.5 seconds, which would capture the frame every 0.5 secods. That is, 2 frames per second. The program saves the images as `image[num].jpg` in an images folder.
For combining images into a video we add path variables to the image folder and set the images in a list. We sort this list in order so that we have the image sequence right. Using a frame-rate, here, 0.5, we can output a video in `.avi` format.
## Capturing images from a webcam
Using the `cv2.VideoCapture` class, we can access the webcam. We keep the video displayed constantly, hitting the `SPACE` key clicks a picture which is saved in the images folder, as `opencv_frame_[num].jpg`. Hitting the `ESC` key quits the window.
## Chroma Keying Videos
Having a green screen video and another which would act as a background, we use openCV to mask the green screen. This was challenging as the window quit with an error, but still gave the desired output.