mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 03:00:14 +08:00
JS bingings fix for QR code detector.
This commit is contained in:
parent
e60a7c0d49
commit
843daca26e
@ -236,6 +236,11 @@ class ArgInfo(object):
|
||||
self.tp = "std::vector<cv::Mat>&"
|
||||
elif self.inputarg:
|
||||
self.tp = "const std::vector<cv::Mat>&"
|
||||
if self.tp == "vector_string":
|
||||
if self.outputarg:
|
||||
self.tp = "std::vector<std::string>&"
|
||||
elif self.inputarg:
|
||||
self.tp = "const std::vector<std::string>&"
|
||||
self.tp = handle_vector(self.tp).strip()
|
||||
if self.const:
|
||||
self.tp = "const " + self.tp
|
||||
@ -319,6 +324,14 @@ class JSWrapperGenerator(object):
|
||||
sys.exit(-1)
|
||||
self.classes[class_info.name] = class_info
|
||||
|
||||
def resolve_class_inheritance(self):
|
||||
new_classes = {}
|
||||
for name, class_info in self.classes.items():
|
||||
|
||||
if not hasattr(class_info, 'bases'):
|
||||
new_classes[name] = class_info
|
||||
continue # not class
|
||||
|
||||
if class_info.bases:
|
||||
chunks = class_info.bases[0].split('::')
|
||||
base = '_'.join(chunks)
|
||||
@ -333,6 +346,10 @@ class JSWrapperGenerator(object):
|
||||
class_info.bases[0] = "::".join(chunks)
|
||||
class_info.isalgorithm |= self.classes[base].isalgorithm
|
||||
|
||||
new_classes[name] = class_info
|
||||
|
||||
self.classes = new_classes
|
||||
|
||||
def split_decl_name(self, name):
|
||||
chunks = name.split('.')
|
||||
namespace = chunks[:-1]
|
||||
@ -759,6 +776,8 @@ class JSWrapperGenerator(object):
|
||||
else: # class/global function
|
||||
self.add_func(decl)
|
||||
|
||||
self.resolve_class_inheritance()
|
||||
|
||||
# step 2: generate bindings
|
||||
# Global functions
|
||||
for ns_name, ns in sorted(self.namespaces.items()):
|
||||
|
@ -113,8 +113,8 @@ objdetect = {'': ['groupRectangles', 'getPredefinedDictionary', 'extendDictionar
|
||||
'drawDetectedDiamonds'],
|
||||
'HOGDescriptor': ['load', 'HOGDescriptor', 'getDefaultPeopleDetector', 'getDaimlerPeopleDetector', 'setSVMDetector', 'detectMultiScale'],
|
||||
'CascadeClassifier': ['load', 'detectMultiScale2', 'CascadeClassifier', 'detectMultiScale3', 'empty', 'detectMultiScale'],
|
||||
'QRCodeDetector': ['QRCodeDetector', 'decode', 'decodeCurved', 'detect', 'detectAndDecode', 'detectMulti', 'setEpsX', 'setEpsY'],
|
||||
# aruco namespace
|
||||
'GraphicalCodeDetector': ['decode', 'detect', 'detectAndDecode', 'detectMulti', 'decodeMulti', 'detectAndDecodeMulti'],
|
||||
'QRCodeDetector': ['QRCodeDetector', 'decode', 'detect', 'detectAndDecode', 'detectMulti', 'decodeMulti', 'detectAndDecodeMulti', 'decodeCurved', 'detectAndDecodeCurved', 'setEpsX', 'setEpsY'],
|
||||
'aruco_PredefinedDictionaryType': [],
|
||||
'aruco_Dictionary': ['Dictionary', 'getDistanceToId', 'generateImageMarker', 'getByteListFromBits', 'getBitsFromByteList'],
|
||||
'aruco_Board': ['Board', 'matchImagePoints', 'generateImage'],
|
||||
|
Loading…
Reference in New Issue
Block a user