JeVoisBase
1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
Tweet
Loading...
Searching...
No Matches
wechatqrcode.py
Go to the documentation of this file.
1
# This file is part of OpenCV Zoo project.
2
# It is subject to the license terms in the LICENSE file found in the same directory.
3
#
4
# Copyright (C) 2021, Shenzhen Institute of Artificial Intelligence and Robotics for Society, all rights reserved.
5
# Third party copyrights are property of their respective owners.
6
7
import
numpy
as
np
8
import
cv2
as
cv
# needs to have cv.wechat_qrcode_WeChatQRCode, which requires compile from source with opencv_contrib/modules/wechat_qrcode
9
10
class
WeChatQRCode
:
11
def
__init__
(self, detect_prototxt_path, detect_model_path, sr_prototxt_path, sr_model_path):
12
self.
_model
= cv.wechat_qrcode_WeChatQRCode(
13
detect_prototxt_path,
14
detect_model_path,
15
sr_prototxt_path,
16
sr_model_path
17
)
18
19
@property
20
def
name
(self):
21
return
self.__class__.__name__
22
23
def
setBackend
(self, backend_id):
24
# self._model.setPreferableBackend(backend_id)
25
if
backend_id != 0:
26
raise
NotImplementedError(
"Backend {} is not supported by cv.wechat_qrcode_WeChatQRCode()"
)
27
28
def
setTarget
(self, target_id):
29
# self._model.setPreferableTarget(target_id)
30
if
target_id != 0:
31
raise
NotImplementedError(
"Target {} is not supported by cv.wechat_qrcode_WeChatQRCode()"
)
32
33
def
infer
(self, image):
34
return
self.
_model
.detectAndDecode(image)
wechatqrcode.WeChatQRCode
Definition
wechatqrcode.py:10
wechatqrcode.WeChatQRCode.setBackend
setBackend(self, backend_id)
Definition
wechatqrcode.py:23
wechatqrcode.WeChatQRCode._model
_model
Definition
wechatqrcode.py:12
wechatqrcode.WeChatQRCode.name
name(self)
Definition
wechatqrcode.py:20
wechatqrcode.WeChatQRCode.__init__
__init__(self, detect_prototxt_path, detect_model_path, sr_prototxt_path, sr_model_path)
Definition
wechatqrcode.py:11
wechatqrcode.WeChatQRCode.setTarget
setTarget(self, target_id)
Definition
wechatqrcode.py:28
wechatqrcode.WeChatQRCode.infer
infer(self, image)
Definition
wechatqrcode.py:33
opencv_zoo
models
qrcode_wechatqrcode
wechatqrcode.py
Please help us improve this page: Edit it on
GitHub
or
email us your edits and suggestions.
Generated by
1.9.8