Hi all !

I need to implement a basic system which would track only people inside an interior space  and return an ID (a unique arbitrary number) and the x,y,z global coordinates and one or more tags of attributes (gender, and other eventual head or body attributes) of each tracked people.

And then store the nfo above plus the time stamp in a big JSON file (images/ video will not be in the contents of this file… but just timestamp, person ID, coordinates, some classification attributes…).

Important to notice that i need the coordinates transformed to the space actual global coordinates (not camera plan u,v coordinates and the depth…). In the end the final material we need would be just this big JSON.

I have an OAK-D camera and the rest of the system  is being implemented in Python. 

Is this something that would be better implemented inside Luxonis HUB platform or could be some code uploaded to the camera itself (or both) ? 
Any guidance with codes samples (if possible…) would help a lot.

 

Hi,

Yes, what you want is possible with the OAK-D and Python.

You can either:

  1. Run everything on a host (like Raspberry Pi),
  2. Upload the pipeline directly to the camera, or
  3. Use Luxonis Hub if you also want remote access, cloud logging, etc.

If you're just saving JSON locally (no video/images), running it on the host or directly on the camera is usually enough.

Hello lovro

Thank you for your prompt reply, with explanations and links with examples.

I'm trying to implement and run in the host

One quick related question here: i assume that spatiallocationcalculator already would make the lens correction and other intrinsic params … ? As for the extrinsic params (camera rotation, position related to the origin.. is this supplied as parameters to the function (?).

Thanks

Hi again,

yes, you are right. The depth you get (depthData.getFrame()) is already corrected for intrinsics (lens distortion, focal length etc.). So the (x, y, z) you calculate are real-world units (millimeters) but relative to camera center.

Also, maybe check this example since you are doing it on host:

gen2-calc-spatials-on-host

Excellent ! Thank you for clarifying and the suggested link with the example … Tks !