Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/157.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
OpenCV C++;Xcode中的错误 < >我使用了 Cugs< /Cuff>构建系统,并将标题“.a”和'DyLIB文件添加到我的终端C++项目中,构建了OpenCV库。但是,当我运行下面的代码时(从中获得),它会给出下面的错误。有人有什么建议吗?任何帮助都将不胜感激 #include <stdlib.h> #include <stdio.h> #include <math.h> #include <cv.h> #include <highgui.h> int main() { //get the image from the directed path IplImage* img = cvLoadImage("/Users/somedir/Programming/TestProj/fruits.jpg", 1); //create a window to display the image cvNamedWindow("picture", 1); //show the image in the window cvShowImage("picture", img); //wait for the user to hit a key cvWaitKey(0); //delete the image and window cvReleaseImage(&img); cvDestroyWindow("picture"); //return return 0; }_C++_Xcode_Opencv_Header_Libraries - Fatal编程技术网

OpenCV C++;Xcode中的错误 < >我使用了 Cugs< /Cuff>构建系统,并将标题“.a”和'DyLIB文件添加到我的终端C++项目中,构建了OpenCV库。但是,当我运行下面的代码时(从中获得),它会给出下面的错误。有人有什么建议吗?任何帮助都将不胜感激 #include <stdlib.h> #include <stdio.h> #include <math.h> #include <cv.h> #include <highgui.h> int main() { //get the image from the directed path IplImage* img = cvLoadImage("/Users/somedir/Programming/TestProj/fruits.jpg", 1); //create a window to display the image cvNamedWindow("picture", 1); //show the image in the window cvShowImage("picture", img); //wait for the user to hit a key cvWaitKey(0); //delete the image and window cvReleaseImage(&img); cvDestroyWindow("picture"); //return return 0; }

OpenCV C++;Xcode中的错误 < >我使用了 Cugs< /Cuff>构建系统,并将标题“.a”和'DyLIB文件添加到我的终端C++项目中,构建了OpenCV库。但是,当我运行下面的代码时(从中获得),它会给出下面的错误。有人有什么建议吗?任何帮助都将不胜感激 #include <stdlib.h> #include <stdio.h> #include <math.h> #include <cv.h> #include <highgui.h> int main() { //get the image from the directed path IplImage* img = cvLoadImage("/Users/somedir/Programming/TestProj/fruits.jpg", 1); //create a window to display the image cvNamedWindow("picture", 1); //show the image in the window cvShowImage("picture", img); //wait for the user to hit a key cvWaitKey(0); //delete the image and window cvReleaseImage(&img); cvDestroyWindow("picture"); //return return 0; },c++,xcode,opencv,header,libraries,C++,Xcode,Opencv,Header,Libraries,避免在OpenCV 2.0中使用Xcode。如果使用OpenCV,请使用Windows并同时使用OpenCV 1.1。这会省去很多头痛。当2.0/Mac有了更好的文档记录后,就可以过渡到Mac平台/2.0版本。这本书(O'Reilly)很好——封面是v1.1。2.0的下一期将很快推出。1.首先,不要使用CMake构建LIB,最好从mac上的macports获取, 您可以使用一行程序轻松地更新到较新的版本 另外,如果您想使用cv::Mat接口与 #include和#include事情会变得更好……

避免在OpenCV 2.0中使用Xcode。如果使用OpenCV,请使用Windows并同时使用OpenCV 1.1。这会省去很多头痛。当2.0/Mac有了更好的文档记录后,就可以过渡到Mac平台/2.0版本。这本书(O'Reilly)很好——封面是v1.1。2.0的下一期将很快推出。1.

首先,不要使用CMake构建LIB,最好从mac上的macports获取, 您可以使用一行程序轻松地更新到较新的版本

另外,如果您想使用
cv::Mat
接口与
#include
#include
事情会变得更好……)包括名称末尾带有版本的动态库。(我认为无版本的dylib是用于旧接口的#include)

首先:

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main()
{

    //get the image from the directed path
    Mat img = loadImage("/Users/somedir/Programming/TestProj/fruits.jpg");

    //show the image in the window
    imshow("picture", img);

    //wait for the user to hit a key
    waitKey(0);
    //delete the image and window (automatic)
    return 0;
}
#包括
#包括
使用名称空间cv;
int main()
{
//从定向路径获取图像
Mat img=loadImage(“/Users/somedir/Programming/TestProj/fruits.jpg”);
//在窗口中显示图像
imshow(“图片”,img);
//等待用户按一个键
等待键(0);
//删除图像和窗口(自动)
返回0;
}
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main()
{

    //get the image from the directed path
    Mat img = loadImage("/Users/somedir/Programming/TestProj/fruits.jpg");

    //show the image in the window
    imshow("picture", img);

    //wait for the user to hit a key
    waitKey(0);
    //delete the image and window (automatic)
    return 0;
}