こんにちは、インスタント OpenCV スターター ブックの最初のデモである lena.jpg を表示しようとしています。
「hello world」を簡単に構築してプレイできます。
問題のコード
// opencv header files
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/core.hpp"
// namespaces declaration
using namespace cv;
using namespace std;
// create a variable to store the image
Mat image;
int main( int argc, char** argv )
{
// open the image and store it in the 'image' variable
// Replace the path with where you have downloaded the image
// image=imread("<path to image">/lena.jpg");
image=imread("/home/nigel/Documents/ffmpeg/tests/lena.jpg");
// create a window to display the image
namedWindow( "Display window", CV_WINDOW_AUTOSIZE );
// display the image in the window created
imshow( "Display window", image );
// wait for a keystroke
waitKey(0);
return 0;
}
エラー
g++ -Wall -fexceptions 'pkg-config --cflags opencv' -g "pkg-config --cflags
opencv' -c/home/nigel/Drone/Test2/main.cpp -o obj/Debug/Drone/Test2/main.o
g++:fatal error:no input files
compilation terminated
process terminated with status 1 (0 minutes, 0 seconds)
lena.jpg のさまざまなパスを試しました。lena.jpg を lena.pnm から変更しました。パスが正しいかどうかわかりません。
OpenCvを初めて使用する場合は、助けていただければ幸いです