Ask Your Question

IJS111's profile - activity

2015-06-18 09:00:07 -0600 asked a question cvOpenFileStorage crashes when flags parameter is CV_STORAGE_READ

I'm trying to read from a xml file with cvOpenFileStorage, but function CvFileStorage* cvOpenFileStorage(const char* filename, CvMemStorage* memstorage, int flags, const char* encoding=NULL ) always crashes.

if(fd.DoModal()==IDOK) { FileName=fd.GetPathName(); m_warn.SetWindowText("Berem podatke o ANN iz "+FileName+"...");

storage = cvCreateMemStorage(1000000);
//Cv
CvFileStorage *fs;


/// Unhandled exception at 0x00007FFA5C288B9C in CellDetector.exe: Microsoft C++ exception: 
//cv::Exception at memory location 0x00000085AABF3F70.

fs = cvOpenFileStorage(FileName, storage, CV_STORAGE_READ,"UTF-8"); // crash

------------------ERROR -------------------------------------------------------------------------------------------------------- - cstr_ 0x000000ff7bda58b4 "C:\builds\master_PackSlave-win64-vc12-shared\opencv\modules\core\src\persistence.cpp:680: error: (-212) C:\Users\student\Desktop\NevronskaMreza.xml(90):

Duplicated key in function cvGetFileNode\n" char *

Platform: Windows 64bit ,opencv3.0-gold-release with vs2013 c++

If I set flags parameter to CV_STORAGE_WRITE, function works correctly.