Merge pull request #25940 from Kumataro:fix25928

python: prefer cv::Mat over cv::UMat in python binding
pull/25394/head
Alexander Smorkalov 4 months ago committed by GitHub
commit 1ca526dcdb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 15
      modules/python/src2/gen2.py

@ -854,7 +854,22 @@ class FuncInfo(object):
all_code_variants = [] all_code_variants = []
# See https://github.com/opencv/opencv/issues/25928
# Conversion to UMat is expensive more than conversion to Mat.
# To reduce this cost, conversion to Mat is prefer than to UMat.
variants = []
variants_umat = []
for v in self.variants: for v in self.variants:
hasUMat = False
for a in v.args:
hasUMat = hasUMat or "UMat" in a.tp
if hasUMat :
variants_umat.append(v)
else:
variants.append(v)
variants.extend(variants_umat)
for v in variants:
code_decl = "" code_decl = ""
code_ret = "" code_ret = ""
code_cvt_list = [] code_cvt_list = []

Loading…
Cancel
Save