3 Replies Latest reply on Apr 16, 2018 2:30 PM by Intel Corporation

    OpenCV + Intel Realsense Viewer


      Hi Guys. I can't integrate OpenCV with the Intel Realsense Viewer source code.


      Using the OpenCV examples with the openCV I downloaded DOES work, but the problem comes when I try and use openCV in a project that isn't in the OpenCV folder (wrappers/OpenCV).


      Also of course the realsense SDK built and runs correctly.


      I'm currently on a Windows 10.

      I'm using visual studio 2017. msvc 14.12

      The opencv version is 3.4.1 (windows pack) that's the version that is pre built for you.


      The steps I followed to try and link openCV to the Intel Realsense Viewer:


      Some terminology:


      1. open the intel realsense sdk solution in visual studio (that's the .sln called librealsense2)

      2. go to the realsense-vewier project inside the 'solution explorer' panel inside visual studio

      3. right click on the project 'realsense-viewer' and then select properties

      4. make sure the 2 drop down boxes above have 'x64' and 'all configurations'

      5. Go to the C/C++ -> General option (from the left white box) and then go to 'Additional Include Directories'

      6. Add in the directory %OpenCVDownloadRoot%/build/include and %OpenCVDownloadRoot%/build/include/opencv (this is the configuration of the example OpenCV projects


      Now at this point, some functions from openCV weren't being linked properly inside the 'realsense-viewer' project (which is weird because the work in the OpenCV projects in the SDK, even though the properties are the same. The errors were as follows:

      So then I followed some extra steps to see if I can get this to work.

      7. Inside the properties dialog box (the one we were just in) instead of selecting C/C++, select 'Linker'

      8. in the 'Additional Libraries Directories' selection, add in %OpenCVDownloadRoot%/build/x64/vc15/lib

      9. inside the 'Linker' properties, search for Input (Linker -> Input)

      10. add in 'opencv_world341d.lib' inside the 'Additional Dependencies' selection.


      Now we get a completely different error:

      Now the realsense libraries aren't being recognised. No other properties were modified except for the above. I can confirm that step 10 causes all of these errors. Even if I reverse the actions of step 10 after performing all the steps, the above error still remains -> this must be a visual studio bug.


      Any help or hints on how I can get OpenCV 3.4.1 + realsense-viewer (from the SDK) working inside visual studio 2017?