Ask Your Question

cannot convert ‘cv::Mat’ to ‘float’

asked 2013-02-14 09:51:39 -0500

ovaal gravatar image

I want to multiply a 1x6 with a 6x1 Mat types matrices, and then store it in a matrix entry as follows;<float>(i,j) = fy.rowRange(i,i+1) * a.colRange(n, n + 1);

But if I compile this I get error: cannot convert ‘cv::Mat’ to ‘float’ in assignment

Does anybody know how to solve this?

edit retag flag offensive close merge delete


Did you mean n or j in a.colRange(...)?

Daniil Osokin gravatar imageDaniil Osokin ( 2013-02-14 23:03:42 -0500 )edit

1 answer

Sort by » oldest newest most voted

answered 2013-02-14 11:10:51 -0500

kabamaru gravatar image

It's probably because the multiplication returns a mat and not a float. Tried accessing it with at<float>(0,0)?

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2013-02-14 09:51:39 -0500

Seen: 1,524 times

Last updated: Feb 14 '13