I am working on 3d photography and need to syncronize 4 azure kinect cameras. I am not happy with cpp and working with python. Could anyone help me finding a code (same as green screen) for synchronizing in python?
-
You can refer to [multiple synchronous kinects](https://github.com/isl-org/Open3D/issues/2478), [Python Reference for Microsoft Azure Kinect Sensor SDK](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/500) and [Camera Calibration in Python with OpenCV](https://pythonwife.com/camera-calibration-in-python-with-opencv/) – Ecstasy Dec 15 '21 at 04:47
-
Please provide enough code so others can better understand or reproduce the problem. – Community Dec 23 '21 at 07:24
1 Answers
Please refer to Synchronize multiple devices for physically connecting multiple Azure Kinect cameras.
I have written a simple Python example of configuring 2 Azure Kinect devices to be synced together where one is master and the other subordinate: k4a_sync.py. It assumes that the k4a python package has already been installed and that the devices are already physically connected with a sync wire before running the example.
Note that based on reading the system timestamps of the collected captures, the time between captures seems to be on the order of around 100-200 ms, which is unexpectedly way higher than the synchronization settings should have produced. This may be related to an open issue: https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1665

- 21
- 1
-
Dear Jonathan, thank you so much for you help. but when I run your code I have this error: AttributeError: module 'k4a' has no attribute 'Device'. Could you please help me? – Mehran Jan 12 '22 at 14:41
-
Hi Mehran, It's possible that your python k4a package is missing the required libraries: k4a.dll, k4arecord.dll, and depthengine_2_0.dll (Windows). These libraries can be located in C:\Program Files\Azure Kinect SDK v1.4.1\sdk\windows-desktop\amd64\release\bin. Because a user might have installed the Azure SDK in another location, the python k4a package instead requires that these libraries are copied into its internal src\k4a\_lib\ folder. Read the docs\building.md for instructions on how to build the k4a wheel. – Jonathan Santos Jan 19 '22 at 19:58
-
This is what I would do (on Windows): 1. Copy the libraries (dlls in Windows) into the src\k4a\_lib\ folder of the python k4a package. 2. Run src\python\k4a\build_wheel.ps1 powershell script. This generates the k4a wheel in a build\ folder. 3. Install the k4a package: "pip install
" 4. Run the example script example\the_basics.py to first test it on one Azure Kinect device to make sure you can communicate with it. 5. Connect 2 Azure Kinect devices and run the example script example\k4a_sync.py. – Jonathan Santos Jan 19 '22 at 20:01 -
Dear Jonathan, Thank you so much for your help. I did all steps, but the error is remained. – Mehran Feb 02 '22 at 10:08
-
I also have following error during installing build_wheels.ps1: SDK-user-jonsanto-AKDK_Sync_Python\src\python\k4a\build_wheel.ps1 .... ERROR: file:///C:/Users/mt0052 does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found. ..... Successfully installed wheel-0.37.1 ERROR: Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found. doxygen not found, skipping building the documentation. – Mehran Feb 02 '22 at 10:22
-
Thanks for posting the error. Let me check and I’ll get back shortly. – Jonathan Santos Feb 20 '22 at 05:57