Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • BeagleBone By Example
  • Toc
  • feedback
BeagleBone By Example

BeagleBone By Example

By : Prabakar
5 (1)
close
BeagleBone By Example

BeagleBone By Example

5 (1)
By: Prabakar

Overview of this book

BeagleBone is a low cost, community-supported development platform to develop a variety of electronic projects. This book will introduce you to BeagleBone and get you building fun, cool, and innovative projects with it. Start with the specifications of BeagleBone Black and its operating systems, then get to grips with the GPIOs available in BeagleBone Black. Work through four types of exciting projects: building real-time physical computing systems, home automation, image processing for a security system, and building your own tele-controlled robot and learn the fundamentals of a variety of projects in a single book. By the end of this book, you will be able to write code for BeagleBone in order to operate hardware and impart decision-making capabilities with the help of efficient coding in Python.
Table of Contents (12 chapters)
close
11
Index

Project: Image capture from a camera using Python and OpenCV


In this chapter we will be writing a code to capture an image from a camera and saving it in .jpg format using Python.

Let's first create a directory named ImageCapture inside which we can save the Python file in which we write the code, and where we can also save the image file that we capture:

  • mkdir ImageCapture

  • cd ImageCapture

It will look like the following screenshot:

  • sudo nano TakePhoto.py

    Refer to the following image:

Now we can go ahead and start writing the code to capture an image from the camera and save it on the BeagleBone Black:

The simplest code possible to do this is given in the following screenshot:

Save it and run it to capture an image from the camera and save it.

The output you will see when you run the code sudo python TakePhoto.py is as shown in the following screenshot:

If you don't get any errors and the program ends printing the Saving Image text, everything should have happened properly. To check this let...

bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete