![]() |
Opencv on N900
Hi all.
I'm trying to port one of my school project onto the N900. The project uses opencv libs. Right now, I'm trying to get everything together. This means I use: OS: Ubuntu 11.04 IDE: QtCreator 2.0.1with qt 4.7.0 Needless to say, the connection of the N900 device with QtCreator is working fine. In addition, I'm able to compile and run a test application (with opencv use) onto the simulator target in QtCreator. Problems arises when I try to build the opencv based application to the MAEMO target (the physical device). I cant seem to link the opencv libs. The compiler complains: /arm-none-linux-gnueabi/bin/ld: cannot find -lcv Should I build the opencv with the proper configuration for arm? If so, where (and what) should I place the build results? Its been two weeks now of forums picking and articles reading. all in vain. I cant seem to get passed this. This is my .pro file: QT += core gui TARGET = TestMaemo TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp HEADERS += mainwindow.h FORMS += mainwindow.ui CONFIG += mobility MOBILITY = symbian { TARGET.UID3 = 0xed764a64 # TARGET.CAPABILITY += TARGET.EPOCSTACKSIZE = 0x14000 TARGET.EPOCHEAPSIZE = 0x020000 0x800000 } LIBS += -lpthread -ljpeg -lpulse-simple LIBS += -lcv -lhighgui Any help would be appreciated. |
Re: Opencv on N900
Hey avieli,
I'm sorry that I can't help you, but I have noticed that you are using Ubuntu 11.04. Does this means that you have managed to install the scratchbox Maemo 5 SDK on 11.04? I'm still trying to figure out how to get the SDK installed on my linux box. |
Re: Opencv on N900
Quote:
|
Re: Opencv on N900
Quote:
My problem is in compiling a test program for the Maemo target in my desktop. Compiling for the maemo target does not even require the device, so i dont think it got anything to do with the device itself. I guess my question is more general and can be rephrased as: What is the proper way for compiling a program, using 3party libs, for the Maemo target on the desktop? The maemo center specifies the way to do it for the desktop/simulator target. not for the maemo target. BTW, all i have (after successfully installing the opencv package) are .so files. not .libs. When i try to specify the location for the .so files of the opencv package the compiler complains: libopencv_highgui.so: could not read symbols: File in wrong format How can i get it resolved? 10x |
Re: Opencv on N900
Quote:
I havent installed the Scartchbox. I followed the instructions for installing the entire Nokia SDK with the QtCreator. Correct me if i'm wrong but as i understand the Simulator in the QtCreator has the same functionality as the Scrachbox, so i didnt bother with it (since the simulator is working great for me). |
Re: Opencv on N900
Quote:
|
Re: Opencv on N900
Quote:
10x |
Re: Opencv on N900
I'd say installing extra packages is a lot easier wit scratchbox but if you really want to use QtSDK/MADDE see this post for more info on what to do.
|
Re: Opencv on N900
Hallelujah!! I've finally successfully compiled a test app using opencv for the maemo target in QtCreator.
Thank you all for helping out. For the benefit of others who may encounter the same problem and for the linux newbies (as i'm), I'll try to specify, in detail, the steps I took in order to solve the issue. These steps are a mix of various solutions I found on the web. On the device (N900): Install the opencv libs: 1. Open the X Terminal. type "sudo gainroot" for root access. 2, type "apt-get install libcv4 libcvaux4 libhighgui4". On your desktop (Linux): download the libcv4 and the libhighgui4 built for maemo, found at http://maemo.org/packages/package_in...ibcv4/2.0.0-3/ and http://maemo.org/packages/view/libhighgui4/ Make sure you download the armel packages. Extract these packages into a folder name "opencv". Remove the version extension from the .so files that are links to "shared library". for example rename the libcv.so.4 to libcv.so. Place the opencv folder and its content to the usr/lib folder inside the maemo nokia sdk folder. For example "Path/to/NokiaSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim/usr/lib/opencv". Opencv libs depend on other libs that are not a part of the QtCreator and are installed by default. You will need to copy these from you device (N900). The libs you need are: libavformat.so libavcodec.so libswscale.so libavutil.so libfaad.so libtheora.so libvorbisenc.so libvorbis.so libogg.so. You can find these libs in your device (N900) by typing in the X Terminal (under root): find -name libname.so* It is most likely you'll find them in usr/lib. Copy these libs from your device to the opencv folder you created ( "Path/to/NokiaSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim/usr/lib/opencv" ). Be sure to remove the version from the libs name, just as you did with the opencv libs. Create a PackageConfig file for the opencv. This file will be used by QtCreator to locate the libs. PackageConfig files are text files with .pc extension. Create a file opencv.pc (you may use gedit for that) and paste the following in it: # Package Information for pkg-config prefix=Path/to/NokiaSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib/opencv includedir=${prefix}/include/opencv Name: opencv Description: Intel(R) Open Source Computer Vision Library Version: 2.0.0 Libs: -L${libdir} -lcv -lhighgui -lavformat -lavcodec -lswscale -lavutil -lfaad -ltheora -lvorbisenc -lvorbis -logg Cflags: -I${includedir} Make sure you update the "prefix" variable according to your path. Do the same for the opencv header files (the .h files). That is locate the opencv header folder on your device (or your desktop) and past it to the path that is specified in the .pc file you just created. For example "Path/to/NokiaSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim/usr//include/opencv". Open you QtCreator project. In the .pro file add the following: CONFIG += link_pkgconfig PKGCONFIG += opencv These lines tell QtCreator to load the libs you copied using the .pc you created. That should be it.. |
All times are GMT. The time now is 06:36. |
vBulletin® Version 3.8.8