First time here? Check out the FAQ!
answered 2013-12-10 03:39:54 -0600
You may need to make your Mat continues before writing to the file like,
image = (image.reshape(0,1));
See OpenCV Mat Documentation for more details