Beaglebone: Video Capture and Image Processing on Embedded Linux using OpenCV

Beaglebone: Video Capture and Image Processing on Embedded Linux using OpenCV


In this video I look at how you can get started with video capture and image processing on the Beaglebone. It is an introductory video that should give people who are new to this topic a starting point to work from. I look at three different distinct challenges:
- How do you capture video from a USB webcam under Linux
- How do you capture image frames from a USB webcam under Linux
- How do you use OpenCV to capture and image process frames so that you can build computer vision applications under Linux on the Beaglebone.

In this video I use a Logitech C920 and the Beaglebone Black. I would highly recommend both of these devices because of the processing power of the Beaglebone black and the high resolution capability of the C920. However, you should be able to adapt the code to any specific camera.

If you use this code or the content of the associated video in your research, please cite:

Molloy, D. [DerekMolloyDCU]. (2013, May, 25). Beaglebone: Video Capture and Image Processing on Embedded Linux using OpenCV [Video file]. Retrieved from http://www.youtube.com/watch?v=8QouvY...

Further information on the videos on this channel can be found at the website http://www.derekmolloy.ie/ including update blogs, source code, text guides and structured instruction. More detail on this specific video is available at:

http://derekmolloy.ie/beaglebone/beag...
Closed Caption:

In this video I am going to look at how you
can get started with video capture and image
processing on the Beaglebone. It is an introductory
video that should give people who are new
to this topic a starting point to work from.
I will look at three different distinct challenges:
How do you capture video from a USB webcam
under Linux
How do you capture image frames from a USB
webcam under Linux
How do you use OpenCV to capture and image
process frames so that you can build computer
vision applications under Linux on the Beaglebone.
I�m using a specific webcam from Logitech
that I would highly recommend because of its
high resolution capability, but you should
be able to adapt the code to your specific
camera.
The good news is that once you have the source
code examples it�s not too difficult. The
latest Angstrom distributions come with almost
everything you need, particularly pre-built
Video4Linux and OpenCV libraries and support.
What I have done here is aggregated the code
that you need and customised it for the camera
that I am using.
If you are building Angstrom, bitbaking Custom
Angstrom distributions to include these packages
or you are building FFMPEG from source you
might be interested in my new personal site:
derekmolloy.ie where I have separate posts
on each of these topics. Go to blog Beaglebone
for all my posts. The site is only new, so
I will be adding more content as I am working
on projects.
Okay, so for this video I am using the Beaglebone
Black, which is the latest Beaglebone that
is available. It is very powerful with a 1GHz
ARM A8 processor with 512MB of DDR3 RAM - a
great improvement for doing any type of image
processing, which is very resource intensive.
The other improvements over the Beaglebone
white are the on-board HDMI output and a 2GB
eMMC, which means that you get boot times
of around 10 seconds � you can still use
the sd slot for additional storage. The best
thing has to be the price � at $45 it is
significantly cheaper than any other device
out there for the specification and is very
good value for money.
For the camera I am using a Logitech C920,
which is a top of the range USB webcam. At
about $80 it�s not cheap, but it is a high
quality camera that has features that could
be really useful in embedded applications.
The big advantage of this device is that it
is capable of recording full-hd 1080p and
encoding it in real-time using the H264 compression
format. It has a very good quality Carl Zeiss
lens that has a 20 step autofocus. There is
good Linux support for this camera and I have
found it to be a straightforward device to
interface to. It is a USB 2.0 device and comes
with 6 feet of cable.
It has a high quality feel to the surround.
It�s not small, but I suppose it needs space
to store the video encoding circuitry. It
has a really useful socket that is formed
in metal on the bottom that would be great
for mounting the camera securely in robotics
applications. Overall, it feels like a solid
piece of equipment that would be capable of
taking some accidental abuse.
I have adapted and written some code for all
of the examples that are presented here in
this video. It is available at my github site:
github.com/derekmolloy/ and the repository
for the project is boneCV (with the CV meaning
computer vision). In this repository you will
find the C and C++ files for the projects
and scripts for building the code and for
using ffmpeg to enclose raw streamed H264
video in a H264 container.
In my setup you will notice I am powering
the camera using the barrel jack and a 5V
1Amp supply. I was getting I/O communication
errors at one stage with this camera and it
came down purely to the fact that powering
the Beaglebone black and camera through the
usb hub on my monitor was not providing enough
current. I tried it on my laptop and it worked
fine � so, just be careful that you are
getting enough power to the devices. As I
said the problem didn�t appear as a brownout
problem it just resulted in an IO error between
the camera and Beaglebone when I tried to
capture video.
Okay so first I am going to check that the
camera is working and download
the source code:
Uname �a
Lsusb
Cd /dev
Should see video0
Video4Linux or V4L is a video capture application
programming interface for Linux, supporting
many USB webcams, TV tuners, and other devices.
Video4Linux is closely integrated with the
Linux kernel and is very stable. We need to
check that Video for linux 2 is working with
our camera:
v4l2-ctl �h gives all of the options
v4l2-ctl �list-devices
To get all available information about our
camera we can use:
V4l2-ctl --all
Right the first point is capturing raw video
from the camera. This would be perfect if
you had a project that captured video when
a sensor is triggered. For example you could
connect a PIR (passive infra red) or an ultrasonic
sensor to one of the GPIOs and when motion
is detected the camera could be triggered
to record video. In this case I am recording
the video to the file system; however, it
would be possible with some coding to stream
the data to a socket where it could be transferred
over the Internet to a host computer that
was decoding the data stream.
The really nice thing about this program is
that I am going to use the H264 format that
is provided by the camera � this means that
the camera is doing almost all of the work
and that the load on the Beaglebone is very
light (well compared to software encoding
a video stream). The Beaglebone is effectively
responsible for taking the data from the USB
input and storing it in a file.
This program is called capture.c
and while I have modified it, it is not my
code. It is provided with the
video for linux 2 API and
you can get further information about it
at
the linuxtv.org website. I�ll just briefly
explain the minor changes that I have
made
for
this camera.

Video Length: 31:40
Uploaded By: Derek Molloy
View Count: 186,099

Related Software Products
Image for Linux
Image for Linux

Published By:
TeraByte, Inc.

Description:
Image for Linux is a reliable and easy to use drive image backup software package. Completely backup, restore, or copy your operating systems, including Windows or Linux. It supports any partition type, including FAT, FAT32, NTFS, EXT2/3, Reiser, and XFS. You can even easily create a self-booting disk to use for backups or recovery.


Related Videos
Tutorial: Real-Time Object Tracking Using OpenCV
Tutorial: Real-Time Object Tracking Using OpenCV

Found this video useful? $1 PayPal Donations are very much appreciated, thank you. https://www.paypal.com/cgi-bin/webscr... For tutoring rates and business inquiries, please email kyle.hounslow@gmail.com A simplified method for tracking objects in a webcam stream. In this video we use Visual Studio 2010 and OpenCV. DOWNLOAD SOURCE FILE HERE (right-click, Save link as): https://raw.githubusercontent.com/kyl... Tutorial made on a 64-bit ...
Video Length: 13:11
Uploaded By: Kyle Hounslow
View Count: 485,044

OpenCV (All Versions) - Easy Installation Guide and Sample Project (VS 2010 C++)
OpenCV (All Versions) - Easy Installation Guide and Sample Project (VS 2010 C++)

A step by step guide on installing OpenCV for Visual Studio 2010. Found this video useful? $1 PayPal Donations are very much appreciated, thank you. https://www.paypal.com/cgi-bin/webscr... OpenCV download: http://sourceforge.net/projects/openc... Some copy and pastables: Additional Include Directories: $(OPENCV_BUILD)\include Additional Library Directories: $(OPENCV_BUILD)\x86\vc10\lib **UPDATE** Version 2.4.6 Additional ...
Video Length: 07:49
Uploaded By: Kyle Hounslow
View Count: 287,968

OpenCV Tutorial: Real-Time Object Tracking Without Colour
OpenCV Tutorial: Real-Time Object Tracking Without Colour

Found this video useful? $1 PayPal Donations are very much appreciated, thank you. https://www.paypal.com/cgi-bin/webscr... For tutoring rates and business inquiries, please email kyle.hounslow@gmail.com In this tutorial we will look at real-time object tracking using the method of sequential images. This allows us to track objects without the use of colour filtering. We code in C++ using Visual Studio 2010. Start by downloading the following zip file: ...
Video Length: 22:31
Uploaded By: Kyle Hounslow
View Count: 263,430

Traffic counting based on OpenCV
Traffic counting based on OpenCV

A simple example of background subtraction and frame difference method. Accuracy may vary.
Video Length: 02:41
Uploaded By: excellentSK
View Count: 251,141

OpenCV Python Neural Network Autonomous RC Car
OpenCV Python Neural Network Autonomous RC Car

Bridgewater State University COMP 502 Project, May 2015 Self driving RC car: OpenCV neural network - Steering Haar-cascade classifiers - Stop sign and traffic light detection Ultrasonic sensor - Front collision avoidance Raspberry Pi - Data streaming (video and sensor) Arduino - RC car control BGM: [Hunter x Hunter 2011] Original Soundtrack 3 28 - Holding A Card File üm-ün Source Code:br ...
Video Length: 03:06
Uploaded By: Wang Zheng
View Count: 246,410

Install Ubuntu Linux on VirtualBox in Windows 7
Install Ubuntu Linux on VirtualBox in Windows 7

In this video, I will show you how to install Ubuntu Linux on VirtualBox in Windows 7. You download either Ubuntu Linux 13.04 or 12.04. Make sure you have a newer computer if you are downloading the 64-bit version. Required files for this project: - Ubuntu Linux ISO image - VirtualBox for Windows 7 hr / bClosed Caption:/b hello and welcome to sake tech in today's video I will show you guys how to install ubuntu linux on a ...
Video Length: 14:41
Uploaded By: sakitech
View Count: 171,098

Raspberry Pi camera module openCV object tracking and following self balancing robot
Raspberry Pi camera module openCV object tracking and following self balancing robot

http://roboticssamy.blogspot.pt/ Vision: Raspberry Pi model B Raspberry Pi camera module OpenCV OpenCV working with Pi camera thanks to this great tutorial: http://thinkrpi.wordpress.com/2013/05... Thank you Pierre Robot setup: Carbon fiber chassis 2000 mAh 11.1V LiPo battery PIC24 microcontroller Murata ENC-03 gyro MMA7361L accelerometer NEMA17 step motors RC 1/8 Buggy wheels Link to ...
Video Length: 01:01
Uploaded By: 74Samy
View Count: 154,983

How to create the OpenCV binary files yourself - Part 1
How to create the OpenCV binary files yourself - Part 1

This is a video version of the OpenCV tutorial here: http://opencv.itseez.com/doc/tutorial... Part 2 may be found at:
Video Length: 12:29
Uploaded By: OpenCVTutorials
View Count: 147,743

Laser tracking projection with Kinect and OpenCV
Laser tracking projection with Kinect and OpenCV

I finally downloaded OpenCV (an open source computer vision library) and spent some time learning about how to use it. It was actually surprisingly painless once I got the hang of it, and there are lots of things you can do once you feed it an image (in this case, the depth image). What I did was rig it to track contours on the depth image, and attempt to pick out a rectangular object. Then, by using the detected location of the corners, I can apply it as a perspective transform to ...
Video Length: 02:41
Uploaded By: marcan
View Count: 134,022

Using KDEnlive for Linux AND Windows!
Using KDEnlive for Linux AND Windows!

Check out my new Linux channel: http://bit.ly/linux-nixie Why buy Sony Vegas when it's open source counterpart KDEnlive will do the trick? http://www.twitter.com/nixiepixel Download your IMG file here: http://www.kdenlive.org/user-manual/downloading-and-installing-kdenlive/live-demonstration-dvd-or-usb-storage Get Image Writer for Windows here: https://launchpad.net/win32-image-writer Need more help? Check out my website for more instructions! Llama picture courtesy of ...
Video Length: 03:23
Uploaded By: Geekbuzz
View Count: 87,234

Copyright © 2025, Ivertech. All rights reserved.