Hello everybody. I am writing a top operator for the ZED 2 camera that can perform body tracking.
Basically, I am trying to do in TD what is available in the examples here:
I have compiled that examples locally, I have followed this tutorial https://www.youtube.com/watch?v=9wBwRDMS2I4 and I was finally able today to initialize the zed camera in my TOP operator.
The problem that I am facing now, is that if I add this line in the constructor
ObjectDetectionParameters obj_det_params;
I receive an obscure error:
âException thrown at 0x00007FF912C7A458 (ntdll.dll) in TouchDesigner.exe: 0xC0000139: Entry Point Not Found.â
Any idea about what it could be?
Are there any other people working on the Zed 2 integration? or is it a process that happens just inside Derivative? It would be helpful to share some insights.
This error likely means itâs failing to find a required .dll when it first tries to use that feature. Do you have all the required .dlls next to your plugin .dll?
Thanks @malcolm for your reply. In visual studio, I have compiled the examples from the zed repository. Then, I have copied all the settings(from the Linker section to the Additional libraries in the c++ section) from the zed official examples to the visual studio solution containing my custom operator.
Is there a way to check which dll is missing? I am new to windows programming
Yep thatâs the tool I would suggest too.
Visual studio doesnât do any of this automatically for you. Itâs literally about copying the .dlls to the directory where your plugin .dll resides. You can make post-build rules for that. But nothing about the include/linking will do that for you.
Thanks @malcolm and @nettoyeur for your reply. I Have downloaded the tool and I have started to play around with it. I have first run the tool with the option âChild Onlyâ, and everything seems ok
With options recursive I have a bunch of missing libraries, with 2 types of error. The first one, is âmodule could not be found on diskâ. Actually it is a long list and I hope I do not have to install them one by one.
The camera is active, the operator loads in TD, but if I uncomment the line â//ObjectDetectionParameters obj_det_params;â it does not load anymore in TD. Although it compiles.
Thanks for your reply @DavidBraun. If for ânextâ you mean in the same folder, no, it isnât. Do you think it should be? All the .dlls or just this one?
I have first tried to copy sl_zed64.dll from the ZED sdk to the folder where my custom TOP .dll is, then I have tried to copy all the .dll that are in the ZED sdk folder to same location. Tthe error still persists, I can compile the lib but as soon as I uncomment the line â//ObjectDetectionParameters obj_det_params;â the TOP operator can not be loaded in TD.
When using the Pytorch libtorch SDK, for some reason I had to place the DLLs inside the TouchDesigner executableâs bin folder, wherever it may be, like in C:/Program Files/Derivative/TouchDesigner/bin. Your location might be different. This is a strange thing to try because itâs not in the wiki, but maybe you can try it. Be prepared to delete the zed DLLs from this location if it doesnât fix it.
Well @DavidBraun, it worked, many thanks
there was already a file called sl_zed64.dll in that folder, but it was probably related to an old version of the SDK. With the 3.3.3 version it works. I have uploaded the code that I have until now and an updated readme file here https://github.com/edap/zed-examples
I think the issue here is the .dll needed for object detection is being whatâs call âdelay-loadedâ. That means that it doesnât try to load the .dll until that line of code you execute it tries to use it.
The issue is that the search path for extra .dlls only includes your plugin directory during initial load of your .dll. After that it falls back to the default search, which wonât include your plugin dir.
I think the current solution for this is to use a delay load hook:
Weâll look at ways to make this cleaner though, or at least give an example of using this.
Looking at this more, the above workflow only really works if your .dll is the one that specifies the /DELAYLOAD. Iâm not sure if this is the case for your particular project configuration.
Another solution would be to manually load the .dlls you need using LoadLibrary() in your constructor. That way they are already loaded before they are referenced later on, so the .dll location is already resolved.
You can use the OP_NodeInfo->pluginPath to determine where our plugin is located on disk, and look for other .dlls setting next to that manually.
All add this info to the wiki.
@malcolm I am not a Windows expert, if replacing the sl_zed64.dll shipped with TD with the new version of the Zed SDK (3.3.3) works, I think I will stick to this solution as it is the most reliable at the moment.
Short update here. The TOP operator has been updated to version the Zed SDK version 3.3.5. I have added some instructions to the readme in case someone want to try out skeleton tracking on TD
Hello!
I just finished implementing your code and it works great! However since I copied all the dll, TouchDesigner crashes everytime I try to use a ZED nodes (TOP, CHOP, SOP). Can you tell what caused this? Could you specify the TD version you are using?
Iâm using:
-ZED 2i
-SDK v. 3.6.5 (Unable to find 3.6.1)
-CUDA 11.1
-CMake 3.23.1
-TouchDesigner 2021.14360
Thanks for your ZedTOP. Itâs work fine.
Iâm trying to make CHOP version of object tracking, and iâve got an error when initializing âObjectDetectionRuntimeParameters detection_parameters_rtâ. When I comment this line, everything work fine.
Unhandled exception at 0x00007FFD1E8DD288 (ucrtbase.dll) in TouchDesigner.exe: An invalid parameter was passed to a function that considers invalid parameters fatal.
Itâs my first TD cpp project, so I donât know what to do next and how to resolve this error. Iâve copied all dllâs to project folder and TD build folder.