Can onion omega support opencv?
-
@Boken-Lin Also, I get to 26% on my cross-compilation, and then get this:
/node/opencv-2.4.11/modules/highgui/src/cap_xine.cpp:58:18: fatal error: xine.h: No such file or directory compilation terminated. make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_xine.cpp.o] Error 1 make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2 make: *** [all] Error 2
Still trying to find the package responsible for providing that thing on whatever version of ubuntu I ended up using in borromeotlhs/docker-onion-omega-nodejs:v1 (which I'm now utilizing as it had a working cross-compilation toolchain )
-
@Theodore-Borromeo Yeah, As soon as our PS2 eye arrives I will give it a try to see what the issue is... It really doesn't make sense because it works with a few other webcams I've tried out. Perhaps the driver required for the eyes are not installed. Anyways, we'll play around with that and see if anything can be done.
Good luck with compiling OpenCV! I know there are a few people who are interested in using it in their projects.
-
@Boken-Lin OK, so I've gotten up to ~25% in the compilation phase. I am missing some stuff, so I need some help finding out which packages provide (and how I have to make it visible to the openWRT toolchain) the following report for found and missing header files/libs/apps on my cross-compile ubuntu dev container:
stuff that is found:
-- checking for module 'gtk+-2.0'
-- found gtk+-2.0, version 2.24.23
-- checking for module 'gthread-2.0'
-- found gthread-2.0, version 2.40.2
-- checking for module 'gstreamer-base-0.10'
-- found gstreamer-base-0.10, version 0.10.36
-- checking for module 'gstreamer-video-0.10'
-- found gstreamer-video-0.10, version 0.10.36
-- checking for module 'gstreamer-app-0.10'
-- found gstreamer-app-0.10, version 0.10.36
-- checking for module 'gstreamer-riff-0.10'
-- found gstreamer-riff-0.10, version 0.10.36
-- checking for module 'gstreamer-pbutils-0.10'
-- found gstreamer-pbutils-0.10, version 0.10.36
-- checking for module 'libunicap'
-- found libunicap, version 0.9.12
-- checking for module 'libdc1394-2'
-- found libdc1394-2, version 2.2.1
-- checking for module 'libv4l1'
-- found libv4l1, version 1.0.1
-- checking for module 'libv4l2'
-- found libv4l2, version 1.0.1
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- checking for module 'libavcodec'
-- found libavcodec, version 54.35.0
-- checking for module 'libavformat'
-- found libavformat, version 54.20.4
-- checking for module 'libavutil'
-- found libavutil, version 52.3.0
-- checking for module 'libswscale'
-- found libswscale, version 2.1.1Things the toolchain can't find:
-- checking for module 'gstreamer-base-1.0'
-- package 'gstreamer-base-1.0' not found
-- checking for module 'gstreamer-video-1.0'
-- package 'gstreamer-video-1.0' not found
-- checking for module 'gstreamer-app-1.0'
-- package 'gstreamer-app-1.0' not found
-- checking for module 'gstreamer-riff-1.0'
-- package 'gstreamer-riff-1.0' not found
-- checking for module 'gstreamer-pbutils-1.0'
-- package 'gstreamer-pbutils-1.0' not found
-- checking for module 'libucil'
-- package 'libucil' not found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - not found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.6", minimum required is "2.0")I know that this is not found, but I also know how to fix once I get it compiled W/O python for now:
-- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version "2.7")
-- Cannot probe for Python/Numpy support (because we are cross-compiling OpenCV)
-- If you want to enable Python/Numpy support, set the following variables:
-- PYTHON_INCLUDE_PATH
-- PYTHON_LIBRARIES
-- PYTHON_NUMPY_INCLUDE_DIRAny clues as to the packages available on latest LTS ubuntu that provide these would probably greatly speed up my successful compilation, as I've clearly got the right toolchain and makefiles, just missing specific bits and pieces
-
@Theodore-Borromeo Seems like you are just missing the header files. Did you install
<package name>-dev
packages withapt-get
? These are the packages that's supposed to provide the header files that you will need to do cross-compilation.
-
@Boken-Lin I did, one of the issues was that I had to symlink videodev.h to videodev2.h. Besides that, it seems that there would need to be a lot more research to enable a lot of the errors emanating from highgui at this point. What I'm trying now is to just compile opencv with none of the gtk/qt stuff, and only enable ffmpeg. That should be barebones enough as a proof of concept. I could then add in python support, maybe (C examples are in there now).
But yeah, apparently a lot of stuff happened in 14.04 that caused a lot of incompatibilities for opencv. I may have to downgrade to 12.02 for the docker-onion-omega-nodejs image, such that when I then extend from it, I can easily utilize the cross compile toolchain + have a stronger guarantee that packages like ffmpeg won't have been deprecated in favor or libav and other such annoyances.
-
@Boken-Lin Seems that I can't get my cross compile build toolchain to 'see' some dev files, libs and headers. Just spent the last week figuring out how to forward the x11 server from a container onto a host machine just to utilize cmake gui! Now that I got that up for an easier way to create the necessary cmake build files, I'm failing sooner in the build process!
I think I may need to install the necessary dev headers and such then compile the open wrt toolchain. Have you ever seen a need to do that in your experience? I had thought that seeing PATH variables and such would be all that's needed, but I guess it makes sense that a cross compiler would need to know about headers before being compiled to then go on and cross compile, right?
-
@Theodore-Borromeo Hmmm, that's a good question. I'm not sure what the answer for that is. So you are saying that even after installing all the
dev
packages, the compiling environment is unable to locate the header files?Can you give me a list of libraries/packages you've installed? I can try to create a SDK after installing them. You can give that SDK a try to compile
opencv
.
-
Seems there is a bunch of already compiled binaries for opencv per the blog post @ http://mark4h.blogspot.com/2013/04/cross-compiling-opencv-for-openwrt.html
And then, there are folks who give a tutorial for making a simple app on mac os x, that would probably be similar using the cross-compile toolchain, @ http://blogs.wcode.org/2014/10/howto-install-build-and-use-opencv-macosx-10-10/
-
@Theodore-Borromeo Nice! Thanks for sharing Let's see what we can build with OpenCV.
-
Brief update, I was able to get a cmake build going, and built the opencv libs for the host system. That was all good, however, once I tried to do cross-compilation, I got the same "missing headers" nonsense.
Since it's been so long since I've taken a shot at this, it actually helped as I think I've found some possible solutions as per:
http://askubuntu.com/questions/583864/opencv-installationOf course, that solution may only be for a HOST (which I already have working @ v2.4.9 )
I may have to bite the bullet and just start all over again with the latest opencv just to see if they've moved passed it. However, MIPS cross compilation is a definite niche subject with only those folks doing things on OpenWRT even caring to explore this architecture! Still, OpenWRT is still pretty straightforward. I wonder if this could be made a feed if it compiles successfully?
-
OK, so this is what I got:
http://bit.ly/1O70tg7 - opencv ipk
http://bit.ly/1rAuvPa - test file ipk for opencvThis was built using the makefile from @Boken-Lin's original suggestion ( https://github.com/WRTnode/openwrt-packages/tree/master/libs/opencv ). I have yet to flash it and test it out, but I figured this being in here sooner rather than later would be good.
The next step, should npm be working, would be to get the nodejs opencv packages for opencv3.0 working, and then tying them into a web camera stream, right?