Merge pull request #24458 from laolaolulu:4.x

* Added JS binding for `getUnconnectedOutLayersNames`
* Fix error: no member named ‘vectorstd’ in namespace ‘std’
This commit is contained in:
laolaolulu 2023-11-13 19:51:20 +08:00 committed by GitHub
parent 9b97c97bd1
commit adc55608f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -482,7 +482,7 @@ class JSWrapperGenerator(object):
ret_type = type_dict[ptr_type]
for key in type_dict:
if key in ret_type:
ret_type = re.sub('(^|[^\w])' + key + '($|[^\w])', type_dict[key], ret_type)
ret_type = re.sub(r"\b" + key + r"\b", type_dict[key], ret_type)
arg_types = []
unwrapped_arg_types = []
for arg in variant.args:
@ -670,7 +670,7 @@ class JSWrapperGenerator(object):
# Replace types. Instead of ret_type.replace we use regular
# expression to exclude false matches.
# See https://github.com/opencv/opencv/issues/15514
ret_type = re.sub('(^|[^\w])' + key + '($|[^\w])', type_dict[key], ret_type)
ret_type = re.sub(r"\b" + key + r"\b", type_dict[key], ret_type)
if variant.constret and ret_type.startswith('const') == False:
ret_type = 'const ' + ret_type
if variant.refret and ret_type.endswith('&') == False:

View File

@ -465,6 +465,7 @@ EMSCRIPTEN_BINDINGS(binding_utils)
register_vector<char>("CharVector");
register_vector<float>("FloatVector");
register_vector<double>("DoubleVector");
register_vector<std::string>("StringVector");
register_vector<cv::Point>("PointVector");
register_vector<cv::Mat>("MatVector");
register_vector<cv::Rect>("RectVector");

View File

@ -147,7 +147,7 @@ video = {
'TrackerMIL_Params': [],
}
dnn = {'dnn_Net': ['setInput', 'forward', 'setPreferableBackend'],
dnn = {'dnn_Net': ['setInput', 'forward', 'setPreferableBackend','getUnconnectedOutLayersNames'],
'': ['readNetFromCaffe', 'readNetFromTensorflow', 'readNetFromTorch', 'readNetFromDarknet',
'readNetFromONNX', 'readNetFromTFLite', 'readNet', 'blobFromImage']}