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

fix step

parent 3a37fc72
No related branches found
No related tags found
1 merge request!45Resolves #100 GPU pipeline for vision
Pipeline #11745 passed
......@@ -25,11 +25,11 @@ void FixstarsSGM::compute(const cv::cuda::GpuMat &l, const cv::cuda::GpuMat &r,
cv::cuda::cvtColor(r, rbw, cv::COLOR_BGR2GRAY);
if (disp.type() != CV_16SC1 || disp.rows != l.rows || disp.cols != l.cols) {
disp = GpuMat(l.rows, l.cols, CV_16SC1, cv::Scalar(0));
disp = GpuMat(l.rows, l.cols, CV_16SC1);
}
if (!ssgm_) { // todo: move to constructor
ssgm_ = new sgm::StereoSGM(l.cols, l.rows, max_disp_, 8, 16, l.step, disp.step,
ssgm_ = new sgm::StereoSGM(l.cols, l.rows, max_disp_, 8, 16, lbw.step, disp.step / sizeof(short),
sgm::EXECUTE_INOUT_HOST2HOST, sgm::StereoSGM::Parameters(10,120,0.95f,true));
}
......
......@@ -116,8 +116,15 @@ bool Calibrate::_loadCalibration(cv::Size img_size, std::pair<Mat, Mat> &map1, s
}
void Calibrate::rectifyStereo(GpuMat &l, GpuMat &r, Stream &stream) {
cv::cuda::remap(l, l, map1_gpu_.first, map2_gpu_.first, INTER_LINEAR);
cv::cuda::remap(r, r, map1_gpu_.second, map2_gpu_.second, INTER_LINEAR);
// cv::cuda::remap() can not use same Mat for input and output
GpuMat l_tmp(l.size(), l.type());
GpuMat r_tmp(r.size(), r.type());
cv::cuda::remap(l, l_tmp, map1_gpu_.first, map2_gpu_.first, cv::INTER_LINEAR, 0, cv::Scalar(), stream);
cv::cuda::remap(r, r_tmp, map1_gpu_.second, map2_gpu_.second, cv::INTER_LINEAR, 0, cv::Scalar(), stream);
stream.waitForCompletion();
l = l_tmp;
r = r_tmp;
}
bool Calibrate::isCalibrated() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment