Yep, I found a solution. The fact is that Unreal doesn’t fit very well with external containers, not matter if they are C++ standard containers. I belive that the reason is because the vector in return is filled inside OpenCV, which lays inside a DLL and Unreal doesn’t know how to free it (the size or the elements it has to free). That’s why its garbage collector is rising issues. The solution I came across was to compile every code client of OpenCV in another DLL in order to avoid Unreal’s garbage collector to try to manage that portion of source code.
NOTE: to return the data from my DLL I used a old C style structure with 3 integer fields, but there is no problem in returning a class. I did it just in case.
Best regards and, if you need more explanation, do not hesitate to come back to me.