• DepthAI-v2
  • Convert RGB to grayscale format in ImageManip

Since I am trying to use the face-detection-retail-0004, I must use the ColorCamera, but my second NN requires grayscale images. I tried using an ImageManip to convert it to RawImgFrame.Type.GRAY8, but I get this error:

Input tensor 'x' (0) exceeds available data range. Data size (2304B), tensor offset (0), size (4608B) - skipping inference

I require a 48x48x1 image. Since it's a U8, I am confused why each number takes 2 bytes. How can I fix this issue?

  • erik replied to this.

    Hi grapecoder ,
    Looking at the Troubleshooting docs, your model expects 4608 bytes. My guess is that you compiled the model without -ip U8 argument passed to OpenVINO Compile Tool. Without setting the -ip U8, model expects FP16 (not U8) image, so 48 * 48 * 2bytes (FP16) => 4608 bytes.
    Thoughts?
    Thanks, Erik

    Ah, I see. I must have read the error wrong.

    As a side note, setting it to RawImgFrame.Type.GRAYF16 breaks the ImageManip. I'm not sure whether this is a bug or not.

    Thanks so much for the help! Your guys' technical support is outmatched. I really appreciate the speed and the quality.