1
我想從VisualStudio項目中工作正常的教程中讀取「classifications.xml」和「images.xml」。我現在如何將Swift XCode項目中的C++庫指向文件?將它們拖放到項目中不起作用。OpenCV在Swift IOS項目中讀取文件
這是原始代碼。我如何將cv :: Filestorage類指向我的項目中的文件?現在它返回一個錯誤
cv::Mat matClassificationInts; // we will read the classification numbers into this variable as though it is a vector
cv::FileStorage fsClassifications("classifications.xml", cv::FileStorage::READ); // open the classifications file
if (fsClassifications.isOpened() == false) { // if the file was not opened successfully
std::cout << "error, unable to open training classifications file, exiting program\n\n"; // show error message
return(0); // and exit program
}
fsClassifications["classifications"] >> matClassificationInts; // read classifications section into Mat classifications variable
fsClassifications.release(); // close the classifications file
謝謝你,我沒有找到包中的文件。現在正在尋找一種方式將他們送入圖書館 – Alexander
@亞歷山大更新了更多信息 –