imutils

imutils VideoStream returns NoneType while integrating with flask

梦想的初衷 提交于 2019-12-11 17:22:00
问题 So i want to create a video stream using imutils VideoStream and put it on the web. This is the Code: camera_web.py from flask import Flask, render_template, Response from imutils.video import VideoStream from imutils.video import FPS import cv2 app = Flask(__name__) vs = VideoStream(src=0).start() @app.route('/') def index(): """ Video streaming home page """ return render_template('index.html') def gen(): rval, frame = vs.read() cv2.imwrite('t.jpg', frame) yield (b'--frame\r\n' b'Content

Install imutils within ROS

痞子三分冷 提交于 2019-12-08 09:39:35
问题 I have an Ubuntu 16.04 OS with ROS kinetic . When I open a terminal and type python it loads python 2.7, and as I try to import imutils it says it's not there. Then, I tried to install it with pip install imutils , but it says: requirment already satisfied in bla/bla/python3.5/bla. If I open the terminal and type python3 , it loads Python 3.5 , and when I try to import that lib, it complaints that it can't find cv2 , and gives an address pointing to where the Python ROS package is located (