openFrameworks-RaspberryPi / openFrameworks

This repo has migrated into the openFramworks core! Please go to http://github.com/openFrameworks/openFrameworks for the latest!
http://github.com/openFrameworks/openFrameworks
Other
104 stars 11 forks source link

Update Core Addon : ofxOpenCv #18

Closed bakercp closed 11 years ago

bakercp commented 11 years ago

Need static libs for linuxarm6vl http://raspberrypi.stackexchange.com/questions/409/can-i-use-opencv http://eduardofv.com/read_post/185-Installing-OpenCV-on-the-Raspberry-Pi http://eduardofv.com/read_post/192-OpenCV-on-the-Raspberry-Pi-with-Arch-Linux-ARM etc

If you take this on, please clearly document your build procedure and post it on this wiki for future reference.

jvcleave commented 11 years ago

Is this something we should just use the ones available from apt-get?

jvcleave commented 11 years ago

there are libs in /addons/ofxOpenCv/libs/opencv/lib/linuxarmv6l - know where these came from?

danzeeeman commented 11 years ago

You can check the git blame? On Nov 25, 2012 5:51 PM, "Jason Van Cleave" notifications@github.com wrote:

there are lib in /addons/ofxOpenCv/libs/opencv/lib/linuxarmv6l - know where these came from?

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/18#issuecomment-10699902.

bakercp commented 11 years ago

btw, those libs are gone now and were dummies put there to test the new makefile's libsorder.make support.

Right now, this is pending a good way to allow addons to optionally link to native libs. This might happen via the addons.make file, or another file.

jvcleave commented 11 years ago

Good news! If you run sudo apt-get install libopencv-dev it will install all the necessary opencv static libs into /usr/lib with the exception of libopencv_haartraining_engine.a

you can then

mkdir /home/pi/openFrameworks/addons/ofxOpenCv/libs/opencv/lib/linuxarmv6l
cd /usr/lib/
cp libopencv*.a /home/pi/openFrameworks/addons/ofxOpenCv/libs/opencv/lib/linuxarmv6l/

I then copied libsorder.make from addons/ofxOpenCv/libs/opencv/lib/linux64 to addons/ofxOpenCvopencv/lib/linuxarmv6l and removed the line libopencv_haartraining_engine.a

Simple test http://i.imgur.com/f99wV.jpg Thresholding http://i.imgur.com/llG3U.jpg Random Threshold (about 30 fps) https://vimeo.com/55077432

Contourfinder works: http://i.imgur.com/A0eE7.jpg

https://gist.github.com/4231042

bakercp commented 11 years ago

Very nice! Given that it is already there, it seems that compiling for the platform from scratch isn't impossible. Definitely a job for someone with distcc running though. Are we currently using the haar training engine at all? I know we're using face recognition? If not, it seems like we should figure out a solution for addons that allows us to link to static or shared system libs without copying. It's still on the todo list ...

jvcleave commented 11 years ago

yeah - I would have just linked it but I am waiting for the new Make system to settle to figure out where the best place is to do it.

I am not sure if ofxCvHaarFinder.h requires libopencv_haartraining_engine.a . I am going to run a few common things through the addon to see if anything is broken

arturoc commented 11 years ago

yes i think we should solve the inclusion of pkg-config libraries and headers for addons, that way we can use this without copying the libraries.

there's actually several opencv packages:

libopencv-calib3d2.3 libopencv-features2d2.3 libopencv-highgui-dev libopencv-objdetect2.3 libopencv-calib3d-dev libopencv-features2d-dev libopencv-imgproc2.3 libopencv-objdetect-dev libopencv-contrib2.3 libopencv-flann2.3 libopencv-imgproc-dev libopencv-video2.3 libopencv-contrib-dev libopencv-flann-dev libopencv-legacy2.3 libopencv-video-dev libopencv-core2.3 libopencv-gpu2.3 libopencv-legacy-dev
libopencv-core-dev libopencv-gpu-dev libopencv-ml2.3
libopencv-dev libopencv-highgui2.3 libopencv-ml-dev

surely haartraining is in on of those

jvcleave commented 11 years ago

it looks like I have all of those packages installed :/

pi@raspberrypi ~/openFrameworks/examples $ dpkg --get-selections | grep cv
gpicview                    install
libcv-dev                   install
libcvaux-dev                    install
libopencv-calib3d-dev               install
libopencv-calib3d2.3                install
libopencv-contrib-dev               install
libopencv-contrib2.3                install
libopencv-core-dev              install
libopencv-core2.3               install
libopencv-dev                   install
libopencv-features2d-dev            install
libopencv-features2d2.3             install
libopencv-flann-dev             install
libopencv-flann2.3              install
libopencv-gpu-dev               install
libopencv-gpu2.3                install
libopencv-highgui-dev               install
libopencv-highgui2.3                install
libopencv-imgproc-dev               install
libopencv-imgproc2.3                install
libopencv-legacy-dev                install
libopencv-legacy2.3             install
libopencv-ml-dev                install
libopencv-ml2.3                 install
libopencv-objdetect-dev             install
libopencv-objdetect2.3              install
libopencv-video-dev             install
libopencv-video2.3              install
jvcleave commented 11 years ago

It took 141 seconds but surprisingly ofxCvHaarFinder still works without the training engine lib.

findHaarObjects.jpg http://i.imgur.com/VCYJT.jpg

edit: got it to 65 seconds by doing it in setup (was previously doing it with a delay in update)

bakercp commented 11 years ago

Very cool. I'm thinking the haar training engine is for creating your own haar training data sets (i.e. creating the frontal, profile, etc xml data).

Meach commented 11 years ago

I haven't checked ofxCvHaarFinder but I confirm that with jvcleave instruction, the example works on the pandaboard as well. Great!

jvcleave commented 11 years ago

This line in config.make will allow you to compile without copying the libs PROJECT_LDFLAGS=-Wl,-rpath=./libs $(shell pkg-config opencv --libs 2> /dev/null)

bakercp commented 11 years ago

For the moment (until we figure out a smart addons system that can pull from system libs), I copied the static libs into the repo. All examples are now working out of the box (although the haar finder example still takes a while!).

Closed with a85f9bc1b5bc48454777f859801adffa421ec16b

kalwalt commented 11 years ago

hi @bakercp @arturoc and all ,the example ofxOpenCv in PandaboardES build succesfully but in Liveo video mode i have only a black window. I'm using the develop-raspberrypi branch. i will try disabling some ofxopencv draw to see if it is a memory issue.

kalwalt commented 11 years ago

@bakercp @arturoc we can close this issue. i tested ofxopenCV with latest develop-raspberrypi and it's fine . Also i have linuxarmv7l libs here: https://github.com/kalwalt/openFrameworks/tree/feature-openCv-linuxarmv7l i'm going to open a pull request for this.

bakercp commented 11 years ago

done!