Convert String to Mat
Hi, Anyone knows how to convert a string to Mat Format? I wanted to have this type of Mat format
cv::Mat data(1,256,CV_32F)
I'm using this code to convert from the string but have problem. Anyone has idea on how to solve this?
for(int d=0;d<256;d++)
{
testing += '0' + pixelValueArray[d];
}
cout<<testing; //this is the string
cv::Mat data(1,ATTRIBUTES,CV_32F,testing.data());
appreciate so much
It'll be better if you add more info about the pixelValueArray and testing, if you want that I may test what I post :) And more: what is the 0 you add? is it a separator? how would you split testing into values? Or it is just one value? Then why do yo want a Mat that has 256 columns and one row?