This commit is contained in:
yumoqing 2021-04-23 15:13:41 +08:00
parent 78e07f8625
commit b485023bae
3 changed files with 7 additions and 5 deletions

View File

@ -8,6 +8,7 @@ import numpy as np
import cv2
from kivy.base import Builder
from .image_processing.image_processing import face_detection
from .xcamera.xcamera import XCamera
btxt = """<CustomCamera>:
resolution: (1920,1050)
@ -24,7 +25,7 @@ btxt = """<CustomCamera>:
PopMatrix
"""
class CustomCamera(Camera):
class CustomCamera(XCamera):
detectFaces = BooleanProperty(False)
angle = NumericProperty(0)
def __init__(self, **kwargs):
@ -60,9 +61,8 @@ class CustomCamera(Camera):
cameras = self._camera.get_camera_count()
return cameras
class QrReader(Camera):
class QrReader(XCamera):
def __init__(self, **kw):
Logger.info('QrReader:Initialed...........')
super(QrReader, self).__init__(**kw)
self.qr_reader = cv2.QRCodeDetector()
self.register_event_type('on_data')

View File

@ -1,4 +1,4 @@
#:import xcamera kivy_garden.xcamera.xcamera
#:import xcamera kivyblocks.xcamera.xcamera
<XCameraIconButton>
icon_color: (0, 0, 0, 1)

View File

@ -22,7 +22,9 @@ package_data = {
'imgs/*.gif',
'imgs/*.jpg',
'ttf/*.ttf',
'ui/*.uidesc'
'ui/*.uidesc',
'xcamera/xcamera.kv',
'xcamera/data/*'
],
}