Understand the concepts of image processing with Python 3 and create applications using Raspberry Pi 4. This book covers image processing with the latest release of Python 3, using Raspberry Pi OS and Raspberry Pi 4B with the 8 GB RAM model as the preferred computing platform.
This second edition begins with the installation of Raspberry Pi OS on the latest model of Raspberry Pi and then introduces Python programming language, IDEs for Python, and digital image processing. It also illustrates the theoretical foundations of Image processing followed by advanced operations in image processing. You'll then review image processing with NumPy, and Matplotlib followed by transformations, interpolation, and measurements of images.
Different types of filters such as Kernels convolution filters, low pass filters, high pass filters, and Fourier filters are discussed in a clear, methodical manner. Additionally, the book examines various image processing techniques such as Morphology, Thresholding, and Segmentation, followed by a chapter on live webcam input with OpenCV, an image processing library with Python. The book concludes with an appendix covering a new library for image processing with Python, pgmagik, followed by a few important tips and tricks relevant to RPi.
What You'll Learn
- Get started with Raspberry Pi and Python
- Understand Image Processing with Pillow
- See how image processing is processed using Numpy and Matplotlib
- Use Pi camera and webcam
Who This Book Is For
Raspberry Pi and IoT enthusiasts, and Python and Open Source professionals
About the Author |
|
xi | |
About the Technical Reviewer |
|
xiii | |
Acknowledgments |
|
xv | |
Introduction |
|
xvii | |
|
Chapter 1 Introduction to Single-Board Computers and Raspberry Pi |
|
|
1 | (30) |
|
Single-Board Computers (SBCs) |
|
|
1 | (2) |
|
Differences Between SBCs and Regular Computers |
|
|
3 | (1) |
|
|
3 | (1) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
5 | (5) |
|
|
10 | (2) |
|
|
12 | (8) |
|
|
20 | (1) |
|
Accessing Raspberry Pi Remotely |
|
|
20 | (5) |
|
|
25 | (2) |
|
|
27 | (1) |
|
|
27 | (1) |
|
|
28 | (2) |
|
|
30 | (1) |
|
Chapter 2 Introduction to Python and Digital Image Processing |
|
|
31 | (20) |
|
A Brief History of the Python Programming Language |
|
|
32 | (2) |
|
|
34 | (3) |
|
|
37 | (1) |
|
Python 2 and Python 3 on Raspberry Pi OS |
|
|
38 | (1) |
|
Running a Python Program and Python Modes |
|
|
38 | (2) |
|
|
40 | (1) |
|
|
40 | (3) |
|
|
43 | (2) |
|
|
45 | (1) |
|
Introduction to Digital Image Processing |
|
|
46 | (1) |
|
|
46 | (1) |
|
|
47 | (2) |
|
Using Raspberry Pi and Python for Digital Image Processing (DIP) |
|
|
49 | (1) |
|
|
49 | (1) |
|
|
50 | (1) |
|
Chapter 3 Getting Started |
|
|
51 | (18) |
|
|
51 | (3) |
|
|
54 | (1) |
|
|
55 | (1) |
|
|
56 | (1) |
|
|
57 | (4) |
|
|
61 | (1) |
|
Python 3 for Digital Image Processing |
|
|
61 | (1) |
|
|
62 | (5) |
|
|
67 | (2) |
|
Chapter 4 Basic Operations on Images |
|
|
69 | (22) |
|
|
69 | (1) |
|
|
70 | (1) |
|
|
71 | (1) |
|
|
72 | (3) |
|
|
75 | (1) |
|
|
76 | (1) |
|
Crop and Paste Operations |
|
|
77 | (2) |
|
Copying and Saving Images to a File |
|
|
79 | (1) |
|
Knowing the Value of a Particular Pixel |
|
|
79 | (1) |
|
|
79 | (2) |
|
|
81 | (3) |
|
|
84 | (1) |
|
|
85 | (4) |
|
|
89 | (1) |
|
|
90 | (1) |
|
Chapter 5 Advanced Operations on Images |
|
|
91 | (22) |
|
|
91 | (14) |
|
|
105 | (3) |
|
|
108 | (2) |
|
Histograms and Equalization |
|
|
110 | (1) |
|
|
111 | (1) |
|
|
112 | (1) |
|
Chapter 6 Introduction to the Scientific Python Ecosystem |
|
|
113 | (16) |
|
The Scientific Python Ecosystem |
|
|
114 | (1) |
|
|
115 | (3) |
|
|
118 | (5) |
|
|
123 | (3) |
|
Conversion Between PIL Image Objects and NumPy ndarrays |
|
|
126 | (1) |
|
|
127 | (2) |
|
Chapter 7 Transformations and Measurements |
|
|
129 | (16) |
|
|
129 | (10) |
|
|
139 | (4) |
|
|
143 | (2) |
|
|
145 | (24) |
|
Kernels, Convolution, and Correlation |
|
|
146 | (4) |
|
|
150 | (1) |
|
|
150 | (6) |
|
|
156 | (5) |
|
|
161 | (4) |
|
|
165 | (2) |
|
|
167 | (2) |
|
Chapter 9 Morphology, Thresholding, and Segmentation |
|
|
169 | (20) |
|
|
169 | (2) |
|
Morphology and Morphological Operations |
|
|
171 | (1) |
|
|
172 | (1) |
|
Binary Morphological Operations |
|
|
172 | (6) |
|
Grayscale Morphological Operations |
|
|
178 | (4) |
|
Thresholding and Segmentation |
|
|
182 | (6) |
|
|
188 | (1) |
|
Chapter 10 Video Processing |
|
|
189 | (52) |
|
Introduction to OpenCV Library |
|
|
189 | (5) |
|
Converting the Colorspace of Image |
|
|
194 | (2) |
|
Separating Color Channels in Live Webcam Stream |
|
|
196 | (2) |
|
More Operations on Live Webcam Stream |
|
|
198 | (1) |
|
|
198 | (2) |
|
|
200 | (4) |
|
|
204 | (2) |
|
|
206 | (10) |
|
|
216 | (4) |
|
|
220 | (1) |
|
|
220 | (3) |
|
|
223 | (1) |
|
Pgmagick Image Processing |
|
|
223 | (2) |
|
|
225 | (1) |
|
|
225 | (1) |
|
Booting Up After Connecting a Display |
|
|
226 | (8) |
|
Connecting to Ethernet/Wired Network |
|
|
234 | (1) |
|
|
235 | (6) |
Index |
|
241 | |
Ashwin Pajankar earned a Master of Technology in Computer Science Engineering from IIIT Hyderabad and has over 25 years of programming experience. He started his journey in programming and electronics at the tender age of 7 with a MS-DOS computer and BASIC programming language. He is now proficient in Assembly programming, C, C++, Java, Shell Scripting, JavaScript, Go Programming, HTML, and Python. His other technical expertise includes single board computers such as Raspberry Pi and Banana Pro, and microcontroller boards (Arduino), and embedded boards (BBC Micro Bit). He has worked extensively on domains such as Software/Product Testing, Software Automation, Databases, Data Analytics, Computer Vision, and Web Development. Ashwin is currently a freelance online instructor teaching programming and electronics to more than 8200 professionals. He also regularly conducts live programming boot camps for software professionals. His growing Youtubechannel has an audience of more than 11000 subscribers. He has published more than 20 books on programming and electronics with many international publications, including Apress and regularly reviews books on programming written by other authors.