Commit 79b71ec9 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

parents 88c4ed01 4d57438c
......@@ -146,14 +146,14 @@ namespace rgbd
// Apply the initial projection to the input depth
Mat_<Point3f> transformedCloud;
{
Mat_<Point3f> point_tmp(outputImagePlaneSize);
Mat_<Point3f> point_tmp(outputImagePlaneSize,Point3f(0.,0.,0.));
for(int j = 0; j < point_tmp.rows; ++j)
for(int j = 0; j < unregisteredDepth.rows; ++j)
{
const DepthDepth *unregisteredDepthPtr = unregisteredDepth[j];
Point3f *point = point_tmp[j];
for(int i = 0; i < point_tmp.cols; ++i, ++unregisteredDepthPtr, ++point)
for(int i = 0; i < unregisteredDepth.cols; ++i, ++unregisteredDepthPtr, ++point)
{
float rescaled_depth = float(*unregisteredDepthPtr) * inputDepthToMetersScale;
......@@ -270,7 +270,6 @@ namespace rgbd
} // iterate cols
} // iterate rows
}
......
......@@ -113,5 +113,26 @@ TEST(Rgbd_DepthRegistration, compute)
test.safe_run();
}
TEST(Rgbd_DepthRegistration, issue_2234)
{
Matx33f intrinsicsDepth(100, 0, 50, 0, 100, 50, 0, 0, 1);
Matx33f intrinsicsColor(100, 0, 200, 0, 100, 50, 0, 0, 1);
Mat_<float> depthMat(100, 100, (float)0.);
for(int i = 1; i <= 100; i++)
{
for(int j = 1; j <= 100; j++)
depthMat(i-1,j-1) = (float)j;
}
Mat registeredDepth;
registerDepth(intrinsicsDepth, intrinsicsColor, Mat(), Matx44f::eye(), depthMat, Size(400, 100), registeredDepth);
Rect roi( 150, 0, 100, 100 );
Mat subM(registeredDepth,roi);
EXPECT_EQ(0, cvtest::norm(subM, depthMat, NORM_INF));
}
}} // namespace
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment