ReadCvMat needs to use image size when writing protobuf.