OpenCV:第一"Hello World Project"要包含的图书馆



我在运行以下简单代码时遇到了一些问题:http://docs.opencv.org/doc/tutorials/introduction/display_image/display_image.html

系统:Windows 7 x64Microsoft Visual Studio 2013(免费使用)项目为32位。

我有许多不同的链接错误作为LNK2001和LNK2019。当我在"配置繁荣">"链接器">"输入"

下添加此库时,所有这些问题都解决了。

"Configuration Prosperities"> " linkker "> "Input"下的库:

opencv_calib3d300.lib
opencv_core300.lib
opencv_features2d300.lib
opencv_flann300.lib
opencv_hal300.lib
libtiff.lib
libpng.lib
libjpeg.lib
libjasper.lib
IlmImf.lib
zlib.lib
opencv_highgui300.lib
opencv_imgproc300.lib
opencv_imgcodecs300.lib
opencv_ml300.lib
opencv_objdetect300.lib
opencv_photo300.lib
opencv_shape300.lib
opencv_stitching300.lib
opencv_ts300.lib
opencv_video300.lib
opencv_videostab300.lib
ippicvmt.lib
libwebp.lib

我使用了以下代码:

#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <iostream>
#include <stdlib.h>
#include "stdafx.h"
#include <opencv2/opencv.hpp>
#include <opencv2/shape.hpp>

using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
    if (argc != 2)
    {
        cout << " Usage: display_image ImageToLoadAndDisplay" << endl;
        return -1;
    }
    Mat image;
    image = imread(argv[1], IMREAD_COLOR); // Read the file
    if (!image.data) // Check for invalid input
    {
        cout << "Could not open or find the image" << std::endl;
        return -1;
    }
    namedWindow("Display window", WINDOW_AUTOSIZE); // Create a window for display.
    imshow("Display window", image); // Show our image inside it.
    waitKey(0); // Wait for a keystroke in the window
    return 0;
}

相关内容

  • 没有找到相关文章

最新更新