Ask Your Question

Revision history [back]

Android OpenCV 3.1 seamlessclone

I'm trying to execue the following lines in native OpenCV for Android (C++). And everything compiles.

warpedSub.convertTo(warpedSub, CV_8UC3);
img2sub.convertTo(img2sub, CV_8UC3);
output.convertTo(output, CV_8UC3);
maskSub.convertTo(maskSub, CV_8UC1);

seamlessClone(warpedSub, img2sub, maskSub, center, output, NORMAL_CLONE);

But I get this error when executing:

08-16 13:51:53.041 4776-4776/com.tzutalin.dlibtest E/cv::error(): OpenCV Error: Assertion failed (CV_MAT_TYPE(mtype) == m.type()) in void cv::_OutputArray::create(int, const int*, int, int, bool, int) const, file /builds/master_pack-android/opencv/modules/core/src/matrix.cpp, line 2236

According to the OpenCV documentation, I have the correct types. I have also tested a prototype completely in C++ on my desktop computer and it all works fine! I don't know what to do, please help!

Android OpenCV 3.1 seamlessclone

I'm trying to execue the following lines in native OpenCV for Android (C++). And everything compiles.

warpedSub.convertTo(warpedSub, CV_8UC3);
img2sub.convertTo(img2sub, CV_8UC3);
output.convertTo(output, CV_8UC3);
maskSub.convertTo(maskSub, CV_8UC1);

seamlessClone(warpedSub, img2sub, maskSub, center, output, NORMAL_CLONE);

But I get this error when executing:

08-16 13:51:53.041 4776-4776/com.tzutalin.dlibtest  E/cv::error(): OpenCV Error: Assertion failed (CV_MAT_TYPE(mtype) == m.type()) in void cv::_OutputArray::create(int, const int*, int, int, bool, int) const, file /builds/master_pack-android/opencv/modules/core/src/matrix.cpp, line 2236

According to the OpenCV documentation, I have the correct types. I have also tested a prototype completely in C++ on my desktop computer and it all works fine! I don't know what to do, please help!