我想在opencv中創建一個簡單的圖像處理器。我到目前爲止已經嘗試用此代碼從文件中打開設置的圖像。OpenCV讓用戶選擇打開圖像
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main()
{
Mat im = imread("c:/image.jpg");
if (im.empty())
{
cout << "Cannot load image!" << endl;
return -1;
}
imshow("Image", im);
waitKey(0);
}
由於這隻允許設置圖像文件打開,我怎麼修改它,讓它允許用戶選擇圖像?
這是可能的,或者我只能從文件加載設置的圖像?
謝謝。
答案似乎是不完整的(其中不openFileDialog1來自?需要什麼庫/ includes/...它看起來像需要.NET框架) – Ale 2014-11-16 13:37:09
這不是C++,而是一些方言,如C++/CLI。回答C++問題時請堅持使用C++。 – 2017-08-04 12:21:35