i wanted to use the spatial calculation node and combine it with a tracking algorithm, that provides a bounding box. its hard to get the spatial location calculator configuration setup right, therefore some answers or a follow-up would be appreciated. From what i see, i first initialize all input / outputs for the spatial calculation and then detect something in a frame. Lets say i have x,y data from one or more ROI's in one loop. So i would like to update my ROIs.
--- so first i have to set my config input queue and spatial calc queue
spatialCalcQueue = device.getOutputQueue("spatialData")
spatialCalcConfigInQueue = device.getInputQueue("spatialCalcConfig")
----- in the inner loop then
# send new config data to spatialcalcnode
newConf = dai.SpatialLocationCalculatorConfigData()
newConf.depthThresholds.lowerThreshold = 100
newConf.depthThresholds.upperThreshold = 14000
topLeft = dai.Point2f(min(corners[:, 0]), max(corners[:, 1]))
bottomRight = dai.Point2f(max(corners[:, 0]), min(corners[:, 1]))
newConf.roi = dai.Rect(topLeft, bottomRight)
# get output of spatial calc node
roidepth = spatialCalcQueue.get().getSpatialLocations()
i get errors already in the send line, but i generally the idea should working smth like that right?
or what is a general pipeline setup / the elements i need to do this?