diff --git a/modules/3d/include/opencv2/3d/depth.hpp b/modules/3d/include/opencv2/3d/depth.hpp index 735bfe4a7a..c0150384d4 100644 --- a/modules/3d/include/opencv2/3d/depth.hpp +++ b/modules/3d/include/opencv2/3d/depth.hpp @@ -132,12 +132,11 @@ CV_EXPORTS_W void rescaleDepth(InputArray in, int type, OutputArray out, double * @param mask The mask of used pixels (of CV_8UC1), it can be empty * @param Rt The transformation that will be applied to the 3d points computed from the depth * @param cameraMatrix Camera matrix - * @param distCoeff Distortion coefficients * @param warpedImage The warped image. * @param warpedDepth The warped depth. * @param warpedMask The warped mask. */ -CV_EXPORTS_W void warpFrame(InputArray image, InputArray depth, InputArray mask, InputArray Rt, InputArray cameraMatrix, InputArray distCoeff, +CV_EXPORTS_W void warpFrame(InputArray image, InputArray depth, InputArray mask, InputArray Rt, InputArray cameraMatrix, OutputArray warpedImage, OutputArray warpedDepth = noArray(), OutputArray warpedMask = noArray()); enum RgbdPlaneMethod diff --git a/modules/3d/src/rgbd/odometry.cpp b/modules/3d/src/rgbd/odometry.cpp index 6fc24d5175..a8ae22721b 100644 --- a/modules/3d/src/rgbd/odometry.cpp +++ b/modules/3d/src/rgbd/odometry.cpp @@ -365,7 +365,7 @@ bool Odometry::compute(InputArray srcDepthFrame, InputArray srcRGBFrame, template static void warpFrameImpl(InputArray _image, InputArray depth, InputArray _mask, - const Mat& Rt, const Mat& cameraMatrix, const Mat& distCoeff, + const Mat& Rt, const Mat& cameraMatrix, OutputArray _warpedImage, OutputArray warpedDepth, OutputArray warpedMask) { //TODO: take into account that image can be empty @@ -394,7 +394,7 @@ warpFrameImpl(InputArray _image, InputArray depth, InputArray _mask, Mat transformedCloud; perspectiveTransform(cloud3, transformedCloud, Rt); projectPoints(transformedCloud.reshape(3, 1), Mat::eye(3, 3, CV_64FC1), Mat::zeros(3, 1, CV_64FC1), cameraMatrix, - distCoeff, points2d); + Mat::zeros(1, 5, CV_64FC1), points2d); Mat image = _image.getMat(); Size sz = _image.size(); @@ -437,14 +437,14 @@ warpFrameImpl(InputArray _image, InputArray depth, InputArray _mask, void warpFrame(InputArray image, InputArray depth, InputArray mask, - InputArray Rt, InputArray cameraMatrix, InputArray distCoeff, + InputArray Rt, InputArray cameraMatrix, OutputArray warpedImage, OutputArray warpedDepth, OutputArray warpedMask) { if (image.type() == CV_8UC1) - warpFrameImpl(image, depth, mask, Rt.getMat(), cameraMatrix.getMat(), distCoeff.getMat(), + warpFrameImpl(image, depth, mask, Rt.getMat(), cameraMatrix.getMat(), warpedImage, warpedDepth, warpedMask); else if (image.type() == CV_8UC3) - warpFrameImpl>(image, depth, mask, Rt.getMat(), cameraMatrix.getMat(), distCoeff.getMat(), + warpFrameImpl>(image, depth, mask, Rt.getMat(), cameraMatrix.getMat(), warpedImage, warpedDepth, warpedMask); else CV_Error(Error::StsBadArg, "Image has to be type of CV_8UC1 or CV_8UC3");