• OAK D LR Support

I recently acquired an OAK-D LR camera, but unfortunately, I have encountered difficulties creating disparity maps, depth maps, or getting any images whatsoever from monocular cameras. These are essential features that are vital for my work, and as such, I am keen on finding a solution. It is apparent that the RGB lens works just fine, so I am puzzled as to what the problem could be with monocular lenses.

Any help is greatly appreciated.

  • jakaskerl replied to this.
  • Hi jakaskerl

    I agree, and I worked a little bit more on it. The way I fixed the plugins issue was to remove the plugin as suggested in this post: wkentaro/labelme842

    Now the cam_test.py works fine and I see the GUI.

    Thanks for responding to my questions.

    Regards,
    Amin

    Hi amin
    What exactly is the issue?
    Can you run cam_test.py and post some screenshots/ add terminal output?

    Thanks,
    Jaka

    • amin replied to this.

      jakaskerl

      Thanks for your response.

      The problem is that I can not run depth_preview_lr.py .

      I ran cam_test.py. Below please fine the result:
      python3 cam_test.py
      QObject::moveToThread: Current thread (0x173dd50) is not the object's thread (0x1906af0).
      Cannot move to target thread (0x173dd50)

      qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/owner/.local/lib/python3.11/site-packages/cv2/qt/plugins" even though it was found.
      This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

      Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.

      Stack trace (most recent call last):
      #26 Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in
      #25 Object "python3", at 0x5b6d9e, in
      #24 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f502b629e3f, in __libc_start_main
      #23 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f502b629d8f, in
      #22 Object "python3", at 0x5b6f48, in Py_BytesMain
      #21 Object "python3", at 0x5f2f9d, in Py_RunMain
      #20 Object "python3", at 0x5f8422, in _PyRun_AnyFileObject
      #19 Object "python3", at 0x5f86ce, in _PyRun_SimpleFileObject
      #18 Object "python3", at 0x5f90e1, in
      #17 Object "python3", at 0x5e4def, in
      #16 Object "python3", at 0x5e87b6, in
      #15 Object "python3", at 0x5c7afe, in PyEval_EvalCode
      #14 Object "python3", at 0x5c83fd, in
      #13 Object "python3", at 0x50ed82, in _PyEval_EvalFrameDefault
      #12 Object "python3", at 0x5029ea, in _PyObject_MakeTpCall
      #11 Object "/home/owner/anaconda3/envs/oakd/lib/python3.11/site-packages/PyQt5/sip.cpython-311-x86_64-linux-gnu.so", at 0x7f5021df36a5, in
      #10 Object "/home/owner/anaconda3/envs/oakd/lib/python3.11/site-packages/PyQt5/QtWidgets.abi3.so", at 0x7f4fbae9240a, in
      #9 Object "/home/owner/anaconda3/envs/oakd/lib/python3.11/site-packages/PyQt5/QtWidgets.abi3.so", at 0x7f4fbae9232c, in
      #8 Object "/home/owner/anaconda3/envs/oakd/lib/python3.11/site-packages/PyQt5/Qt5/lib/libQt5Widgets.so.5", at 0x7f4fba367aa8, in QApplicationPrivate::init()
      #7 Object "/home/owner/anaconda3/envs/oakd/lib/python3.11/site-packages/PyQt5/Qt5/lib/libQt5Gui.so.5", at 0x7f4fbb36accb, in QGuiApplicationPrivate::init()
      #6 Object "/home/owner/anaconda3/envs/oakd/lib/python3.11/site-packages/PyQt5/Qt5/lib/libQt5Core.so.5", at 0x7f4fc84a4fe2, in QCoreApplicationPrivate::init()
      #5 Object "/home/owner/anaconda3/envs/oakd/lib/python3.11/site-packages/PyQt5/Qt5/lib/libQt5Gui.so.5", at 0x7f4fbb3682ac, in QGuiApplicationPrivate::createEventDispatcher()
      #4 Object "/home/owner/anaconda3/envs/oakd/lib/python3.11/site-packages/PyQt5/Qt5/lib/libQt5Gui.so.5", at 0x7f4fbb367f9f, in QGuiApplicationPrivate::createPlatformIntegration()
      #3 Object "/home/owner/anaconda3/envs/oakd/lib/python3.11/site-packages/PyQt5/Qt5/lib/libQt5Core.so.5", at 0x7f4fc82929bb, in QMessageLogger::fatal(char const*, ...) const
      #2 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f502b6287f2, in abort
      #1 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f502b642475, in raise
      #0 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f502b696a7c, in pthread_kill
      Aborted (Signal sent by tkill() 262464 1000)
      Aborted (core dumped)

      erik
      Thanks for the reply.

      I can not run depth_preview_lr.py successfully. Only one image shows up and then gets frozen. I have posted the output of the cam_test.py in the above post.

        Hi amin
        That's a PyQt5 problem. Try reinstalling pyqt and opencv libraries. I had the same problem and managed to solve it using https://stackoverflow.com/a/46460108. It's annoying a bit since every time I install requirements I have to first uninstall opencv, otherwise it stops working. There should be a workaround to this though, if you find it, please let me know 😉

        Hope it helps,
        Jaka

        This is how I resolved the issue:

        I was using the install_requirement.py in the dpethai repository, but it only installs the depthai 2.21.2.0 version. When I upgraded to depthai 2.22.0.0, it started working.

        I did try uninstalling the opencv and PyQt5 and reinstalling them again, but it did not help in my case. When I am running cam_test.py, I am still getting the same error, but I am able to run depth map using OAK-D LR camera with the above fix.

          Hi amin
          That's great, but I think the thread error will cause further problems when using the SDK.

          Thanks,
          Jaka

          • amin replied to this.

            Hi jakaskerl

            I agree, and I worked a little bit more on it. The way I fixed the plugins issue was to remove the plugin as suggested in this post: wkentaro/labelme842

            Now the cam_test.py works fine and I see the GUI.

            Thanks for responding to my questions.

            Regards,
            Amin

            6 months later

            I have the exact same issue trying to run depth_preview_lr.py, but none of the solutions in the linked post on removing the plugin work for me. When I attempt to run it, I get the following message and one frozen frame:

            qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "/home/owner/.local/lib/python3.10/site-packages/cv2/qt/plugins"

            Any advice would be appreciated.

              Hi MaggieWang
              Maybe try manually exporting the path to your pyqt plugins inside the environment you are using.

              export QT_QPA_PLATFORM_PLUGIN_PATH=/path/to/your/qt/plugins.

              I think this is not really a depthai issue though.

              Thanks,
              Jaka

              Exporting the path did not work for me. When I use the fix amin used from above, I am able to run cam_test.py, but then depth_preview_lr.py does not work.

              I was able to resolve plugin issues for both files by using the fix from here (pyqt5==5.14.2 opencv-python==4.8.0.76), but I still have the original issue with depth_preview_lr.py. Both files throw no errors but when running depth_preview_lr.py, one frame appears, freezes, and eventually gives a message that the application is not responding.

                Hi MaggieWang
                Could you pull any changes on depthai-python repo and re-run the install_requirements.py? I can confirm the script should work, so there is likely some weird dependency issue still.

                Thanks,
                Jaka

                Ah, both work now. Must have been an update I missed. Much appreciated!