I am trying to use following code, but it gives error. Error message is like : OpenCV Error: Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)si ze.p[0] && (unsigned)(i1DataType<_Tp>::channels) < (unsigned)(size.p[1]channel s()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1 << 3 ) - 1))*4) & 15) == elemSize1()) in unknown function, file c:\program files (x86 )\opencv2.2\include\opencv2\core\mat.hpp, line 517
My code is given below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
int main(.....)
{
vector<double>pdf_vector;
//read data from file and put it in pdf_vector.
vector<double>all_vector;
Mat dft_input_vector(pdf_vector);
Mat dft_output_vector;
dft(dft_input_vector, dft_output_vector);
for(i=0;i<1;i++)
{
for(j=0;j<pdf_vector.size ();j++)
{
all_vector.push_back (dft_output_vector.at <float>(i,j));
}
}
.................
}
int main(.....)
{
vector<double>pdf_vector;
//read data from file and put it in pdf_vector.
vector<double>all_vector;
Mat dft_input_vector(pdf_vector);
Mat dft_output_vector;
dft(dft_input_vector, dft_output_vector);
for(i=0;i<pdf_vector.size ();i++)
{
for(j=0;j<1;j++)
{
all_vector.push_back (dft_output_vector.at <double>(i,j));
}
}
.................
}