1 2 3 Previous Next 60 Replies Latest reply on Nov 4, 2014 8:38 AM by Paridhi_Agrawal

    OpenCV projects ?


      The linux SD image comes with openCV libraries, does this mean i can hook up a webcam and use it? and since the Galileo is X86, does that mean my openCV projects should work on the Galileo?

      I am wondering if any one has got something like this working, it would be nice to have my projects mobile!

        • 1. Re: OpenCV projects ?
          Clayton Hofrock

          I have connected my webcam to my Galileo, but I am not smart enough to figure out how to get it to work. I have never played with OpenCV.


          I do believe the main purpose for the Host USB connection was to connect a webcam. At least that is the rumors I have heard. I have not seen a web cam in use with a Galileo yet.


          If you could point me to some OpenCV information, I could give it a test.

          1 of 1 people found this helpful
          • 2. Re: OpenCV projects ?

            Yes, you can do that. After you attach a webcam, the linux will provide a /dev/video-Device and OpenCV will work without any problems (if your cam supported on linux in general).


            But there are some caveats:

            - The current SD image has a bug, the Python-OpenCV module does not work. But it will, if you build a LSB linux image as described here: Intel Galileo - Building Linux Image - Malinov Family Web Presence

            - If you use C/C++, then you must compile your projects on a host computer. Existing binaries may not work. (Or install the LSB linux image as mentioned above, then you get build tools on the image too)

            - The Quark SoC has a decent performance but is too slow for real video processing. I wrote a Python script that does face recognition using a webcam and OpenCV. The frame rate after processing is around 1 fps with a matrix size of 180x150. (*)


            (*) For a comparison: The Rasperry Pi B does the same job with a frame rate of around 1,3 fps.

            • 3. Re: OpenCV projects ?

              Now, chofrock has seen a Galileo with a webcam in action gal_cam.jpg

              • 4. Re: OpenCV projects ?

                how did you attach the cam? was there a converter for the micro USB?


                I do all my opencv projects in C++, what kind of cross compilers do i need? or do i even need any? i tried to run a simple program, but it says binary cannot be executed.


                btw thats an interesting setup there, whats going on ??

                • 5. Re: OpenCV projects ?

                  there are lots of material on the topic of OpenCV, see Books | OpenCV for list of books, i personally suggest the O'Riely book, it covers image processing concepts as well as the libraries, which makes for a better understanding of your program, they also released a C++ version this month, which i will definitely be getting.


                  there is also lots of tutorials on the openCV website, with code ready to compile. OpenCV also comes with really cool examples when you compile it.

                  • 6. Re: OpenCV projects ?

                    To attach the cam, you need an adapter USB Micro A male to USB A female. Listen carefully, you need Micro *A*, not the common Micro B. I looked for an adapter Micro A to anything half a day, finally found a Micro A male to A male adapter cable and now I use this cable with a female-female adapter to connect the cam. (This is visible on the image left to the center)

                    BTW: You can also attach an USB hub to the adapter instead of directly connecting the cam to the Galileo, giving you additional usb ports But then the USB hub should have its own power source.


                    For cross compiling, you can use the build chain setup as described by the Intel Galileo BSP Build Guide: Intel® Quark BSP Build Guide

                    (I never did cross compiling of my own programs for the Galileo, so I can't really assist here.)


                    The pic shows a fun appliance. I use a python script to do face recognition with the webcam, if OpenCV found a face, the script controls a servo (left to the wifi antenna) to "shake" something on the front (not visible). I will release the script next week, if nothing bad happens. 

                    • 7. Re: OpenCV projects ?

                      that is such a subtle difference! The Micro B plug seem to fit the A slot quiet well tho, unfortunately i placed an order for Micro B adapter already looking at their schematic, their differences are just the shape of the plug, if it fits may as well work too . a usb adapter should have been one of the many useless adapters i got in the box ....


                      how did you port your openCV code? i am thinking of compiling on my desktop than a stright forward port should work, since they are all x86 ?

                      • 8. Re: OpenCV projects ?

                        The pin layout is identical, unfortunatly the physical construction differs completly.


                        I used OpenCV with Python and Java only, so I never had to deal with porting code between different architectures or operating systems.


                        About the compiling and "they are all x86", there are two issues:

                        The Quark SoC is - exaggerated - some kind of milkshake of the i486 and i586 architecture. Some configure scripts may fail to prepare the build as needed, even if the build chain for cross compiling is set up correctly. They may - I guess - create an i586-only binary instead of sticking to i486 functionality where necessary. An example is ffmpeg. It is part of the (LSB) Linux image, it was cross compiled on a host computer without problems, but the binary fails on the Galileo because of "Illegal instructions" (means usually "unknown/misused cpu op codes"). I got a partly working ffmpeg after compiling it on the Galileo itself.

                        Another problem, and that is the main issue with existing binaries not working - the Linux images by Intel uses the uglibc, while most (desktop) linuxes use eglibc as base library. The later can be solved by using the LSB Linux image.


                        Edit: Intel has a word filter in the forum...

                        • 9. Re: OpenCV projects ?
                          Clayton Hofrock

                          I have heard, that it is best when compiling for the Galileo to use a switch that forces it to compile for a 486 processor. I think this is where the Galileo will get the best performance.


                          The Quark is not a exactly a 486 processor, nor is it exactly a 586 processor. It is different.


                          BTW, finding a way to bypass the swear filter on a forum is usually not a good idea.  

                          • 10. Re: OpenCV projects ?

                            Hi Alexander


                            where did you find the Micro A adapter cable?

                            I can't find any ....




                            • 11. Re: OpenCV projects ?

                              I got mine here:



                              One producer of these cables is:

                              Delock Produkte Kabel


                              Also, a Micro-B plug could work, but might fit too loose, so be careful.

                              • 12. Re: OpenCV projects ?

                                Thanks for the info


                                I'll try a microB adapter first (some on the way. At < 1€ each it is not much of a risk).


                                Next I need to rebuild the LSB Linux image anyway ...

                                • 13. Re: OpenCV projects ?

                                  hi, i pluged a webcam,but there's no /dev/video, why?

                                  the webcam can be detected under ubuntu 12.04


                                  Message was edited by: water mirror

                                  • 14. Re: OpenCV projects ?

                                    try "modprobe uvcvideo"

                                    1 2 3 Previous Next