byte * matToBytes(Mat image)
{
int size = () * ();
byte * bytes = new byte[size]; // you will have to delete[] that later
std::memcpy(bytes,,size * sizeof(byte));
}
Mat bytesToMat(byte * bytes,int width,int height)
{
Mat image = Mat(height,width,CV_8UC3,bytes).clone(); // make a copy
return image;
}