【问题标题】:How to optimize my parallax map disparity map?如何优化我的视差图视差图?
【发布时间】:2020-01-11 09:38:31
【问题描述】:

我使用SGBM和wls得到的视差图如下。但是得到的视差图有一些缺陷,所以我的点云也很差。有人可以告诉我如何优化它吗?

int dis2pcloud(Mat color,Mat depth)
{
    if (color.empty() || depth.empty())
    {
    cout << "The image is empty, please check it!" << endl;
    return -1;
    }
    PointCloud<PointXYZRGB>::Ptr cloud(new PointCloud<PointXYZRGB>);

    for (int row = 0; row < depth.rows; row++)
    {
        for (int col = 0; col < depth.cols; col++)
        {
            ushort d = depth.ptr<ushort>(row)[col];

            if (d==0)
                continue;
            PointXYZRGB p;

            p.z = fx * baseline / (d + doffs); // Zc = baseline * f / (d + doffs)

            p.x = (col - u0) * p.z / fx; 
            p.y = (row - v0) * p.z / fy;
            p.y = -p.y;  
            p.z = -p.z;
            p.b = color.ptr<uchar>(row)[col * 3];
            p.g = color.ptr<uchar>(row)[col * 3 + 1];
            p.r = color.ptr<uchar>(row)[col * 3 + 2];
            cloud->points.push_back(p);
        }
    } 

【问题讨论】:

    标签: depth stereo-3d 3d-reconstruction


    【解决方案1】:
    猜你喜欢
    • 2011-07-15
    • 2015-06-11
    • 2013-12-19
    • 2012-01-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多