unable to find sqrt of mat

asked 2014-11-01 16:08:15 -0600

Deepak Kumar gravatar image

updated 2014-11-01 16:37:44 -0600

hi, I am getting error in finding square root of a mat variable. can any one help me to find out the solution,

here is the code :-

Mat sigma = new Mat (height, width, CvType.CV_32F);
 Mat x = new Mat (height, width, CvType.CV_32F);
 Mat y = new Mat (height, width, CvType.CV_32F);
 Core.multiply(mu, mu, x);
 Core.subtract(mu2, x, y);
 Core.pow(y, 0.5, sigma);
 //Core.sqrt(y, sigma);

i tried both pow and sqrt in both error is coming.

here is logcat :-

E/org.opencv.core(2837): core::sqrt_10() caught cv::Exception: /home/reports/ci/slave_desktop/50-SDK/opencv/modules/core/src/mathfuncs.cpp:1931: error: (-215) depth == CV_32F || depth == CV_64F in function void cv::pow(cv::InputArray, double, cv::OutputArray)

thanks

edit retag flag offensive close merge delete

Comments

1

How are mu2 and mu defined? What is y.type() just before you call pow? It looks as if it's no float or double matrix.

FooBar gravatar imageFooBar ( 2014-11-01 16:41:48 -0600 )edit

also, mu and mu2 must have same shape as x and y

berak gravatar imageberak ( 2014-11-02 01:07:36 -0600 )edit