Hi!

This could be an easy one but here we go;

I would like to create a 4 channel, 32-bit png image from the Oak-d (PoE)
I have looked into the openCV API guide but i can´t really get it working. to be able to capture by cv2 i (at least think so) need cv2.Videocapture and as i understand it this could be tricky with PoE.

I´m new to both python and OAK to i might be missing something very obvious.

Does anyone have a solution or a direction to a solution? As i´m new to this, if you got the time, please be as specific as possible 🙂

I´m on Windows, python 3.9, Visual Studio and Oak-D (POE).

Thanks

Martin

  • erik replied to this.

    Hello MartinL ,
    From my understanding you would like to create RGBA frame from RGB one?

    frame = inColor.get().getCvFrame() # Get color frame from OAK camera
    
    # First create the image with alpha channel
    rgba = cv2.cvtColor(frame, cv2.COLOR_RGB2RGBA)
    # Then assign the mask to the last channel of the image
    alpha_data = 255 # I assume?
    rgba[:, :, 3] = alpha_data

    I haven't tested this code, but it should give you a starting point on how to achieve that.
    Thanks, Erik

    Hi Erik,

    Thank you for your quick reply, i´ll look into this right away and get back to you!

    Martin

    5 days later

    Hi,

    I just want to give the feedback that was supposed to come "right away" 🙂

    It works great, thank you for you help!

    Martin

    • erik replied to this.

      Hello MartinL ,
      Great that you got it working, thanks for circling back!
      Thanks, Erik