Raspberry PI Computer Vision Programming 1st Edition Pajankar download
Raspberry PI Computer Vision Programming 1st Edition Pajankar download
https://ebookname.com/product/raspberry-pi-computer-vision-
programming-1st-edition-pajankar/
https://ebookname.com/product/raspberry-pi-gaming-2nd-edition-
design-create-and-play-all-kinds-of-video-games-on-your-
raspberry-pi-computer-shea-silverman/
https://ebookname.com/product/raspberry-pi-robotics-
essentials-1st-edition-grimmett/
https://ebookname.com/product/raspberry-pi-led-blueprints-1st-
edition-kurniawan/
https://ebookname.com/product/new-practical-chinese-reader-
vol-1-3rd-ed-3rd-edition-liu-xun/
The Fundamentals of Interior Architecture First Edition
Naomi House
https://ebookname.com/product/the-fundamentals-of-interior-
architecture-first-edition-naomi-house/
https://ebookname.com/product/environmental-impact-assessment-
methodologies-2nd-edition-y-anjaneyulu/
https://ebookname.com/product/operator-theory-functional-
analysis-and-applications-operator-theory-advances-and-
applications-282-1st-ed-2021-edition-m-amelia-bastos-editor/
https://ebookname.com/product/measure-and-integration-1st-
edition-leonard-f-richardson/
https://ebookname.com/product/a-treatise-on-universal-algebra-
with-applications-alfred-north-whitehead/
Toward Better Infrastructure Conditions Constraints and
Opportunities in Financing Public Private Partnerships
1st Edition Riham Shendy
https://ebookname.com/product/toward-better-infrastructure-
conditions-constraints-and-opportunities-in-financing-public-
private-partnerships-1st-edition-riham-shendy/
Raspberry Pi Computer Vision
Programming
Ashwin Pajankar
BIRMINGHAM - MUMBAI
Raspberry Pi Computer Vision Programming
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-78439-828-6
www.packtpub.com
Credits
Reviewers Proofreaders
James Allen Stephen Copestake
Arush Kakkar Safis Editing
Luis A. Larco
Fred Stakem Indexer
Priya Sane
Aldo Vargas
Graphics
Commissioning Editor
Sheetal Aute
Amit Ghodake
Disha Haria
Acquisition Editor
Llewellyn Rozario Production Coordinator
Shantanu Zagade
Technical Editor
Edwin Moses
Copy Editors
Puja Lalwani
Vedangi Narvekar
About the Author
James Allen is a computer scientist and a teacher whose experiences run the gamut
from web and application programming to graphic design and sound engineering.
If a form of media can be produced on a computer, there is a very good chance that
he has dabbled in something along those lines.
Aldo loves to design, build, and control drones at work and during his free time.
He also enjoys scuba diving, skydiving, and riding motorcycles. If you're interested
in knowing more about his work, you can visit http://aldux.net.
www.PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.com
and as a print book customer, you are entitled to a discount on the eBook copy. Get in
touch with us at service@packtpub.com for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
TM
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser
[i]
Table of Contents
[ ii ]
Table of Contents
[ iii ]
Table of Contents
[ iv ]
Preface
Raspberry Pi was developed as a low-cost single-board computer with the
intention of promoting computer science education in schools. It also represents
a welcome return to a simple and fun yet effective way to learn computer science
and programming.
You can use Raspberry Pi to learn and implement concepts in computer vision.
With a $35 Raspberry Pi computer and a USB webcam, anyone can afford to become
a pro in computer vision in no time and build a real-life computer vision application
to impress friends and colleagues.
Chapter 2, Working with Images, Webcams, and GUI, teaches you how to work with
images, videos, and various cameras.
Chapter 3, Basic Image Processing, explores arithmetic and logical operations on images.
Chapter 5, Let's Make Some Noise, teaches the basics of noise in digital images and
low-pass filters. It also discussed their usage in the removal of noise from images.
Chapter 6, Edges, Circles, and Lines' Detection, explores high-pass filters and their
applications. It also explores the detection of features like edges, circles, and lines.
[v]
Preface
Chapter 7, Image Restoration, Quantization, and Depth Map, explores image restoration
by inpainting. It also teaches image segmentation, quantization, and depth maps.
[ vi ]
Preface
Conventions
In this book, you will find a number of text styles that distinguish between different
kinds of information. Here are some examples of these styles and an explanation of
their meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "
We are going to learn about the linspace() function now."
New terms and important words are shown in bold. Words that you see on the
screen, for example, in menus or dialog boxes, appear in the text like this: "Go to
Enable Boot to Desktop/Scratch | Desktop."
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or disliked. Reader feedback is important for us as it helps
us develop titles that you will really get the most out of.
[ vii ]
Preface
If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide at www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you find a mistake in one of our books—maybe a mistake in the text or
the code—we would be grateful if you could report this to us. By doing so, you can
save other readers from frustration and help us improve subsequent versions of this
book. If you find any errata, please report them by visiting http://www.packtpub.
com/submit-errata, selecting your book, clicking on the Errata Submission Form
link, and entering the details of your errata. Once your errata are verified, your
submission will be accepted and the errata will be uploaded to our website or added
to any list of existing errata under the Errata section of that title.
[ viii ]
Preface
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all
media. At Packt, we take the protection of our copyright and licenses very seriously.
If you come across any illegal copies of our works in any form on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.
We appreciate your help in protecting our authors and our ability to bring you
valuable content.
Questions
If you have a problem with any aspect of this book, you can contact us at
questions@packtpub.com, and we will do our best to address the problem.
[ ix ]
Introduction to Computer
Vision and Raspberry Pi
OpenCV is a simple yet powerful tool for any computer vision enthusiast. One can
learn computer vision in an easy way by writing OpenCV programs in Python.
The Raspberry Pi family of single-board computers uses Python as the preferred
development platform. Using a Raspberry Pi computer and Python for OpenCV
programming is one of the best ways to start your journey into the world of
computer vision. We will commence our journey with this chapter by getting
ourselves familiar with the following topics:
• Computer vision
• OpenCV
• Raspberry Pi
• Setting up Raspberry Pi
• Installing OpenCV and its dependencies
• NumPy basics
Computer vision
Computer vision is an area of computer science, mathematics, and electrical
engineering. It includes ways to acquire, process, analyze, and understand images
and videos from the real world in order to mimic human vision. Also, unlike
human vision, computer vision can also be used to analyze and process depth
and infrared images.
[1]
Introduction to Computer Vision and Raspberry Pi
Computer vision is also concerned with the theory of information extraction from
images and videos. A computer vision system can accept different forms of data as
an input, including, but not limited to, images, image sequences, and videos that can
be streamed from multiple sources to further process and extract useful information
from for decision making.
Artificial intelligence and computer vision share many topics, such as image
processing, pattern recognition, and machine learning techniques, as shown
in the following diagram:
Don't worry about this jargon as of now. We will explore most of these concepts in
detail in the later chapters.
OpenCV
OpenCV (Open Source ComputerVision) is a library of programming functions
for computer vision. It was initially developed by the Intel Russia research center
in Nizhny Novgorod, and it is currently maintained by Itseez.
[2]
Chapter 1
OpenCV was released under a Berkeley Software Distribution (BSD) license and
hence, it is free for both academic and commercial use. It has interfaces for popular
programming languages, such as C/C++, Python, and Java, and it runs on a variety
of operating systems including Windows, Android, and Unix-like operating systems.
OpenCV was initially an Intel Research initiative to develop tools to analyze images.
In August 2012, support for OpenCV was taken over by a nonprofit foundation,
OpenCV.org, which is currently developing it further. It also maintains a developer
and user site for OpenCV.
[3]
Introduction to Computer Vision and Raspberry Pi
Popular single-board computers available in the market include, but are not limited
to, Raspberry Pi, Banana Pi, BeagleBone, and Cubieboard.
Raspberry Pi
Raspberry Pi is a series of low-cost, palm-sized, single-board computers developed
by the Raspberry Pi Foundation in the UK. The intention behind the creation of
Raspberry Pi was to promote the teaching of basic computer skills in schools, and
the former serves this purpose well. Raspberry Pi has expanded its footprint well
beyond its intended purpose by penetrating into the market of embedded systems
and research.
As of now, there are five major models of Raspberry Pi, which are as follows:
• Model A
• Model A+ (currently in production and available for purchase)
• Model B (available for purchase but not in production)
[4]
Chapter 1
The Raspberry Pi Foundation provides Debian and Arch variants and Linux
ARM distributions for download. Python is the main programming platform and
languages like C, C++, Java, Perl, and Ruby can be used to program Raspberry Pi.
We will use Raspberry Pi B+ for our Computer Vision learning. However, these
examples can also be executed on other Raspberry Pi Models.
Component Specification
CPU 700 MHz ARM1176JZF-S core (ARM11 family, ARM v6 instruction set)
GPU Broadcom VideoCore IV @250 MHz
Memory 512 MB SDRAM (shared with GPU—the limit of memory used by GPU
can be set using raspi-config utility)
USB 2.0 ports 4
Video output HDMI, composite video (PAL and NTSC) via 3.5 mm TRRS jack shared
with audio out (you need to use converters for VGA type displays)
Audio output Analog via 3.5 mm phone jack; digital via HDMI port
Onboard microSD
storage
Networking 10/100 Mbit/s Fast Ethernet, no onboard Wi-Fi or Bluetooth
Power 600 mA (3 W), 5 V via http://en.wikipedia.org/wiki/MicroUSB
or GPIO header (using MicroUSB for power is recommended)
Operating systems
Raspberry Pi primarily uses Unix-like, Linux-kernel-based operating systems,
like the variants of Debian and Fedora.
The Raspberry Pi models A, A+, B, and B+ are based on the ARM11 family chip,
which runs on the ARM v6 instruction set. The ARM v6 instruction set does not
support Ubuntu and Windows.
[5]
Introduction to Computer Vision and Raspberry Pi
However, the recently launched Raspberry Pi 2 is based on ARM Cortex A7, which
is capable of running both Windows 10 and Ubuntu (Snappy Core). The following
operating systems are officially supported by all the models of Raspberry Pi and are
available for download at the download page:
• OpenELEC
• Pidora (Fedora Remix)
• RASPBMC
• RISC OS
• Raspbian—we will use this with a Raspberry Pi B+ throughout this book.
Raspbian
Raspbian is an unofficial variant of Debian Wheezy armhf (ARM hard float)
that is compiled for hard float code that will run on Raspberry Pi computers.
It is a free operating system based on Debian that is optimized for the Raspberry Pi
hardware. Raspbian is more than a pure OS. It comes with over 35,000 packages
and precompiled software for Raspberry Pi.
[6]
Exploring the Variety of Random
Documents with Different Content
The Project Gutenberg eBook of Letters of
Samuel Taylor Coleridge, Vol. 1 (of 2)
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.
Language: English
LETTERS OF
SAMUEL TAYLOR COLERIDGE
LETTERS
OF
EDITED BY
ERNEST HARTLEY COLERIDGE
IN TWO VOLUMES
VOL. I
LONDON
WILLIAM HEINEMANN
1895
[All rights reserved.]
Page
CHAPTER I. STUDENT LIFE, 1785-1794.
I. Thomas Poole, February, 1797. (Biographia Literaria,
1847, ii. 313) 4
II. Thomas Poole, March, 1797. (Biographia Literaria,
1847, ii. 315) 6
III. Thomas Poole, October 9, 1797. (Biographia Literaria,
1847, ii. 319) 10
IV. Thomas Poole, October 16, 1797. (Biographia
Literaria, 1847, ii. 322) 13
V. Thomas Poole, February 19, 1798. (Biographia
Literaria, 1847, ii. 326) 18
VI. Mrs. Coleridge, Senior, February 4, 1785. (Illustrated
London News, April 1, 1893) 21
VII. Rev. George Coleridge, undated, before 1790.
(Illustrated London News, April 1, 1893) 22
VIII. Rev. George Coleridge, October 16, 1791. (Illustrated
London News, April 8, 1893) 22
IX. Rev. George Coleridge, January 24, 1792 23
X. Mrs. Evans, February 13, 1792 26
XI. Mary Evans, February 13, 1792 30
XII. Anne Evans, February 19, 1792 37
XIII. Mrs. Evans, February 22 [1792] 39
XIV. Mary Evans, February 22 [1792] 41
XV. Rev. George Coleridge, April [1792]. (Illustrated
London News, April 8, 1893) 42
XVI. Mrs. Evans, February 5, 1793 45
XVII. Mary Evans, February 7, 1793. (Illustrated London
News, April 8, 1893) 47
XVIII. Anne Evans, February 10, 1793 52
XIX. Rev. George Coleridge, July 28, 1793 53
XX. Rev. George Coleridge [Postmark, August 5, 1793] 55
XXI. G. L. Tuckett, February 6 [1794], (Illustrated
London News, April 15, 1893) 57
XXII. Rev. George Coleridge, February 8, 1794 59
XXIII. Rev. George Coleridge, February 11, 1794 60
XXIV. Capt. James Coleridge, February 20, 1794. (Brandl’s
Life of Coleridge, 1887, p. 65) 61
XXV. Rev. George Coleridge, March 12, 1794. (Illustrated
London News, April 15, 1893) 62
XXVI. Rev. George Coleridge, March 21, 1794 64
XXVII. Rev. George Coleridge, end of March, 1794 66
XXVIII. Rev. George Coleridge, March 27, 1794 66
XXIX. Rev. George Coleridge, March 30, 1794 68
XXX. Rev. George Coleridge, April 7, 1794 69
XXXI. Rev. George Coleridge, May 1, 1794 70
XXXII. Robert Southey, July 6, 1794. (Sixteen lines
published, Southey’s Life and Correspondence,
1849, i. 212) 72
XXXIII. Robert Southey, July 15, 1794. (Portions published in
Letter to H. Martin, July 22, 1794, Biographia
Literaria, 1847, ii. 338) 74
XXXIV. Robert Southey, September 18, 1794. (Eighteen lines
published, Southey’s Life and Correspondence,
1849, i. 218) 81
XXXV. Robert Southey, September 19, 1794 84
XXXVI. Robert Southey, September 26, 1794 86
XXXVII. Robert Southey, October 21, 1794 87
XXXVIII. Robert Southey, November, 1794 95
XXXIX. Robert Southey, Autumn, 1794. (Illustrated London
News, April 15, 1893) 101
XL. Rev. George Coleridge, November 6, 1794 103
XLI. Robert Southey, December 11, 1794 106
XLII. Robert Southey, December 17, 1794 114
XLIII. Robert Southey, December, 1794. (Eighteen lines
published, Southey’s Life and Correspondence,
1849, i. 227) 121
XLIV. Mary Evans, (?) December, 1794. (Samuel Taylor
Coleridge, A Narrative, 1894, p. 38) 122
XLV. Mary Evans, December 24, 1794. (Samuel Taylor
Coleridge, A Narrative, 1894, p. 40) 124
XLVI. Robert Southey, December, 1794 125
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com