如何在 Visual C 2010 Express 中安裝 OpenCV 2.4.3
要在 Visual C 2010 Express 中安裝 OpenCV 2.4.3,請依照下列步驟操作步驟:
1.安裝
2。專案配置
在項目屬性→連結器中→ 輸入,加入以下依賴(其中「_d」後綴表示「調試」配置):
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
3.程式碼範例
在專案中建立一個新的 C檔案並輸入以下程式碼:
#include <opencv2/highgui/highgui.hpp> #include <iostream> using namespace cv; using namespace std; int main() { // Load and display an image Mat im = imread("c:/full/path/to/lena.jpg"); if (im.empty()) { cout << "Cannot load image!" << endl; return -1; } imshow("Image", im); waitKey(0); return 0; }
以上是如何在 Visual C 2010 Express 中設定 OpenCV 2.4.3?的詳細內容。更多資訊請關注PHP中文網其他相關文章!