Incorrect colors with opencv-test

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
GPU
• DeepStream Version
5.0.1
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)

I made a small change to gst-dsexample plugin.
I added a background-substraction function using opencv, but results were not as expected.
for debugging purposes, I decided to save the input image prior to any other custom change, using
cv::imwrite(filename,in_mat); (and then I commented everything else)
the surprise was to find that the saved image didn’t had the correct colors.

this is the image I got:

and this is the image I expected (the same I can see on the rttsp sink)

.

the app I ran is deepstream-opencv-example. On the app I only changed the sink to rtsp

what could be causing this issue?

It looks like you show RGB as BGR. Please check your code of saving image. python - why cv2.imwrite() changes the color of pics? - Stack Overflow. It has nothing to do with deepstream.