How to load an OpencvSharp.CpPlusPlus.Mat from a XML file?



I'm trying to do stereo vision of opencvsharp in C#. I already have distortion matrix stored in a xml file. Now i want to read that matrix to use for calculation. I tried this code:



FileStorage fs = new FileStorage();
fs.Open("intrinsics.yml",FileStorageMode.FormatYaml);
Mat M1, M2, D1, D2;
fs["M1"] >> M1;
fs["D1"] >> D1;
fs["M2"] >> M2;
fs["D2"] >> D2;


But it's doesn't work. Can someone help me with that? thanks in advance. P/S: sorry for my bad English!


No comments:

Post a Comment