View my account

Does rs2::gl::pointcloud_renderer provide member function or method with which I could download or export rendered 3D surf to matrix, instead of displaying it? If not, how may export rendered 3D surf?

Comments

27 comments

  • MartyG

    Hi Lblsydx  You can export a RealSense pointcloud to a file format called .ply (a pointcloud data file) without rendering the pointcloud on the screen.

     

    你好@Lblsydx 您可以将 RealSense 点云导出为名为 .ply(点云数据文件)的文件格式,而无需在屏幕上渲染点云。

    0
    Comment actions Permalink
  • Lblsydx

    Please provide an example C++ progarm to export the rendered 3D surface from rs2::gl::pointcloud_renderer instead of the pointcloud.

    请提供C++程序代码将渲染后的图像而不是点云导出到文件。

    0
    Comment actions Permalink
  • Lblsydx

    Could rs2::gl::pointcloud_renderer render the pointcloud on other places, except for the screen? Since I'm afraid that if I project RealSense pointcloud directly to xy plane the points may be discontinuous with spatial coordiante.

    除了屏幕,rs2::gl::pointcloud_renderer可以把点云渲染到其他地方吗?我担心如果直接把点云投影到xy平面,这些点可能在平面上不连续,即得不到连续的图像。

    0
    Comment actions Permalink
  • MartyG

    0
    Comment actions Permalink
  • MartyG

    You could perhaps use the rs-gl C++ example and insert an export_to_ply instruction after the pc.calculate line to export it to a .ply file, and comment out the part of the program that renders the pointcloud visually so that it only exports the pointcloud and does not show it.

    您或许可以使用 rs-gl C++ 示例,并在 pc.calculate 行后插入 export_to_ply 指令将其导出到 .ply 文件,并注释掉程序中以可视方式呈现点云的部分,以便它仅导出点云而不显示它。

    https://github.com/IntelRealSense/librealsense/blob/master/examples/gl/rs-gl.cpp

    https://github.com/IntelRealSense/librealsense/blob/master/examples/gl/rs-gl.cpp#L136-L142

    0
    Comment actions Permalink
  • Lblsydx

    MartyG MartyGThe program in the github link is about rs2::pointcloud, instead of rs2::gl::pointcloud_renderer. I'm instrersted in rs2::gl::pointcloud_renderer, instead of rs2::pointcloud.

    刚才github中的程序不是关于rs2::gl::pointcloud_renderer,而是关于rs2::pointcloud,我想把渲染后的图像从rs2::gl::pointcloud_renderer中下载出来。

    0
    Comment actions Permalink
  • MartyG

    The program does use rs2::gl::pointlcloud.and rs2::gl::pointcloud_renderer, as it is a GL example.

    https://github.com/IntelRealSense/librealsense/blob/master/examples/gl/rs-gl.cpp#L54

    https://github.com/IntelRealSense/librealsense/blob/master/examples/gl/rs-gl.cpp#L59

    0
    Comment actions Permalink
  • Lblsydx

    Which line of the program could dispaly the 3D model on the screen?

    程序的哪个语句是将渲染后的3d模型显示到屏幕上的?MartyG MartyG

    0
    Comment actions Permalink
  • Lblsydx

    MartyG MartyG 你有联系方式吗 想加下微信或qq?

    0
    Comment actions Permalink
  • MartyG

    I am only able to respond by comments on this website.

    I recommend commenting out lines 136-147 of the rs-gl program by putting // in front of them to see whether it disables rendering.

     

    我只能通过本网站的评论来回复。

    我建议通过在 rs-gl 程序的前面添加 // 来注释掉 rs-gl 程序的第 136-147 行,以查看它是否会禁用渲染。

    https://github.com/IntelRealSense/librealsense/blob/master/examples/gl/rs-gl.cpp#L136-L142

    0
    Comment actions Permalink
  • Lblsydx

    我意思不是禁止渲染,只是禁止显示渲染后的3d图像。opengl可以将这个图像导出为3d体素文件或矩阵吗?
    I would like to forbid displaying the rendered 3d model, instead of rendering. In which function in openGL could I get and export the voxels of the rendered 3d model?

    0
    Comment actions Permalink
  • MartyG

    This should provide helpful C++ references for voxel export:

    https://github.com/IntelRealSense/librealsense/issues/6411

    0
    Comment actions Permalink
  • Lblsydx

    Does rs2-gl provide method to get the color at a certain voxel? How could visit voxel buffer of openGL?
    rs2::gl::pointcloud_renderer可不可以将渲染后的3d模型体素化,并导出各体素的颜色?如何访问opengl存放3d模型体素信息的缓冲区?

    0
    Comment actions Permalink
  • MartyG

    GL is a method of accelerating the performance of SDK functions of the type RS2:: by inserting gl:: into the function's name - such as rs2::pointcloud becoming rs2::gl::pointcloud. These GL-enabled functions can then take advantage of a computer's graphics GPU for faster processing.

     

    So if an RS2:: function such as rs2::pointcloud does not support a particular feature - like getting the color at a certain voxel - then rs2::gl::pointcloud will not support it either. 

     

    I do not know of a way to get a voxel color at a particular coordinate.

     

    GL 是一种通过在函数名称中插入 gl:: 来加速 RS2:: 类型的 SDK 函数性能的方法 - 例如 rs2::pointcloud 变为 rs2::gl::pointcloud。然后,这些启用 GL 的函数可以利用计算机的图形 GPU 进行更快的处理。

    因此,如果 RS2:: 函数(例如 rs2::pointcloud)不支持特定功能(例如获取特定体素的颜色),那么 rs2::gl::pointcloud 也不会支持它。

    我不知道如何获取特定坐标处的体素颜色。

    0
    Comment actions Permalink
  • Lblsydx

    如何将rs2::gl::pointcloud_renderer渲染输出的位置从屏幕重定向到别的位置?

    How I could redirect the address, where rs2::gl::pointcloud_renderer render on and output to, to other places such cv::Mat?

    0
    Comment actions Permalink
  • MartyG

    I believe that focusing on rs2::gl::pointcloud_renderer will not enable you to achieve your goal, because this approach is not how librealsense pointcloud scripts publish a pointcloud.  They usually either use the pc.calculate instruction or the rs2_deproject_pixel_to_point instruction.   

     

    Instead, if you want to generate a RealSense pointcloud that uses an OpenCV mat then you could try the RealSense C++ / OpenCV pointcloud example program here:

    https://github.com/UnaNancyOwen/RealSense2Sample/tree/master/sample/PointCloud

     

    The pointcloud program code is in the realsense.cpp file.

     

     

     

    0
    Comment actions Permalink
  • Lblsydx

    d435i采集到的深度在哪个范围内精度较高?通过realsense sdk2如何打开d435i的激光?

    In which range is the highest accuracy of the depth, which I got from d435i? By virtue of realsense sdk2, how could I open the laser of d435i?

    0
    Comment actions Permalink
  • MartyG

    The maximum depth sensing range of D435i is 10 meters.  Error increases linearly as the distance from the camera increases though, and decline in accuracy will begin to become noticeable beyond 3 meters from the camera. 

     

    Below is a C++ script for controlling the on and of status of the laser and its laser power value with librealsense2 code.

     

    D435i 的最大深度感应范围为 10 米。但随着与相机距离的增加,误差会线性增加,距离相机 3 米以外时,准确度的下降将开始变得明显。

    下面是一个 C++ 脚本,用于使用 librealsense2 代码控制激光的开启和关闭状态及其激光功率值。

     

    https://dev.intelrealsense.com/docs/api-how-to#controlling-the-laser

    0
    Comment actions Permalink
  • Lblsydx

    But if the point is near the camera, a few dm or cm, the depth accuracy seems to be lower. Does cv::viz::Viz3d provide method to render, export pointcloud, or project pointcloud to bird's eye view?

    如果离深度相机太近,几厘米几分米,深度精度也下降。cv::viz::Viz3d提不提供渲染点云,将渲染后3d图像投影到鸟瞰图、主视图、侧视图,然后导出为cv::mat的方法?

    0
    Comment actions Permalink
  • MartyG

    RealSense cameras have a minimum depth sensing distance that varies depending on the camera model.  D435i's minimum distance is around 10 cm.  If the camera moves closer to an object or surface than that then the depth detail nearest to the camera starts to break up and then disappear.

     

    You can increase the value of a setting called Disparity Shift so that the camera can get nearer to an object without the depth detail breaking,  Increasing the Disparity Shift value however also reduces the maximum depth sensing range of the camera.

     

    You might be able to reduce the D435i's minimum depth distance to 7 cm with a very high Disparity Shift value. 

     

    For high accuracy and high quality images at very close range to a object though, the best solution is to use the D405 camera model.

     

    RealSense 相机具有最小深度感应距离,具体取决于相机型号。D435i 的最小距离约为 10 厘米。如果相机靠近物体或表面,则最靠近相机的深度细节将开始分解然后消失。

    您可以增加视差偏移设置的值,以便相机可以更靠近物体而不会破坏深度细节,但是增加视差偏移值也会减少相机的最大深度感应范围。

    您可以使用非常高的视差偏移值将 D435i 的最小深度距离降低到 7 厘米。

    但是,如果要在非常近的距离内获得高精度和高质量的图像,最好的解决方案是使用 D405 相机型号。

    0
    Comment actions Permalink
  • Lblsydx

    How could I display rs2::pointcloud as realsense-viewer 3d, by virtue of realsense sdk2 program code? Which method of cv::viz::Viz3d could render, export pointcloud, or project pointcloud to bird's eye view?
    我如何基于realsense sdk2编程,实现类似realsense-viewer 3d显示点云?cv::viz::Viz3d通过什么方法渲染点云,将渲染后3d图像投影到鸟瞰图、主视图、侧视图,然后导出为cv::mat?

    0
    Comment actions Permalink
  • MartyG

    The SDK's C++ example rs-pointcloud produces a pointcloud that looks and works similarly to the Viewer's.

    https://github.com/IntelRealSense/librealsense/tree/master/examples/pointcloud

     

    There is a RealSense C++ / OpenCV pointcloud example program created by a RealSense user that uses cv ::viz::Viz3d

    https://github.com/UnaNancyOwen/RealSense2Sample/tree/master/sample/PointCloud

    https://github.com/UnaNancyOwen/RealSense2Sample/blob/master/sample/PointCloud/realsense.cpp#L73

    0
    Comment actions Permalink
  • Lblsydx

    https://github.com/IntelRealSense/librealsense/tree/master/examples/pointcloud
    这个例程中如果我不想把点云显示到屏幕上 而是输出到cv ::mat程序该怎么修改?cv ::viz::Viz3d显示的位置如何从屏幕重定向到cv ::mat中?
    How may I modify the example above, if I would like to output the pointcloud to cv ::mat, instead of window on the screen? How may I redirect the output window of cv ::viz::Viz3d from the screen to cv ::mat?

    0
    Comment actions Permalink
  • MartyG

    The UnaNancyOwen pointcloud program above is the only RealSense program that I know of that uses cv ::viz::Viz3d and my OpenCV programming knowledge is unfortunately limited.  So there are no other RealSense programming references or advice that I can offer about using cv ::viz::Viz3dI do apologise.

     

    You could try creating a new case on this Help Center site just about that question and waiting for a member of the Intel RealSense Help Center team to respond.  I am not a Help Center team member, only a volunteer.

     

    上面的 UnaNancyOwen 点云程序是我所知道的唯一使用 cv ::viz::Viz3d 的 RealSense 程序,而不幸的是,我的 OpenCV 编程知识有限。因此,我无法提供有关使用 cv ::viz::Viz3d 的其他 RealSense 编程参考或建议。我很抱歉。

    您可以尝试在此帮助中心网站上创建一个关于该问题的新案例,然后等待英特尔 RealSense 帮助中心团队的成员回复。我不是帮助中心团队成员,只是一名志愿者。

    0
    Comment actions Permalink
  • Lblsydx

    Would you please kindly tell me how to enter the help center?
    如何在realsense帮助中心网站上创建一个关于该问题的新案例?

    0
    Comment actions Permalink
  • MartyG

    This support website that you are writing on is the Help Center.  Please go to the front page of this website and click the New Post button.

    您正在撰写的这个支持网站是帮助中心。请转到该网站的首页并单击新帖子按钮。

    https://support.intelrealsense.com/hc/en-us/community/topics

    0
    Comment actions Permalink

Please sign in to leave a comment.