import cv2 import thread import numpy as np try: #import pygame import pygame.camera #from pygame.locals import * except: pass from SeaGoatVision.server.media.media_streaming import Media_streaming from SeaGoatVision.server.core.configuration import Configuration from SeaGoatVision.commons.param import Param from SeaGoatVision.commons import log logger = log.get_logger(__name__) class Pygame_cam(Media_streaming): """Return images from the webcam.""" def __init__(self, config): # Go into configuration/template_media for more information self.config = Configuration() self.own_config = config super(Pygame_cam, self).__init__() self.media_name = config.name self.run = True self.video = None pygame.init() pygame.camera.init()
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. """ Description : launch qt client """ import sys from PySide.QtGui import QApplication import main from SeaGoatVision.commons import log logger = log.get_logger(__name__) def run(ctr, subscriber, local=False, host="localhost", port=8090): app = QApplication(sys.argv) win = main.WinMain(ctr, subscriber, host=host, islocal=local) win.show() try: rint = app.exec_() except BaseException as e: logger.critical("Exit error : %s" % e) rint = -1 # close the server win.quit() ctr.close()