Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv create mat object with a loop

Hello,

I use this code : Mat sampleMat = (Mat_<float>(1,1) << (trainData[i][0]));

But I want to create mat object with a loop. Maybe it looks like this :

Mat sampleMat = (Mat_<float>(1,size) << for(j < size)(trainData[i][j]));

How can I do this?

opencv create mat object with a loop

Hello,

I use this code :

Mat sampleMat = (Mat_<float>(1,1) << (trainData[i][0]));

(trainData[i][0]));

But I want to create mat object with a loop. Maybe it looks like this :

Mat sampleMat = (Mat_<float>(1,size) << for(j < size)(trainData[i][j]));

size)(trainData[i][j]));

How can I do this?