Ask Your Question
0

Android bitwise xor

asked 2013-04-10 16:35:03 -0600

Hi, I've tried bitwise xor on android but I get the following error:

04-11 00:25:47.404: E/cv::error()(7370): OpenCV Error: Sizes of input arguments do not match (The operation is neither 'array op array' (where arrays have the same size and type), nor 'array op scalar', nor 'scalar op array') in void cv::binary_op(cv::InputArray, cv::InputArray, cv::OutputArray, cv::InputArray, void (* const*)(const uchar*, size_t, const uchar*, size_t, uchar*, size_t, cv::Size, void*), bool), file /home/reports/ci/slave/50-SDK/opencv/modules/core/src/arithm.cpp, line 1021

Here is my code:

Mat temp1 = mRgba.submat(roi); 
Mat temp2 = Mat.zeros(temp1.size(), CvType.CV_8UC1);    
Core.bitwise_xor(temp1, temp2, temp1);

I've also tried to instantiate temp1 and temp2 the following way:

Mat temp1 = new Mat(height, width, CvType.CV_8UC1); 
Mat temp2 = new Mat(height, width, CvType.CV_8UC1);

But still the same error..

edit retag flag offensive close merge delete

Comments

also please make sure that both temp1 and temp2 are of the same type

Andrey Pavlenko gravatar imageAndrey Pavlenko ( 2013-04-11 08:10:09 -0600 )edit

Both are same type and size, even tried with a different output matrix of the same size & type and I still get the same error.

razvan gravatar imagerazvan ( 2013-04-11 08:41:48 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-04-11 06:04:26 -0600

Try creating a seperate output matrix for your function. Sometimes these functions do not allow the same input and output matrix. Report back if it still goes wrong.

edit flag offensive delete link more

Comments

I've already tried that, still the same error.. any other ideas?

razvan gravatar imagerazvan ( 2013-04-11 08:40:50 -0600 )edit

Maybe create an explicit assert function to debug? I still believe something is wrong with your incomming data.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-11 08:55:02 -0600 )edit

Question Tools

Stats

Asked: 2013-04-10 16:35:03 -0600

Seen: 1,246 times

Last updated: Apr 11 '13