I have some trouble with managing memory in my function. Valgrid says I\'m having a memory leak after the convert-function. Could it be because of the data is not being properly
please don't store pointers to Mat in your vector(or anywhere else !).
those things are refcounted internally, like smartpointers, and you're wrecking that by storing/copying pointers (a vector of pointers to smartpointers would sound silly anyway, no?).
use a plain vector<Mat>
, trade some additional ~56 bytes per item against sound sleep tonight ;)