Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Loading SVM results in crash FileStorage

$
0
0
Hello everyone, I am currently developing an iOS application that uses the OpenCV framework for image processing. To process this image I want to make a prediction based on a trained SVM xml file we trained earlier with images. To load this xml file (in the iOS Application) we are using the normal method to do this is in a sandboxed application in Objective-C. After we got the right path we want to load this using the SVM->load method in Objective-C++: NSString *path = [[NSBundle mainBundle] pathForResource:@"model" ofType:@"xml"]; const char* cPath = [path cStringUsingEncoding:NSMacOSRomanStringEncoding]; FileStorage fs([path UTF8String], FileStorage::READ); cv::FileStorage read(cPath, cv::FileStorage::READ); auto my_svm = cv::ml::SVM::create(); // Crash is because of this line down below my_svm->load(read.root()); Unfortunately, this result in the following crash: error: (-27) NULL or empty buffer in function cvOpenFileStorage I looked up this error on various fora, which states that this is because FileStorage cannot find the path sent in the argument of the load method. After debugging this for hours, I lost my faith and really want to resolve this issue. Does anyone here knows what is going on here, or probably, what is going wrong here? Thanks in advance

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>