XCode 4中OpenCV FileStorage的问题 [英] Problems with OpenCV FileStorage in XCode 4

查看:100
本文介绍了XCode 4中OpenCV FileStorage的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于这个问题,我已经把头发扯了好几个星期,但我还不太清楚. 输入用于cv :: FileStorage的示例代码:

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();

在Visual Studio中

生成文件 test.yml 就好了.但是,使用最新版本的OpenCV(2.4.1)在XCode4中再现代码似乎不会输出任何文件.它运行得很好.任何关于为什么这样做的想法都很棒.

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.

推荐答案

我尝试了您的代码,它运行正常.您可能只是在错误的地方寻找了test.yml.它不会与源代码位于同一文件夹中.它在您的可执行文件所在的文件夹中,位于派生数据路径下.默认情况下,这是~/Library/Developer/Xcode/DerivedData.从那里,找到带有您的项目名称的文件夹.在此之下,找到build/Products/Debugbuild/Products/Release来找到您的可执行文件(以及您的test.yml文件).

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).

如果需要,可以通过转到Xcode首选项->位置来更改派生数据文件夹.

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

这篇关于XCode 4中OpenCV FileStorage的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆