@luqt123
Hi Lukas,
Assuming that you have already allocated space for your kuvio_image, you can copy it across using OpenCv functions. Possible functions for this are for example cv::cvtColor, cv::mixChannels and cv::merge. Please read OpenCv documentation on how they are used.
For example, if your opencv image is a 24-bit RGB image, the copying can be done simply as follows:
int my_opencv_function(/*params,*/ kuvio_image* imgOut)
{
if (imgOut->type == kuvio_rgb32_image_type)
{
cv::Mat myOpenCvImage = ... // Get or create an RGB image. eg. cv::imread
/// ...do stuff with the image and copy to kuvio_image
cv::mixChannels(myOpenCvImage, OpenCvMat(imgOut, OpenCvMat::Rgb24), {0, 0, 1, 1, 2, 2});
}
Please bear in mind that the sizes of the allocated kuvio_image and the size of the image in cv::Mat myOpenCvImage must be identical.