Ask Your Question
1

get float value from Mat

asked 2018-08-21 14:58:43 -0600

Aiyyaa gravatar image

updated 2018-09-07 00:55:17 -0600

I have a matrix of size [2 x 2], of type 64FC1, named eigenvectors.

[0.707152069011339, 0.7070614904610364;
 -0.7070614904610364, 0.707152069011339]

If I write cout<<(float)eigenvectors.at<float>(0,0); or cout<<eigenvectors.at<float>(0,0); I get number 5.25957e+19 instead of 0.707152069011339. How can I get exactly number 0.707152069011339 or any of numbers of this matrix?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2018-08-21 16:57:09 -0600

updated 2018-08-21 16:58:14 -0600

64FC1 -> double

cout << eigenvectors.at<double>(0,0);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-08-21 14:58:43 -0600

Seen: 630 times

Last updated: Aug 21 '18