@@ -68,9 +68,8 @@ TEST_F(EpipolarDepthEstimationTest, DISABLED_EstimateDepth) {
6868 1.0 ;
6969
7070 // Update the source keyframe's image.
71- cv::Mat tempMat = image.toOpenCVImage ();
7271 cv::Mat cvMat;
73- tempMat .convertTo (cvMat, CV_16U);
72+ image. toOpenCVImage () .convertTo (cvMat, CV_16U);
7473 sourceKeyframe.updateImage (cvMat);
7574
7675 // Create the target keyframe.
@@ -110,9 +109,8 @@ TEST_F(EpipolarDepthEstimationTest, DISABLED_EstimateDepth) {
110109 static_cast <Eigen::Index>(std::round (targetPixel (0 )))) =
111110 1.0 ;
112111
113- // Update the target keyframe's image.
114- tempMat = image.toOpenCVImage ();
115- tempMat.convertTo (cvMat, CV_16U);
112+ // Update the source keyframe's image.
113+ image.toOpenCVImage ().convertTo (cvMat, CV_16U);
116114 targetKeyframe.updateImage (cvMat);
117115
118116 EXPECT_NE (targetKeyframe.imagePyr .getImage ().getImageData ().sum (), 0 );
@@ -197,9 +195,8 @@ TEST_F(EpipolarDepthEstimationTest, DISABLED_EstimateDepthWithNoMatches) {
197195 1.0 ;
198196
199197 // Update the source keyframe's image.
200- cv::Mat tempMat = image.toOpenCVImage ();
201198 cv::Mat cvMat;
202- tempMat .convertTo (cvMat, CV_16U);
199+ image. toOpenCVImage () .convertTo (cvMat, CV_16U);
203200 sourceKeyframe.updateImage (cvMat);
204201
205202 // Create the target keyframe.
@@ -232,9 +229,8 @@ TEST_F(EpipolarDepthEstimationTest, DISABLED_EstimateDepthWithNoMatches) {
232229 EXPECT_EQ (landmarkInTarget (1 ), 0 );
233230 EXPECT_EQ (landmarkInTarget (2 ), 2 );
234231
235- // Update the target keyframe's image.
236- tempMat = image.toOpenCVImage ();
237- tempMat.convertTo (cvMat, CV_16U);
232+ // Update the source keyframe's image.
233+ image.toOpenCVImage ().convertTo (cvMat, CV_16U);
238234 targetKeyframe.updateImage (cvMat);
239235
240236 // Before running the depth estimator, set the landmark depth to the incorrect
@@ -315,9 +311,8 @@ TEST_F(EpipolarDepthEstimationTest, EstimateDepthAlongEdge) {
315311 .setConstant (1 );
316312
317313 // Update the source keyframe's image.
318- cv::Mat tempMat = image.toOpenCVImage ();
319314 cv::Mat cvMat;
320- tempMat .convertTo (cvMat, CV_16U);
315+ image. toOpenCVImage () .convertTo (cvMat, CV_16U);
321316 sourceKeyframe.updateImage (cvMat);
322317
323318 // Create the target keyframe.
@@ -357,9 +352,8 @@ TEST_F(EpipolarDepthEstimationTest, EstimateDepthAlongEdge) {
357352 .block (std::round (targetPixel (1 )), 0 , 1 , 512 )
358353 .setConstant (1 );
359354
360- // Update the target keyframe's image.
361- tempMat = image.toOpenCVImage ();
362- tempMat.convertTo (cvMat, CV_16U);
355+ // Update the source keyframe's image.
356+ image.toOpenCVImage ().convertTo (cvMat, CV_16U);
363357 targetKeyframe.updateImage (cvMat);
364358
365359 // Before running the depth estimator, set the landmark depth to the incorrect
0 commit comments