Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
1,940 Views

Error compiling opencv code on Edison

Hello everyone, I am trying to compile one of the opencv examples (opencv_version.cpp). I have successfully installed opencv on my edison board with the arduino expansion card using this tutorial https://software.intel.com/en-us/articles/opencv-300-beta-ipp-tbb-enabled-on-yocto-with-intel-edison https://software.intel.com/en-us/articles/opencv-300-beta-ipp-tbb-enabled-on-yocto-with-intel-edison

Does someone has any ideas to what the errors am getting might be related to. (I have posted the picture below)

Thanks. Really appreciate any ideas.

14 Replies
Highlighted
18 Views

  • I guess some dependencies are unresolved in your case (missing OpenCV dev packages)
  • if you can live with OpenCV 2.4 as well you might consider taking prebuilt packages e.g. from AlexT_Intel repo: http://repo.opkg.net/edison/repo/core2-32/ Index of /edison/repo/core2-32
  • if you do have a Yocto build environment set up it might be easier (faster) to build there rather than on the target
Highlighted
Novice
18 Views

Hi mhahn thanks for your reply. Do you know or does anyone know any tutorial for a beginner describing how to install and run an opencv example using AlexT_Intel repo?

0 Kudos
Highlighted
Novice
18 Views

I am using this command to compile now: g++ -o opencv_version opencv_version.cpp `pkg-config opencv --cflags --libs`

but I get a different error now: Does anyone have seen this before?

0 Kudos
Highlighted
18 Views

Looks like your OpenCV installation is faulty as libopencv_core.a has undefined references. How did you install opencv?

Maybe try dynamically linking?

Can you try linking the opencv libs directly rather than via pkg-config?

I.E. something like -lopencv_core ...

0 Kudos
Highlighted
Novice
18 Views

Thank you so much for your response,

I have tried using this command:

g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -L/usr/local/lib -g -o binary openc

v_version.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopen

cv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_stitch

ing

but I still get the same error as above. Do you know of any complete tutorial of how to get opencv installed and compiled successfully with a USB camera?

I have looked at the AlexT_Intel repo but I don't know which opencv packet to install. I which there was a tutorial that describes step by step.

0 Kudos
Highlighted
18 Views

g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -L/usr/local/lib -g -o binary openc

v_version.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopen

cv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_stitch

ing

but I still get the same error as above. Do you know of any complete tutorial of how to get opencv installed and compiled successfully with a USB camera?

ok, so it's definitely a bad installation - did you compile opencv for eglibc?

I have looked at the AlexT_Intel repo but I don't know which opencv packet to install. I which there was a tutorial that describes step by step.

you would definitely need http://repo.opkg.net/edison/repo/core2-32/libopencv-core2.4_2.4.9-r1_core2-32.ipk libopencv-core2.4 and http://repo.opkg.net/edison/repo/core2-32/libopencv-core-dev_2.4.9-r1_core2-32.ipk libopencv-core-dev. On the others: just check which opencv domain the cv functions you use are in. Why not just install all of them?

0 Kudos
Highlighted
Honored Contributor II
18 Views

I'd second that. It most definitely looks like you just haven't installed one of the dependency opencv packages, 0gravity . You need at least opencv-dev and opencv-staticdev packages + all the libopencv* packages your program actually uses.

0 Kudos
Highlighted
Novice
18 Views

Hey guys thanks a lot for the replies.

So I did installed opencv-dev and opencv-staticdev and compiled this code:

# include

# include "opencv2/opencv.hpp"

using namespace std;

using namespace cv;

int main() {

VideoCapture cap(0);

if(!cap.isOpened()) {

cout << "I'm blind..." << endl;

return -1;

}

cout << "I can see!" << endl;

return 0;

}

using: g++ test.cpp `pkg-config opencv --cflags --libs` -o test

And it works! So thanks a lot mhahn and AlexT_Intel

So now I can capture video and stuff but I can't see anything because everything is on the Edison Do you guys know of any way that I can see the video?

Thanks a lot for all the help.

0 Kudos
Highlighted
18 Views

  • streaming video (DLNA ...)
  • USB graphics card
  • ...
0 Kudos
Highlighted
Beginner
18 Views

Hi, i have followed this tutorial https://software.intel.com/en-us/articles/opencv-300-beta-ipp-tbb-enabled-on-yocto-with-intel-edison OpenCV 3.0.0-beta ( IPP & TBB enabled ) on Yocto with Intel® Edison | Intel® Developer Zone and installed opencv on my edison board and now when i try to compile and run opencv programs using cmake iam getting various errors, i have re flashed the board several times since i didnt enable the v4l2, but the problem still persists. can you please give a brief explanation on how to compile and run opencv applications on my board? iam trying to capture video from a webcam and process i for obstacle detection. It would be very helpful if you guys can even point me to the right website where i can find more useful information about it.

Thank you.

0 Kudos
Highlighted
Novice
18 Views

Hey ManojVangala I follow that tutorial too! and I had some problems. So I just follow that tutorial until he part it says to expand the root partition and then I just installed opencv by doing:

opkg install opencv-dev

opgk install opencv-staticdev

before doing the above commands you need to go to the http://alextgalileo.altervista.org/edison-package-repo-configuration-instructions.html AlexT_Intel repo and follow those instructions.

after this you should be able to compile the sample code I posted above.

0 Kudos
Highlighted
Novice
18 Views

Hey,

I'm pretty new to this community and started working with my edison a few weeks ago. I am currently trying to setup OpenCV on my edison and get the program Test.cpp running (FYI it contains the exact same code as yours). When I start the program in Putty I get nothing back. Not even an error. I think this is a good sign, but should I be able to see the message "I'm blind"? Or is it just because I am not executing my program from an IDE like e.g. Eclipse? My 3. question is what packages I should install to be able to use CannyEdge Detection and HoughCircles (HairCascade)?

Thank you

0 Kudos
Highlighted
18 Views

don'T know which "Test.cpp" you are talking - but way not adding debug output messages?

It doesn't matter whether you run your program from Eclipse or from the terminal (PuTTy ...) at the end you are always executing a binary on your target

# 3: I guess you'll find the answer looking into OpenCV docs? Maybe check the required imports and check which package contains those

0 Kudos
Highlighted
Beginner
18 Views

Hi jbuechel, it's late reply, but may help you or the others, if you just do the following steps:

1.type: g++ test.cpp `pkg-config opencv --cflags --libs` -o test (make sure the correct spelling of the file name in this case test.cpp)

2. type: ./test (don't forget "." before "/")

0 Kudos