isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.37k stars 2.29k forks source link

Can not use Azure Kinect related feature #1314

Closed stytim closed 3 years ago

stytim commented 4 years ago

Describe the bug Open3d can not load k4a.dll or k4arecord.dll even after I copy depthengine_2_0.dll, k4a.dll and k4arecord.dll to my anaconda python environment library folder D:\miniconda3\envs\cv2\Library\bin

To Reproduce Steps to reproduce the behavior:

  1. cd Open3D
  2. python examples/Python/ReconstructionSystem/sensors/azure_kinect_viewer.py --align_depth_to_color
  3. See error

Expected behavior [Open3D FATAL] Cannot load k4a.dll

Screenshots Capture2

Capture

Environment (please complete the following information):

NickMoore99 commented 4 years ago

Having the same issue

Fred3D-tech commented 4 years ago

I'm waiting for a Kinect Azure to use with open3d.. is it solved ?

stephansturges commented 4 years ago

Did you follow all the steps here? Including installing the azure Kinect sdk? http://www.open3d.org/docs/latest/tutorial/Basic/azure_kinect.html

On Mon, 25 Nov 2019 at 08:13, argosvr notifications@github.com wrote:

I'm waiting for a Kinect Azure to use with open3d.. is it solved ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/intel-isl/Open3D/issues/1314?email_source=notifications&email_token=AE3BDJS3OFQEBWMKDUPAOLLQVN3JNA5CNFSM4JMJDRUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFBMA3Y#issuecomment-558022767, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3BDJR5CW6WTKSNNVX7L4LQVN3JNANCNFSM4JMJDRUA .

-- Stephan Sturges +32 484 06 19 63

theNded commented 4 years ago

@yxlao is this because the dll signature has changed?

Vintagelavalamp commented 4 years ago

I fixed the issue by renaming the Azure SDK folder (literally changed 1.3.0 to 1.2.0). Probably open3d looks for the specific 1.2.0 folder.

scimad commented 4 years ago

I had similar issue working with 1.3.0 SDK. So I downgraded Kinect SDK to 1.2.0.

Tested both k4a versions with open3d-0.8.0 and only k4a v1.2 works with open3d 0.8.0. Trying open3d with k4a SDK 1.3 throws [Open3D FATAL] Cannot load k4a.dll whereras installing SDK 1.2 works fine. Just for the record, the installers are here: v1.2, v1.3

chuong commented 4 years ago

Works with k4a SDK 1.2.0. DLL binaries need to be copied to examples/Python/ReconstructionSystem/sensors/ where the python script is.

One issue is that when firmware of sensor has been upgraded with k4a SDK 1.4.0, the sensor no longer works with k4a SDK 1.2.0.

djaym7 commented 4 years ago

Fixed this issue by copying k4a.dll, depthengine_2_0.dll, k4arecord.dll from sdk 1.2.0 (C:\Program Files\Azure Kinect SDK v1.2.0\sdk\windows-desktop\amd64\release\bin) to your python location C:\Users\Username\AppData\Local\Programs\Python\Python36\DLLs\ (works with sdk 1.4.0 installed, just copy 1.2.0 dlls to python folder)

mastrogiorgis commented 4 years ago

None of the above worked. Python 3.7 Win 10 Anacoda Open3D 0.10

PS. The issue occurs only with Kinect Azure SDK 14.0

scimad commented 4 years ago

I really don't understand why this issue hasn't been taken much seriously. Having faced this issue really many times and in multiple versions, I can see that issue really needs attention and has been here for relatively long time. @syncle @yxlao

foamliu commented 4 years ago

This is dispointint...

Fred3D-tech commented 4 years ago

I can't understand how this is still not solved.. this is not serious .. is this project really seriously maintained ? When I see that I doubt about that. @theNded @chuong

karipulli commented 4 years ago

Copying the 1.4 dlls to any of the locations suggested before did not work. However, after I installed 1.2 SDK using the msi installer using the link posted above (I have now all of 1.2, 1.3, 1.4, and I think I've upgraded the FW too), the python bindings for the examples in Open3D\examples\python\ReconstructionSystem\sensors started working. No need to copy the dll's anywhere. However, it'd be great if it would just work with the latest sdk...

germanros1987 commented 4 years ago

we are trying to find some bandwidth to work on this

gh-BumsooKim commented 4 years ago

when i work python examples/Python/ReconstructionSystem/sensors/azure_kinect_viewer.py

I can see error "Cannot load k4a.dll"

so I downgraded Kinect SDK to 1.2.0. with @scimad comment. Then it works! azure_kinect_viewer.py is works. and azure_kinect_recorder.py is works.

but after work python examples/Python/ReconstructionSystem/sensors/azure_kinect_mkv_reader.py, I can see error "Cannot load k4arecord.dll"

i can't solve it

yxlao commented 3 years ago

On Windows, the Open3D Kinect plugin will look for the Kinect K4A library located in the default installation paths:

https://github.com/intel-isl/Open3D/blob/3c6e66419a0f5669b27503f1e30dd4960b1aa4ba/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.cpp#L76-L79

Currently, it supports 1.2.0 to 1.4.1. So first, check if the dll files are are found in the paths above.

If the K4A library is not in the default location, you'll need to set the K4A_LIB_DIR environment variable to point to the directory containing the K4A's *.dll files.

Some of the fixes we have are in the master branch, we'll be updating the python packages in the next release.

shgoren commented 3 years ago

Hey I'm still experiencing the same issue when trying to run azure_kinect_mkv_reader.py I added the the K4A_LIB_DIR environment variable and also copied the dlls to open3d package can you guide me towards how to find out what wrong?

---EDIT--- following some advice here I copied the dlls to the python/DLLs folder and I no longer get the cannot load error now I get these repeated and no images are created:

[2021-01-03 23:34:03.522] [error] [t=4476] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (295): Invalid argument to capture_dec_ref(). capture_handle (0000018639970620) is not a valid handle of type k4a_capture_t [2021-01-03 23:34:03.525] [error] [t=4476] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 00000186399703E0 [2021-01-03 23:34:03.525] [error] [t=4476] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (344): Invalid argument to capture_get_color_image(). capture_handle (00000186399703E0) is not a valid handle of type k4a_capture_t [2021-01-03 23:34:03.525] [error] [t=4476] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 00000186399703E0 [2021-01-03 23:34:03.526] [error] [t=4476] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (359): Invalid argument to capture_get_depth_image(). capture_handle (00000186399703E0) is not a valid handle of type k4a_capture_t [2021-01-03 23:34:03.527] [error] [t=4476] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 00000186399703E0

Thanks

RecursiveAV commented 3 years ago

I have this exact same issue also. I've followed @shgoren's method and copied the dll's into the local folder, but now have the below errors. The viewer and recorder examples work ok but the reader throws the above error and I see the same error when using the RGBD element in other scripts. I’m using the 1.4.1 SDK which I understand is valid with the latest version of open3d. I’m using python so wondering if this is a python specific issue?

[2021-02-17 18:17:13.227] [error] [t=12204] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000023BFAF70450 [2021-02-17 18:17:13.227] [error] [t=12204] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (295): Invalid argument to capture_dec_ref(). capture_handle (0000023BFAF70450) is not a valid handle of type k4a_capture_t [2021-02-17 18:17:13.229] [error] [t=12204] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000023BFAF707D0 [2021-02-17 18:17:13.229] [error] [t=12204] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (344): Invalid argument to capture_get_color_image(). capture_handle (0000023BFAF707D0) is not a valid handle of type k4a_capture_t [2021-02-17 18:17:13.230] [error] [t=12204] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000023BFAF707D0 [2021-02-17 18:17:13.231] [error] [t=12204] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (359): Invalid argument to capture_get_depth_image(). capture_handle (0000023BFAF707D0) is not a valid handle of type k4a_capture_t [2021-02-17 18:17:13.232] [error] [t=12204] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000023BFAF707D0 [2021-02-17 18:17:13.233] [error] [t=12204] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (295): Invalid argument to capture_dec_ref(). capture_handle (0000023BFAF707D0) is not a valid handle of type k4a_capture_t

guypystin commented 3 years ago

У меня тоже такая же проблема. Я последовал методу @shgoren и скопировал dll в локальную папку, но теперь у меня есть следующие ошибки. Примеры средства просмотра и записи работают нормально, но программа чтения выдает указанную выше ошибку, и я вижу ту же ошибку при использовании элемента RGBD в других сценариях. Я использую SDK 1.4.1, который, как я понимаю, подходит для последней версии open3d. Я использую python, поэтому мне интересно, связана ли это с конкретной проблемой python?

[2021-02-17 18: 17: 13.227] [ошибка] [t = 12204] D: \ a \ 1 \ s \ extern \ Azure-Kinect-Sensor-SDK \ src \ allocator \ allocator.c (118): k4a_capture_t_get_context (). Недействительный k4a_capture_t 0000023BFAF70450 [2021-02-17 18: 17: 13.227] [ошибка] [t = 12204] D: \ a \ 1 \ s \ extern \ Azure-Kinect-Sensor-SDK \ src \ allocator \ allocator.c ( 295): недопустимый аргумент функции capture_dec_ref (). capture_handle (0000023BFAF70450) не является допустимым дескриптором типа k4a_capture_t [2021-02-17 18: 17: 13.229] [ошибка] [t = 12204] D: \ a \ 1 \ s \ extern \ Azure-Kinect-Sensor-SDK \ src \ allocator \ allocator.c (118): k4a_capture_t_get_context (). Неверный k4a_capture_t 0000023BFAF707D0 [2021-02-17 18: 17: 13.229] [ошибка] [t = 12204] D: \ a \ 1 \ s \ extern \ Azure-Kinect-Sensor-SDK \ src \ allocator \ allocator.c (344): Неверный аргумент функции capture_get_color_image (). capture_handle (0000023BFAF707D0) не является допустимым дескриптором типа k4a_capture_t [2021-02-17 18: 17: 13.230] [ошибка] [t = 12204] D: \ a \ 1 \ s \ extern \ Azure-Kinect-Sensor-SDK \ src \ allocator \ allocator.c (118): k4a_capture_t_get_context (). Недействительный k4a_capture_t 0000023BFAF707D0 [2021-02-17 18: 17: 13.231] [ошибка] [t = 12204] D: \ a \ 1 \ s \ extern \ Azure-Kinect-Sensor-SDK \ src \ allocator \ allocator.c ( 359): недопустимый аргумент функции capture_get_depth_image (). capture_handle (0000023BFAF707D0) не является допустимым дескриптором типа k4a_capture_t [2021-02-17 18: 17: 13.232] [ошибка] [t = 12204] D: \ a \ 1 \ s \ extern \ Azure-Kinect-Sensor-SDK \ src \ allocator \ allocator.c (118): k4a_capture_t_get_context (). Недействительный k4a_capture_t 0000023BFAF707D0 [2021-02-17 18: 17: 13.233] [ошибка] [t = 12204] D: \ a \ 1 \ s \ extern \ Azure-Kinect-Sensor-SDK \ src \ allocator \ allocator.c ( 295): недопустимый аргумент функции capture_dec_ref (). capture_handle (0000023BFAF707D0) не является допустимым дескриптором типа k4a_capture_t

I have the same problem, have you solved it?

sjtu-jq commented 1 year ago

Issue had been fixed. Based on the following config, I successfully run the full reconstruction without any bug: Hardware: Azure Kinect DK K4A SDK version: 1.4.1 Open3D: installed by pip, version = 0.17.0 (May be there is no one care this at now)