From 31f66766b7b179f67fa81e3f489a0a3f2a9a3437 Mon Sep 17 00:00:00 2001 From: Dan Ben-Yosef Date: Sun, 7 Mar 2021 19:06:08 +0200 Subject: [PATCH] Merge pull request #19685 from danbey:setting_stereoBMImpl_in_init_list Init params (StereoBMParams) in StereoBMImpl constructor initialization list * Init StereoBMImpl in initialization list To improve preformence it is better to init the params (StereoBMImpl) in the initialization list. * coding style * drop useless copy/move ctor Co-authored-by: Alexander Alekhin --- modules/calib3d/src/stereobm.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/calib3d/src/stereobm.cpp b/modules/calib3d/src/stereobm.cpp index 96c8d0662d..f58aa5e400 100644 --- a/modules/calib3d/src/stereobm.cpp +++ b/modules/calib3d/src/stereobm.cpp @@ -1148,13 +1148,15 @@ class StereoBMImpl CV_FINAL : public StereoBM { public: StereoBMImpl() + : params() { - params = StereoBMParams(); + // nothing } StereoBMImpl( int _numDisparities, int _SADWindowSize ) + : params(_numDisparities, _SADWindowSize) { - params = StereoBMParams(_numDisparities, _SADWindowSize); + // nothing } void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) CV_OVERRIDE