Hi guys,
I'm a bit confused. i hope you can help me out.
I have a matrix called rgba.
i want to transpose it, and then, flip it on both axis.
Mat rgba = org.opencv.android.Utils.bitmapToMat(frame);
Mat flipped = new Mat();
if (!Utils.isInLandscape()){
/* portrait - transpose than flip twice */
Mat transposed = rgba.t();
Mat flipped2 = new Mat();
Core.flip(transposed, flipped2, 0);
Core.flip(flipped2, flipped, 1);
flipped2.release();
transposed.release();
...
}
...
do something with flipped...
flipped,release();
rgba.release()
this is my code, but i have a feeling that i'm doing it wrong.. there are too many matrices and too many releases going on..
so, is this right? and in general when should i release a matrix, and does the CV wrapper, releases native objects by itself, or is it my responsibility?
any help would be appreciated.
thanks,
Vlad