Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I thing which I got to know and learn about such scenario is that opencv with android have vector indexing error when using with jni , you there are some alternative methods which we can try :

for clone as mention by @Stevenputtemans we need to create temporary Mat like instead of using

Mat x = ch[3].clone();

we can use it like

Mat x = ch[3];
Mat y =  x.clone();

Now move on for multiply channels , as there is indexing error in opencv when using with ndk , you can create Mat and use multiply function with like :

Mat ch0 = ch[0];
Mat ch1 = ch[1];
Mat ch2 = ch[2];

multiply(y, ch0, ch0);
multiply(y, ch1, ch1);
multiply(y, ch2, ch2);

vector<Mat> xx;
xx.push_back(ch0);
xx.push_back(ch1);
xx.push_back(ch2);

merge(x, image);