librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

rs-post-processing problem

Open temmat opened this issue 8 years ago • 16 comments


Required Info
Camera Model { D435 }
Firmware Version (5.9.14.0)
Operating System & Version {Win (10)
Platform PC
SDK Version 2.15.0
Language C++/ VS2017
Segment others

Issue Description

The rs-post-processing.cpp example doesn't work.

Firstly the ImGui used in librealsense seems to be quite old (1.49 to be precise), the init function calls have been changed from that, but using the ImGui directly from the librealsense source "third-party" folder is ok for this (building with Cmake does this).

What I'm actually having problems with is in VS2017 with a "no suitable conversion function from "window*" to "GLFWwindow*" in the init function call: ImGui_ImplGlfw_Init(app, false);

From what I understand a GLFWwindow is window+context, so ... should the window declaration actuall be done differently than in the example or is my VS2017 setup missing something else ?

Thank you for any help / hint.


Additional info, as just noticed: There is no "rs-post-processing" sample included in the windows distribution "rssetup-2.15.0.163.exe" and the "example.hpp" which includes the "window" definition are quite different between releases/OS so I guess the problem I have is because I'm trying to use an example that was not prepared for the Windows distribution of the librealsense as is. So is there a rs-post-processing example for the Windows distribution or are there any hints what needs to be adapted to use it ?

temmat avatar Aug 21 '18 23:08 temmat

For anyone interested in this, the rs-measure example has an implementation of the post processing filters (which works for windows too). It's a different approach though (than the example in the source files) and the hole-filling filter is not implemented, but still, you can see how it works I guess.

If you want to add the hole filling filter yourself, then all you need to do is declare it at the beginning of the main function and then call it in the video_processing_thread after the disparity2depth transformation.

With this I don't consider the issue solved (because the actual rs-post-processing example is still missing in the windows build), but developers can still get some idea how to do it from this other example.

temmat avatar Aug 27 '18 08:08 temmat

Hi @temmat My team was unable to reproduce the no suitable conversion error. (tried both the GitHub and the SDK installed versions). Cmake can be a bit hidden away when running VS17, but please make sure you open the entire librealsense solution (the CMakeLists.txt at root level) and not just the CMakeList of the sample. This way, glfw3 should be one of the projects you build and everything should be working.

dorodnic avatar Aug 29 '18 10:08 dorodnic

Thank you for the comment an your attempt to get the same error.

To clarify: I was talking about the prebuilt Windows sdk version 2.15.0.163. which does not include the post-processing example. I tried installing the sdk again, and the said example is simply not there. I haven't built the sdk from source yet, but it seems I might have to to get that specific example working. Or is it perhaps included in the newer 2.16 build ?

(I got the error "no suitable conversion" when I quickly tried to compile just the post-processing example from https://github.com/IntelRealSense/librealsense/blob/master/examples/post-processing/rs-post-processing.cpp with VS2017 without using Cmake, )

temmat avatar Sep 02 '18 20:09 temmat

Sorry, I stand corrected. I checked that all the installer examples compile cleanly using VS17, but post-processing is not in the installer. So far we shied away from redistributing too much 3rd-party libraries in the installer (this is the reason for both post-processing and align missing - both would pull IMGUI and GLFW into the installer) We will revisit this decision since this is not the first issue bringing it up.

dorodnic avatar Sep 03 '18 05:09 dorodnic

Here are my concerns with adding GLFW and IMGUI (and similarly OpenCV) into the installer -

  1. librealsense API is designed to allow you to compile the library with one version of Visual Studio and the application with another. This is not true for libraries in general, and there are plenty of examples that require a dedicated DLL for every version of Visual Studio (PCL for instance). I think GLFW and IMGUI are also Visual Studio agnostic, but we need to check.
  2. Every binary we distribute has Intel digital signature to let users know they are using an official version. It would be a bit odd for us to distribute 3rd-party libraries in this fashion.

dorodnic avatar Sep 03 '18 05:09 dorodnic

I thought glfw was already included, since there are some glfw callbacks and structures named accordingly within librealsense (at least judging by the comments) in the rs-measure example ( specifically "register_glfw_callbacks") and in samples\example.hpp (specifically the glfw_state structure). But maybe those are just names and have actually no dependency on the glfw library.

I understand your concern with including glfw or imgui (or any other third party library) with librealsense - it's objectively "cleaner" not to, and of course represent more dependencies to deal with if expanding the sample code to something else. Nevertheless the examples that you mention yourself (post-processing and align) show/propose how to deal with librealsense in a highly relevant matter, so I propose to either include the examples and the necessary libraries in the upcoming releases OR (as an alternative solution) use another simple method to provide an input interface needed for the manipulation of example parameters ... I guess even a very basic console input/text in a separate window could produce a similar result ?

temmat avatar Sep 03 '18 23:09 temmat

[Realsense Customer Engineering Team Comment] @temmat Did you still have issue of rs-post-processing? Please update. Thanks!

Well, both post-processing and align samples are still not part of the SDK installer and there is no replacement unless the user builds the samples themselves from github.

For me personally it is solved, it is however not for any other user using the SDK installer.

temmat avatar Oct 22 '18 09:10 temmat

This issue should be resolved in the upcoming 2.16.2 release. The installer is going to include the missing examples and redistribute GLFW, IMGUI and OpenCV. Once the release is ready, I hope it will help new users. @temmat thank you for the valuable feedback.

dorodnic avatar Oct 24 '18 17:10 dorodnic

[Realsense Customer Engineering Team Comment] @temmat Could you please have a try with 2.16.2 to see if you still get the problem? Thanks!

I had the same issue written here as well.

I will test the latest release version when it is out, since 2.16.2 and 2.16.3 are still pre-releases!

HippoEug avatar Nov 06 '18 07:11 HippoEug

[Realsense Customer Engineering Team Comment] @temmat @HippoEug 2.16.5 is released now. Please have a try to see if your problem fixed. Thanks!

[Realsense Customer Engineering Team Comment] @temmat @HippoEug Any good news? Please update. Thanks!

Yeah it is OK for me !

HippoEug avatar Dec 13 '18 03:12 HippoEug

[Realsense Customer Engineering Team Comment] @HippoEug That's great. @temmat How about your test?

Align and post-processing are included and build for me too. Tested with latest version 2.17.0.394 windows SDK installer.

temmat avatar Dec 17 '18 15:12 temmat