I have an array of double. I want to store them in Mat. This is how I am doing it.
double g2f1_[] = { 0.001933, 0.118119, 0.338927, -0.921300, 0.338927, 0.118119, 0.001933};
g2f1y=Mat(7,1,CV_32F,&g2f1_);
for(int i=0;i<7;i++){
for(int j=0;j<1;j++){
cout<<g2f1y.at<float>(i,j)<<" ";
}
cout<<endl;
}
But when I cout those values I get the following result which is entirely different then what I had stored. Also I am getting different values on running it again and again.
Output:
8.65736e+31
0
3.61609e+31
0
0
0
1.02322e+15
I have gone through following link