OpenCVForUnity icon indicating copy to clipboard operation
OpenCVForUnity copied to clipboard

Save mat to disk.

Open PanMig opened this issue 4 years ago • 1 comments

Hello, I would like to save a Mat instance to the disk. More specifically this instance is the result of the dnn forward operation, model.foward() .

I tried to use Imgcodecs.imwrite() or use the Unity's build-in binary formatter but the class Mat is not serializable so it won't work.

Any ideas ?

Thank you in advance

PanMig avatar Apr 09 '20 12:04 PanMig

Since OpenCVForUnity is a clone of OpenCV Java, you are able to use the same API as OpenCV Java 4.2.0(https://docs.opencv.org/master/javadoc/). FileStorage class has not been implemented.

I think this post is very helpful. https://answers.opencv.org/question/8873/best-way-to-store-a-mat-object-in-android/

EnoxSoftware avatar Apr 10 '20 10:04 EnoxSoftware