From 10774ff068e701eb1ee378d9a1171c2b0e8e4d6a Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Mon, 1 Apr 2013 11:18:30 +0400 Subject: [PATCH] removed unnecessary tmp variable (convertTo can work in-place) --- modules/calib3d/test/test_stereomatching.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/calib3d/test/test_stereomatching.cpp b/modules/calib3d/test/test_stereomatching.cpp index 4b35dad990..2be50a0170 100644 --- a/modules/calib3d/test/test_stereomatching.cpp +++ b/modules/calib3d/test/test_stereomatching.cpp @@ -459,14 +459,14 @@ void CV_StereoMatchingTest::run(int) continue; } int dispScaleFactor = datasetsParams[datasetName].dispScaleFactor; - Mat tmp; trueLeftDisp.convertTo( tmp, CV_32FC1, 1.f/dispScaleFactor ); trueLeftDisp = tmp; tmp.release(); + trueLeftDisp.convertTo( trueLeftDisp, CV_32FC1, 1.f/dispScaleFactor ); if( !trueRightDisp.empty() ) - trueRightDisp.convertTo( tmp, CV_32FC1, 1.f/dispScaleFactor ); trueRightDisp = tmp; tmp.release(); + trueRightDisp.convertTo( trueRightDisp, CV_32FC1, 1.f/dispScaleFactor ); Mat leftDisp, rightDisp; int ignBorder = max(runStereoMatchingAlgorithm(leftImg, rightImg, leftDisp, rightDisp, ci), EVAL_IGNORE_BORDER); - leftDisp.convertTo( tmp, CV_32FC1 ); leftDisp = tmp; tmp.release(); - rightDisp.convertTo( tmp, CV_32FC1 ); rightDisp = tmp; tmp.release(); + leftDisp.convertTo( leftDisp, CV_32FC1 ); + rightDisp.convertTo( rightDisp, CV_32FC1 ); int tempCode = processStereoMatchingResults( resFS, ci, isWrite, leftImg, rightImg, trueLeftDisp, trueRightDisp, leftDisp, rightDisp, QualityEvalParams(ignBorder));