Hello,

I am running depthai_demo.py on my OAK D pro W and got some x,y,z measurements of the object detected to the camera. It's really cool to see it, but I cannot find where the data for x,y,and z calculations is coming from. I do not know if the x,y,z are achieved because of the DEPTHAI_ZOO model or because of the Spatial Location Calculator, which I found in the depthai-python.examples. I would appreciate every help on addressing the syntax to call out x, y, and z data in the depthaidemo.py. I think it would be easier if I want to do that using spatial_location_calculator.py, but when I run the file and all other spatial files, it gives me "IndexError: cannot do a non-empty take from an empty axes." and I haven't seen this error when running other files in the depthai-python-examples folder.

thank you for all of the helps!

    Hi KwinT
    The xyz coordinates are calculated with spatial location calculator. The index error you are receiving is likely due to something on the host not being correct since SpatialLocationCalculator node won't return such python errors. The node needs both a depth frame and a ROI to work properly.

    Thoughts?
    Jaka

    Hi Jaka,

    Thank you for your reply. If x, y, and z coordinates in the demo.py are from spatial location calculator, then how come i could run the demo wothout any problem but have error when running all spatial examples? Is there any way to print out x, y, and z in the terminal by running demo.py? What can i do to fix the index error?

      Hi KwinT
      Demo is created to work out of the box. With examples, you can sometimes run into errors that can be caused by different things (usually version mismatch). Did you run the install_requirements.py script before running the examples?
      It would also help if you pasted the whole error (considering the spatial_location_calculator.py is unaltered) so I can see which array is empty.

      Thanks,
      Jaka