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

View File

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

View File

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