samedi 18 janvier 2020

When I use OpenCV cv :: Rect use viz to visualize the cropped picture cannot be displayed

I tried 2D point cloud cropping and successfully displayed the picture. Currently I want tried 3D point cloud cropping for visual display, but it has been failing. I don't know what the problem is?

enter code here

    UMat tsdfRender;
    kf->render(tsdfRender);

    int startX = 100, startY = 260, start_width = 180, start_height = 160;
    UMat ROI(tsdfRender, Rect(startX, startY, start_width, start_height));
    UMat crop_tsdfRender;
    ROI.copyTo(crop_tsdfRender);
    imshow("2D_Result", crop_tsdfRender);

    UMat points;
    UMat normals;
    kf->getCloud(points, normals);

    // Show fused point cloud and normals
    if (!points.empty() && !normals.empty() && renderViz)
    {
        viz::WCloud cloud(points, viz::Color::white());
        viz::WCloudNormals cloudNormals(points, normals, 1, 0.01, viz::Color::cyan());

        visualization.showWidget("cloud", cloud);
        visualization.showWidget("normals", cloudNormals);
        visualization.spinOnce(1, true);
    }

Aucun commentaire:

Enregistrer un commentaire