Ask Your Question

pankit7's profile - activity

2017-02-22 07:16:35 -0600 answered a question compile opencv withough gui

I believe you should remove the portions of code using the highgui, and then compile for ARM. (without the -lopencv_highgui command)
For example: functions with imshow() or imread() make use of highgui libraries. So you must remove them if you dont want to use the gui.

2017-02-22 06:52:17 -0600 asked a question OpenCV Highgui error - Crosscompile

I'm have build the OpenCV library from source for Zynq (ARM). But, OpenCV was build on the same PC for x86 (PC) also. Firstly, I can execute every example on my PC without any issues. Secondly, I am able to crosscompile and execute every program on the arm target, except the ones including highgui libraries, where I receive the following error:

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /home/hristov/workspace/opencv/modules/highgui/src/window.cpp, line 534
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/user/workspace/opencv/modules/highgui/src/window.cpp:534: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage

Yes, I have gone through the forum for solutions for this issue but some answers were unclear and I would like some more detail into this. I have created the OpenCV build for ARM build WITH_GTK and GTK2. Also installed libgtk2.0-dev, pkg-config

However, From another topic on this forum, I learned that the problem lies in setting up the pkg-config: Topic: Opencv GUI with GTK 2 - SOLVED ! ! ! (Cannot post links due to insufficient karma :/ )

Q) Based on the above solution, Do you set the path for PKG_CONFIG_PATH on your ARM platform (Zynq) or on the PC platform (Ubuntu PC)? Because, it is already set to the described path on the ARM platform whereas it is different on the PC Linux platform. More details of the current path is shown below:

PKG_CONFIG_PATH in PC(Ubuntu):
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

PKG_CONFIG_PATH in ARM (Embedded platform):
/usr/local/lib/arm-linux-gnueabihf/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

If the pkg-config must be changed on my PC, to the /usr/lib/arm-linux-gnueabihf/pkgconfig/ location, I cannot find any gtk libraries in that location. Should this still be performed?

Q) Also, Should the GTK libraries also be installed in the Target Embedded system (ARM)?

Hope someone can help me with this solution as I have rebuild the libraries umpteen times with many different solutions, but to no avail. Thanks!

2017-02-10 05:24:50 -0600 answered a question Opencv GUI with GTK 2 - SOLVED ! ! !

Hello Spas Hristov,

I have been receiving the same error as you have, due to which I have performed n number of rebuilds with gtk+2, but still am receiving the same error!! Now, I came across your solution, and I think it could help solve my problem, but I still have a small query regarding it. Do you set the path for PKG_CONFIG_PATH on your ARM platform (Rasp Pi for you) or on the PC platform (Ubuntu PC i assume)? Because, it is already set to the described path on the ARM platform while it is different on the PC Linux platform. More details of the current path is shown below:

PKG_CONFIG_PATH in PC(Ubuntu):
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

PKG_CONFIG_PATH in ARM (Embedded platform):
/usr/local/lib/arm-linux-gnueabihf/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

I cross-compile on my Ubuntu PC using the following command:

arm-linux-gnueabihf-g++ -o example example.cpp -I/usr/lib/opencv_arm/install/include -L/usr/lib/opencv_arm/install/lib -lopencv_core -lopencv_imgcodecs -lopencv_highgui -lopencv_video -lopencv_imgproc -lopencv_videoio -lopencv_features2d -lopencv_flann -lopencv_ml -lopencv_photo -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d

Another point which may be helpful is that, I have build OpenCV for both these platforms - PC (Ubuntu) and Embedded (cross compile), and it works perfectly for the PC(Ubuntu), whereas for the embedded platform I am facing the GTK+2 issue.

Thanks!