I have multiple OAK-D PoE Pro cameras and want to capture image frame only when I want.

This is my understanding on how cameras transfer image data to host PC: (Please correct me if I am wrong or missing anything)
=> Let's say I have a simple pipeline sending 4K color image. Whenever the camera is booted up with pipeline, it streams data continuously to the queue on host PC. What I can do is deciding how the queue on host PC side behaves. For example,
if I set the queue as size 1 and non-blocking, the device will fill in the queue continuously, so I can get "the latest" image frame from device.
If I set it as blocking, the device will fill in the queue only when the image data in queue is consumed.
In either blocking or non-blocking, the device keeps sending image data to the queue on host PC.

My issue:
I don't have enough bandwidth if the cameras keep sending image data continuously. My program crashes because at some point, one camera became not able to finish data transfer within a pre-defined timing window in FW, so the watchdog kicks in and reboots the device, which leads to connection drop. I am facing the network bottleneck when I use multiple OAK-D PoE Pro cameras at the same time.

Questions:

  1. Is there a way that I can control the device whether it can send image data or not, instead of continuously sending it to device?
  2. Is using Script node or Standalone mode a good approach? I don't fully understand how they work and cannot find much information.
  3. What about using compression? Compress image data, transfer it, and decompress it in host pc?

I would much appreciate your advice. Thanks!

  • erik replied to this.

    Hi GeonsooKim ,
    I would suggest using either Script node to discard the frame or forward it to the host when needed (example here), or use still events for ColorCamera, so it would only capture a still frame when you send a trigger event to the OAK camera (example here, press c to capture).

    1. Answered above
    2. So actually that's another approach - this example. you can flash it into standalone mode, and a computer can then send request to the OAK POE's http server to get an image. Which is likely ideal in your use case.
    3. Yes, possible as well, example here. I would suggest going with mjpeg.py, as you are needing frames not videos.

    Thoughts?
    Thanks, Erik

    Erik,

    Thanks for the quick reply. I will try out the still event first as it seems the simplest and satisfies my needs.

    For the encoded stream (MJPEG), does it use lossless compression algorithm? Or do I lose some data in the process?

    Thank you

    • erik replied to this.

      GeonsooKim ,
      You can use lossless (videoEnc.setLossless(True)), just note that majority of the programs (eg video players/img viewers) don't support this codec.
      Thanks, Erik

      @erik,

      I see. Thanks for the reply.

      Quick question. I have checked a couple of code examples capturing Still images - example 1 and example 2, and found out that they compress data by using encoder to transfer Still image from device to host PC. Why does compression (stillEncoder = pipeline.create(dai.node.VideoEncoder)) have to come and play for Still image transfer?

      The video encoder seems like it encodes the frame and sends it to host pc continuously. What I want is that the camera doesn't do anything until I send signal. As soon as I send a signal, the camera captures the Still image and sends it to host PC. Do I need VideoEncoder for this?

      Thank you

      • erik replied to this.

        Hi GeonsooKim ,
        No, you don't need VideoEncoder if you don't want to encode the image. You can link Still output directly to XlinkOut, and get the unencoded still image on the host.
        Thanks, Erik

        @erik,

        Good to know that it can be done without video encoder.

        What was the purpose of having video encoder node for Still image capture then? Does the video encoder node bring in any benefits in the process of capturing Still image?

        Thank you

        • erik replied to this.

          Hi GeonsooKim ,
          No, it simply encodes the frame into jpg image, so it reduces file size.
          Thanks, Erik