久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 Visual C++ 2010 Express 中安裝 OpenCV 2.4.3

Installing OpenCV 2.4.3 in Visual C++ 2010 Express(在 Visual C++ 2010 Express 中安裝 OpenCV 2.4.3)
本文介紹了在 Visual C++ 2010 Express 中安裝 OpenCV 2.4.3的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

如何在 VC++ 2010 Express 下安裝和使用 OpenCV 2.4.3?

How do you install and use OpenCV 2.4.3 under VC++ 2010 Express?

推薦答案

1.安裝 OpenCV 2.4.3

首先,從 sourceforge.net 獲取 OpenCV 2.4.3.它是自解壓的,因此只需雙擊即可開始安裝.將其安裝在一個目錄中,例如 C:.

First, get OpenCV 2.4.3 from sourceforge.net. Its a self-extracting so just double click to start the installation. Install it in a directory, say C:.

等到所有文件都被提取出來.它將創建一個新目錄 C:opencv包含 OpenCV 頭文件、庫、代碼示例等.

Wait until all files get extracted. It will create a new directory C:opencv which contains OpenCV header files, libraries, code samples, etc.

現在您需要將目錄 C:opencvuildx86vc10in 添加到您的系統路徑中.此目錄包含運行代碼所需的 OpenCV DLL.

Now you need to add the directory C:opencvuildx86vc10in to your system PATH. This directory contains OpenCV DLLs required for running your code.

打開控制面板系統高級系統設置高級 Tab →環境變量...

Open Control PanelSystemAdvanced system settingsAdvanced Tab → Environment variables...

在系統變量部分,選擇路徑 (1)、編輯 (2),然后輸入C:opencvuildx86vc10in; (3),然后點擊確定.

On the System Variables section, select Path (1), Edit (2), and type C:opencvuildx86vc10in; (3), then click Ok.

在某些計算機上,您可能需要重新啟動計算機,系統才能識別環境路徑變量.

On some computers, you may need to restart your computer for the system to recognize the environment path variables.

這將在您的計算機上完成 OpenCV 2.4.3 的安裝.

This will completes the OpenCV 2.4.3 installation on your computer.

2.創建一個新項目并設置 Visual C++

打開 Visual C++ 并選擇 文件項目...Visual C++空項目.為您的項目命名(例如:cvtest)并設置項目位置(例如:c:projects).

Open Visual C++ and select FileNewProject...Visual C++Empty Project. Give a name for your project (e.g: cvtest) and set the project location (e.g: c:projects).

點擊確定.Visual C++ 將創建一個空項目.

Click Ok. Visual C++ will create an empty project.

確保在解決方案配置組合框中選擇了調試".右鍵單擊 cvtest 并選擇 屬性VC++ 目錄.

Make sure that "Debug" is selected in the solution configuration combobox. Right-click cvtest and select PropertiesVC++ Directories.

選擇包含目錄以添加新條目并鍵入C:opencvuildinclude.

Select Include Directories to add a new entry and type C:opencvuildinclude.

點擊確定關閉對話框.

返回屬性對話框,選擇庫目錄以添加新條目并鍵入C:opencvuildx86vc10lib.

Back to the Property dialog, select Library Directories to add a new entry and type C:opencvuildx86vc10lib.

點擊確定關閉對話框.

返回屬性對話框,選擇鏈接器輸入附加依賴項以添加新條目.在彈出對話框中,輸入以下文件:

Back to the property dialog, select LinkerInputAdditional Dependencies to add new entries. On the popup dialog, type the files below:

opencv_calib3d243d.lib
opencv_contrib243d.lib
opencv_core243d.lib
opencv_features2d243d.lib
opencv_flann243d.lib
opencv_gpu243d.lib
opencv_haartraining_engined.lib
opencv_highgui243d.lib
opencv_imgproc243d.lib
opencv_legacy243d.lib
opencv_ml243d.lib
opencv_nonfree243d.lib
opencv_objdetect243d.lib
opencv_photo243d.lib
opencv_stitching243d.lib
opencv_ts243d.lib
opencv_video243d.lib
opencv_videostab243d.lib

請注意,文件名以d"(代表調試")結尾.另請注意,如果您安裝了另一個版本的 OpenCV(比如 2.4.9),這些文件名將以 249d 而不是 243d 結尾(opencv_core249d.lib..etc).

Note that the filenames end with "d" (for "debug"). Also note that if you have installed another version of OpenCV (say 2.4.9) these filenames will end with 249d instead of 243d (opencv_core249d.lib..etc).

點擊確定關閉對話框.在項目屬性對話框中單擊確定以保存所有設置.

Click Ok to close the dialog. Click Ok on the project properties dialog to save all settings.

注意:

這些步驟將為調試"解決方案配置 Visual C++.對于發布"解決方案(可選),您需要重復添加 OpenCV 目錄和 Additional依賴項部分,使用:

These steps will configure Visual C++ for the "Debug" solution. For "Release" solution (optional), you need to repeat adding the OpenCV directories and in Additional Dependencies section, use:

opencv_core243.lib
opencv_imgproc243.lib
...

代替:

opencv_core243d.lib
opencv_imgproc243d.lib
...

您已經完成了 Visual C++ 的設置,現在是編寫真正代碼的時候了.右鍵單擊您的項目并選擇添加新項目...Visual C++C++ 文件.

You've done setting up Visual C++, now is the time to write the real code. Right click your project and select AddNew Item...Visual C++C++ File.

為您的文件命名(例如:loadimg.cpp)并點擊確定.在編輯器中輸入以下代碼:

Name your file (e.g: loadimg.cpp) and click Ok. Type the code below in the editor:

#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main()
{
    Mat im = imread("c:/full/path/to/lena.jpg");
    if (im.empty()) 
    {
        cout << "Cannot load image!" << endl;
        return -1;
    }
    imshow("Image", im);
    waitKey(0);
}

上面的代碼將加載 c:fullpath olena.jpg 并顯示圖像.你可以使用您喜歡的任何圖像,只需確保圖像的路徑正確即可.

The code above will load c:fullpath olena.jpg and display the image. You can use any image you like, just make sure the path to the image is correct.

鍵入 F5 編譯代碼,它將在一個漂亮的窗口中顯示圖像.

Type F5 to compile the code, and it will display the image in a nice window.

這是你的第一個 OpenCV 程序!

And that is your first OpenCV program!

3.從這里去哪里?

既然您的 OpenCV 環境已準備就緒,接下來要做什么?

Now that your OpenCV environment is ready, what's next?

  1. 轉到示例目錄 →c:opencvsamplescpp.
  2. 閱讀并編譯一些代碼.
  3. 編寫您自己的代碼.

這篇關于在 Visual C++ 2010 Express 中安裝 OpenCV 2.4.3的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Assertion failed (size.widthgt;0 amp;amp; size.heightgt;0)(斷言失敗(size.width0 amp;amp; size.height0))
Rotate an image in C++ without using OpenCV functions(在 C++ 中旋轉圖像而不使用 OpenCV 函數)
OpenCV: process every frame(OpenCV:處理每一幀)
Why can#39;t I open avi video in openCV?(為什么我不能在 openCV 中打開 avi 視頻?)
OpenCV unable to set up SVM Parameters(OpenCV 無法設置 SVM 參數)
Convert a single color with cvtColor(使用 cvtColor 轉換單一顏色)
主站蜘蛛池模板: 亚洲另类自拍 | av日日操 | 久久久久久久久一区 | 在线看av的网址 | 欧美成人一区二区三区片免费 | 自拍偷拍第一页 | 国产精品视频久久久 | 国产a视频 | 日日噜噜噜夜夜爽爽狠狠视频, | 亚洲人成人一区二区在线观看 | 亚洲啊v在线 | 欧美在线a | 伊人网在线看 | 国产一级一级国产 | 成人免费激情视频 | 中文字幕在线视频免费视频 | 在线中文字幕av | 毛片a级 | 男女国产网站 | 国产精品视频免费播放 | 在线超碰| 亚洲一区不卡在线 | 久久精品一区二区三区四区 | 亚洲成av人片在线观看无码 | 精品视频在线免费观看 | 免费a级毛片在线播放 | 亚洲 中文 欧美 日韩 在线观看 | 国产亚洲黄色片 | 在线观看视频h | 男人天堂网址 | av在线免费观看网址 | 亚洲综合五月天婷婷 | 午夜一级大片 | 国产欧美视频一区 | 精品国产一级片 | 999久久久| 国产成人精品久久二区二区91 | 亚洲午夜小视频 | 国产毛片av | 精品欧美一区二区精品久久久 | 免费在线观看黄视频 |