refactor(*): delete folder-3rdparty;style(*): change coding styles
This commit is contained in:
@@ -177,7 +177,8 @@ void RectifyProcessor::stereoRectify(models::CameraPtr leftOdo,
|
||||
|
||||
_alpha = MIN(alpha, 1.);
|
||||
{
|
||||
newImgSize = newImgSize.width*newImgSize.height != 0 ? newImgSize : imageSize;
|
||||
newImgSize = newImgSize.width*newImgSize.height != 0 ?
|
||||
newImgSize : imageSize;
|
||||
double cx1_0 = cc_new[0].x;
|
||||
double cy1_0 = cc_new[0].y;
|
||||
double cx2_0 = cc_new[1].x;
|
||||
@@ -291,19 +292,18 @@ std::shared_ptr<struct CameraROSMsgInfoPair> RectifyProcessor::stereoRectify(
|
||||
Ctain::Matrix4d T = loadT(ex_right_to_left);
|
||||
Ctain::Matrix3d R = T.topLeftCorner<3, 3>();
|
||||
Ctain::Vector3d t = T.topRightCorner<3, 1>();
|
||||
std::cout<<"T:"<<T;
|
||||
// cv::Mat cv_R, cv_t;
|
||||
// cv::eigen2cv(R, cv_R);
|
||||
cv::Mat cv_R(3, 3, CV_64FC1);
|
||||
for(int i = 0; i < 3; ++i) {
|
||||
for(int j = 0; j < 3; ++j) {
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
cv_R.at<double>(i, j) = R(i, j);
|
||||
}
|
||||
}
|
||||
// cv::eigen2cv(t, cv_t);
|
||||
cv::Mat cv_t(3, 1, CV_64FC1);
|
||||
for(int i = 0; i < 3; ++i) {
|
||||
cv_t.at<double>(i, 0) = t(i, 0);
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
cv_t.at<double>(i, 0) = t(i, 0);
|
||||
}
|
||||
cv::Mat K1, D1, K2, D2;
|
||||
cv::Size image_size1, image_size2;
|
||||
@@ -406,24 +406,18 @@ void RectifyProcessor::InitParams(
|
||||
in_left_cur = in_left;
|
||||
in_right_cur = in_right;
|
||||
ex_right_to_left_cur = ex_right_to_left;
|
||||
|
||||
LOG(INFO) <<"q2";
|
||||
|
||||
|
||||
models::CameraPtr camera_odo_ptr_left =
|
||||
generateCameraFromIntrinsicsEquidistant(in_left);
|
||||
models::CameraPtr camera_odo_ptr_right =
|
||||
generateCameraFromIntrinsicsEquidistant(in_right);
|
||||
|
||||
LOG(INFO) <<"q3";
|
||||
|
||||
|
||||
auto calib_info_tmp = stereoRectify(camera_odo_ptr_left,
|
||||
camera_odo_ptr_right,
|
||||
in_left,
|
||||
in_right,
|
||||
ex_right_to_left);
|
||||
|
||||
LOG(INFO) <<"q4";
|
||||
|
||||
|
||||
*calib_infos = *calib_info_tmp;
|
||||
cv::Mat rect_R_l =
|
||||
cv::Mat::eye(3, 3, CV_32F), rect_R_r = cv::Mat::eye(3, 3, CV_32F);
|
||||
@@ -433,9 +427,7 @@ void RectifyProcessor::InitParams(
|
||||
rect_R_r.at<float>(i, j) = calib_infos->right.R[i*3+j];
|
||||
}
|
||||
}
|
||||
|
||||
LOG(INFO) <<"q5";
|
||||
|
||||
|
||||
double left_f[] =
|
||||
{calib_infos->left.P[0], calib_infos->left.P[5]};
|
||||
double left_center[] =
|
||||
@@ -444,11 +436,7 @@ void RectifyProcessor::InitParams(
|
||||
{calib_infos->right.P[0], calib_infos->right.P[5]};
|
||||
double right_center[] =
|
||||
{calib_infos->right.P[2], calib_infos->right.P[6]};
|
||||
|
||||
LOG(INFO) <<"q6";
|
||||
std::cout << "rectR:" << rect_R_l;
|
||||
LOG(INFO) <<"q9\n";
|
||||
std::cout << "left_center:"<<left_center[0]<<","<<left_center[1]<<std::endl;
|
||||
|
||||
camera_odo_ptr_left->initUndistortRectifyMap(
|
||||
map11, map12, left_f[0], left_f[1],
|
||||
cv::Size(0, 0), left_center[0],
|
||||
@@ -456,19 +444,7 @@ void RectifyProcessor::InitParams(
|
||||
camera_odo_ptr_right->initUndistortRectifyMap(
|
||||
map21, map22, right_f[0], right_f[1],
|
||||
cv::Size(0, 0), right_center[0],
|
||||
right_center[1], rect_R_r);
|
||||
// cv::Mat a;
|
||||
// cv::Mat b;
|
||||
|
||||
// camera_odo_ptr_left->initUndistortRectifyMap(
|
||||
// rect_R_l, rect_R_l,0, 0);
|
||||
// camera_odo_ptr_right->initUndistortRectifyMap(
|
||||
// map21, map22, right_f[0], right_f[1],
|
||||
// cv::Size(0, 0), right_center[0],
|
||||
// right_center[1], rect_R_r);
|
||||
|
||||
LOG(INFO) <<"q7";
|
||||
|
||||
right_center[1], rect_R_r);
|
||||
}
|
||||
|
||||
const char RectifyProcessor::NAME[] = "RectifyProcessor";
|
||||
@@ -481,20 +457,12 @@ RectifyProcessor::RectifyProcessor(
|
||||
: Processor(std::move(proc_period)),
|
||||
calib_model(CalibrationModel::UNKNOW),
|
||||
_alpha(-1) {
|
||||
|
||||
LOG(INFO) <<"Q";
|
||||
|
||||
|
||||
calib_infos = std::make_shared<struct CameraROSMsgInfoPair>();
|
||||
|
||||
LOG(INFO) <<"W";
|
||||
|
||||
InitParams(
|
||||
*std::dynamic_pointer_cast<IntrinsicsEquidistant>(intr_left),
|
||||
*std::dynamic_pointer_cast<IntrinsicsEquidistant>(intr_right),
|
||||
*extr);
|
||||
|
||||
LOG(INFO) <<"E";
|
||||
|
||||
}
|
||||
|
||||
RectifyProcessor::~RectifyProcessor() {
|
||||
|
||||
Reference in New Issue
Block a user