write/read opencv matrix in c