前提・実現したいこと
Eclipse3.8でOpenCV3を使用したいです。
パスの指定などをしたところ、IplImageではビルド・実行できるのですが、
Matではできません。
使用しているOSはUbuntu 16.0.4です。
よろしくお願いいたします。
発生している問題・エラーメッセージ
make all
Building file: ../src/test.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/local/include/opencv2 -I/usr/local/include/opencv -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/test.d" -MT"src/test.d" -o "src/test.o" "../src/test.cpp"
../src/test.cpp: In function ‘int main()’:
../src/test.cpp:34:77: error: ‘imread’ was not declared in this scope
cv::Mat input_img = imread("/home/LisaXXXX/デスクトップ/test5/0.jpg");
../src/test.cpp:34:77: note: suggested alternative:
In file included from /usr/local/include/opencv2/highgui.hpp:47:0,
from /usr/local/include/opencv2/highgui/highgui.hpp:48,
from ../src/test.cpp:13:
/usr/local/include/opencv2/imgcodecs.hpp:152:18: note: ‘cv::imread’
CV_EXPORTS_W Mat imread( const String& filename, int flags = IMREAD_COLOR );
make: *** [src/test.o] エラー 1
src/subdir.mk:18: ターゲット 'src/test.o' のレシピで失敗しました
該当のソースコード
#include <iostream>
#include <cv.h>
#include <highgui.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "opencv2/opencv.hpp"
using namespace std;
int main() {
cv::Mat input_img = imread("/home/kajiyar58/デスクトップ/test5/0.jpg");
imshow("lena", input_img);
cv::waitKey(0);
return 0;
}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/06/01 06:50