![]() |
AR applications on N900 (OpenCV)
1 Attachment(s)
Hello,
Just to make life easier to anyone who wants to do AR on N900 i have a few suggestions. 1.) Use openCV library for any tracking and image manipulation. It is an amazing library that is available in the repo. M900: $ apt-get install libcv4 libcvaux4 libhighgui4 Scratchbox: $ apt-get install libcv4 libcv-dev opencv-doc libcvaux-dev libcvaux4 python-opencv libhighgui-dev libhighgui4 2.) For capturing video use openCV library calls or go through the hassle of GStreamer (appsink element) which can be integrated with QT using QGLWidget object. I attached source code of a project GstOpenGL that demonstrates how this can be done. Make sure you have qt 4.6 on your N900 or scratchbox. The GstOoenGL does not use openCV. The code has not been cleaned and optimized but should save you time. Klen |
Re: AR applications on N900 (OpenCV)
thanks Klen, very helpful.
would be nice if you have the link to the doxygen or details of api's. |
Re: AR applications on N900 (OpenCV)
a) Thank you very much, Klen.
b) krk969: Do you mean http://opencv.willowgarage.com/docum...cpp/index.html ? I also read parts of "Learning OpenCV: Computer Vision with the OpenCV Library", which seemed quite helpful. The conventional resources are: http://doc.qt.nokia.com/qt-maemo-4.6/classes.html http://www.khronos.org/opengles/sdk/docs/man/ http://gstreamer.freedesktop.org/documentation/ Hope that helps. Since the main code chunks are taken from the tutorials and contain no doxygen documentation themselves, there shouldn't be any further resources imho. |
Re: AR applications on N900 (OpenCV)
If I open the .pro file via left click in Qt Creator, this happens:
build results in an error, so I have to qmake then I get 22 errors with "gl* (glVertexAttribPointer etc.) was not declared" if I build or "gst/interfaces/photography.h: No such file or directory" if I rebuild If I delete everything, unzip it again, open QtCreator manually and load the same .pro file via menu, it buils just fine, but if I change it into a format to be able to generate a Debian package easily later on I get "No rule to make target 'texture.qrc'" Could anybody help me with this please? I seem not to be sufficiently familiar with qmake. Oh - if I try to run it using MADDE (which again works fine with other programs), I get: Code:
Files to deploy: /scratchbox/users/maemo/home/maemo/OwnProjects/AWESOME/DistanceQT-build/DistanceQT. If I build another modification compilation works, but I get a Code:
/scratchbox/tools/bin/misc_runner: /targets/links/scratchbox.config: No such file or directory Btw: I use Qt 4.6.2 instead of 4.5. If there are any cleaned up versions, fixes for my problems, updates etc please let me know. Best regards, Dorfmeister |
Re: AR applications on N900 (OpenCV)
Hi,
I solved the issues (thanks, Klen) and now try to include OpenCV support. I installed the packages recommended by Klen and tried a test pipeline using gst-launch (based on http://vimeo.com/6866036): Code:
gst-launch v4l2camsrc device=/dev/video0 ! video/x-raw-yuv,width=480,height=272 ! videorate ! capsfilter caps="video/x-raw-yuv,width=480,height=272,framerate=(fraction)12/1" ! queue ! ffmpegcolorspace ! faceblur ! ffmpegcolorspace ! xvimagesink Code:
WARNING: erroneus pipeline: no element "faceblur" Thanks in advance. EDIT: There are simply no OpenCV-GStreamer plugins available according to Daniil (thanks!), which is the reason why the pipeline doesn't work. I wrote a short example for using OpenCV myself, see here: http://discussion.forum.nokia.com/fo...-in-Qt-example Best regards, Dorfmeister |
Re: AR applications on N900 (OpenCV)
Quote:
The way to do this: 1.) create an IplImage object of the right size and format. HTML Code:
IplImage *frame; HTML Code:
cvSetData(tracker->frame ,data,CameraN900::buffer_width*3); HTML Code:
cvResize(tracker->frame,tracker->frameBGR); The other way to go is to compleatly skip the QT and work with OpenCV only. You have all the functions that you need for displaying the and capturing the video stream. And the run fast but did not compare them with this approach. I guess if you don't need QT integration this is the way to go. Sorry for the late reply. I think I was not subscribed to this thread. I hope this helps. Cheers, Klen |
Re: AR applications on N900 (OpenCV)
There are OpenCV-GStreamer plugins in the repository, Gst-Opencv
http://maemo.org/packages/view/gst-opencv/ |
All times are GMT. The time now is 16:34. |
vBulletin® Version 3.8.8