Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
3,523 Views

OpenCV projects ?

Jump to solution

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!

0 Kudos

Accepted Solutions
Highlighted
New Contributor II
47 Views

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: http://www.malinov.com/Home/sergey-s-blog/intelgalileo-buildinglinuximage 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.

View solution in original post

0 Kudos
60 Replies
Highlighted
47 Views

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.

Highlighted
New Contributor II
48 Views

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: http://www.malinov.com/Home/sergey-s-blog/intelgalileo-buildinglinuximage 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.

View solution in original post

0 Kudos
Highlighted
New Contributor II
47 Views

Now, chofrock has seen a Galileo with a webcam in action

Highlighted
Novice
47 Views

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 ??

0 Kudos
Highlighted
Novice
47 Views

there are lots of material on the topic of OpenCV, see http://opencv.org/books.html 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.

Highlighted
New Contributor II
47 Views

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:

(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.

0 Kudos
Highlighted
Novice
47 Views

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 ?

0 Kudos
Highlighted
New Contributor II
47 Views

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...

0 Kudos
Highlighted
47 Views

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.

0 Kudos
Highlighted
New Contributor I
47 Views

Hi Alexander

where did you find the Micro A adapter cable?

I can't find any ....

Thx

Liam

0 Kudos
Highlighted
New Contributor II
47 Views
0 Kudos
Highlighted
New Contributor I
47 Views

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 ...

0 Kudos
Highlighted
Novice
47 Views

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

Highlighted
47 Views

try "modprobe uvcvideo"

0 Kudos
Highlighted
Honored Contributor II
47 Views

IIRC that's not enough. You'd need to also load two V4L drivers, at least that was the case for my webcam (some Logitec one)

So if after "modprobe uvcvideo" you don't have the /dev/video device, try also "modprobe v4l2-common && modprobe v4l2-int-device".

0 Kudos
Highlighted
47 Views

FYI: the slot car race demo shown at http://www.youtube.com/watch?v=efgMQR2w64Q Intel® Galileo Devkit for IoT - YouTube runs video processing with OpenCV on webcam input. Depending on the complexity of the image processing you can get like 4 fps

 

0 Kudos
Highlighted
Novice
47 Views

Could you share your eglibc-based image? And one more question: how can you debug opencv program without X server on the board? Just pass a picture to the python script and analyze result picture?

Highlighted
47 Views

you can find an image on https://software.intel.com/en-us/iotdevkit Intel® IOT Developer Kit. If you want to Yocto build a more recent one you can do from http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-iot-devkit/ meta-intel-iot-devkit - Intel IoT Developer Kit metadata branch devkit-daisy-multilibc

0 Kudos
Highlighted
Novice
47 Views

Just to be sure: Is Debian Live USB Image featuring the Yocto ADT (4.2GB zipped) or http://iotdk.intel.com/src/iotdk_src_140220.tar.gz SD card image source (4.3GB tar.gz) eglibc-based?

0 Kudos