diff --git a/samples/python/stitching_detailed.py b/samples/python/stitching_detailed.py index cd3f063e35..7bf5a9ac0d 100644 --- a/samples/python/stitching_detailed.py +++ b/samples/python/stitching_detailed.py @@ -29,8 +29,9 @@ BA_COST_CHOICES['no'] = cv.detail_NoBundleAdjuster FEATURES_FIND_CHOICES = OrderedDict() try: + cv.xfeatures2d_SURF.create() # check if the function can be called FEATURES_FIND_CHOICES['surf'] = cv.xfeatures2d_SURF.create -except AttributeError: +except (AttributeError, cv.error) as e: print("SURF not available") # if SURF not available, ORB is default FEATURES_FIND_CHOICES['orb'] = cv.ORB.create