本文整理汇总了Python中kivy.uix.image.Image.getSymbols方法的典型用法代码示例。如果您正苦于以下问题:Python Image.getSymbols方法的具体用法?Python Image.getSymbols怎么用?Python Image.getSymbols使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.uix.image.Image
的用法示例。
在下文中一共展示了Image.getSymbols方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _detect_qrcode_frame
# 需要导入模块: from kivy.uix.image import Image [as 别名]
# 或者: from kivy.uix.image.Image import getSymbols [as 别名]
def _detect_qrcode_frame(self, instance, camera, data):
global data_qr
# the image we got by default from a camera is using the NV21 format
# zbar only allow Y800/GREY image, so we first need to convert,
# then start the detection on the image
parameters = camera.getParameters()
size = parameters.getPreviewSize()
barcode = Image(size.width, size.height, 'NV21')
barcode.setData(data)
barcode = barcode.convert('Y800')
result = self._scanner.scanImage(barcode)
if result == 0:
self.symbols = []
return
# we detected qrcode! extract and dispatch them
symbols = []
it = barcode.getSymbols().iterator()
while it.hasNext():
symbol = it.next()
qrcode = BtmsValidRoot.Qrcode(
type=symbol.getType(),
data=symbol.getData(),
quality=symbol.getQuality(),
count=symbol.getCount(),
bounds=symbol.getBounds())
symbols.append(qrcode)
data_qr = symbol.getData()
#self.ids.result_label.text = data_qr
self.validate()
self.symbols = symbols