Ask Your Question

cv::log issue ?

asked 2018-07-11 08:47:40 -0500

zazarb gravatar image

Hello, I have issues with the cv::log function. The documentations says that the cv::log function takes the natural logarithm of each element when the element value is not null and a constant C set to -700 otherwise. However, when I apply cv::log to a 3X1 null array (that is v = [0;0;0]), cv::log(v,answer); returns answer = [-1.#INF, -1.#INF, -1.#INF]. Shouldn't it return answer = [C, C, C] instead ? Thanks if someone can clarify !

edit retag flag offensive close merge delete


from docs:

Output on zero, negative and special (NaN, Inf) values is undefined.

where did you find "a constant C set to -700" ?

berak gravatar imageberak ( 2018-07-11 08:54:36 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-07-11 10:15:20 -0500

Eduardo gravatar image

Related pull request: Update cv::log documentation #6771.

Please remember that you can access up-to-date documentation or a specific documentation version matching your OpenCV version at this url:

edit flag offensive delete link more


Thanks, I was indeed using v3.1 of OpenCV where the documentation seemed to be incorrect. Best,

zazarb gravatar imagezazarb ( 2018-07-12 03:53:16 -0500 )edit

Question Tools

1 follower


Asked: 2018-07-11 08:47:40 -0500

Seen: 193 times

Last updated: Jul 11 '18