• Setting subpixel in sdk-generated stereo nodes

Hi!

I'm trying to use encoded video as source. I can't seem to manage getting depth on my own using the api (values are just wrong, but I don't understand why), so I got to using the sdk. I use this standard code:

from depthai_sdk import OakCamera

import depthai

with OakCamera(replay='../../Videos') as oak:

color = oak.create_camera('color')

left = oak.create_camera('left')

right = oak.create_camera('right')

nn = oak.create_nn(, color,"yolo", spatial=True)

nn.config_yolo(…)

nn.config_spatial(upper_threshold=30000, calc_algo=depthai.SpatialLocationCalculatorAlgorithm.MEDIAN)

oak.visualize([nn.out.main,nn.out.spatials],scale = 1, fps=True)

oak.start(blocking=True)

How do I set subpixel mode to the stereodepth node automatically created by the sdk?

Thanks!

  • erik replied to this.
    • Best Answerset by erik

    Hi K2_ ,
    Something like this should work:

       #...
        color = oak.create_camera('color')
        left = oak.create_camera('left')
        right = oak.create_camera('right')
    
        stereo = oak.create_stereo(left=left, right=right)
        stereo.config_stereo(subpixel=True)
    
        nn = oak.create_nn('my_yolo_model.blob', color,"yolo", spatial=stereo)
       #...

    Hi K2_ ,
    Something like this should work:

       #...
        color = oak.create_camera('color')
        left = oak.create_camera('left')
        right = oak.create_camera('right')
    
        stereo = oak.create_stereo(left=left, right=right)
        stereo.config_stereo(subpixel=True)
    
        nn = oak.create_nn('my_yolo_model.blob', color,"yolo", spatial=stereo)
       #...

    Worked like a charm, thanks !