Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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