• DepthAI
  • Doing SpatialDetection with Upside down camera

So, our Oak D PoE camera got mounted upside down... we're trying to perform spatial detection using a YoloSpatialDetection node with a model trained on right side up images. I was able to simply rotate the color camera feed by 180 degrees using an ImageManip node and link that with YoloSpatialDetection, but am having trouble with flipping the mono cameras / depth information. I've tried these solutions:

1) Rotating the mono cameras by 180 degrees using an ImageManip node but am getting [error] Output image is bigger (2764800B) than maximum frame size specified in properties (1048576B) - skipping frame. Changing the maximum frame size with setMaxOutputFrameSize() to 2764800 then yields odd results.
2) Changing the image orientation of both mono cameras using monoLeft.setImageOrientation(dai.CameraImageOrientation.ROTATE_180_DEG)
monoRight.setImageOrientation(dai.CameraImageOrientation.ROTATE_180_DEG)
. This does flip the depth map, but the quality of the depth map greatly decreases.
3) Rotating the depth map by 180 degrees using an ImageManip node to then send into the YoloSpatialDetector. This results in [error] Output image is bigger (3276800B) than maximum frame size specified in properties (1048576B) - skipping frame. I thought possibly the issue might be the frame type, so I tried including manipDepth.initialConfig.setFrameType(dai.ImgFrame.Type.RAW16) , but was met with [system] [critical] Fatal error. Please report to developers. Log: 'ImageManipHelper' '54'

Let me know where to look for resources or what I can do to get this working, thanks!

  • erik replied to this.

    Hi tyler ,
    Sorry about the issues here. I have just created a simple demo from spatail_mobilenet.py with rotated OAK-D; Could you try it out🙂? Oh and FWIW we are working on SDK (abstraction on top of depthai API), so "rotating camera" in the code will be just a matter of a passed argument, instead of having to deal with imagemanips etc. Thoughts?
    Thanks, Erik