1 of 1 people found this helpful
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.
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.
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 ??
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.
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.
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 ?
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...
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.
where did you find the Micro A adapter cable?
I can't find any ....
I got mine here:
One producer of these cables is:
Also, a Micro-B plug could work, but might fit too loose, so be careful.
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 ...
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
try "modprobe uvcvideo"