Commit ac9c9053 authored by James Ward's avatar James Ward
Browse files

Make class member variables locals where possible

parent 8d80abd5
......@@ -112,13 +112,6 @@ private:
double reprojectionCost(const RotationTranslation& rot_trans);
double centreAlignmentCost(const RotationTranslation& rot_trans);
cv::Mat camera_normals_;
cv::Mat camera_centres_;
cv::Mat lidar_centres_;
cv::Mat lidar_normals_;
cv::Mat lidar_corners_;
cv::Mat pixel_errors_;
Rotation eul;
RotationTranslation eul_t, eul_it;
initial_parameters_t i_params;
......
......@@ -308,12 +308,10 @@ bool Optimiser::optimise()
ROS_INFO_STREAM("Lidar corner:" << c);
}
}
camera_normals_ = cv::Mat(n, 3, CV_64F);
camera_centres_ = cv::Mat(n, 3, CV_64F);
lidar_centres_ = cv::Mat(n, 3, CV_64F);
lidar_normals_ = cv::Mat(n, 3, CV_64F);
lidar_corners_ = cv::Mat(n, 3, CV_64F);
pixel_errors_ = cv::Mat(1, n, CV_64F);
auto camera_normals_ = cv::Mat(n, 3, CV_64F);
auto camera_centres_ = cv::Mat(n, 3, CV_64F);
auto lidar_centres_ = cv::Mat(n, 3, CV_64F);
auto lidar_normals_ = cv::Mat(n, 3, CV_64F);
// Insert vector elements into cv::Mat for easy matrix operation
int row = 0;
......@@ -327,8 +325,6 @@ bool Optimiser::optimise()
ln.copyTo(lidar_normals_.row(row));
cv::Mat lc = cv::Mat(sample.lidar_centre).reshape(1).t();
lc.copyTo(lidar_centres_.row(row));
cv::Mat l_cn = cv::Mat(sample.lidar_corners[2]).reshape(1).t();
l_cn.copyTo(lidar_corners_.row(row));
row++;
}
cv::Mat NN = camera_normals_.t() * camera_normals_;
......
Supports Markdown
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