Ask Your Question

cv::sqrt() and cv::pow() throwing exceptions

asked 2012-10-11 04:55:47 -0600

luko28 gravatar image

Hi, i've got a strange problem. I can't use sqrt() or pow() with power value <1.0, i'm just getting exceptions. Using pow() with any power value >= 1.0 works with no problems. Anybody have any idea what's wrong? (OpenCV 2.4.9, MS VS 2010)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-11-07 05:49:11 -0600

icedecker gravatar image

updated 2012-11-07 05:49:50 -0600

A bit late... I don't know which error you get (please paste the error) but if the error is like as in:

assertion ... depth == CV_32F || depth == CV_64F in function pow

You need to make sure that the image is in CV_32F or CV_64F format. To do it you can do img8bits.convertTo(imgc, CV_32FC3) for example (for 3-channel).

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2012-10-11 04:55:47 -0600

Seen: 12,008 times

Last updated: Nov 07 '12