How to use python bindings?

Hello, I am trying to use the python bindings, so my final goal is to be able to import the library aditofpython.cpp in the first_frame.py file. However, I don't quite understand what are the proper instructions. What I did so far is the following:

1) I installed Miscosoft Visual Studio 15 2017, anaconda3, CMake, OpenCV, and OpenSSL (this one comes together with Git:C:\Program Files\Git\usr\bin);

2) I run \aditof_sdk\scripts\windows\setup_project.bat to make sure that glog, protobuf, libwebsockets are installed. During the installation, a lot of .h files were not found and some of the tests were failed. In the end, I see that the programs are successfully downloaded, however in the folder "installed" there is only glog and protobuf. Are all these three necessary for python interfacing? How to check that they are properly installed?

3) What should I do next? As I understood I should try to build some additional files with cmake as written here:https://github.com/analogdevicesinc/aditof_sdk/tree/master/cmake. So firstly I need to go to the aditof_sdk root folder and create a build folder. Then I run the command 

cmake -DWITH_PYTHON=on -DWITH_OPENCV=on -DCMAKE_PREFIX_PATH="/opt/glog;/opt/protobuf;/opt/websockets" -DCMAKE_INSTALL_PREFIX="/opt/aditof" ..

For that, as I understand, I need to copy glog, protobuf and libwebsockets folders from \aditof_sdk\scripts\windows\deps to \aditof_sdk-master\opt. Is this correct? The command above gave me the error: protobuf was not found.

Sorry for the dumb questions, I haven't any experience interfacing C++ and Python before.

  • 0
    •  Analog Employees 
    on Feb 19, 2021 8:18 AM

    Hello Anton,

    I would like to know what operating system are you using and if it is a 32-bit or 64-bit version.

    If you use the script to build the files you must copy the 3 files from aditof_sdk\scripts\windows\build\bindings\python\. (There is a .LIB, .EXP and a python extension module.) to your first-frame folder. You should be able to run the example.

  • Thanks for the answer, Septimiu!

    I am using 64-bit version. I don't have the bindings folder in aditof_sdk\scripts\windows\build\. Also, I don't have any .LIB, .EXP files in :\aditof_sdkbindings\python if you meant this path.

  • 0
    •  Analog Employees 
    on Feb 19, 2021 8:57 AM in reply to AntonB

    Can you run the script using PowerShell and send us the log please?

    Also the steps for manually installing the sdk and dependencies can be found here:

    github.com/.../build_instructions.md

  • 0
    •  Analog Employees 
    on Feb 22, 2021 2:15 PM in reply to AntonB

    Hi,

    Looks like one of the dependencies (Websockets) did not build properly. I've found this message in the log file you have sent:

    !!! Failed to generate SSL certificate for Test Server using cmd.exe !!!:

    I believe this is because of the version of the openSSL that you have (openssl-0.9.8k_X64).

    Can you please download a version from here: https://slproweb.com/products/Win32OpenSSL.html ? Choose the developer package (the 64MB installer).

    Then clean the build folder that the script created and start again. Then look if the message I've mentioned above is still there. Hopefully it shouldn't.

    Dan

  • installLog.txt
    **********************
    Windows PowerShell transcript start
    Start time: 20210223122035
    Username: DESKTOP-JM66SB2\test
    RunAs User: DESKTOP-JM66SB2\test
    Configuration Name: 
    Machine: DESKTOP-JM66SB2 (Microsoft Windows NT 10.0.19041.0)
    Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    Process ID: 11532
    PSVersion: 5.1.19041.610
    PSEdition: Desktop
    PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.19041.610
    BuildVersion: 10.0.19041.610
    CLRVersion: 4.0.30319.42000
    WSManStackVersion: 3.0
    PSRemotingProtocolVersion: 2.3
    SerializationVersion: 1.1.0.1
    **********************
    Transcript started, output file is D:\aditof_sdk-master\scripts\windows\installLog.txt
    PS D:\aditof_sdk-master\scripts\windows> D:\aditof_sdk-master\scripts\windows\setup_project.bat
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    CMake Deprecation Warning at examples/aditof-demo/CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    -- OpenCV ARCH: x64
    -- OpenCV RUNTIME: vc15
    -- OpenCV STATIC: OFF
    -- Found OpenCV: C:/Users/test/Downloads/opencv/build (found version "3.4.3")
    -- Found OpenCV 3.4.3 in C:/Users/test/Downloads/opencv/build/x64/vc15/lib
    -- You might need to add C:\Users\test\Downloads\opencv\build\x64\vc15\bin to your PATH to be able to run your applications.
    CMake Deprecation Warning at examples/aditof-test/CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    -- OpenCV ARCH: x64
    -- OpenCV RUNTIME: vc15
    -- OpenCV STATIC: OFF
    -- Found OpenCV 3.4.3 in C:/Users/test/Downloads/opencv/build/x64/vc15/lib
    -- You might need to add C:\Users\test\Downloads\opencv\build\x64\vc15\bin to your PATH to be able to run your applications.
    CMake Deprecation Warning at examples/first-frame/CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    CMake Deprecation Warning at examples/first-frame-network/CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    -- Found OpenSSL: optimized;C:/Program Files/OpenSSL-Win64/lib/VC/libcrypto64MD.lib;debug;C:/Program Files/OpenSSL-Win64/lib/VC/libcrypto64MDd.lib (found version "1.1.1j")
    CMake Deprecation Warning at bindings/python/CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    -- Found PythonInterp: C:/Users/test/anaconda3/python.exe (found version "3.8.5")
    -- Found PythonLibs: C:/Users/test/anaconda3/libs/Python38.lib
    -- Performing Test HAS_MSVC_GL_LTCG
    -- Performing Test HAS_MSVC_GL_LTCG - Success
    -- LTO enabled
    CMake Deprecation Warning at bindings/python/examples/dnn/CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    Downloading MobileNetSSD_deploy.prototxt into D:/aditof_sdk-master/scripts/windows/build/bindings/python/examples/dnn
    Downloading MobileNetSSD_deploy.caffemodel into D:/aditof_sdk-master/scripts/windows/build/bindings/python/examples/dnn
    CMake Deprecation Warning at bindings/opencv/CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    -- OpenCV ARCH: x64
    -- OpenCV RUNTIME: vc15
    -- OpenCV STATIC: OFF
    -- Found OpenCV 3.4.3 in C:/Users/test/Downloads/opencv/build/x64/vc15/lib
    -- You might need to add C:\Users\test\Downloads\opencv\build\x64\vc15\bin to your PATH to be able to run your applications.
    CMake Deprecation Warning at bindings/opencv/dnn/CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    Downloading MobileNetSSD_deploy.prototxt into D:/aditof_sdk-master/scripts/windows/build/bindings/opencv/dnn
    Downloading MobileNetSSD_deploy.caffemodel into D:/aditof_sdk-master/scripts/windows/build/bindings/opencv/dnn
    CMake Deprecation Warning at bindings/opencv/maskrcnn/CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    CMake Deprecation Warning at bindings/opencv/imshow/CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: D:/aditof_sdk-master/scripts/windows/build
    Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.
    
      Checking Build System
      Running cpp protocol buffer compiler on src/connections/network/buffer.proto
      Building Custom Rule D:/aditof_sdk-master/sdk/CMakeLists.txt
      filters_factory.cpp
      frame.cpp
    D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): warning C4251: 'aditof::Frame::m_impl': class 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::Frame' [D:\adi
    tof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
              with
              [
                  _Ty=FrameImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): note: see declaration of 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=FrameImpl
              ]
      frame_impl.cpp
      frame_operations.cpp
      sensor_enumerator_factory.cpp
      system.cpp
    D:\aditof_sdk-master\sdk\include\aditof/system.h(96): warning C4251: 'aditof::System::m_impl': class 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::System' [D:\
    aditof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
              with
              [
                  _Ty=SystemImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/system.h(96): note: see declaration of 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=SystemImpl
              ]
      system_impl.cpp
      utils.cpp
      calibration_96tof1.cpp
      camera_96tof1.cpp
    D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): warning C4251: 'aditof::Frame::m_impl': class 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::Frame' [D:\adi
    tof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
              with
              [
                  _Ty=FrameImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): note: see declaration of 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=FrameImpl
              ]
    D:\aditof_sdk-master\sdk\src\cameras\ad-96tof1-ebz\camera_96tof1.cpp(207): warning C4305: '=': truncation from 'double' to 'float' [D:\aditof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
    D:\aditof_sdk-master\sdk\src\cameras\ad-96tof1-ebz\camera_96tof1.cpp(208): warning C4305: '=': truncation from 'double' to 'float' [D:\aditof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
      usb_utils.cpp
      usb_depth_sensor_windows.cpp
    D:\aditof_sdk-master\sdk\src\connections\usb\windows\usb_depth_sensor_windows.cpp(619): warning C4101: 'offset_idx': unreferenced local variable [D:\aditof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
    D:\aditof_sdk-master\sdk\src\connections\usb\windows\usb_depth_sensor_windows.cpp(618): warning C4101: 'offset': unreferenced local variable [D:\aditof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
    D:\aditof_sdk-master\sdk\src\connections\usb\windows\usb_depth_sensor_windows.cpp(617): warning C4101: 'j': unreferenced local variable [D:\aditof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
    D:\aditof_sdk-master\sdk\src\connections\usb\windows\usb_depth_sensor_windows.cpp(617): warning C4101: 'i': unreferenced local variable [D:\aditof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
      usb_sensor_enumerator.cpp
      usb_storage_windows.cpp
    D:\aditof_sdk-master\sdk\src\connections\usb\windows\usb_storage_windows.cpp(80): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data [D:\aditof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
    D:\aditof_sdk-master\sdk\src\connections\usb\windows\usb_storage_windows.cpp(103): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data [D:\aditof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
      usb_temperature_sensor_windows.cpp
      usb_windows_utils.cpp
    D:\aditof_sdk-master\sdk\src\connections\usb\windows\usb_windows_utils.cpp(160): warning C4267: '=': conversion from 'size_t' to 'uint32_t', possible loss of data [D:\aditof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
    D:\aditof_sdk-master\sdk\src\connections\usb\windows\usb_windows_utils.cpp(230): warning C4267: '+=': conversion from 'size_t' to 'uint32_t', possible loss of data [D:\aditof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
      connection_validator.cpp
      network.cpp
    D:\aditof_sdk-master\sdk\src\connections\network\network.cpp(389): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [D:\aditof_sdk-master\scripts\windows\build\sdk\aditof.vcxproj]
      network_depth_sensor.cpp
      network_sensor_enumerator.cpp
      Generating Code...
      Compiling...
      network_storage.cpp
      network_temperature_sensor.cpp
      buffer.pb.cc
      Generating Code...
         Creating library D:/aditof_sdk-master/scripts/windows/build/sdk/Release/aditof.lib and object D:/aditof_sdk-master/scripts/windows/build/sdk/Release/aditof.exp
      aditof.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\sdk\Release\aditof.dll
      Building Custom Rule D:/aditof_sdk-master/bindings/python/CMakeLists.txt
      aditofpython.cpp
    D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): warning C4251: 'aditof::Frame::m_impl': class 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::Frame' [D:\adi
    tof_sdk-master\scripts\windows\build\bindings\python\aditofpython.vcxproj]
              with
              [
                  _Ty=FrameImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): note: see declaration of 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=FrameImpl
              ]
    D:\aditof_sdk-master\sdk\include\aditof/system.h(96): warning C4251: 'aditof::System::m_impl': class 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::System' [D:\
    aditof_sdk-master\scripts\windows\build\bindings\python\aditofpython.vcxproj]
              with
              [
                  _Ty=SystemImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/system.h(96): note: see declaration of 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=SystemImpl
              ]
         Creating library D:/aditof_sdk-master/scripts/windows/build/bindings/python/Release/aditofpython.lib and object D:/aditof_sdk-master/scripts/windows/build/bindings/python/Release/aditofpython.exp
      Generating code
      Finished generating code
      aditofpython.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\bindings\python\Release\aditofpython.cp38-win_amd64.pyd
      Building Custom Rule D:/aditof_sdk-master/examples/aditof-demo/CMakeLists.txt
      aditofdemorecorder.cpp
    D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): warning C4251: 'aditof::Frame::m_impl': class 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::Frame' [D:\adi
    tof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
              with
              [
                  _Ty=FrameImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): note: see declaration of 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=FrameImpl
              ]
    D:\aditof_sdk-master\examples\aditof-demo\aditofdemorecorder.cpp(85): warning C4244: 'initializing': conversion from 'std::streamoff' to 'int', possible loss of data [D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\adito
    f-demo.vcxproj]
      aditofdemoview.cpp
    D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): warning C4251: 'aditof::Frame::m_impl': class 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::Frame' [D:\adi
    tof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
              with
              [
                  _Ty=FrameImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): note: see declaration of 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=FrameImpl
              ]
    D:\aditof_sdk-master\sdk\include\aditof/system.h(96): warning C4251: 'aditof::System::m_impl': class 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::System' [D:\
    aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
              with
              [
                  _Ty=SystemImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/system.h(96): note: see declaration of 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=SystemImpl
              ]
      cvui.h: compiling implementation because of CVUI_IMPLEMENTATION. See: https://dovyski.github.io/cvui/usage/
    D:\aditof_sdk-master\examples\aditof-demo\aditofdemoview.cpp(237): warning C4805: '|': unsafe mix of type 'int' and type 'bool' in operation [D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
    D:\aditof_sdk-master\examples\aditof-demo\aditofdemoview.cpp(249): warning C4805: '|': unsafe mix of type 'int' and type 'bool' in operation [D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
    D:\aditof_sdk-master\examples\aditof-demo\aditofdemoview.cpp(271): warning C4805: '|': unsafe mix of type 'int' and type 'bool' in operation [D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
    D:\aditof_sdk-master\examples\aditof-demo\aditofdemoview.cpp(286): warning C4805: '|': unsafe mix of type 'int' and type 'bool' in operation [D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
    D:\aditof_sdk-master\examples\aditof-demo\aditofdemoview.cpp(295): warning C4805: '|': unsafe mix of type 'int' and type 'bool' in operation [D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
    D:\aditof_sdk-master\examples\aditof-demo\aditofdemoview.cpp(316): warning C4805: '|': unsafe mix of type 'int' and type 'bool' in operation [D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
    D:\aditof_sdk-master\examples\aditof-demo\aditofdemoview.cpp(655): warning C4244: '=': conversion from '_Rep' to 'int', possible loss of data [D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
              with
              [
                  _Rep=double
              ]
    D:\aditof_sdk-master\examples\aditof-demo\aditofdemoview.cpp(643): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help
     for details. [D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\stdio.h(1764): note: see declaration of 'sprintf'
    D:\aditof_sdk-master\examples\aditof-demo\aditofdemoview.cpp(644): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help
     for details. [D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\stdio.h(1764): note: see declaration of 'sprintf'
    D:\aditof_sdk-master\examples\aditof-demo\aditofdemoview.cpp(851): warning C4101: 'ia': unreferenced local variable [D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
    D:\aditof_sdk-master\examples\aditof-demo\aditofdemoview.cpp(926): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help
     for details. [D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\stdio.h(1764): note: see declaration of 'sprintf'
      aditofdemocontroller.cpp
    D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): warning C4251: 'aditof::Frame::m_impl': class 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::Frame' [D:\adi
    tof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
              with
              [
                  _Ty=FrameImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): note: see declaration of 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=FrameImpl
              ]
    D:\aditof_sdk-master\sdk\include\aditof/system.h(96): warning C4251: 'aditof::System::m_impl': class 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::System' [D:\
    aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
              with
              [
                  _Ty=SystemImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/system.h(96): note: see declaration of 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=SystemImpl
              ]
      main.cpp
    D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): warning C4251: 'aditof::Frame::m_impl': class 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::Frame' [D:\adi
    tof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
              with
              [
                  _Ty=FrameImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): note: see declaration of 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=FrameImpl
              ]
    D:\aditof_sdk-master\sdk\include\aditof/system.h(96): warning C4251: 'aditof::System::m_impl': class 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::System' [D:\
    aditof_sdk-master\scripts\windows\build\examples\aditof-demo\aditof-demo.vcxproj]
              with
              [
                  _Ty=SystemImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/system.h(96): note: see declaration of 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=SystemImpl
              ]
      Generating Code...
      aditof-demo.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\Release\aditof-demo.exe
      Building Custom Rule D:/aditof_sdk-master/bindings/opencv/dnn/CMakeLists.txt
      main.cpp
    D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): warning C4251: 'aditof::Frame::m_impl': class 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::Frame' [D:\adi
    tof_sdk-master\scripts\windows\build\bindings\opencv\dnn\aditof-opencv-dnn.vcxproj]
              with
              [
                  _Ty=FrameImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): note: see declaration of 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=FrameImpl
              ]
    D:\aditof_sdk-master\sdk\include\aditof/system.h(96): warning C4251: 'aditof::System::m_impl': class 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::System' [D:\
    aditof_sdk-master\scripts\windows\build\bindings\opencv\dnn\aditof-opencv-dnn.vcxproj]
              with
              [
                  _Ty=SystemImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/system.h(96): note: see declaration of 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=SystemImpl
              ]
      aditof-opencv-dnn.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\bindings\opencv\dnn\Release\aditof-opencv-dnn.exe
      Building Custom Rule D:/aditof_sdk-master/bindings/opencv/imshow/CMakeLists.txt
      main.cpp
    D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): warning C4251: 'aditof::Frame::m_impl': class 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::Frame' [D:\adi
    tof_sdk-master\scripts\windows\build\bindings\opencv\imshow\aditof-opencv-imshow.vcxproj]
              with
              [
                  _Ty=FrameImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): note: see declaration of 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=FrameImpl
              ]
    D:\aditof_sdk-master\sdk\include\aditof/system.h(96): warning C4251: 'aditof::System::m_impl': class 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::System' [D:\
    aditof_sdk-master\scripts\windows\build\bindings\opencv\imshow\aditof-opencv-imshow.vcxproj]
              with
              [
                  _Ty=SystemImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/system.h(96): note: see declaration of 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=SystemImpl
              ]
      aditof-opencv-imshow.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\bindings\opencv\imshow\Release\aditof-opencv-imshow.exe
      Building Custom Rule D:/aditof_sdk-master/bindings/opencv/maskrcnn/CMakeLists.txt
      main.cpp
    D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): warning C4251: 'aditof::Frame::m_impl': class 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::Frame' [D:\adi
    tof_sdk-master\scripts\windows\build\bindings\opencv\maskrcnn\aditof-opencv-maskrcnn.vcxproj]
              with
              [
                  _Ty=FrameImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): note: see declaration of 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=FrameImpl
              ]
    D:\aditof_sdk-master\sdk\include\aditof/system.h(96): warning C4251: 'aditof::System::m_impl': class 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::System' [D:\
    aditof_sdk-master\scripts\windows\build\bindings\opencv\maskrcnn\aditof-opencv-maskrcnn.vcxproj]
              with
              [
                  _Ty=SystemImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/system.h(96): note: see declaration of 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=SystemImpl
              ]
    D:\aditof_sdk-master\bindings\opencv\maskrcnn\main.cpp(64): warning C4305: 'initializing': truncation from 'double' to 'float' [D:\aditof_sdk-master\scripts\windows\build\bindings\opencv\maskrcnn\aditof-opencv-maskrcnn.vcxproj]
    D:\aditof_sdk-master\bindings\opencv\maskrcnn\main.cpp(116): warning C4244: 'argument': conversion from 'time_t' to 'unsigned int', possible loss of data [D:\aditof_sdk-master\scripts\windows\build\bindings\opencv\maskrcnn\aditof-opencv
    -maskrcnn.vcxproj]
    D:\aditof_sdk-master\bindings\opencv\maskrcnn\main.cpp(369): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [D:\aditof_sdk-master\scripts\windows\build\bindings\opencv\maskrcnn\aditof-opencv-maskrcnn
    .vcxproj]
    D:\aditof_sdk-master\bindings\opencv\maskrcnn\main.cpp(424): warning C4244: 'initializing': conversion from '_Tp' to 'float', possible loss of data [D:\aditof_sdk-master\scripts\windows\build\bindings\opencv\maskrcnn\aditof-opencv-maskr
    cnn.vcxproj]
              with
              [
                  _Tp=double
              ]
      aditof-opencv-maskrcnn.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\bindings\opencv\maskrcnn\Release\aditof-opencv-maskrcnn.exe
      Building Custom Rule D:/aditof_sdk-master/examples/aditof-test/CMakeLists.txt
      main.cpp
    D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): warning C4251: 'aditof::Frame::m_impl': class 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::Frame' [D:\adi
    tof_sdk-master\scripts\windows\build\examples\aditof-test\aditof-test.vcxproj]
              with
              [
                  _Ty=FrameImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): note: see declaration of 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=FrameImpl
              ]
    D:\aditof_sdk-master\sdk\include\aditof/system.h(96): warning C4251: 'aditof::System::m_impl': class 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::System' [D:\
    aditof_sdk-master\scripts\windows\build\examples\aditof-test\aditof-test.vcxproj]
              with
              [
                  _Ty=SystemImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/system.h(96): note: see declaration of 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=SystemImpl
              ]
      cvui.h: compiling implementation because of CVUI_IMPLEMENTATION. See: https://dovyski.github.io/cvui/usage/
    D:\aditof_sdk-master\examples\aditof-test\main.cpp(129): warning C4244: 'argument': conversion from 'double' to '_Tp', possible loss of data [D:\aditof_sdk-master\scripts\windows\build\examples\aditof-test\aditof-test.vcxproj]
              with
              [
                  _Tp=int
              ]
      aditof-test.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\examples\aditof-test\Release\aditof-test.exe
      Building Custom Rule D:/aditof_sdk-master/examples/first-frame/CMakeLists.txt
      main.cpp
    D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): warning C4251: 'aditof::Frame::m_impl': class 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::Frame' [D:\adi
    tof_sdk-master\scripts\windows\build\examples\first-frame\first-frame.vcxproj]
              with
              [
                  _Ty=FrameImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): note: see declaration of 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=FrameImpl
              ]
    D:\aditof_sdk-master\sdk\include\aditof/system.h(96): warning C4251: 'aditof::System::m_impl': class 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::System' [D:\
    aditof_sdk-master\scripts\windows\build\examples\first-frame\first-frame.vcxproj]
              with
              [
                  _Ty=SystemImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/system.h(96): note: see declaration of 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=SystemImpl
              ]
      first-frame.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\examples\first-frame\Release\first-frame.exe
      Building Custom Rule D:/aditof_sdk-master/examples/first-frame-network/CMakeLists.txt
      main.cpp
    D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): warning C4251: 'aditof::Frame::m_impl': class 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::Frame' [D:\adi
    tof_sdk-master\scripts\windows\build\examples\first-frame-network\first-frame-network.vcxproj]
              with
              [
                  _Ty=FrameImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/frame.h(104): note: see declaration of 'std::unique_ptr<FrameImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=FrameImpl
              ]
    D:\aditof_sdk-master\sdk\include\aditof/system.h(96): warning C4251: 'aditof::System::m_impl': class 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>' needs to have dll-interface to be used by clients of class 'aditof::System' [D:\
    aditof_sdk-master\scripts\windows\build\examples\first-frame-network\first-frame-network.vcxproj]
              with
              [
                  _Ty=SystemImpl
              ]
      D:\aditof_sdk-master\sdk\include\aditof/system.h(96): note: see declaration of 'std::unique_ptr<SystemImpl,std::default_delete<_Ty>>'
              with
              [
                  _Ty=SystemImpl
              ]
      first-frame-network.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\examples\first-frame-network\Release\first-frame-network.exe
      Building Custom Rule D:/aditof_sdk-master/CMakeLists.txt
    Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.
    
      aditof.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\sdk\Release\aditof.dll
      aditof-opencv-dnn.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\bindings\opencv\dnn\Release\aditof-opencv-dnn.exe
      aditof-opencv-imshow.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\bindings\opencv\imshow\Release\aditof-opencv-imshow.exe
      Building Custom Rule D:/aditof_sdk-master/bindings/opencv/CMakeLists.txt
    Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.
    
      aditof.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\sdk\Release\aditof.dll
      aditof-demo.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\examples\aditof-demo\Release\aditof-demo.exe
      aditof-test.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\examples\aditof-test\Release\aditof-test.exe
      first-frame.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\examples\first-frame\Release\first-frame.exe
      first-frame-network.vcxproj -> D:\aditof_sdk-master\scripts\windows\build\examples\first-frame-network\Release\first-frame-network.exe
      Building Custom Rule D:/aditof_sdk-master/examples/CMakeLists.txt
    PS D:\aditof_sdk-master\scripts\windows> Stop-Transcript
    **********************
    Windows PowerShell transcript end
    End time: 20210223140947
    **********************
    
    Dear Dan, 

    Thank you very much for the advice, it worked! Protobuf, glog and websockets seem to be installed properly (attach the log file). However I am still not able to launch first-frame.py. I copied .EXP, .LIB and a python file (aditofpython.cp38-win_amd64) from D:\aditof_sdk-master\scripts\windows\build\bindings\python\Release and put these 3 files together with first-frame.py, aditofpython.cpp and aditof folder (with .h files) in one folder. However, running firs-frame.py in Spyder gives me this error: ImportError: DLL load failed while importing aditofpython: The specified module could not be found.

  • 0
    •  Analog Employees 
    on Feb 25, 2021 8:11 AM in reply to AntonB

    Hi,

    Firstly please try to run the script from the command line without any IDE.
    Secondly, make sure the path to aditof.dll is in %PATH%.

  • Hi Virgil,

    Thank you. I launched from anaconda prompt and at least there is no error about importing the library, but now i get the error about usb connection. The camera works in usual Aditof-Demo.exe:

    WARNING: Logging before InitGoogleLogging() is written to STDERR
    I0226 14:19:44.684635 5952 usb_sensor_enumerator.cpp:99] Looking for USB connected sensors
    E0226 14:19:44.816154 5952 usb_sensor_enumerator.cpp:160] invalid connection string:
    system.getCameraList() Status.Ok
    Traceback (most recent call last):

    File "D:\aditof_sdk-master\bindings\python\first_frame.py", line 41, in <module>
    camera1 = cameras[0]

    IndexError: list index out of range

  • 0
    •  Analog Employees 
    on Feb 26, 2021 7:41 AM in reply to AntonB

    is the Blue LED on the camera turned on when you try to connect?

  • Yes, after I press S3 button, as advised. Also, as I said, the camera perfectly works in Aditof_Demo.exe, so it shouldn't be a problem in the connection itself.