Skip to content
Snippets Groups Projects
Commit 0d3cf241 authored by Sebastian Hahta's avatar Sebastian Hahta
Browse files

delay

parent a6beb257
No related branches found
No related tags found
1 merge request!32Resolves #76 calibration rework
Pipeline #11448 passed
......@@ -60,7 +60,7 @@ void ftl::calibration::intrinsic(map<string, string> &opt) {
if (found) { calib.drawPoints(img, points); }
cv::imshow("Camera", img);
cv::waitKey(500);
cv::waitKey(750);
if (!found) { continue; }
......
......
......@@ -25,14 +25,13 @@ void ftl::calibration::stereo(map<string, string> &opt) {
// TODO PARAMETERS TO CONFIG FILE
Size image_size = Size(1280, 720);
int iter = 35;
int iter = 30;
double max_error = 1.0;
string filename_intrinsics = (hasOption(opt, "profile")) ? getOption(opt, "profile") : "./panasonic.yml";
CalibrationChessboard calib(opt); // TODO paramters hardcoded in constructor
// PARAMETERS
int stereocalibrate_flags =
cv::CALIB_FIX_ASPECT_RATIO | cv::CALIB_SAME_FOCAL_LENGTH | cv::CALIB_FIX_INTRINSIC |
int stereocalibrate_flags = cv::CALIB_FIX_INTRINSIC |
// K1 to K6 fixed by intrinsic calibration
cv::CALIB_FIX_K1 | cv::CALIB_FIX_K2 | cv::CALIB_FIX_K3 |
cv::CALIB_FIX_K4 | cv::CALIB_FIX_K5 | cv::CALIB_FIX_K6;
......@@ -80,7 +79,7 @@ void ftl::calibration::stereo(map<string, string> &opt) {
cv::imshow("Camera: " + std::to_string(i), img);
}
cv::waitKey(500);
cv::waitKey(750);
if (res != 2) { LOG(WARNING) << "Input not detected on all inputs"; }
else {
......@@ -124,7 +123,7 @@ void ftl::calibration::stereo(map<string, string> &opt) {
camera_matrices[0], dist_coeffs[0],
camera_matrices[1], dist_coeffs[1],
image_size, R, T, E, F, per_view_errors,
stereocalibrate_flags | cv::CALIB_USE_EXTRINSIC_GUESS,
stereocalibrate_flags,
cv::TermCriteria(cv::TermCriteria::COUNT+cv::TermCriteria::EPS, 120, 1e-6)
);
......@@ -163,6 +162,12 @@ void ftl::calibration::stereo(map<string, string> &opt) {
camera.retrieve(in[i]);
cv::imshow("Camera: " + std::to_string(i), in[i]);
cv::remap(in[i], out[i], map1[i], map2[i], cv::INTER_CUBIC);
// draw lines
for (int r = 0; r < image_size.height; r = r+50) {
cv::line(out[i], cv::Point(0, r), cv::Point(image_size.width-1, r), cv::Scalar(0,0,255), 1);
}
cv::imshow("Camera " + std::to_string(i) + " (rectified)", out[i]);
}
}
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment