Archive 17/01/2023.

How to draw the image collected by the camera in the urho3d window

wqf

I need to create a scene. Use opencv to capture the camera image and render the image on the urho3d window in real time, and then place a 3d model somewhere in the window. Now I don’t know how to draw the image on the window of urho3d, the image is an array in rgb format, like “rgbrgbrgb”, if anyone can give me some suggestions, I will be grateful.

nickwebha

This is not a complete answer to your question but this code might help. tileString is expected to be a supported image format (PNG in my case).

As far as getting the image from OpenCV into Urho3D I have no clue.

SirNate0

You can probably use an Urho3D::Image and use SetSize and SetData to copy the data from whatever buffer OpenCV stores it in to a format supported by Texture2D. You may also be able to set the data directly to a texture, using an RGB format (you can get the format for that from Graphics).