【问题标题】:missing region in disparity map视差图中的缺失区域
【发布时间】:2012-09-09 13:59:53
【问题描述】:

我目前正在使用 opencv2.3 和 Pointgrey Bumblebee2 立体摄像机作为输入设备进行立体处理。获取图像是通过 libdc1394 完成的。

我的整流和立体声处理代码如下:

void StereoProcessing::calculateDisparityMap(const Mat &left, const Mat &right, Mat &disparity_map)

  Mat map11, map12, map21, map22, left_rectified, right_rectified, disp16;

  // Computes the undistortion and rectification transformation maps
  initUndistortRectifyMap(this->camera_matrix1,
        this->distance_coefficients1,
        this->R1,
        this->P1,
        this->output_image_size,
        CV_16SC2,
        map11,
        map12);
  initUndistortRectifyMap(this->camera_matrix2,
        this->distance_coefficients2,
        this->R2,
        this->P2,
        this->output_image_size,
        CV_16SC2,
        map21,
        map22);

  // creates rectified images
  remap(left, left_rectified, map11, map12, INTER_LINEAR);
  remap(right, right_rectified, map21, map22, INTER_LINEAR);

  // calculates 16-bit disparitymap
  this->stereo_bm(left_temp, right_temp, disp16);

  disp16.convertTo(disparity_map, CV_8U, 255 / (this->stereo_bm.state->numberOfDisparities * 16.0));
}

这工作正常,除了视差图中的黑色左边框,如下所示:

输入图像是这两个 - 如您所见;):

所以我现在的问题是: 这是正常行为吗?或者你有没有看到我到目前为止所做的任何错误? 作为另一个信息,整改工作正常

【问题讨论】:

  • 您可以使用循环访问您的像素,其中行和列倒置?
  • 我不访问像素,除了提到的 opencv 函数,它们从输入图像中获取图像大小,所以我猜没有:(
  • 这是什么->output_image_size ?

标签: c++ opencv disparity-mapping


【解决方案1】:

我认为发生这种情况是因为该算法通过将左侧图像中像素周围的块与右侧图像中同一行中的像素周围的块进行匹配来计算差异(假设图像已被校正)。由于存在一个区域,左摄像头和右摄像头的视图之间没有重叠,因此该算法无法找到该区域内像素周围的块的匹配。 “缺失”区域的宽度等于参数“视差数”,因为算法在“视差数”尝试后放弃了尝试匹配给定块(与左图像中的像素在同一水平行中)。如果我不够清楚,我很抱歉。如果您想了解更多有关其工作原理的详细信息,请参阅http://siddhantahuja.wordpress.com/2010/04/11/correlation-based-similarity-measures-summary/ 中的一些代码。

【讨论】:

    【解决方案2】:

    缺失区域的宽度等于 stereo_bm 中使用的视差数量。它是stereo_bm algorithm 的正常副产品。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-20
      • 2021-06-13
      • 1970-01-01
      • 2016-01-01
      • 2021-07-26
      相关资源
      最近更新 更多