diff --git a/modules/intensity_transform/src/bimef.cpp b/modules/intensity_transform/src/bimef.cpp index 2500d2abe8..9cad67578f 100644 --- a/modules/intensity_transform/src/bimef.cpp +++ b/modules/intensity_transform/src/bimef.cpp @@ -226,15 +226,15 @@ static Mat solveLinearEquation(const Mat_& img, Mat_& W_h_, Mat_ tin(img_t.ptr(), img_t.rows*img_t.cols); Eigen::VectorXf x = cg.solve(tin); - Mat_ tout(img.rows, img.cols); - tout.forEach( + Mat tout(img.rows, img.cols, CV_32FC1); + tout.forEach( [&](float &pixel, const int * position) -> void { pixel = x(position[1]*img.rows + position[0]); } ); - return std::move(tout); + return tout; } static Mat_ tsmooth(const Mat_& src, float lambda=0.01f, float sigma=3.0f, float sharpness=0.001f)