https://github.com/kmanadkat/flask-opencv-webcam
https://github.com/kmanadkat/flask-opencv-webcam
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kmanadkat/flask-opencv-webcam
- Owner: kmanadkat
- Created: 2020-09-28T09:23:26.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-28T09:24:03.000Z (about 5 years ago)
- Last Synced: 2025-02-01T04:43:40.875Z (8 months ago)
- Language: Python
- Size: 960 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## OpenCV - Flask Webstream
[](https://www.python.org/downloads/release/python-376/)
[](https://pypi.org/project/opencv-python/)
[](https://pypi.org/project/Flask/)
[](https://opensource.org/licenses/MIT)This is quick start boiler plate for streaming opencv video capture on web server using flask.
![]()
### ⚙️ Installation
Following are the packages required to be installed for running. **Installing these with the help of Anaconda is recommended,** so sub-dependencies of these packages can be taken care automatically.
```
- flask 1.1.1
- opencv-python 4.2.0.32
- opencv-contrib-python-headless 4.2.0.32
```### 🔌 Running main.py
After getting dependencies install just run this file like normal python program, (green play button on top right corner in case you are using IDEs). You might require to run following command before running main.py
```
$ export FLASK_APP=main.py
```### 💡 Processing input frames (adding detection algorithms)
To make developement easy, there is myAlgorithm(..) function where you can spice things up with input frame. Example :
```python
# Implement Custom Algorithm here (on frame)
# and return new modified_frame
def myAlgorithm(frame):
modified_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
return modified_frame
```
Inside myAlgorithm(..) function you can implement your own detection/image processing algorithms and return modified frame. This modified frame will be shown as the continuos output of frames on web server.⛳️⛳️⛳️