Problems with OpenCV FileStorage in XCode 4

跟風遠走 提交于 2019-12-12 17:22:36

问题


I've been tearing my hair over this problem for some weeks, but I can't quite figure it out. Entering the example code used for cv::FileStorage:

FileStorage fs("test.yml", FileStorage::WRITE);
Mat cameraMatrix = (Mat_<double>(3,3) << 1000, 0, 320, 0, 1000, 240, 0, 0, 1);
fs << "cameraMatrix" << cameraMatrix;
fs.release();

in Visual Studio produces the file test.yml just fine. However, reproducing the code in XCode4 with the latest build of OpenCV(2.4.1) doesn't seem to output any file whatsoever. It runs just fine though. Any ideas as to why this is would be great.


回答1:


I tried your code and it works fine. You're probably just looking in the wrong place for test.yml. It's not going to be in the same folder as your source code. It's in the folder with your executable file under the derived data path. By default, this is ~/Library/Developer/Xcode/DerivedData. From there, look for a folder with your project name. Under that, look for build/Products/Debug or build/Products/Release to find your executable (and your test.yml file).

If you want, you can change the derived data folder by going to Xcode Preferences -> Location.



来源:https://stackoverflow.com/questions/11783839/problems-with-opencv-filestorage-in-xcode-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!