OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Thu, 03 Oct 2013 18:04:54 -0500"Not-a-Number" NaN with arithmetical operationshttp://answers.opencv.org/question/17582/not-a-number-nan-with-arithmetical-operations/Hello,
I have a doubt. I am doing a division between two vectors (65356x1 size). Both vectors include 0s and It divides each array element. The problem is when it divides by 0s, operation (0/0), its result is not NaN, is 0!. I think It is wrong... Are there some way to get the correct result (with NaNs)?
The code is very simple: Mat G = im_g/tableReshaped; (where img_g and tableReshaped are 65356x1 matrices).Fri, 26 Jul 2013 06:12:24 -0500http://answers.opencv.org/question/17582/not-a-number-nan-with-arithmetical-operations/Answer by carlosb for <p>Hello, </p>
<p>I have a doubt. I am doing a division between two vectors (65356x1 size). Both vectors include 0s and It divides each array element. The problem is when it divides by 0s, operation (0/0), its result is not NaN, is 0!. I think It is wrong... Are there some way to get the correct result (with NaNs)?</p>
<p>The code is very simple: Mat G = im_g/tableReshaped; (where img_g and tableReshaped are 65356x1 matrices).</p>
http://answers.opencv.org/question/17582/not-a-number-nan-with-arithmetical-operations/?answer=21900#post-id-21900It is the expected behavior and i couldn't change it. I replaced to the values with NaN manually....Thu, 03 Oct 2013 18:04:54 -0500http://answers.opencv.org/question/17582/not-a-number-nan-with-arithmetical-operations/?answer=21900#post-id-21900