Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
1,575 Views

Can anyboby tell me a detailed step by step guide to connect webcam to intel galileo gen 2?

I want to interface a webcam to intel galileo. But I am having trouble connecting it . I found some useful posts but I was not able to understand properly. Please can atell me a detailed step-by -step guide to interface webcam . Thanks for the help.

0 Kudos
16 Replies
Highlighted
Valued Contributor I
17 Views

If you have a uvc webcam, just plug it into the host usb socket, open a terminal, ssh to board and see if board sees it by doing a listing of /dev, should see a listing for video0. If not, do "modprobe uvcvideo", and it should appear. After that, there should be listing for video0 in /dev and will be available.

rgb

Highlighted
Beginner
17 Views

I have Microsoft LifeCam VX-1000 which is not a uvc webcam. So what should I do now . I tried the commands before there is no video or video0 listing in /dev.

0 Kudos
Highlighted
17 Views

I did a quick online search - looks like the camera should work with uvc as well. I'd recommend to search online for something like "Linux VX-1000"

0 Kudos
Highlighted
Beginner
17 Views

I used a logitech webcam and i was able to finally get the video0 listing inside the ./dev. But now when run it I get the following message.

VIDIOC_QUERYMENU: Invalid argument

VIDIOC_QUERYMENU: Invalid argument

VIDIOC_QUERYMENU: Invalid argument

VIDIOC_QUERYMENU: Invalid argument

VIDIOC_QUERYMENU: Invalid argument

VIDIOC_QUERYMENU: Invalid argument

VIDIOC_QUERYMENU: Invalid argument

 

What is the solution for this . Thank you intel_adminrgbmhahn

0 Kudos
Highlighted
Beginner
17 Views

This is my source code

# include "opencv2/imgproc/imgproc.hpp"

# include "opencv2/core/core.hpp"

# include "opencv2/highgui/highgui.hpp"

# include

int main()

{

cv::VideoCapture stream(-1); // open video stream from any video source

int count=0;

while( !stream.isOpened() && count < 1000) // if valid stream opened

{

cv::Mat inFrame;

if ( ! stream.read(inFrame) ) // try to read a frame

break;

inFrame = cv::imread("donald_duck_in.bmp");

cv::Mat outFrame = inFrame.clone();

cv::GaussianBlur( inFrame, outFrame, cv::Size(3, 3), 0, 0 );

count++;

}

return 0;

}

intel_admin AlexT_IntelDaniel05rgbmhahn 

0 Kudos
Highlighted
17 Views

not sure whether it's relevant:

  • while( !stream.isOpened() I guess you should drop the "!"?
  • you might have to add waitKey
  • you might have to set the geometry (some cameras offer different geometries)
0 Kudos
Highlighted
Beginner
17 Views

I tried that but it is giving same error but after that it is asking select timeout . It switches on the camera but nothing happens.

0 Kudos
Highlighted
17 Views

well, the thing is: as long as !stream.isOpened() holds you can't access it. I.E. if stream.isOpened you should throw an error or so.

btw: running C++ you should be able to just read frames like

cv::Mat frame;

stream >> frame;

However, this all isn't related to "VIDIOC_QUERYMENU: Invalid argument"

I guess, the "open for any video source" -> -1 isn't quite supported. Can you try specifying the number? (0, 1, ...)?

0 Kudos
Highlighted
Valued Contributor I
17 Views

I'm at work so can't check right now, but if I remember opencv use video for linux v4l.

Can you run # v4l2-ctl --all to see if the system is recognizing the camera and what parameters it is reporting?

thanks

rgb

0 Kudos
Highlighted
Valued Contributor I
17 Views

If it isn't a real uvc, I would suggest you buy one. They are cheap and almost anything you buy will work. I have a super cheap, no-name clone, and it works, at least with low resolution. I also spent a few days trying to get a Kodak webcam to work, and only manged to make the system not work with a uvc camera.

rgb

0 Kudos
Highlighted
Valued Contributor I
17 Views

Any luck?

Don't know if it will do any good, but something else you can try, if you are using AlexT's version of Yocto, is to install fswebcam from his repository to see if the problem is with opencv

see AlexT_Intel for instructions to set up

then

opkg update

opkg install fswebcam

fswebcam test.jpg

works great for me and I can run from C++ or Python to get photos with a really cheap webcam

regards

rgb

0 Kudos
Highlighted
Beginner
17 Views

Hii sorry for the late reply . I tried the thing you told me , I got the following

root@quark0169f7:~# v4l2-ctl --all

Driver Info (not using libv4l2):

Driver name : uvcvideo

Card type : UVC Camera (046d:081b)

Bus info : usb-0000:00:14.3-1

Driver version: 3.8.7

Capabilities : 0x84000001

Video Capture

Streaming

Device Capabilities

Device Caps : 0x04000001

Video Capture

Streaming

Priority: 2

Video input : 0 (Camera 1: ok)

Format Video Capture:

Width/Height : 640/480

Pixel Format : 'YUYV'

Field : None

Bytes per Line: 1280

Size Image : 614400

Colorspace : SRGB

Crop Capability Video Capture:

Bounds : Left 0, Top 0, Width 640, Height 480

Default : Left 0, Top 0, Width 640, Height 480

Pixel Aspect: 1/1

Streaming Parameters Video Capture:

Capabilities : timeperframe

Frames per second: 30.000 (30/1)

Read buffers : 0

brightness (int) : min=0 max=255 step=1 default=128 value=128

contrast (int) : min=0 max=255 step=1 default=32 value=32

saturation (int) : min=0 max=255 step=1 default=32 value=32

white_balance_temperature_auto (bool) : default=1 value=1

gain (int) : min=0 max=255 step=1 default=64 value=64

power_line_frequency (menu) : min=0 max=2 default=2 value=2

white_balance_temperature (int) : min=0 max=10000 step=10 default=4000 value=4000 flags=inactive

sharpness (int) : min=0 max=255 step=1 default=24 value=24

backlight_compensation (int) : min=0 max=1 step=1 default=0 value=0

exposure_auto (menu) : min=0 max=3 default=3 value=3

exposure_absolute (int) : min=1 max=10000 step=1 default=166 value=166 flags=inactive

exposure_auto_priority (bool) : default=0 value=1

root@quark0169f7:~# opkg update

Downloading http://iotdk.intel.com/repos/1.1/iotdk/Packages http://iotdk.intel.com/repos/1.1/iotdk/Packages.

Updated list of available packages in /var/lib/opkg/iotdk.

Downloading http://iotdk.intel.com/repos/1.1/intelgalactic/Packages http://iotdk.intel.com/repos/1.1/intelgalactic/Packages.

Updated list of available packages in /var/lib/opkg/mraa-upm.

root@quark0169f7:~# opkg install fswebcam

Unknown package 'fswebcam'.

Collected errors:

* opkg_install_cmd: Cannot install package fswebcam.

 

So it is uvc camera, but fswebcam thing is not working. I am using Yocto 3.8.7 . How should I proceed now ?

0 Kudos
Highlighted
Beginner
17 Views

I installed AlexT_Intel instructions to set up ,

But while installing the package for fswebcam I am getting

checking for gdImageCreateTrueColor in -lgd... no

configure: error: GD graphics library not found

 

I downloaded the package from https://bitbucket.org/libgd/gd-libgd/issues?status=new&status=open libgd / gd-libgd / issues — Bitbucket but I am not able to install it. cmake , make command does not work. Can you help me how to proceed further.

 

Thank you for being so patient.
0 Kudos
Highlighted
Valued Contributor I
17 Views

Hi Ank

From your line

Updated list of available packages in /var/lib/opkg/iotdk.

It looks like you are using the XDK Iot version of Yocto, which is not compatible with AlexT's repository.

If this is the case, then remove links to AlexT's repository. Alex said is working on a version of fswebcam for IoT, but hasn't done so yet.

 

Have you tried using Video4Linux to take a picture?

I don't have the command here, will look for it later.

rgb

0 Kudos
Highlighted
Valued Contributor I
17 Views

Hi Ank

There is a utility v4l2grab that should allow you test your camera and take a picture.

Instructions are at: https://github.com/twam/v4l2grab/wiki/Installation https://github.com/twam/v4l2grab/wiki/Installation

  1. Get the file

git clone https://github.com/twam/v4l2grab.git https://github.com/twam/v4l2grab.git

2. CD into into directory

 

cd v4l2grab

3. Generate the autotools files

 

./autogen.sh

 

4. Run configure

 

./configure

 

5. Run make

 

make

6. Run make install

 

sudo make instal

7. make sure you have /dev/video, if not modprobe uvcvideo

8. take a picture v4l2grab -o test.jpg 

It just worked for me on the XDK IoT version of Linux

regards

rick

0 Kudos
Highlighted
Beginner
17 Views

Hello Ank,

I have a solution.

Here is a step-by-step tutorial for interfacing the Intel Galileo with a USB Webcam:

http://www.instructables.com/id/Streaming-USB-Webcam-with-the-Intel-Galileo-Gen-2/ Streaming USB Webcam with the Intel Galileo Gen 2

Best,

Andrew Nava-Juarez

0 Kudos