<tfoot id='4Ym5p'></tfoot>
      • <bdo id='4Ym5p'></bdo><ul id='4Ym5p'></ul>
    1. <i id='4Ym5p'><tr id='4Ym5p'><dt id='4Ym5p'><q id='4Ym5p'><span id='4Ym5p'><b id='4Ym5p'><form id='4Ym5p'><ins id='4Ym5p'></ins><ul id='4Ym5p'></ul><sub id='4Ym5p'></sub></form><legend id='4Ym5p'></legend><bdo id='4Ym5p'><pre id='4Ym5p'><center id='4Ym5p'></center></pre></bdo></b><th id='4Ym5p'></th></span></q></dt></tr></i><div id='4Ym5p'><tfoot id='4Ym5p'></tfoot><dl id='4Ym5p'><fieldset id='4Ym5p'></fieldset></dl></div>
    2. <small id='4Ym5p'></small><noframes id='4Ym5p'>

      <legend id='4Ym5p'><style id='4Ym5p'><dir id='4Ym5p'><q id='4Ym5p'></q></dir></style></legend>

    3. OpenCV 不适用于 Visual Studio

      OpenCV doesn#39;t work with Visual Studio(OpenCV 不适用于 Visual Studio)
      <tfoot id='4R6xN'></tfoot>

        <bdo id='4R6xN'></bdo><ul id='4R6xN'></ul>

      • <small id='4R6xN'></small><noframes id='4R6xN'>

          <i id='4R6xN'><tr id='4R6xN'><dt id='4R6xN'><q id='4R6xN'><span id='4R6xN'><b id='4R6xN'><form id='4R6xN'><ins id='4R6xN'></ins><ul id='4R6xN'></ul><sub id='4R6xN'></sub></form><legend id='4R6xN'></legend><bdo id='4R6xN'><pre id='4R6xN'><center id='4R6xN'></center></pre></bdo></b><th id='4R6xN'></th></span></q></dt></tr></i><div id='4R6xN'><tfoot id='4R6xN'></tfoot><dl id='4R6xN'><fieldset id='4R6xN'></fieldset></dl></div>
            <legend id='4R6xN'><style id='4R6xN'><dir id='4R6xN'><q id='4R6xN'></q></dir></style></legend>
              <tbody id='4R6xN'></tbody>

                本文介绍了OpenCV 不适用于 Visual Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我刚刚安装了 openCV 版本.我的电脑上有 3.00 测试版,我正在尝试使用 VS2013 对其进行测试.我遵循了快速入门指南:

                I just installed openCV ver. 3.00 beta on my computer and I'm trying to test it with VS2013. I followed quick start guide:

                1) windows 安装,使用 pre- 构建库.

                1) Installation for windows, using pre-build libraries.

                2) Microsoft VS 中的 OpenCV,使用本地方法和 x64/vc12 目录库.

                2) OpenCV inside Microsoft VS, using local method and x64/vc12 directory for libraries.

                因此,他们的示例(在链接 #2 中列出)产生了错误:

                As a result, their example(listed in link #2) produced an error:

                #include <opencv2/core.hpp>
                #include <opencv2/imgcodecs.hpp>
                #include <opencv2/highgui.hpp>
                #include <iostream>
                
                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.empty()) // 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;
                }
                

                输出为:

                1>------ Build started: Project: test_openCV, Configuration: Debug Win32 ------
                1>LINK : fatal error LNK1104: cannot open file 'opencv_calib3d300d.lib'
                ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
                

                据我所知,我的程序可以看到 openCV 库,但由于某些原因无法打开它们.请帮忙.

                As far as I understand, my program can see openCV libraries, but for some reason cannot open them. Please help.

                谢谢

                更新:尝试做前四条评论中推荐的操作,仍然没有结果.所以我会在这里发布完整的信息:

                Update: Tried to do what was recommended in first four comments, no result still. So I will post here full information:

                项目:CUDA 6.5(我需要使用 CUDA).

                Project: CUDA 6.5 (I need to work with CUDA).

                源文件:Source.cpp

                模式:调试,x64.

                环境变量:

                OPENCV_DIR: C:programsmishaopencvuildx64vc12
                
                Path (the last string): %OPENCV_DIR%in
                

                页面属性:

                CC++ -> General -> Additional Include Directories(last string):
                    $(OPENCV_DIR)....include
                Linker -> General -> Additional Library Directories(last string):
                    $(OPENCV_DIR)lib
                Linker -> Input -> Additional Dependencies:
                    opencv_calib3d300d.lib
                    opencv_core300d.lib
                    opencv_features2d300d.lib
                    opencv_flann300d.lib
                    opencv_highgui300d.lib
                    opencv_imgcodecs300d.lib
                    opencv_imgproc300d.lib
                    opencv_ml300d.lib
                    opencv_objdetect300d.lib
                    opencv_photo300d.lib
                    opencv_shape300d.lib
                    opencv_stitching300d.lib
                    opencv_superres300d.lib
                    opencv_ts300d.lib
                    opencv_video300d.lib
                    opencv_videoio300d.lib
                    opencv_videostab300d.lib
                

                输出:

                1>------ Build started: Project: test_openCV, Configuration: Debug x64 ------
                1>LINK : fatal error LNK1104: cannot open file 'opencv_calib3d300d.lib'
                ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
                

                因此,由于某种原因,我无法构建 x64 项目.错误是一样的.

                So, I cannot build x64 project for some reason. Error is the same.

                更新 2:如果您可以构建此示例(或任何使用 OpenCV 的示例),能否将其发送至 genkin@physics.msu.ru?我自己想办法

                推荐答案

                经过长时间的不同尝试,我找到了答案此处.对于 x64 项目,除了我上面所做的,你还必须:

                After a long time of different attempts, I found the answer here. For x64 project, in addition to what I did above, you have to:

                1) 设置环境变量后重新启动 PC.没有重新启动,我的计算机上的变量路径未更新.

                1) Restart your PC after setting enviromental variables. Variable Path was not updated on my computer without restart.

                2) 除了上面添加的库之外,您还必须添加(尽管对于本示例,其中一些可能不会使用):

                2) In addition to libraries added above, you have to add (although, for this example some of them might not be used):

                ippicvmt.lib
                IlmImfd.lib
                libtiffd.lib 
                libpngd.lib
                libjasperd.lib
                libjpegd.lib
                libwebpd.lib
                zlibd.lib
                comctl32.lib
                

                我最近不得不在新 PC 上再次安装它.正如 user1060873 所指出的,您只需添加位于 $OPENCV$/lib 文件夹中的库.例如,在我的 PC 上,它是 C:opencvuildx64vc12lib.请注意,对于调试模式,您应该添加 opencv_world310d.lib,对于发布版本 opencv_world310.lib

                I recently had to install it again on a new PC. As user1060873 pointed out, you have to add only the libraries located in your $OPENCV$/lib folder. For example, on my PC it is C:opencvuildx64vc12lib. Note, that for debug mode you should add opencv_world310d.lib, and for release opencv_world310.lib

                这篇关于OpenCV 不适用于 Visual Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Constructor initialization Vs assignment(构造函数初始化 Vs 赋值)
                Is a `=default` move constructor equivalent to a member-wise move constructor?(`=default` 移动构造函数是否等同于成员移动构造函数?)
                Has the new C++11 member initialization feature at declaration made initialization lists obsolete?(声明时新的 C++11 成员初始化功能是否使初始化列表过时了?)
                Order of constructor call in virtual inheritance(虚继承中构造函数调用的顺序)
                How to use sfinae for selecting constructors?(如何使用 sfinae 选择构造函数?)
                Initializing a union with a non-trivial constructor(使用非平凡的构造函数初始化联合)

                    • <small id='Mv5uX'></small><noframes id='Mv5uX'>

                      <legend id='Mv5uX'><style id='Mv5uX'><dir id='Mv5uX'><q id='Mv5uX'></q></dir></style></legend>
                        <bdo id='Mv5uX'></bdo><ul id='Mv5uX'></ul>
                          <tbody id='Mv5uX'></tbody>
                        <i id='Mv5uX'><tr id='Mv5uX'><dt id='Mv5uX'><q id='Mv5uX'><span id='Mv5uX'><b id='Mv5uX'><form id='Mv5uX'><ins id='Mv5uX'></ins><ul id='Mv5uX'></ul><sub id='Mv5uX'></sub></form><legend id='Mv5uX'></legend><bdo id='Mv5uX'><pre id='Mv5uX'><center id='Mv5uX'></center></pre></bdo></b><th id='Mv5uX'></th></span></q></dt></tr></i><div id='Mv5uX'><tfoot id='Mv5uX'></tfoot><dl id='Mv5uX'><fieldset id='Mv5uX'></fieldset></dl></div>

                        • <tfoot id='Mv5uX'></tfoot>