Webcam input problem with OpenCV

Hi.
I'm working for my project about image processing with opencv on
BeagleBoard.
I installed angstrom image from online build on the board, and then
set some packages needed
for working opencv with opkg install.
I connected webcam(Quickcam 3500 compliant with UVC) on the board, and
wrote simple code
for showing image from webcam on the monitor.
But when I excuted the code, I saw the error message like this.

Camera decode error (-1): Corrupt JPEG data: premature end of data
segment

Program seems to work. But there's no image output on the LCD monitor.
Please tell me what I have to do to solve the problem.

Hi.
I'm working for my project about image processing with opencv on
BeagleBoard.
I installed angstrom image from online build on the board, and then
set some packages needed
for working opencv with opkg install.
I connected webcam(Quickcam 3500 compliant with UVC) on the board, and
wrote simple code
for showing image from webcam on the monitor.
But when I excuted the code, I saw the error message like this.

Camera decode error (-1): Corrupt JPEG data: premature end of data
segment

Program seems to work. But there's no image output on the LCD monitor.
Please tell me what I have to do to solve the problem.

Does it works on your desktop?
If not, then it is probably the problem of UVC driver or OpenCV.

Regards,
Andrey.

Thank you for the answer.
I also guess it should be the matter of between Angstrom and OpenCV.
Because when I tried it with my colleague' s cam(for GSCPA), it didn't
work either.
But I downloaded OpenCV with opkg install, they are just compiled
library and header files,
not source code. I believed it should work in all cases :frowning:
Then, do I have to compile OpenCV source for Angstrom? If so, is there
anything to modify in the source?

Well, you actually did not answer whether it works on the desktop (PC
or notebook) or not.
If it works, then the problem is specific for BB or Angstrom.
In any case I would suggest to try to split one problem in two: a)
figure out whether your camera is properly supported by UVC driver and
b) whether OpenCV can deal with it. To achieve this you can first try
other program (probably starting on PC) like for example luvcview [1],
ekiga, skype or whatever else program which can capture image from the
camera. In the same time, if you have other camera which is known to
work, you can try it with your OpenCV program. If everything works on
your desktop computer, then you can try the same experiments on BB. I
think it will give you better understanding of what is failing.

[1] http://www.quickcamteam.net/software/linux/v4l2-software/luvcview/

I agree with Andrey,
You should verify your webcams work with the BB before complicating
things with openCV interface. If you are using a desktop image there
is mplayer and possibly ekiga installed. launching mplayer at a
terminal
prompt on the GUI will offer all sorts of information.
Use lsusb and lsmod to see if your camera drivers are loading.
Try these lines with Desktop fs on BB:
mplayer tv:// -tv driver=v4l2:width=320:height=240:noaudio:device=/dev/
video0 -fps 15 -vo xv
OR
DISPLAY=:0.0 mplayer -tv width=320:height=240:driver=v4l2 -fps 15 tv://

note: there may be a different driver= arg for UVC cameras.
I haven't used a console image webcam yet.

Don Lewis

I am implementing the face detection with from the live camera feed using

logitech C270 webcam
Beaglebone Black with 4 GB eMMC
Debian Wheezy

I am able to get the captured faces when used from x86 pc

but on the board I am getting these errors

`

root@beaglebone:~/opencv_python# ./face_save_live_feed.py haarcascade_frontalface_default.xml
Corrupt JPEG data: 2 extraneous bytes before marker 0xd3
Corrupt JPEG data: 1 extraneous bytes before marker 0xd2
Corrupt JPEG data: 1 extraneous bytes before marker 0xd3
Corrupt JPEG data: 1 extraneous bytes before marker 0xd1
Corrupt JPEG data: 1 extraneous bytes before marker 0xd2
Corrupt JPEG data: 1 extraneous bytes before marker 0xd4
Corrupt JPEG data: 6 extraneous bytes before marker 0xd6
Corrupt JPEG data: 1 extraneous bytes before marker 0xd6
Corrupt JPEG data: 4 extraneous bytes before marker 0xd7
Corrupt JPEG data: 5 extraneous bytes before marker 0xd5
Corrupt JPEG data: 1 extraneous bytes before marker 0xd1
Corrupt JPEG data: 1 extraneous bytes before marker 0xd3
Corrupt JPEG data: 2 extraneous bytes before marker 0xd4
Corrupt JPEG data: 3 extraneous bytes before marker 0xd7
^CTraceback (most recent call last):
File “./face_save_live_feed.py”, line 43, in
flags=cv2.CASCADE_SCALE_IMAGE
KeyboardInterrupt

`

Having said that I am new to Image Processing and I don’t know what exactly is happening
So please do tell me what exactly is meant by these errors