Commit 311ee203 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed RGBD compile errs and warnings

parent 16839ea5
......@@ -307,7 +307,14 @@ namespace
(*normal)[2] = *row_r;
}
else
signNormal((*M_inv) * (*B_vec), *normal);
{
Mat33T Mr = *M_inv;
Vec3T Br = *B_vec;
Vec3T MBr(Mr(0, 0) * Br[0] + Mr(0, 1)*Br[1] + Mr(0, 2)*Br[2],
Mr(1, 0) * Br[0] + Mr(1, 1)*Br[1] + Mr(1, 2)*Br[2],
Mr(2, 0) * Br[0] + Mr(2, 1)*Br[1] + Mr(2, 2)*Br[2]);
signNormal(MBr, *normal);
}
}
private:
......
......@@ -189,26 +189,26 @@ protected:
case 0:
method = cv::RgbdNormals::RGBD_NORMALS_METHOD_FALS;
std::cout << std::endl << "*** FALS" << std::endl;
errors[0][0] = 0.006;
errors[0][1] = 0.03;
errors[1][0] = 0.00008;
errors[1][1] = 0.02;
errors[0][0] = 0.006f;
errors[0][1] = 0.03f;
errors[1][0] = 0.00008f;
errors[1][1] = 0.02f;
break;
case 1:
method = cv::RgbdNormals::RGBD_NORMALS_METHOD_LINEMOD;
std::cout << std::endl << "*** LINEMOD" << std::endl;
errors[0][0] = 0.04;
errors[0][1] = 0.07;
errors[1][0] = 0.05;
errors[1][1] = 0.08;
errors[0][0] = 0.04f;
errors[0][1] = 0.07f;
errors[1][0] = 0.05f;
errors[1][1] = 0.08f;
break;
case 2:
method = cv::RgbdNormals::RGBD_NORMALS_METHOD_SRI;
std::cout << std::endl << "*** SRI" << std::endl;
errors[0][0] = 0.02;
errors[0][1] = 0.04;
errors[1][0] = 0.02;
errors[1][1] = 0.04;
errors[0][0] = 0.02f;
errors[0][1] = 0.04f;
errors[1][0] = 0.02f;
errors[1][1] = 0.04f;
break;
default:
method = (cv::RgbdNormals::RGBD_NORMALS_METHOD)-1;
......@@ -369,15 +369,15 @@ protected:
}
// Compare each found plane to each ground truth plane
size_t n_planes = plane_coefficients.size();
size_t n_gt_planes = gt_planes.size();
int n_planes = (int)plane_coefficients.size();
int n_gt_planes = (int)gt_planes.size();
cv::Mat_<int> matching(n_gt_planes, n_planes);
for (size_t j = 0; j < n_gt_planes; ++j)
for (int j = 0; j < n_gt_planes; ++j)
{
cv::Mat gt_mask = gt_plane_mask == j;
int n_gt = cv::countNonZero(gt_mask);
int n_max = 0, i_max = 0;
for (size_t i = 0; i < n_planes; ++i)
for (int i = 0; i < n_planes; ++i)
{
cv::Mat dst;
cv::bitwise_and(gt_mask, plane_mask == i, dst);
......
......@@ -206,7 +206,7 @@ bool CV_OdometryTest::readData(Mat& image, Mat& depth) const
void CV_OdometryTest::generateRandomTransformation(Mat& rvec, Mat& tvec)
{
const float maxRotation = 3.f / 180.f * CV_PI; //rad
const float maxRotation = (float)(3.f / 180.f * CV_PI); //rad
const float maxTranslation = 0.02f; //m
RNG& rng = theRNG();
......
......@@ -42,7 +42,7 @@ protected:
float avg_diff = 0;
for (int y = 0; y < rows; ++y)
for (int x = 0; x < cols; ++x)
avg_diff += cv::norm(image_points.at<cv::Vec2f>(y,x) - cv::Vec2f(x,y));
avg_diff += (float)cv::norm(image_points.at<cv::Vec2f>(y,x) - cv::Vec2f((float)x,(float)y));
// Verify the function works
ASSERT_LE(avg_diff/rows/cols, 1e-4) << "Average error for ground truth is: " << (avg_diff / rows / cols);
......
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