- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
好的。我按照本网站上的“使用 CMake 构建”指令集进行操作: http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port
我制作了一个“build”文件夹。我使用 cmake 生成了“Unix Makefiles”。我运行了 make -j8 和 sudo make install。一切都应该在它需要的地方,对吧?错误的。我打开 FaceTracker.xcodeproj 文件,单击“运行”,这是我得到的:
The run destination My Mac 64-bit is not valid for Running the scheme 'FaceTracker'.
The scheme 'FaceTracker' contains no buildables that can be built for the SDKs supported by > the run destination My Mac 64-bit. Make sure your targets all specify SDKs that aresupported by this version of Xcode.
我应该怎么做才能让它发挥作用?我害怕在 Lion 上使用预编译的 OpenCV 包,考虑到它们有多旧。我也是 Xcode 新手。
编辑:12 月 14 日,晚上 7:05:
我做了一个helloworld程序
////////////////////////////////////////////////////////////////////////
//
// hello-world.cpp
//
// This is a simple, introductory OpenCV program. The program reads an
// image from a file, inverts it, and displays the result.
//
////////////////////////////////////////////////////////////////////////
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <cv.h>
#include <highgui.h>
int main(int argc, char *argv[])
{
IplImage* img = 0;
int height,width,step,channels;
uchar *data;
int i,j,k;
if(argc<2){
printf("Usage: main <image-file-name>\n\7");
exit(0);
}
// load an image
img=cvLoadImage(argv[1]);
if(!img){
printf("Could not load image file: %s\n",argv[1]);
exit(0);
}
// get the image data
height = img->height;
width = img->width;
step = img->widthStep;
channels = img->nChannels;
data = (uchar *)img->imageData;
printf("Processing a %dx%d image with %d channels\n",height,width,channels);
// create a window
cvNamedWindow("mainWin", CV_WINDOW_AUTOSIZE);
cvMoveWindow("mainWin", 100, 100);
// invert the image
for(i=0;i<height;i++) for(j=0;j<width;j++) for(k=0;k<channels;k++)
data[i*step+j*channels+k]=255-data[i*step+j*channels+k];
// show the image
cvShowImage("mainWin", img );
// wait for a key
cvWaitKey(0);
// release the image
cvReleaseImage(&img );
return 0;
}
我尝试用 gcc 编译它:
gcc helloworld.cpp
helloworld.cpp:12:16: error: cv.h: No such file or directory
helloworld.cpp:13:21: error: highgui.h: No such file or directory
helloworld.cpp: In function ‘int main(int, char**)’:
helloworld.cpp:18: error: ‘IplImage’ was not declared in this scope
helloworld.cpp:18: error: ‘img’ was not declared in this scope
helloworld.cpp:20: error: ‘uchar’ was not declared in this scope
helloworld.cpp:20: error: ‘data’ was not declared in this scope
helloworld.cpp:29: error: ‘cvLoadImage’ was not declared in this scope
helloworld.cpp:40: error: expected primary-expression before ‘)’ token
helloworld.cpp:40: error: expected `;' before ‘img’
helloworld.cpp:44: error: ‘CV_WINDOW_AUTOSIZE’ was not declared in this scope
helloworld.cpp:44: error: ‘cvNamedWindow’ was not declared in this scope
helloworld.cpp:45: error: ‘cvMoveWindow’ was not declared in this scope
helloworld.cpp:52: error: ‘cvShowImage’ was not declared in this scope
helloworld.cpp:55: error: ‘cvWaitKey’ was not declared in this scope
helloworld.cpp:58: error: ‘cvReleaseImage’ was not declared in this scope
Jesse:testing jessebikman$ g++ helloworld.cpp
helloworld.cpp:12:16: error: cv.h: No such file or directory
helloworld.cpp:13:21: error: highgui.h: No such file or directory
helloworld.cpp: In function ‘int main(int, char**)’:
helloworld.cpp:18: error: ‘IplImage’ was not declared in this scope
helloworld.cpp:18: error: ‘img’ was not declared in this scope
helloworld.cpp:20: error: ‘uchar’ was not declared in this scope
helloworld.cpp:20: error: ‘data’ was not declared in this scope
helloworld.cpp:29: error: ‘cvLoadImage’ was not declared in this scope
helloworld.cpp:40: error: expected primary-expression before ‘)’ token
helloworld.cpp:40: error: expected `;' before ‘img’
helloworld.cpp:44: error: ‘CV_WINDOW_AUTOSIZE’ was not declared in this scope
helloworld.cpp:44: error: ‘cvNamedWindow’ was not declared in this scope
helloworld.cpp:45: error: ‘cvMoveWindow’ was not declared in this scope
helloworld.cpp:52: error: ‘cvShowImage’ was not declared in this scope
helloworld.cpp:55: error: ‘cvWaitKey’ was not declared in this scope
helloworld.cpp:58: error: ‘cvReleaseImage’ was not declared in this scope
似乎我的问题是安装的库,但考虑到我的平台不是 Linux,而是 OS X,我不确定在哪里可以找到它们,而且我没有使用 Macports 或 Home Brew,我使用了推荐安装方式,CMake。您知道我如何使用 CMake 使用的位置在我的 Mac 上设置 PKG_CONFIG_PATH 吗?安装说明非常困惑,而且我似乎无法使用CMake卸载OpenCV,这也很困惑。
最佳答案
基本上,您忘记了在 cmd 行上添加所有内容! headers 目录、libs 目录以及与适当库的链接:
g++ helloworld.cpp -o helloworld -I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
关于c - 尝试使用通过 cmake 安装的 OpenCV-2.3.1 在 XCode 中运行示例 MacOSX FaceTracker 程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8499879/
这个问题在这里已经有了答案: 关闭 11 年前。 Possible Duplicate: Sample data for IPv6? 除了 wireshark 在其网站上提供的内容之外,是否有可以下
我正在寻找可以集成到现有应用程序中并使用多拖放功能的示例或任何现成的解决方案。我在互联网上找到的大多数解决方案在将多个项目从 ListBox 等控件拖放到另一个 ListBox 时效果不佳。谁能指出我
我是 GATE Embedded 的新手,我尝试了简单的示例并得到了 NoClassDefFoundError。首先我会解释我尝试了什么 在 D:\project\gate-7.0 中下载并提取 Ga
是否有像 Eclipse 中的 SWT 示例那样的多合一 JFace 控件示例?搜索(在 stackoverflow.com 上使用谷歌搜索和搜索)对我没有帮助。 如果它是一个独立的应用程序或 ecl
我找不到任何可以清楚地解释如何通过 .net API(特别是 c#)使用谷歌计算引擎的内容。有没有人可以指点我什么? 附言我知道 API 引用 ( https://developers.google.
最近在做公司的一个项目时,客户需要我们定时获取他们矩阵系统的数据。在与客户进行对接时,提到他们的接口使用的目前不常用的BASIC 认证。天呢,它好不安全,容易被不法人监听,咋还在使用呀。但是没办法呀,
最近在做公司的一个项目时,客户需要我们定时获取他们矩阵系统的数据。在与客户进行对接时,提到他们的接口使用的目前不常用的BASIC 认证。天呢,它好不安全,容易被不法人监听,咋还在使用呀。但是没办法呀,
我正在尝试为我的应用程序设计配置文件格式并选择了 YAML。但是,这(显然)意味着我需要能够定义、解析和验证正确的 YAML 语法! 在配置文件中,必须有一个名为 widgets 的集合/序列。 .这
你能给我一个使用 pysmb 库连接到一些 samba 服务器的例子吗?我读过有类 smb.SMBConnection.SMBConnection(用户名、密码、my_name、remote_name
linux服务器默认通过22端口用ssh协议登录,这种不安全。今天想做限制,即允许部分来源ip连接服务器。 案例目标:通过iptables规则限制对linux服务器的登录。 处理方法:编
我一直在寻找任何 PostProjectAnalysisTask 工作代码示例,但没有看。 This页面指出 HipChat plugin使用这个钩子(Hook),但在我看来它仍然使用遗留的 Po
我发现了 GWT 的 CustomScrollPanel 以及如何自定义滚动条,但我找不到任何示例或如何设置它。是否有任何示例显示正在使用的自定义滚动条? 最佳答案 这是自定义 native 滚动条的
我正在尝试开发一个 Backbone Marionette 应用程序,我需要知道如何以最佳方式执行 CRUD(创建、读取、更新和销毁)操作。我找不到任何解释这一点的资源(仅适用于 Backbone)。
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题?通过 editing this post 添加详细信息并澄清问题. 去年关闭。 Improve this
我需要一个提交多个单独请求的 django 表单,如果没有大量定制,我找不到如何做到这一点的示例。即,假设有一个汽车维修店使用的表格。该表格将列出商店能够进行的所有可能的维修,并且用户将选择他们想要进
我有一个 Multi-Tenancy 应用程序。然而,这个相同的应用程序有 liquibase。我需要在我的所有数据源中运行 liquibase,但是我不能使用这个 Bean。 我的应用程序.yml
我了解有关单元测试的一般思想,并已在系统中发生复杂交互的场景中使用它,但我仍然对所有这些原则结合在一起有疑问。 我们被警告不要测试框架或数据库。好的 UI 设计不适合非人工测试。 MVC 框架不包括一
我正在使用 docjure并且它的 select-columns 函数需要一个列映射。我想获取所有列而无需手动指定。 如何将以下内容生成为惰性无限向量序列 [:A :B :C :D :E ... :A
$condition使用说明和 $param在 findByAttributes在 Yii 在大多数情况下,这就是我使用 findByAttributes 的方式 Person::model()->f
我在 Ubuntu 11.10 上安装了 qtcreator sudo apt-get install qtcreator 安装的版本有:QT Creator 2.2.1、QT 4.7.3 当我启动
我是一名优秀的程序员,十分优秀!