Hi,

I am trying to perform a very simple and common image manipulation: masking. In my application, in one of the mono camera images (say left image), I want to mask pixels whose corresponding depth (or disparity) is out of the range of interest. This would make further processing of the images simpler and computationally less expensive. However, I see that the ImageManip node does not seem to provide this functionality. Am I missing something?

If indeed this is not possible using depthai nodes, please could someone let me know the best way to do this on OAK-D Pro?

Best,
AB

PS: I don't want to stream images to the host and use OpenCV, as that would increase latency. Ideally I want to use the onboard processor for the masking.

Hi @abhanupr
It's not possible to mask images on device. You can use the StereoDepth to apply a threshold filter to mask out the depth values that fall out of range, but to do the same on left frame, a fast CPU would be needed, which is missing on the RVC2.

Your best bet is host side.

Thanks,
Jaka

    Hi jakaskerl ,

    Thank you for the reply. How about we feed the disparity and the left frame as inputs to a custom CV code running a PyTorch model that does the masking? Similar to the frame concatenation example? Would that speed things up compared to doing things on the host side?

    Best,
    AB