Home > Back-end >  About the opencv filestorage function
About the opencv filestorage function

Time:09-26

Filestorage function called always appear this prompt "0 x76b10192 in untreated Exception: Microsoft c + + exceptions: CV: : Exception, is located at memory location 0 x00bbc55c" but also to open application filestorage variables appear not for opencv_core249d. DLL loading any symbol, used the 2.4.9 2.4.10 3.0 these versions will be an error, please everyone a great god the way!!!!! Thank you very much ~!
Code is the most simple use filestorage reads the XML file

# include & lt; iostream>
# include & lt; string>
# include & lt; Opencv2/core/core. Hpp>

using namespace std;
Using the namespace CV;


Void main () {
FileStorage fs2 (" test. XML, "FileStorage: : READ);

//the first method: use (type) operator on FileNode.
Int the frameCount=(int) fs2 [] "the frameCount";

STD: : string date;
//the second method: use FileNode: : operator & gt;>
"CalibrationDate" fs2 [] & gt;> date;

Mat cameraMatrix2 distCoeffs2;
"CameraMatrix" fs2 [] & gt;> CameraMatrix2;
"DistCoeffs" fs2 [] & gt;> DistCoeffs2;

Cout & lt; <"The frameCount:" & lt; <"Calibration date:" & lt; <"Camera matrix:" & lt; <"Distortion coeffs:" & lt;
FileNode the features=fs2 (" features "),
FileNodeIterator it=the features. The begin (), it_end=the features. The end ();
int idx=0;
STD: : vector Lbpval;

//to iterate through a sequence using FileNodeIterator
for (; It!=it_end; + + it, idx++)
{
Cout & lt; <"Feature #" & lt; Cout & lt; <"X=" & lt; <(int) (* it) [" x "] <", y="& lt; <(int) (* it) [" y "] <", LBP: (";
//you can also easily read numerical arrays using FileNode & gt;> STD: : vector operator.
(* it) [" LBP "] & gt;> Lbpval;
For (int I=0; i <(int) lbpval. The size (); I++)
Cout & lt; <"" & lt; <(int) lbpval [I];
Cout & lt; <") "& lt; }
Fs2. Release ();
}

CodePudding user response:

I also met the same problem
  • Related