示例#1
0
 def __init__(self):
     self.cam = CoreCamera(index=0, resolution=(640, 480))
     self.caminstance = self.cam._android_camera
示例#2
0
import numpy as np
import cv2
from maskv import streaming

from kivy.uix.image import Image
from kivy.core.camera import Camera as CoreCamera
from kivy.properties import NumericProperty, ListProperty, BooleanProperty

# access to camera
#core_camera = CoreCamera(index=0, resolution=(640, 480), stopped=True)
camera_available = False

try:
    #cam = kivy.camera()
    core_camera = CoreCamera(index=0, resolution=(640, 480), stopped=True)
except TypeError:
    core_camera = None
if not core_camera is None:  # Experiment has shown both checks are needed

    camera_available = True
print(camera_available)


# Widget to display camera
class CameraCv(Image):
    '''Camera class. See module documentation for more information.
    '''

    play = BooleanProperty(True)
    '''Boolean indicating whether the camera is playing or not.
    You can start/stop the camera by setting this property::