c++ - Writing uchar* data to file -
I am using the OpenCV library, which has a class named Here's my code: and I get an error message: What should I do differently? Mat Data stored in an array on the uchar * Mat :: data , representing the matrix. I want to write this data in a binary file using C ++.
cv :: Mat m (3, 3, CV_8UC1); // It basically creates 3-by-3 matrix std :: fstream fileOut ("file.bin", std :: ios :: out | std :: ios :: binary); FileOut.write ((* four *), m.data, 9); // It should write 9 bytes of data
reinterpret_cast & lt; Const char * & gt; (M.data)
Use
Comments
Post a Comment