Sunday, 8 September 2013

Runtime Error : image step is wrong

Runtime Error : image step is wrong

Getting this error , when i run the code
Error :
OpenCV Error: Image step is wrong (The matrix is not continuous, thus its
number of rows can not be changed) in unknown function, file
......\src\opencv\modul es\core>\src\matrix.cpp, line 802
I am using opencv 2.4.4 with VS 10
Below is code :
Mat classes;//(numPlates+numNoPlates, 1, CV_32FC1);
Mat trainingData;//(numPlates+numNoPlates, imageWidth*imageHeight,
CV_32FC1 );
Mat trainingImages;
vector<int> trainingLabels;
for(int i=0; i< numPlates; i++)
{
stringstream ss(stringstream::in | stringstream::out);
ss << path_Plates << i << ".jpg";
Mat img=imread(ss.str(), 0);
img= img.reshape(1,1);
trainingImages.push_back(img);
trainingLabels.push_back(1);
}
My images are of same size's

No comments:

Post a Comment