100% found this document useful (1 vote)
52 views65 pages

Get Raspberry Pi Image Processing Programming: Develop Real-Life Examples with Python, Pillow, and SciPy 1st Edition Ashwin Pajankar PDF ebook with Full Chapters Now

Raspberry

Uploaded by

bomblerodela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
52 views65 pages

Get Raspberry Pi Image Processing Programming: Develop Real-Life Examples with Python, Pillow, and SciPy 1st Edition Ashwin Pajankar PDF ebook with Full Chapters Now

Raspberry

Uploaded by

bomblerodela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Download Full Version ebook - Visit ebookmeta.

com

Raspberry Pi Image Processing Programming: Develop


Real-Life Examples with Python, Pillow, and SciPy
1st Edition Ashwin Pajankar

https://ebookmeta.com/product/raspberry-pi-image-processing-
programming-develop-real-life-examples-with-python-pillow-
and-scipy-1st-edition-ashwin-pajankar/

OR CLICK HERE

DOWLOAD NOW

Discover More Ebook - Explore Now at ebookmeta.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

Raspberry Pi Image Processing Programming: With NumPy,


SciPy, Matplotlib and OpenCV, 2nd Edition Ashwin Pajankar

https://ebookmeta.com/product/raspberry-pi-image-processing-
programming-with-numpy-scipy-matplotlib-and-opencv-2nd-edition-ashwin-
pajankar-2/
ebookmeta.com

Raspberry Pi Image Processing Programming: With NumPy,


SciPy, Matplotlib, and OpenCV 2nd Edition Ashwin Pajankar

https://ebookmeta.com/product/raspberry-pi-image-processing-
programming-with-numpy-scipy-matplotlib-and-opencv-2nd-edition-ashwin-
pajankar/
ebookmeta.com

Practical Linux with Raspberry Pi OS: Quick Start 1st


Edition Ashwin Pajankar

https://ebookmeta.com/product/practical-linux-with-raspberry-pi-os-
quick-start-1st-edition-ashwin-pajankar/

ebookmeta.com

Java 9 Dependency Injection Write loosely coupled code


with Spring 5 and Guice 1st Edition Nilang Patel Krunal
Patel
https://ebookmeta.com/product/java-9-dependency-injection-write-
loosely-coupled-code-with-spring-5-and-guice-1st-edition-nilang-patel-
krunal-patel/
ebookmeta.com
Discovering Becca (The Platinum Society #5) 1st Edition
Cris Anson

https://ebookmeta.com/product/discovering-becca-the-platinum-
society-5-1st-edition-cris-anson/

ebookmeta.com

Fashion Theory A Reader 2nd Edition Malcolm Barnard

https://ebookmeta.com/product/fashion-theory-a-reader-2nd-edition-
malcolm-barnard/

ebookmeta.com

Dictionary of Daily Life in Biblical Post Biblical


Antiquity Perfumes Edwin M Yamauchi Marvin R Wilson

https://ebookmeta.com/product/dictionary-of-daily-life-in-biblical-
post-biblical-antiquity-perfumes-edwin-m-yamauchi-marvin-r-wilson/

ebookmeta.com

Bodies on the Verge Queering Pauline Epistles Semeia


Studies 1st Edition Joseph A. Marchal

https://ebookmeta.com/product/bodies-on-the-verge-queering-pauline-
epistles-semeia-studies-1st-edition-joseph-a-marchal/

ebookmeta.com

America s War on Terror 2nd Edition Patrick Hayden Tom


Lansford Robert P Watson

https://ebookmeta.com/product/america-s-war-on-terror-2nd-edition-
patrick-hayden-tom-lansford-robert-p-watson/

ebookmeta.com
Forgotten The Djinn Wars 10 1st Edition Christine Pope

https://ebookmeta.com/product/forgotten-the-djinn-wars-10-1st-edition-
christine-pope/

ebookmeta.com
TECHNOLOGY IN AC TION™

Raspberry Pi
Image Processing
Programming
Develop Real-Life Examples with
Python, Pillow, and SciPy

Ashwin Pajankar
Raspberry Pi
Image Processing
Programming
Develop Real-Life Examples with
Python, Pillow, and SciPy

Ashwin Pajankar
Raspberry Pi Image Processing Programming: Develop Real-Life Examples with Python,
Pillow, and SciPy
Ashwin Pajankar
Nashik, Maharashtra, India
ISBN-13 (pbk): 978-1-4842-2730-5 ISBN-13 (electronic): 978-1-4842-2731-2
DOI 10.1007/978-1-4842-2731-2
Library of Congress Control Number: 2017936370
Copyright © 2017 by Ashwin Pajankar
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part
of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission
or information storage and retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol
with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only
in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of
the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are
not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject
to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of
publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for
any errors or omissions that may be made. The publisher makes no warranty, express or implied, with
respect to the material contained herein.
Managing Director: Welmoed Spahr
Lead Editor: Celestin Suresh John
Technical Reviewer: Lentin Joseph
Editorial Board: Steve Anglin, Pramila Balan, Laura Berendson, Aaron Black,
Louise Corrigan, Jonathan Gennick, Robert Hutchinson, Celestin Suresh John,
Nikhil Karkal, James Markham, Susan McDermott, Matthew Moodie, Natalie Pao,
Gwenan Spearing
Coordinating Editor: Sanchita Mandal
Copy Editor: Kezia Endsley
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505,
e-mail [email protected], or visit www.springeronline.com. Apress Media, LLC is a
California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc
(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail [email protected], or visit www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional
use. eBook versions and licenses are also available for most titles. For more information, reference
our Special Bulk Sales–eBook Licensing web page at www.apress.com/bulk-sales.
Any source code or other supplementary materials referenced by the author in this text are
­available to readers at www.apress.com. For detailed information about how to locate your book’s
source code, go to www.apress.com/source-code/. Readers can also access source code at
SpringerLink in the Supplementary Material section for each chapter.

Printed on acid-free paper


Contents at a Glance

About the Author������������������������������������������������������������������������������ xi


About the Technical Reviewer�������������������������������������������������������� xiii
Acknowledgments��������������������������������������������������������������������������� xv
Introduction����������������������������������������������������������������������������������� xvii

■■Chapter 1: Introduction to Single Board Computers and


Raspberry Pi����������������������������������������������������������������������������������� 1
■■Chapter 2: Introduction to Python and Digital Image
Processing������������������������������������������������������������������������������������ 25

■Chapter 3: Getting Started������������������������������������������������������������ 41

■Chapter 4: Basic Operations on Images��������������������������������������� 51

■Chapter 5: Advanced Operations on Images�������������������������������� 65

■Chapter 6: Introduction to Scientific Python�������������������������������� 81

■Chapter 7: Transformations and Measurements�������������������������� 93

■Chapter 8: Filters and Their Application��������������������������������������� 99

■Chapter 9: Morphology, Thresholding, and Segmentation���������� 111

Index���������������������������������������������������������������������������������������������� 123

iii
Contents

About the Author������������������������������������������������������������������������������ xi


About the Technical Reviewer�������������������������������������������������������� xiii
Acknowledgments��������������������������������������������������������������������������� xv
Introduction����������������������������������������������������������������������������������� xvii

■■Chapter 1: Introduction to Single Board Computers and


Raspberry Pi����������������������������������������������������������������������������������� 1
Single Board Computers (SBCs)�������������������������������������������������������������� 1
Differences Between SBCs and Regular Computers������������������������������������������������ 2
System on Chips (SoCs)�������������������������������������������������������������������������������������������� 2
History of SBCs��������������������������������������������������������������������������������������������������������� 3
SBC Families������������������������������������������������������������������������������������������������������������� 3

The Raspberry Pi������������������������������������������������������������������������������������� 4


Raspberry Pi Setup���������������������������������������������������������������������������������� 5
Required Hardware��������������������������������������������������������������������������������������������������� 6
Preparation of the microSD Card for Raspberry Pi��������������������������������������������������� 9
Download the Required Free Software������������������������������������������������������������������� 10
Writing the Raspbian OS Image to the microSD Card��������������������������������������������� 10
Altering the Contents of the config.txt File for a VGA Monitor�������������������������������� 12
Booting Up the Pi���������������������������������������������������������������������������������������������������� 13
Configuring the Pi��������������������������������������������������������������������������������������������������� 15

The Raspbian OS����������������������������������������������������������������������������������� 18


The config.txt File���������������������������������������������������������������������������������� 18

v
■ Contents

Connecting the Raspberry Pi to a Network and to the Internet������������� 19


WiFi������������������������������������������������������������������������������������������������������������������������� 19
Ethernet������������������������������������������������������������������������������������������������������������������ 21

Updating the Pi�������������������������������������������������������������������������������������� 22


Updating the Firmware������������������������������������������������������������������������������������������� 22
Updating and Upgrading Raspbian������������������������������������������������������������������������� 22
Updating raspi-config��������������������������������������������������������������������������������������������� 23

Shutting Down and Restarting Pi���������������������������������������������������������� 24


Conclusion��������������������������������������������������������������������������������������������� 24
■■Chapter 2: Introduction to Python and Digital Image
Processing������������������������������������������������������������������������������������ 25
A History of Python�������������������������������������������������������������������������������� 25
Features of Python�������������������������������������������������������������������������������� 26
Simple�������������������������������������������������������������������������������������������������������������������� 26
Easy to Learn���������������������������������������������������������������������������������������������������������� 27
Easy to Read����������������������������������������������������������������������������������������������������������� 27
Easy to Maintain����������������������������������������������������������������������������������������������������� 27
Open Source����������������������������������������������������������������������������������������������������������� 27
High-Level Language���������������������������������������������������������������������������������������������� 27
Portable������������������������������������������������������������������������������������������������������������������ 27
Interpreted�������������������������������������������������������������������������������������������������������������� 28
Object-Oriented������������������������������������������������������������������������������������������������������ 28
Extensible��������������������������������������������������������������������������������������������������������������� 28
Extensive Libraries������������������������������������������������������������������������������������������������� 28
Robust�������������������������������������������������������������������������������������������������������������������� 28
Rapid Prototyping��������������������������������������������������������������������������������������������������� 29
Memory Management�������������������������������������������������������������������������������������������� 29
Powerful����������������������������������������������������������������������������������������������������������������� 29
Community Support������������������������������������������������������������������������������������������������ 29

vi
■ Contents

Python 3������������������������������������������������������������������������������������������������ 29
The Differences Between Python 2 and Python 3�������������������������������������������������� 30
Why Use Python 3��������������������������������������������������������������������������������������������������� 31

Python 2 and Python 3 on Raspbian������������������������������������������������������ 31


Running a Python Program and Python Modes������������������������������������� 31
Interactive Mode����������������������������������������������������������������������������������������������������� 32
Normal Mode���������������������������������������������������������������������������������������������������������� 32

IDEs for Python�������������������������������������������������������������������������������������� 33


IDLE������������������������������������������������������������������������������������������������������������������������ 33
Geany���������������������������������������������������������������������������������������������������������������������� 34

Introduction to Digital Image Processing���������������������������������������������� 36


Signal Processing��������������������������������������������������������������������������������������������������� 36
Image Processing��������������������������������������������������������������������������������������������������� 37
Using Raspberry Pi and Python for Digital Image Processing (DIP)������������������������ 38

Conclusion��������������������������������������������������������������������������������������������� 39

■Chapter 3: Getting Started������������������������������������������������������������ 41
Image Sources�������������������������������������������������������������������������������������� 41
Using the Webcam�������������������������������������������������������������������������������������������������� 42
The Pi Camera Module�������������������������������������������������������������������������������������������� 44
Using Python 3 for Digital Image Processing���������������������������������������� 46
Working with Images���������������������������������������������������������������������������������������������� 47

Conclusion��������������������������������������������������������������������������������������������� 50

■Chapter 4: Basic Operations on Images��������������������������������������� 51
Image Module���������������������������������������������������������������������������������������� 51
Splitting and Merging Image Channels������������������������������������������������������������������� 51
Image Mode Conversion����������������������������������������������������������������������������������������� 53
Image Blending������������������������������������������������������������������������������������������������������� 53
Resizing an Image�������������������������������������������������������������������������������������������������� 55

vii
■ Contents

Rotating an Image�������������������������������������������������������������������������������������������������� 56
Crop and Paste Operations������������������������������������������������������������������������������������� 57
Copying and Saving Images to a File���������������������������������������������������������������������� 58
Knowing the Value of a Particular Pixel������������������������������������������������������������������ 58

ImageChops Module������������������������������������������������������������������������������ 59
ImageOps Module��������������������������������������������������������������������������������� 61
Conclusion��������������������������������������������������������������������������������������������� 63

■Chapter 5: Advanced Operations on Images�������������������������������� 65
The ImageFilter Module������������������������������������������������������������������������ 65
The ImageEnhance Module������������������������������������������������������������������� 74
Color Quantization��������������������������������������������������������������������������������� 76
Histograms and Equalization����������������������������������������������������������������� 77
Histogram Equalization������������������������������������������������������������������������������������������� 78

Conclusion��������������������������������������������������������������������������������������������� 79

■Chapter 6: Introduction to Scientific Python�������������������������������� 81
The Scientific Python Stack������������������������������������������������������������������ 81
Installing the SciPy Stack��������������������������������������������������������������������������������������� 82
A Simple Program��������������������������������������������������������������������������������������������������� 82
Simple Image Processing��������������������������������������������������������������������������������������� 83
Introduction to NumPy�������������������������������������������������������������������������������������������� 84
Matplotlib���������������������������������������������������������������������������������������������������������������� 86
Image Channels������������������������������������������������������������������������������������� 89
Conversion Between PIL Image Objects
and NumPy ndarrays����������������������������������������������������������������������������� 91
Conclusion��������������������������������������������������������������������������������������������� 92

viii
■ Contents


■Chapter 7: Transformations and Measurements�������������������������� 93
Transformations������������������������������������������������������������������������������������ 93
Measurements�������������������������������������������������������������������������������������� 95
Conclusion��������������������������������������������������������������������������������������������� 98

■Chapter 8: Filters and Their Application��������������������������������������� 99
Filters���������������������������������������������������������������������������������������������������� 99
Low-Pass Filters��������������������������������������������������������������������������������������������������� 100
High-Pass Filters�������������������������������������������������������������������������������������������������� 105
Fourier Filters������������������������������������������������������������������������������������������������������� 108

Conclusion������������������������������������������������������������������������������������������� 110

■Chapter 9: Morphology, Thresholding, and Segmentation���������� 111
Distance Transforms���������������������������������������������������������������������������� 111
Morphology and Morphological Operations����������������������������������������� 113
Structuring Element���������������������������������������������������������������������������������������������� 113
Various Morphological Operations������������������������������������������������������������������������ 113
Grayscale Morphological Operations�������������������������������������������������������������������� 115

Thresholding and Segmentation��������������������������������������������������������� 117


Conclusion������������������������������������������������������������������������������������������� 121
Book Summary������������������������������������������������������������������������������������ 121
What’s Next����������������������������������������������������������������������������������������� 121

Index���������������������������������������������������������������������������������������������� 123

ix
About the Author

Ashwin Pajankar is a polymath. He is a Science popularizer, a programmer, a maker, an


author, and a YouTuber. He graduated from IIIT Hyderabad with MTech in Computer
Science and Engineering. He has a keen interest in the promotion of science, technology,
engineering, and mathematics (STEM) education. He has written three books with Packt
Publication, six books with Leanpub, and one book with Apress Media, and he has also
reviewed four books for Packt Publications. He’s currently working on several more books
with Apress Media as well.
His personal web site is found at www.AshwinPajankar.com.
His LinkedIn profile is found at https://in.linkedin.com/in/ashwinpajankar.

xi
About the Technical
Reviewer

Lentin Joseph is an author, entrepreneur, electronics


engineer, robotics enthusiast, machine vision expert,
embedded programmer, and the founder and the
CEO of Qbotics Labs (http://www.qboticslabs.com)
from India.
He completed his bachelor’s degree in electronics
and communication engineering at the Federal
Institute of Science and Technology (FISAT), Kerala.
For his final year engineering project, he made a social
robot that interacted with people. The project was a
huge success and was mentioned in many forms of
visual and print media. His robot can communicate with people and reply intelligently
and has image-processing capabilities such as face, motion, and color detection. The
entire project was implemented using the Python programming language. His interest in
robotics, image processing, and Python started with that project.
After his graduation, he worked for three years at a startup company focusing on
robotics and image processing. In the meantime, he learned to work with famous robotic
software platforms such as Robot Operating System (ROS), V-REP, and Actin (a robotic
simulation tool), as well as with image-processing libraries such as OpenCV, OpenNI, and
PCL. He also knows about robot 3D designing and embedded programming on Arduino
and Tiva Launchpad.
After three years, he started a new company called Qbotics Labs, which mainly
focuses on research to build great products in domains such as robotics and machine
vision. He maintains a personal web site (at http://www.lentinjoseph.com) and a
technology blog called technolabsz (see http://www.technolabsz.com). He publishes
his works on his tech blog. He was also a speaker at PyCon2013, India, on the topic of
learning about robotics using Python.
Lentin is the author of the books, Learning Robotics Using Python (see http://
learn-robotics.com to find out more) and Mastering ROS for Robotics Programming
(see http://mastering-ros.com to find out more), both by Packt. The first book was
about building an autonomous mobile robot using ROS and OpenCV. This book was
launched at ICRA 2015 and was featured in the ROS blog, Robohub, OpenCV, the Python
web site, and various other such forums. The second book is on mastering the Robot
Operating System, which was also launched at ICRA 2016, and is one of the bestselling
books on ROS. The third book is on ROS robotics projects (see http://rosrobots.com),
and is expected to be published by April 2017.

xiii
■ About the Technical Reviewer

He also reviewed one book about the Robot Operating System called Effective
Robotics Programming Using ROS (https://www.packtpub.com/hardware-and-
creative/effective-robotics-programming-ros-third-edition).
Lentin and his team were also winners of the HRATC 2016 challenge conducted
as part of ICRA 2016. He was also a finalist in the ICRA 2015 challenge, HRATC
(see http://www.icra2016.org/conference/challenges/).

xiv
Acknowledgments

Writing a book is a journey that I am glad I undertook. First, I want to thank my wife
Kavitha, without whose support the journey would never have been possible. The journey
spanned a few months but the experience will last a lifetime. I had my wife Kavitha with
me onboard this journey and I wish to express my deepest gratitude to her. Without her
unwavering support and affection, I couldn’t have pulled it off.
I am grateful to the community of professionals, students, trainers, and teachers
who, with their continual bombardment of queries, impelled me to learn more, simplify
my knowledge and findings, and place it neatly in the book. This book is for all of them.
I want to thank my friends and colleagues—the practitioners from the industry and
experts from academia—for their good counsel and filling me in with the knowledge
on the latest in the fields of single board computers, computer vision, digital image
processing, and Python.
I want to thank the technical reviewer for his vigilant reviews, suggestions,
corrections, and expert opinion.
I consider myself very fortunate for the editorial assistance provided by Apress
Media. This is my second book with Apress and collaborating with them on both the
books has been fabulous. I am thankful to Celestin Suresh John, Senior Manager, Editorial
Acquisition, Apress and Springer Science and Business Media Company, for giving me a
long-desired opportunity to collaborate and write for Apress. I also want to acknowledge
Sanchita Mandal, coordinating editor, Anila Vincent, development editor, and the team
of associates from Apress Media who adeptly guided me through the entire process of
preparation and publication.

xv
Introduction

Why This Book?


I have been using Python for more than 10 years for a variety of tasks. Initially, I used it
for GUI applications. Then I quickly moved to scientific uses as my academic projects
demanded it. When I entered professional life, I used it for automation first and then
for implementation of alert mechanisms. I have been using Python the last six years
for various fields like scientific computing, the Internet of Things, and single board
computers. I have written plenty of Python code all these years. I prefer Python to Bash
scripting, which offers limited capabilities to users like me. Over the last 10 years, I have
worked as a developer, an R&D engineer, a maker, an author, and a QA specialist. I used
Python in every single role.
This is my third dedicated book on the topic of digital image processing. I have
extensive work experience in the field of digital image processing and computer vision.
Almost all of the digital image processing programming I did was in C++ and Python. For
beginners in image processing programming, I always recommend Python, as it is easy
to learn. Also, if you are working in the research areas like Medical imaging, optics, and
biology, where the core expertise is not computer science but you must use digital image
processing, Python is the best choice, as you won’t get bogged down with its syntax.
To prepare for and write this book, I spent a lot of time writing code examples from
scratch, testing them, and then checking the PEP-8 compatibility. Also, I spent numerous
hours writing and editing the text in order to explain the image processing concepts in very
simple and plain language. I did not keep track of the time I spent posting on various forums
and discussing problems with colleagues from the industry and academia. I have poured my
heart and soul into writing this book. I hope that you readers who want to get started with
digital image processing and single board computers will find this book immensely valuable.
I wrote this book to share my knowledge and experiences while programming in
the field of digital image processing with Python 3 and Raspberry Pi. I explored multiple
techniques, frameworks, and libraries for capturing, processing, and displaying digital
images in this book. I hope you will enjoy reading and following the book as much as I
enjoyed writing it. The book covers the following topics:
• Introduction to single board computers, Python 3, and Raspberry Pi
• Interfacing Raspberry Pi with the Pi Camera module and a
Webcam
• Exploring various image-processing libraries like Pillow and
scipy.ndimage
• Introduction to additional libraries such as NumPy, matplotlib,
and Tkinter, which assist us in image processing

xvii
■ Introduction

Who This Book Is For


Raspberry Pi enthusiasts are the main audience of this book. This includes a large and
diverse set of people such as developers, students, researchers, and novice learners.
The book is for those who have some prior knowledge of the Python programming
language. If you are a developer, student, or a researcher with some experience in Python
programming, you can quickly learn the concepts related to digital image processing with
your favorite little British computer, Raspberry Pi.

What This Book Is Not


This is not a book for learning Python 3 programming and syntax from scratch. It is more
of a DIY cookbook for Raspberry Pi and digital image processing. If your understanding
of coding is limited or you are not from computer science background, you will find it
difficult to follow this book.

How This Book Is Organized


This book has nine chapters. Here is a sneak peek into the chapters of the book:
Chapter 1: This chapter introduces the readers to the history and the philosophy of
single board computers. Then it explores Raspberry Pi basics. It teaches readers to set up
the Raspberry Pi and connect it to a network.
Chapter 2: This chapter introduces the readers to the history and the philosophy
of Python. It teaches you how to install Python and how to set up the environment for
Python 3 programming. It also explores new features of Python 3 in brief and introduces
the readers to a few popular Python 3 IDEs. The chapter concludes with a brief
introduction to the concepts related to digital image processing and related areas.
Chapter 3: The aim of this chapter is to quickly get the readers started with digital
image processing in Python 3. The chapter introduces the readers to capture images with
a Webcam and Pi Camera. It introduces the readers to Pillow for image processing and to
Tkinter for GUI.
Chapter 4: This chapter serves to introduce basic arithmetic and logical operations
on Image. Readers also study the image channels in this chapter.
Chapter 5: This chapter explores advanced operations like filtering and effects on
images. Readers are introduced to the concept of the histogram and its computation.
Chapter 6: This chapter introduces you to the world of scientific image processing.
We will install the SciPy stack on Raspberry Pi. We also get started with SciPy, NumPy,
and matplotlib in this chapter.
Chapter 7: This chapter helps readers understand the measurements and
transformations using the scipy.ndimage module of SciPy library.
Chapter 8: This chapter introduces readers to the important concept of filtering. We
will study types of filters (such as low-pass and high-pass filters) and their applications.
Chapter 9: This chapter helps readers understand the concepts related to
morphology. It also covers thresholding. Finally, the chapter uses both concepts to
achieve segmentation in binary images.

xviii
■ Introduction

How Do You Get the Most Out of This Book


It is easy to leverage the book to gain the maximum amount of information you can,
simply by abiding to the following:
• Read the chapters thoroughly. Perform the examples hands-on by
following the step-by-step instructions stated in the code. Do not
skip any code example. If need be, repeat the examples a second
time or until the concept is firmly etched in your mind.
• Join a Python community or discussion forum.
• Read the online documentation available for various image-
processing frameworks in Python 3.
• Read blogs covering computer vision, signal and image
processing, and Python 3.

Where Next?
I endeavored to unleash the power of digital image processing libraries for Python 3 as an
aid to the Raspberry Pi community. I recommend you read the book from cover to cover
without skipping any of the chapters, text, code examples, or exercises.
I wish you well in exploring Python and Raspberry Pi!

A Quick Word for the Instructor’s Fraternity


Attention has been paid in arriving at the sequence of chapters and also to the flow of
topics within each chapter. This is done particularly to assist my fellow instructors and
academicians in carving out a syllabus for their training from the Table of Contents (ToC).
I ensured that each concept discussed in the book includes adequate hands-on
content to enable you to teach better and provide ample hands-on practice to your
students.

A Quick Word for the Non-Computer Science Readers


If you are reading this book and do not belong to the computer science-related field then
you might face a few hurdles to understanding the concepts and mathematics behind
them. If you are working in allied fields like mathematics, electronics, signal processing,
bio-medical imaging, digital imaging, or bio-informatics, and you are reading this book
for work, I recommend reading a few books on the fundamentals of the topics explained
here. This is essential, as the book focuses more on the practicals.
Happy learning and Pythoning!!!
Author, Ashwin Pajankar

xix
CHAPTER 1

Introduction to Single
Board Computers and
Raspberry Pi

We will start this exciting journey exploring the scientific domain of digital image
processing with Raspberry Pi. To begin the journey, you must be comfortable with the
basics of single board computers (SBCs) and with Raspberry Pi. This chapter discusses
the definition, history, and philosophy behind SBCs. It compares SBCs to regular
computers. Then it moves toward the most popular and best selling SBC of all time, the
Raspberry Pi. By the end of this chapter, you will have adequate knowledge to set up your
own Raspberry Pi independently. This chapter aims to make you comfortable with the
basic concepts of SBCs and Raspberry Pi setup.

Single Board Computers (SBCs)


A single board computer (referred to as an SBC from now on) is a fully functional computer
system built around a single printed circuit board. An SBC has a microprocessor(s),
memory, input/output, and other features required of a minimally functioning computer.
Unlike with desktop personal computers (PC), most SBCs do not have expansion slots for
peripheral functions or expansion. As all the components—processor(s), RAM, and GPU,
etc.—are integrated on a single printed circuit board (PCB), you cannot upgrade an SBC.
Few SBCs are made to plug into a backplane for system expansion. SBCs come in
many varieties, sizes, shapes, form factors, and feature sets. Due to the advances in the
electronics and semiconductor technologies, prices of most SBCs are very low. One of the
most important features of SBCs is their inexpensive cost. With a price at around $50 a
piece, you have in your hand a development tool suitable for new applications, hacking,
debugging, testing, hardware development, and automation systems.

© Ashwin Pajankar 2017 1


A. Pajankar, Raspberry Pi Image Processing Programming,
DOI 10.1007/978-1-4842-2731-2_1
Chapter 1 ■ Introduction to Single Board Computers and Raspberry Pi

SBCs are usually manufactured with the following form factors:


• Pico-ITX
• PXI
• Qseven
• VMEbus
• VPX
• VXI
• AdvancedTCA
• CompactPCI
• Embedded Compact Extended (ECX)
• Mini-ITX
• PC/104
• PICMG

Differences Between SBCs and Regular Computers


Table 1-1 lists the differences between SBCs and regular computers.

Table 1-1. Differences Between SBCs and Regular Computers

Single Board Computer Regular Computer


Not modular Modular
Components cannot be upgraded or Components can be upgraded or
replaced replaced
A System On Chip Not a System On Chip
Has a small form factor Has a large form factor
Is portable Is mostly non-portable or semi-portable
Consumes less power Consumes more power
Cheaper than a regular computer Costs more than a SBC

System on Chips (SoCs)


All the SBCs are predominantly SoCs. A system on a chip (SoC) is an integrated circuit
(IC) that has all the components of a computer on a single chip. SoCs are very common
with mobile electronic devices because of their low power consumption and versatility.
SoCs are widely used in mobile phones, SBCs, and embedded hardware. A SoC includes
all the hardware and software needed for its operation.

2
Chapter 1 ■ Introduction to Single Board Computers and Raspberry Pi

SoC versus Regular CPU


The biggest advantage of using a SoC is its size. If you use a CPU, it’s very hard to
make a compact computer, only because of the number of individual chips and other
components that you need to arrange on a board. However, when using SoCs, you can
place complete application-specific computing systems in smartphones and tablets,
and still have plenty of space for batteries, the antenna, and other add-ons required for
remote telephony and data communication.
Due to the very high level of integration and the compact size, a SoC uses
considerably less power than a regular CPU. This is a significant advantage of SoCs
when it comes to mobile and portable systems. Also, reducing the number of chips by
eliminating redundant ICs on a computer board results in a compact board size.

History of SBCs
Dyna-Micro was the first true SBC. It was based on the Intel C8080A and used Intel’s first
EPROM, the C1702A. The Dyna-Micro was rebranded and marketed by E&L Instruments
of Derby, CT in 1976 as the MMD-1 (Mini-Micro Designer 1). It became famous as
the leading example of microcomputers. SBCs were very popular in the earlier days of
computing, as many home computers were actually SBCs. However, with the rise of PCs,
the popularity of SBCs declined. Since 2010, there has been a resurgence in the popularity
of SBCs due to their lower production costs.
Apart from the MMD-1, here are a few other popular historical SBCs:
• The BBC Micro was built around an MOS technology 6502A
processor running at 2MHz.
• The Ferguson Big Board II was a Zilog Z80-based computer
running at 4MHz.
• The Nascom was another Zilog Z80-based computer.

SBC Families
Based on the manufacturers and designers, the SBCs are grouped into families, models,
and generations. Here are a few popular SBC families:
• Raspberry Pi by the Raspberry Pi Foundation
• Banana Pi and Banana Pro
• Intel Edison and Galileo
• CubieBoard
• BeagleBone and BeagleBoard

3
Chapter 1 ■ Introduction to Single Board Computers and Raspberry Pi

The Raspberry Pi
The Raspberry Pi is a family of credit card-sized SBCs developed in the United
Kingdom by the Raspberry Pi Foundation. The Raspberry Pi Foundation formed
in 2009. The aim behind developing Raspberry Pi was to promote the teaching of
basic computer science in schools and developing countries by providing a low-cost
computing platform.
Raspberry Pi Foundation’s Raspberry Pi was released in 2012. It was a massive
hit and sold over two million units in two years. Subsequently, the Raspberry Pi
Foundation revised versions of the Raspberry Pi. They also released other accessories
for the Pi.
You can find more information about the Raspberry Pi foundation on the Raspberry
Pi Foundation’s web site at https://www.raspberrypi.org.
The product page for Raspberry Pi's current production models and other
accessories is at https://www.raspberrypi.org/products.
I have written, executed, and tested all the code examples in this book on Raspberry
Pi Models B+, 2B, and 3B. Raspberry Pi 3 Model B (also known as 3B) is the most recent
model of Raspberry Pi. Table 1-2 lists the specifications of the Raspberry Pi 3, Model B.

Table 1-2. Specifications of the Raspberry Pi 3 Model B

Release Date February 2016


Architecture ARMv8
SoC broadcom BCM2837
CPU 1.2GHz 64-bit quad-core ARM Cortex-A53
GPU Broadcom VideoCore IV (3D part of GPU @ 300MHz, video part
of GPU @ 400MHz)
Memory 1 GB (shared with GPU)
USB 2.0 ports 4
Video output HDMI rev 1.3 and Composite Video RCA jack
On-board storage Micro SDHC slot
On-board network 10/100 Mbps Ethernet, Bluetooth, and WiFi
Power source 5V via MicroUSB
Power ratings 800 mA (4W)

Figure 1-1 shows the top view of Raspberry Pi 3 Model B. The components relevant
to this book are labeled in the image.

4
Chapter 1 ■ Introduction to Single Board Computers and Raspberry Pi

Figure 1-1. Raspberry Pi 3 Model B, top view

Figure 1-2 shows the bottom view of Raspberry Pi 3 Model B.

Figure 1-2. Raspberry Pi 3 Model B, bottom view

You can get more Information on Raspberry Pi 3 Model B by visiting the product
page at https://www.raspberrypi.org/products/raspberry-pi-3-model-b.

Raspberry Pi Setup
You have to set up Raspberry Pi before you can use it for exploration and adventure. This
section explains in detail how to set it up. As mentioned earlier, I am using Raspberry Pi 3
Model B for this setup. The setup process is exactly same for Raspberry Pi 2 Model B and
Raspberry Pi 1 Model B+. Here is the list of hardware materials to be procured for the setup.

5
Chapter 1 ■ Introduction to Single Board Computers and Raspberry Pi

Required Hardware
The following hardware is required to set up the Raspberry Pi.

Raspberry Pi
You need to use Raspberry Pi 3 Model B or Raspberry Pi 2 Model B or Raspberry Pi 1
Model B+ for the setup.

Computer
A Windows computer or laptop with an Internet connection is required. You need to use
a computer to prepare a microSD card with a Raspbian OS image for the Pi.

I/O Devices
A standard USB keyboard and a USB mouse are required.

microSD Card
A microSD card (see Figure 1-3) with at least 8GB of storage is needed. You’ll use the card
for secondary storage for the Pi. A card of Class 10 is recommended as the data transfer
speed with class 10 is great. I recommend using at least an 8GB card to be on the safe side.
Choosing a 16GB card will be adequate for most of the use cases.

■■Note Before purchasing a card, visit http://elinux.org/RPi_SD_cards to check the


compatibility of the card with the Raspberry Pi.

Figure 1-3. Class 10 microSD card

6
Chapter 1 ■ Introduction to Single Board Computers and Raspberry Pi

Power Supply
For all the Raspberry Pi models, a 5V Micro USB power supply unit (PSU) is required. The
recommended current capacity of the PSU for Raspberry Pi 3 Model B is 2.5 amp. For all
the other models, a 2 amp PSU is more than enough.
You can find Raspberry Pi's official power supply (see Figure 1-4) at
https://thepihut.com/products/official-raspberry-pi-universal-power-supply.

Figure 1-4. Raspberry Pi official power supply

Card Reader
You also need a card reader. Many laptops have a built-in SD card reader.
If the laptop or the card reader works with an SD card only, you need a additional
microSD-to-SD card adapter. Figure 1-5 shows a card reader and an adapter.

7
Chapter 1 ■ Introduction to Single Board Computers and Raspberry Pi

Figure 1-5. Card reader and microSD-to-SD adapter

Monitor
You need an HDMI or VGA monitor.
For an HDMI monitor, you need an HDMI male-to-male cable (see Figure 1-6). It is
typically packaged with the HDMI monitor.

Figure 1-6. HDMI male-to-male cable

8
Chapter 1 ■ Introduction to Single Board Computers and Raspberry Pi

For the VGA monitor, you need a VGA cable (see Figure 1-7). This too is usually
packaged with the VGA monitor.

Figure 1-7. VGA male-to-male cable (also known as a D-SUB cable)

If you are using a VGA monitor, you need an HDMI to VGA adapter (see Figure 1-8),
because Raspberry Pi has an HDMI port only for the video output.

Figure 1-8. HDMI to VGA adapter

Preparation of the microSD Card for Raspberry Pi


Manually preparing the microSD card for Pi is the best way of installing any OS into
a microSD card for SBCs. Many users (including me) prefer it, because it allows the
contents of microSD card to be modified manually (if needed) before it is used for
booting. The other way to prepare the microSD is to use NOOBS (New Out Of the Box
Software), which I have not used in this book.

9
Chapter 1 ■ Introduction to Single Board Computers and Raspberry Pi

This approach allows you to access to the configuration files like /boot/config.txt
before booting. You might have to modify the configuration files in a few cases
(we will discuss that soon) before booting up the Pi. The default Raspbian image has two
partitions, called boot and system. Be sure to use at least a 16GB microSD card for the Pi
considering any possible future upgrades to the OS.

Download the Required Free Software


Let's download the required software.

Download Accelerator Plus


Download the Download Accelerator Plus setup from its download page (http://www.
speedbit.com/dap/download/downloading.asp). This freeware is used to manage
downloads. It is useful for large downloads, as you can pause and resume downloads. If
your computer shuts down suddenly or the Internet is interrupted, it resumes the download
from the last checkpoint. Once you download and install it, use it to manage any further
downloads.

Win32 Disk Imager


Download the Win32 Disk Imager setup from its download page (https://sourceforge.net/
projects/win32diskimager/files/latest/download). Install it.

WinZip or WinRaR
You need a file extraction utility. Download WinZip (http://www.winzip.com/win/
en/index.htm) or WinRaR (http://www.win-rar.com/download.html). Install the one
you chose.

Download and Extract the Raspbian OS Image


You will use the Raspbian OS for the Pi. (We will discuss Raspbian in detail in a later part
of the chapter.) As of now, download the latest ZIP of the image of the Raspbian OS from
https://www.raspberrypi.org/downloads/raspbian. Extract the image ZIP file using
WinZip or WinRaR.

Writing the Raspbian OS Image to the microSD Card


Insert the microSD card into the card reader. If your computer or laptop has a built-in
card reader, insert it there. You might have to use a microSD-to-SD card adapter if the
card reader or your computer has a slot only for the SD card reader.
Open Win32 Disk Imager. Select the location of the image file and click the Write
button (see Figure 1-9).

10
Chapter 1 ■ Introduction to Single Board Computers and Raspberry Pi

Figure 1-9. Win32 Disk Imager

If you see the warning message shown in Figure 1-10, toggle the write protection
notch of the card reader or the SD card adapter (or both). Then click the Write button
again.

Figure 1-10. Write protection error message

Figure 1-11 shows the warning message that will be displayed. Click Yes to continue.

Figure 1-11. Overwrite warning message

11
Chapter 1 ■ Introduction to Single Board Computers and Raspberry Pi

Once the OS image has been written to the SD card, the message in Figure 1-12 will
be displayed. Click OK.

Figure 1-12. The Write Successful message

This means the Raspbian OS has been flashed to the microSD card.

Altering the Contents of the config.txt File for a VGA


Monitor

■■Note This step is a must if you are planning to use a VGA monitor. You should skip this
step if you are using an HDMI monitor.

You need to change the contents of the config.txt file to get the Pi working with
VGA monitors. You will learn more about config.txt later in this chapter.
Insert the microSD card into the card reader again and browse it in Windows
Explorer. In Windows Explorer, it will be represented as a removable media drive
called boot.
Open the config.txt file and make the following changes to it:
• Change #disable_overscan=1 to disable_overscan=1
• Change #hdmi_force_hotplug=1 to hdmi_force_hotplug=1
• Change #hdmi_group=1 to hdmi_group=2
• Change #hdmi_mode=1 to hdmi_mode=16
• Change #hdmi_drive=2 to hdmi_drive=2
• Change #config_hdmi_boost=4 to config_hdmi_boost=4
Save the file after making these changes. The microSD card is now ready for the Pi
and for a VGA monitor.

12
Chapter 1 ■ Introduction to Single Board Computers and Raspberry Pi

Booting Up the Pi
Let's boot the Pi up with the prepared microSD card. The steps for that are as follows.

1. If you are using an HDMI monitor, connect the monitor


directly to the Pi’s HDMI port using the HDMI male-to-male
cable. If you are using a VGA monitor, use the HDMI-to-VGA
adapter to convert HDMI signals to VGA.
2. Insert the microSD card into the microSD card slot of the Pi.
3. Connect the USB mouse and the USB keyboard.
4. At this point, make sure that the power is switched off. Then
connect the Pi to the power supply with a micro USB power
cable discussed earlier.
5. Connect the monitor to the power supply.
6. Check all the connections. Switch on the power supply of the
Pi and the monitor.

At this point, the Raspberry Pi will boot up.


For all the models of Raspberry Pi with the single core processor, the boot screen will
resemble the screen in Figure 1-13.

Figure 1-13. Single-core CPU RPi model boot screen

13
Chapter 1 ■ Introduction to Single Board Computers and Raspberry Pi

For all the models of Raspberry Pi with the quad-core processor, the boot screen will
resemble Figure 1-14.

Figure 1-14. Quad-core CPU RPi model boot screen

Once the Pi boots up, the monitor displays the desktop, as shown in Figure 1-15.

Figure 1-15. Raspbian desktop (as of February 2017)

14
Discovering Diverse Content Through
Random Scribd Documents
CHAPTER XXII.
ANOTHER NEW CHANCELLOR.

The discontent in the country has now reached its culmination upon
its becoming generally known that all concerts, and theatres, and
other amusements in Berlin are free. The inhabitants of every little
insignificant bit of a place demand that the national purse provide
them with the same diversions that we have here; and they base
their claim upon the acknowledged social equality of all, and upon
the right of all to enjoy the same identical recompense for the same
labours. They say that even under the best of circumstances they
are still placed at a great disadvantage, as every village can’t have
gas or electric lighting, heating by hot-air pipes, and the like.
The Onward attempted to soothe the feelings of the people in the
country by graceful and appropriate references to the advantages of
country life, idyllic remarks upon the enjoyment of nature, and the
sweet freshness of the air. This was looked upon as irony, and they
wanted to know what enjoyment of Nature there was during heavy
rains, or in the long winter evenings?
“What fresh air do we get in the cramped little cottages in the
country, or in the stables and shippons?”
Thus they grumbled in letters to the paper.
It was pointed out to them that it had never been any different.
They admitted the truth of this, but then went on to say that
formerly everyone who did not care to stay in the country was at
liberty to remove into a town. Now, however, it was very different,
and the countryman was tied to his clod of earth until it pleased the
authorities to dispose otherwise of him. And under these
circumstances they must look to the State to provide them with just
the same amusements as the large towns had. They merely asked
for equal rights for all, and no more.
The Chancellor did not at all know what to do. The wise government
of a people has unquestionably more knotty points about it than the
cleaning of boots and the brushing of clothes. This scheme of
planning recreations for the people has been about the only thing he
has carried through. But with the best will in the world he could not
possibly have a band of music, a circus, and a company of specialists
at every street-crossing. Pondering upon this business, the happy
thought occurred to him to have a few hundred thousand Berliners
transferred to the enjoyments of the country every Sunday, and a
corresponding number of country people brought up to the
attractions of the town. But unfortunately for this social equality the
weather proved very unequal. In rainy weather the Berlin people
showed no great liking for damp excursions into the country. But the
country people, who had arrived in great numbers, naturally
expected those seats at the various places of amusement which the
Berliners did not care to relinquish.
After the Chancellor had succeeded in thus setting the townspeople
and the country people thoroughly at loggerheads with each other,
his retirement was deemed expedient, in order that the feeling
against him might not unduly prejudice the coming general
elections. In Berlin, as might be expected, the disgust at the
stoppage of all further free recreations is universal. Henceforth
places at the theatres and similar entertainments can only be had
against payment in the coupons of the money-certificates.
The Secretary to the Treasury has been appointed as the
Chancellor’s successor. He is known as a man who goes straight to
the point, regardless of all considerations, and he also has the
reputation of being a good financier. This latter quality will be all the
more welcome, as there are all sorts of ugly whispers abroad
respecting the disproportion there is between income and
expenditure in the finances of the socialised Community.
CHAPTER XXIII.
FOREIGN COMPLICATIONS.

The entire navy left by the late Government is to be got ready for
service with all possible speed. In addition to this, the standing
army, which had already been increased to 500,000 men with a view
the better to maintain order at home, and to keep a good watch on
the frontiers, has been still further strengthened. These are amongst
the first measures taken by the new Chancellor to avert dangers
which menace us from abroad.
In the speech which the Foreign Secretary made before the
Committee of Government, and in which he unfolded the above
measures, he calls attention to the necessity there is for them, in
consequence of the deplorable growth of friction, of complications
and dissensions with foreign powers. But it must distinctly be
understood that the Minister for Foreign Affairs was in no way
responsible for this unfortunate state of things. In the socialised
Community it was the province of this Minister to arrange with
foreign powers for the barter of all goods between State and State.
It resulted from this arrangement that all complaints in respect of
inferiority of goods, or unpunctuality in supplying them, had to be
attended to in the form of diplomatic notes. All that tension which
sometimes ensued from the breaking off of business connections,
from the jealousies of competition, or from similar commercial
causes, and which formerly had only affected mercantile circles, was
now transferred to the direct relations which one nation had with
another. This is in the nature of the new arrangements.
The Minister went on to say it had been hoped that the almost
universal consciousness of having adopted right principles, and the
sentiment of the brotherhood of all nations, would play a different
part than had been found to be the case in actual practice, toning
down differences, and bringing universal peace. He said it need
occasion no surprise that the English, that egotistical Manchester
race, and their American cousins, would have nothing at all to do
with Socialism. They never could get over it that the socialistic
European continent, by the repudiation of all State bonds, shares,
and so on, had shaken off all slavish indebtedness to English holders
of continental scrip. But even these inveterate lovers of money ought
to see that Germany had lost unnumbered millions more by the
repudiation than it had gained. This was evident, inasmuch as all the
Russian, Austrian, Italian and other bonds in German hands had also
been repudiated by the socialistic governments of those countries.
These various socialistic governments do not thank us a bit for
having, in our lofty consciousness of the international value of
Socialism, accepted without a murmur the abolition of all claims for
interest on such foreign bonds as were in our possession. Several of
these governments have latterly become so egotistical, and they
show such a want of regard for us, that they positively go the length
of refusing to let us have any goods except against either money
down, or an equivalent value in such other goods as they may
require. Payment in money was no difficulty to our Government so
long as any of those stocks of coined and uncoined gold and silver
which had become worthless to us were left. But now that we have
by degrees got to the end of our stock of noble metals, we are
constantly coming across all kinds of obstacles in the way of the
exchange of our goods for commodities which we need from other
countries, such as corn, timber, flax, cotton, wool, petroleum, coffee,
etc. These obstructions are not confined to the snobbish gentlemen
of England and America, but they are every bit as numerous on the
part of the neighbouring socialistic nations. Our requirements for the
articles just mentioned have not diminished one atom under our
socialistic form of government. Quite the reverse. But the
neighbouring States, with similar views to our own, tell us that since
the introduction of the socialistic form of government they find no
demand at all for German goods, such as velvets, shawls, ribbons,
mantles, embroideries, gloves, pianos, glass and similar wares. They
say that since the restoration of the precise balance of social
equality, they produce more of these goods themselves than there is
a demand for.
The English and Americans, in their enmity to Socialism, are
everlastingly drumming it into us that our manufactures, from
ironware and textile goods down to stockings and toys, have so
deteriorated under the new system of manufacture, that they can no
longer pay us the old prices; and they say that unless an
improvement takes place they will have to look to other sources of
supply. But even as it is, with the enhanced cost of production, we
cannot make our trade pay. All attempts to settle an international
maximum working-day have failed, as the various socialistic
governments allow particular interests to influence them, and
pretend that in this matter they must be guided by such special
features as climate, national character, and the like.
What is our Government to do in this dilemma? The fact that we, on
our part, now require no more silk, and no more expensive wines
from abroad, is but a meagre compensation for the loss of our
export trade, amounting to many millions. It can occasion no
surprise that the exchange of diplomatic notes partakes daily of an
increasingly irritable character. Already, both on the West and on the
East, hints have fallen that the right thing for Germany to do, seeing
she seems incapable of maintaining her population, would be for her
to cede slices of the country to neighbouring States. Nay, the
question is even debated whether it would not be advisable, as a
precautionary measure, to lay an attachment on these border lands,
as security for the bill which Germany had run up for goods supplied
to her.
Foreign holders of German bonds who feel themselves injured by our
repudiation, take every opportunity of indemnifying themselves by
laying an embargo on German vessels and merchandise. Then again,
the assistance given by foreign ships to fugitives from our country, is
a permanent cause of angry representations.
In short, the hope that the advent of Socialism everywhere would
prove synonymous with the reign of eternal peace between the
nations, was so far from being realised that the very opposite
threatened. The Minister concluded his speech by saying that the
Committee of Government could hence hardly fail to see the
necessity there was for the navy being again fitted out for service;
and it would doubtless also sanction the increase of the army to a
million men.
CHAPTER XXIV.
THE ELECTION STIR.

The general election is at last to take place, and next Sunday is fixed
as the polling day. This choice of a day of rest and leisure deserves
the highest commendation, as nowadays a hundred times more
issues depend upon the result of an election than was formerly the
case. Laws are everything in a socialistic State; the law has to
prescribe to each separate individual how long he must labour, how
much he has to eat and drink, how he must be dressed, housed and
what not.
This is already very apparent in the addresses to constituents, and in
the election cries. The number of parties which advocate particular
interests is legion. Many of the addresses issued by the candidates
bristle with proposals for the reform of the daily bills of fare, for the
increase of the meat rations, for better beer, stronger coffee, (since
the complications with various foreign powers, we scarcely ever get
any coffee that is not made exclusively of chicory,) for finer houses,
better heating apparatus, more splendid lighting, cheaper clothes,
whiter underlinen, etc. etc.
Many women are extremely indignant at the rejection of their
demand that one half of the representatives in the various divisions
be of their sex. The ground for this rejection was that the demand
was a reactionary endeavour to split up the interests of the whole
Community into separate interests. The women, however, on their
part, fear that, by throwing in their lot with the men, and having
divisions common to both, many of their voters will in the end go
over to the men’s side. They fear that the result of this, coupled with
the other fact that the support of women candidates by men is not
at all to be relied on, will be that they will be able to carry but a
limited number of candidates.
A large number of women, quite irrespective of age, have now
thrown in their lot with the Younkers, and this party, the better to
render the new alliance permanent, has inscribed upon its banner
the right of all women to marriage. These politicians are now
constantly appealing to Bebel’s book on woman, and they want to
make out that they are the real genuine Bebelites. Their programme
is—A four hours’ maximum working-day; four weeks’ holiday in the
year for everybody, with a sojourn at the sea-side or in the country;
the re-introduction of free amusements; weekly change in the kind
of labour to be performed; and lastly, the monthly duration of all
appointments to high offices and offices of State (including the office
of Chancellor), all such appointments to be held in rotation by all
persons in the State, without distinction. The Government party
shows considerable confidence, although, in reality, the programme
it has issued does not go beyond ordinary commonplace; but it calls
upon all other parties, as true patriots, to forget their differences,
and to unite and form a grand Party of Order, in opposition to the
party of negation and demolition, which was stealthily increasing,
and which, under the enticing name of a Party of Freedom, sought
to ingratiate itself with the nation. This so-called party of freedom
demands the re-recognition of the right of parents to bring up their
children, abolition of the State cookshops, free choice of trades and
professions, entire liberty to move about as one pleases, and a
better recompense for the higher kinds of labour. Now, it is
abundantly clear that the concession of demands such as these must
of necessity upset all equality, and be eminently calculated to sap
the very foundations of Socialism. The candidates of the
Government party very properly point out in their addresses to
constituents that the granting of such demands would inevitably
open the door to the return of personal possessions, the doctrine of
inheritance, the sovereignty of wealth, and the plundering system of
bygone days.
But, after all, the amount of excitement shown at the present
election is strangely out of proportion to the number and many-
sidedness of the election cries. In old days people took a good deal
more interest in an election. People can now say what they think.
Following the resolutions passed at the Erfurt Conference, in
October, 1891, all such laws as tended to limit freedom of speech
and the right of combination are now abrogated; but what is the
good of a free press so long as the Government is in possession of
every printing establishment? What is the right of public meeting
worth when every single meeting-hall belongs to the Government?
True, the public halls, when not already engaged, may be taken by
parties of all shades of politics for purposes of public meeting. Only,
as it chances, it is just the various Opposition parties that invariably
have such ill-luck in this way. As often as they want a hall or a room,
they find it has been previously engaged, so they are unable to hold
a meeting. The press organs of the Government are in duty bound
to insert such election notices from all parties as are paid for as
advertisements; but by an unfortunate oversight at the issue of the
money-certificates, there were no coupons supplied for such
particular purposes. The unpleasant result of this omission is a total
lack of all funds with which to pay the expenses of an election. In
this respect the Socialists were vastly better off under the old style.
They then had large sums at their disposal, and it must be admitted
they knew how to apply them judiciously.
The Opposition parties complain bitterly of the scarcity of persons
who, when it comes to the test, have the requisite courage to boldly
face the Government as opponents, either as candidates for
Parliament or as speakers at election meetings. The fact that every
obnoxious person may be unceremoniously told off by the
Government to some other occupation, or sent away to a distant
part of the country, may have something to do with this hanging
back. Such sudden changes involve frequently the endurance of
many unpleasantnesses and hardships, particularly to people of riper
years. Of course everybody has the right to protest against a
transfer which looks like mere caprice on the part of the
Government. But how can an individual undertake to prove that the
transfer was not a well-advised step, and not justified by other
alterations elsewhere in the general labour scheme, which rendered
this particular appointment necessary?
The daily conferences which we controllers have together, make it
more and more clear that the minds of men, both in the towns and
in the country, are in a bad ferment. It is impossible to resist the
conviction that the most trifling cause might, at any moment, suffice
to call forth a violent eruption of popular feeling in favour of a
restoration of the old order of things. From all parts of the country
reports are constantly coming in, detailing violent collisions between
civilians and the troops which were sent out to establish Socialism.
The Government is not even quite sure of the troops. This is the
reason why Berlin, in spite of the great augmentation of the army,
has not received any garrison. But our police force, on the other
hand, which has been picked from the ranks of perfectly reliable
Socialists throughout the whole country, has been increased to
30,000 men. In addition to mounted police, the police force is now
further strengthened by the addition of artillery and pioneers.
The voting takes place by means of voting-papers, which bear the
official stamp, and which are handed in in sealed envelopes. But in
view of the system of espionage in the hands of the Government,
which penetrates into everyone’s most private affairs; in view of the
publicity which everybody’s life now has, and the system of control
that all are subject to; in view of these things, many persons seem
to mistrust the apparent security and secrecy of the voting-papers,
and not to vote according to their inmost convictions. In former
times, somewhat of this sort of thing prevailed in small electoral
districts. Now, however, every single individual is a spy on his
neighbour.
There is, hence, a great deal of uncertainty as to the result of the
elections. If the nation gives expression to its real wishes, we shall
see the return of a majority bent upon a restoration of the old order
of things. But if these wishes are kept in check by fear, we shall get
a parliament which is a mere tool in the hands of the Government.
I do not yet at all know, for my part, how I shall vote. I fancy,
somehow, that through my son’s flight a sharp eye is being kept on
me. I shall most likely end by giving in a blank voting-paper.
CHAPTER XXV.
SAD NEWS.

Annie, our dear, precious, little Annie, is dead! It seems impossible


to actually realise that the pretty, little creature that used to frolic
about, so full of life and joy, is now all at once cold and lifeless; that
those young lips which prattled away so sweetly are now for ever
dumb; that those laughing eyes that used to shine so brightly are
now closed in the stillness of death.
And to-day, too, is her birthday. My wife had gone in the morning to
the Children’s Home in the hope of, at least, being able to see the
child for a few minutes. With a smile on her face, and her heart
brimful of joy, she inquired for Annie. A pause ensued, and then she
was asked again for her name and address. Presently the news was
broken to her that the child had died during the night, of quinsy, and
that a message to this effect was now on its way to the parents.
My wife sank down on a chair perfectly stupefied. But the mother’s
love for her child soon brought her strength back again. She refused
to credit such a thing, to believe that her Annie, her child, could be
dead; there must be a strange mistake somewhere. She hastily
followed the attendant to the death-room. Ah! there had been no
mistake. There lay Annie, our dear little Annie, in that still long sleep
from which no calling, and no kissing, and no bitter agony of the
poor mother will ever awaken her.
What avails it to enter into a long account of the suddenness with
which this malignant disease had attacked her? It began with a cold
which she had probably caught at night. At home the child always
had a way of kicking off the bed-clothes in her sleep. But yonder
there is no mother’s eye to watch tenderly at the bedside of each
little one amongst so many hundreds. Then again, the prescribed
ventilation always causes more or less draught in the bedrooms. Or
possibly the child had not been properly dried after a bath. In all
these great establishments a good part of the work must
unavoidably be done in a summary manner. It is likely enough, too,
that the different style of living had made the child a little weaker,
and therefore more susceptible than she had been at home. But
what avails now inquiry or speculation? All that will never bring our
Annie back to life again.
How will my poor wife be able to stand all this sorrow upon sorrow?
The shock had such a serious effect upon her that she had to be
taken in a cab straight from the Children’s Home to the hospital.
Later on they fetched me. Annie had been the pet of the family, the
only girl, born some time after the lads. How many had been our
hopes, our dreams, for her welfare, when she should be once grown
up?
I must break the news to-morrow to Ernst as best I can. It will not
do for grandfather to get to hear it at all. He can never more tell her
stories as she sits on his lap, as she so often used to, and ask again
and again to be told about “Little Red Riding Hood and the Wolf.”
Franz and Agnes in America have as yet no suspicion of our sorrow,
and they won’t get my letter before nine or ten days. Franz loved his
little sister tenderly, and it was rarely that he omitted to bring her
some trifle when coming home from work. The little rogue knew this
well enough, and used to run to meet him on the stairs as soon as
there was any sign of his coming.
And now there is an end to all these things; an end to these and to
so many other things in a few short months.
CHAPTER XXVI.
THE RESULT OF THE ELECTIONS.

With heaviness such as this in the heart, all political matters seem so
immaterial and idle to one. The sorrows of the present moment
make one regard all considerations for the future with indifference.
Franz has proved to be right in his forecast of the results of the
elections. In his last letter he expressed his belief that, in a
community in which there was no longer any personal or commercial
freedom, even the freest form of government would fail to restore
any political independence. He considered that those subjects who
are so dependent upon the Government, even in the most ordinary
affairs of life, as is now the case with us, would only in very rare
instances have the courage to vote, no matter how secret that
voting might be, in opposition to the known wishes of those in
power. The right of voting, Franz wrote, could have no more serious
significance in our socialistic State of society than such a right has
for soldiers in barracks, or for prisoners in gaol.
The result of the elections shows that the Government party, in spite
of all the wide-spread discontent there is, has secured two-thirds of
the votes recorded. And this triumph, moreover, has been obtained
without any special efforts on their part. The only exception which
must be made in this connection was the transfer of a few leaders of
the party of freedom, and of the Younkers, which transfers were
obviously made for political reasons, and intended to act as
warnings.
Weighed down by the load of adversity which has befallen us as a
family, I relinquished my original intention of giving an adverse vote,
and sided with the Government. Whatever would have become of
my wife and me if, in our present frame of mind, I had been sent
away to some far-off little place in the provinces?
It seems somewhat odd that in the country, where the discontent is
at its height, the Government has scored the best results. The only
explanation is, that as people in the country are even more under
surveillance than is the case in thickly-populated towns, they are still
more reticent in giving expression to opposition views than
townspeople are. In addition to this, the recent increase of the army
has sent some terror into men’s hearts in the disaffected districts.
In Berlin, the Government party is in a minority. And as, according to
the system of proportional election now adopted, Berlin forms only
one electoral division, the vote of our city is on the side of the Party
of Freedom.
The Younkers have come off very badly, and, in spite of the strong
support given them by the Woman’s Universal Wedlock League, have
only succeeded in returning one candidate. It seems pretty clear that
the nation has no desire to see any additions made to the socialistic
edifice now erected. And even this one candidate would scarcely
have been returned but for the help of friends belonging to the Party
of Freedom, who supported his election because of the vigorous
attacks he made on the Government.
The Party of Freedom, or the Friends of Freedom, as they also style
themselves, have obtained nearly one-third of the total number of
votes recorded throughout the whole country. And this result has
been obtained in spite of all the efforts made by the Government
side to brand them as a party of demolition, and one that sought
only to undermine the established order of society.
The relative measure of success which this party has obtained is
largely owing to the support given by women voters, and, indeed,
these latter have shown a good deal more activity in the elections
than the voters of the rougher sex. They have made no secret of the
bitterness they feel at the present state of things, and of their
chagrin at the restrictions placed upon private and domestic affairs.
In particular, the regulation rendering it possible at any moment to
give notice of the dissolution of marriage, had the effect of making a
large number of deserted wives specially active in the distribution of
voting-papers, and in bringing dilatory voters up to the poll.
Of lady candidates only one has been returned to Parliament, this
one being the wife of the new Chancellor. This lady is not an
adherent of the Government party, but calls herself an entirely
independent member. In her election speeches she has repeatedly
assured her hearers that she would, in Parliament, follow exactly the
same course she had always adopted at home, both towards her
present husband, and towards the husbands she has had before,
and plainly speak out her mind whenever the welfare of the nation
seemed to require it. The Government party did not care to oppose
the election of this lady, partly out of courtesy to the Chancellor, and
partly in order that her return might serve as an illustration of the
equality of women’s rights with those of men.
CHAPTER XXVII.
A LARGE DEFICIT.

A deficit of a milliard per month! A thousand million marks


expenditure over income per month! That was the disagreeable
message with which the Chancellor greeted the assembling of the
new Parliament. The only wonder is that this could be kept secret
until after the elections. But it is now high time to look into this
matter, and see that some improvement is made.
For a long time past there have been signs in all directions that
something or other was wrong. When going to make purchases you
were told, only too often, that such and such an article had just run
out of stock, and that a fresh supply would not come in for some
little time. It now comes out, however, that this was due, not to an
increase in the demand, but to a decrease in the supply. Things got
so bad that there was often the greatest difficulty experienced in
obtaining the most indispensable articles of clothing. In the case of
other articles of daily use you had frequently either to go without, or
to put up with the most old-fashioned and antiquated things which
had been left on hand ever so long. All import goods, such as coffee,
petroleum, farinaceous foods, and so on, were so high in price as to
be scarcely procurable.
Indeed, in no respects can it be said that the people have lived in
luxury and riot. At dinner, the meat rations have remained nominally
the same as at first, viz. one-third of a pound per head. But, latterly,
there have been unpleasant innovations in respect of including bone,
gristle, fat and similar unprofitable matter in the gross weight of the
rations. The vegetable part of the bill of fare has been also much
simplified, and is now restricted to potatoes, peas, beans, and
lentils. On Bebel day the increased meat ration and the free glass of
beer which had been looked for were conspicuous by their absence.
The strictest economy extends even to the matter of pepper, salt,
and spices. On all hands there are complaints that the tastelessness
and sameness of the dishes are such as to produce nausea, even in
those who have the most robust appetites. What little conversation
there is at meal times tends more and more in the direction of talk
about sickness and internal complaints.
So far as appearances seem to indicate, our population, in spite of
the considerable emigration which has taken place, may count upon
a rapid increase as a result of the undertaking on the part of the
State to bring up all children free of cost. But notwithstanding this,
no measures are taken to meet the demand, and even here in Berlin
there is scarcely any building going on. Even the most indispensable
repairs are constantly being postponed. No longer is there a syllable
dropped about alterations and improvements anywhere; about the
renewal of machinery and stores; about the building of new mills, or
works, or the enlargement of old ones; or about the construction of
new railways.
All stores for daily consumption seem to have dwindled down to a
minimum. The only stocks we have are of such things that there is
little or no demand for. What other stocks there are consist of such
goods as we formerly sent abroad, but which there is now, especially
in socialistic countries, no longer any sale for. These goods are
gloves, silks, velvets, pianos, wines, embroidered and fancy goods,
etc. etc. All such articles may now be had in the home-markets at
less than cost price, for the mere sake of getting rid of them.
From month to month the deficit seems to grow greater instead of
less, in spite of all attempts to grapple with the difficulty. Even the
stocks of raw material and auxiliary material begin to show signs of
not being long able to keep the various works fully going. Foreign
merchants everywhere have ceased sending any goods to Germany
on credit, or otherwise than against an immediate exchange of
goods to the same value.
Unpromising as this state of affairs looks, the Government cannot
really be reproached with having regulated consumption without a
due amount of previous forethought. From the statement made at
the opening of the new Parliament, it seems that, from pretty
accurate calculations made, the value of the entire productivity of
the country, immediately anterior to the Revolution, had been from
17 to 18 milliards of marks annually. The Government took this as a
basis, and did not even calculate on any possible increase in the
value of the nation’s productivity under a new system of things. It
simply went on the assumption that this value would remain at least
the same, and would not diminish through the maximum working-
day being fixed at eight hours. The calculation of the amount of
consumption per head of the population was based upon this
assumption. But even if the Government had proved right, it is quite
evident that the majority of the nation has so far not been placed on
a better footing, but on a worse one, than it was in before the great
Revolution, to say nothing of all the restrictions placed upon
personal and commercial liberty.
A short time, however, sufficed to show that the value of the nation’s
productiveness sank down to one-third of what it had formerly been.
From 18 milliard marks a year it went down to six milliards, or from
one and a half milliards per month to half a milliard. In this way we
have a deficit of a milliard per month. In four months this amounts
to a loss equal to the war contribution which France had to pay to
Germany in the great war of past days.
What will this land us in? and where are we to look for help? The
next sitting of Parliament is awaited with considerable excitement
and interest, as the Chancellor intends then to go into the reasons of
the deficit.
CHAPTER XXVIII.
DOMESTIC AFFAIRS.

I find myself still quite solitary at home, a thing I have never known
since I was a single young man.
My poor wife still lingers on at the hospital, and the doctor lately
asked me to make as few visits as I possibly could to her, so that she
might be kept from all excitement. For she no sooner sees me than
she throws her arms passionately round my neck, as though I had
just been rescued from some alarming danger. When I have to leave
her there is a renewal of these agitating scenes, and it is long before
she can reconcile herself to the idea of my going. After the
conversations we have had together, her thoughts naturally wander
back to me and the other members of the family; and the more she
suffers them to run in this groove the more anxiety and uncertainty
does she feel on our account. She is constantly fancying us exposed
to all kinds of dreadful persecutions and perils, and is afraid of never
seeing us more. The shock her system sustained through the death
of our little daughter, and through the events connected with the
flight of Franz and Agnes, still affects her most severely.
My wish was to consult our former doctor on her case. He knows her
system thoroughly well, as he has attended her, when occasion
required, ever since our marriage. When I called upon him he had
just returned from a youthful suicide, whom he had in vain
endeavoured to call back to life. He told me he was extremely sorry
to say that his eight hours maximum working-day had just expired,
and that such being the case, he was unable, although much against
his will, and in spite of the friendship between us, to give any more
medical advice on that day. He told me that he had already, on two
occasions, been denounced by a younger colleague, who was not
able to render a sufficient number of coupons to the State Book-
keeping Department, to prove that he had been engaged
professionally for eight hours each day. This young man had laid an
information against him for exceeding the hours of labour, and he
had been heavily fined for over-production.
Commenting upon the case he had just returned from, the old
gentleman enlarged upon the frightful increase in the number of
suicides in the socialistic Community. I asked him whether this one
had been a case of unrequited love. He replied in the negative, but
went on to say that such cases did sometimes occur, precisely as
formerly, as it would scarcely do to prohibit women by act of
Parliament from rejecting proposals which were not agreeable to
them. The old gentleman who, in his younger days, had been an
army surgeon, attributed the increase in the number of suicides to
other causes. He told me he had frequently observed that a
considerable number of such suicides as took place in the army
arose from the simple fact that many young men, although they felt
perfectly content in all other respects, found the unaccustomed
restraints of military life utterly unbearable. These young men found
life under such circumstances unendurable, even although they
knew that in the course of two or three years they would return to
their accustomed freedom. Hence, it was no wonder, he continued,
that the irksome and life-long restrictions of personal freedom which
have resulted from the new organisation of production and
consumption, together with the idea of the absolute social equality
of all, should have had the effect with many persons, and those by
no means of an inferior order, of so far robbing life of all its charms,
that at last they had recourse to suicide as the only way of escape
from the restraints of a dreary and monotonous existence, which all
their efforts were powerless to alter. It is very possible the old
gentleman is not altogether in the wrong.
It is cheering to reflect that we have good news from Franz and
Agnes in America. This is the only ray of sunshine in my life. They
write that they have already left the boarding-house in New York, in
which they stayed immediately after their marriage, and have
managed to get a humble little home together. Through being an
excellent hand at his trade, and through his honourable character,
Franz has become foreman in a first-class printing concern. Agnes
works for a large millinery establishment, and it seems that the
wages in this branch have gone up considerably in America since the
competition on the part of Germany has fallen so seriously in
arrears. Thus, by economy, they are enabled to buy one thing after
another for their cosy home. Franz was terribly upset by the news of
his little sister’s death, and he much wants me to send Ernst over to
him, and promises to provide for his future.
No words could describe how sorry I feel for Ernst at his school.
And, in fact, as a general thing, one hears nothing but unfavourable
accounts of these schools, more particularly of those which are
occupied by young men of from eighteen to twenty-one years of
age. These young men all know that upon the completion of their
twenty-first year, irrespective of what they have learnt, or whether
they have learnt much or little, precisely the same fate awaits them
all. They know they will find exactly the same course prescribed for
them that is prescribed for all alike, and that no efforts or talents will
ever avail to enable them to pass beyond that prescribed course.
They know, further, that the fact of their tastes lying in this or that
particular direction, affords not the slightest guarantee of their
receiving an appointment in accordance with those tastes, or even in
any approximate accordance with them. The result is, that almost
without exception they run into all sorts of extravagance and excess,
so that lately such severe measures had to be taken for keeping
them within bounds as could scarcely be surpassed in reformatories.
But in spite of all this, I dare not yet venture to whisper a word to
Ernst about flight. Even if I could devise a sure way of getting the
young fellow on board a foreign vessel, and supposing I had any
means of recouping Franz for the expense of the journey, I should
still feel incapable of taking such a decisive step for Ernst’s future,
without his mother’s full acquiescence. And to talk to her of such a
thing, in her present frame of mind, might be her death.
CHAPTER XXIX.
A STORMY PARLIAMENTARY SITTING.

I have not been in the House since the debate on the savings bank
question. It will be remembered that this was prior to the recent
general election, and that the House, or as it was styled, the
Committee of Government, was then composed exclusively of those
members of the Socialist party who had sat before the Revolution,
the seats of all the members of the various other parties having
been declared vacant, in consideration of the fact that all such
members had been returned through the influence of capital. To-day,
however, the newly elected opponents of Socialism sat in their
places, occupying the entire left side of the House, and numbering
about one-third of the seats.
The only lady member who has been returned, the Chancellor’s wife,
sat in the middle of the front Opposition bench. She is a fine,
dashing woman, with plenty of energy: to my thinking she was
perhaps a trifle coquettishly attired for the occasion. She followed
her husband’s speech with marked attention, at one time nodding
approval, and at another shaking her head—she wore ringlets, and
had red ribbons in her hair—to denote dissent.
The Government side of the House lay under a very apparent cloud
of depression, resulting from the news of the large deficit. The
Opposition, on the other hand, was very lively in its sallies. The
strangers’ galleries were densely packed, the number of women
present being especially large, and the excitement everywhere
considerable.
A debate on the condition of the national finances was down for the
order of the day, and I will endeavour to reproduce here the main
points of the debate as to the causes of the great deficit. The first
speaker was
The Chancellor—“The fact of a considerable diminution in productive
values having taken place in our country, a diminution so great that
those values are now only one-third of what they were before the
great Revolution, is a fact that it ill becomes us either to be-laugh or
to be-weep, but which we must all endeavour to grasp and to
comprehend. Prominent amongst the causes of that retrogression
are the opponents of our socialistic system.”
The Member for Hagen, on the Left—“Oh, oh.”
The Chancellor—“I need scarcely remind the Member for Hagen that
in order to establish Socialism in the country, we have been under
the necessity of increasing the police force more than tenfold. In
addition to this, we have seen the expediency of doubling the
strength of the navy, and of the standing army, so that these forces
might be in a position to render adequate support to the police in
their work of maintaining order and preventing emigration, and
might also constitute a sufficient bulwark against dangers from
abroad. Furthermore, the declaring void all State bonds and values
on the part of the various socialistic governments of Europe, has
necessarily affected whatever German capital was invested in those
countries, and in this way greatly tended to lessen our income. Our
export trade has fallen off to an alarming extent, partly owing to the
Socialist order of things which now reigns supreme in many
countries, and partly to the aversion which the bourgeois nations
show to our manufacturing system. In respect of these various
causes it can hardly be anticipated that there will be much alteration
in the future.
“A fruitful cause, in our view, of the great falling-off in the nation’s
productive power has been the release of young and old persons
from the obligation to labour (hear, hear, from the Left), and the
shortening of the hours of labour. (Uproar.) We are also further of
opinion that the abolition of all piece-work has, undoubtedly,
contributed to a diminution of manufacture. (Hear, hear, from the
Left). One result of the demoralising effects of the former state of
society is, that, unfortunately, the consciousness of the indispensable
necessity that is laid upon all persons alike, in a socialistic
community, to labour, has not even yet penetrated the bulk of the
people to such an extent (dissent from the Right), that we should
feel justified in not laying before you the measure we are about to
introduce, viz. a bill to extend the maximum working-day to twelve
hours. (Sensation.) In addition to this, we propose—at least as a
provisional measure, and until such time as a satisfactory balance
shall have been restored—to extend the obligation to work to all
persons between the ages of fourteen and seventy-five, instead of,
as hitherto, to those between the ages of twenty-one and sixty-five.
(Hear, hear, from the Left.) We shall, however, in these
arrangements, make provision for affording facilities to talented
young persons for their further culture, and shall also take care that
decrepit persons are engaged in a kind of labour that shall not
militate against their state of health.
“In the next place, we are strongly of opinion that a plainer and less
expensive system of national nourishment than has hitherto been
adopted (dissent from the Right) would very materially aid in
reducing the deficit. Carefully conducted investigations which we
have recently made have fully established the fact that, providing
the rations of potatoes and vegetables be increased in a
proportionate degree, the customary one-third of a pound of meat is
by no means a requisite ingredient of the chief meal of the day, but
that one-tenth of a pound of meat, or fat, is abundantly sufficient.”
The Member for Hagen—“In Ploezensee!”[1]
The President—“I must request the Member for Hagen to
discontinue these interruptions.” (Applause from the Right.)
The Chancellor—“It is a well-known fact that there are many
estimable persons—I allude to those persons who are styled
vegetarians—who hold not only that meat may very well be
dispensed with altogether, but that it is positively injurious to the
human system. (Uproar from the Right.)
“One of the main sources, however, from which we calculate upon
effecting economy, is the placing of narrower bounds to individual
caprice as manifested in the purchase of articles. A measure of this
nature is a necessary and logical step in the direction of social
equality, and we hope, by its means, to put an end to the irrational
rule of supply and demand which even nowadays to a great extent
obtains, and which so much tends to place obstacles in the way of
production, and to raise the price of things correspondingly. The
Community produces, let us say, articles of consumption, furniture,
clothes, and so on. But the demand for these articles is regulated by
the merest freak or caprice—call it fashion, taste, or whatever you
like.”
The Chancellor’s lady—“Oh, oh.”
The Chancellor hesitated a moment, and sought by means of a glass
of water to calm his evident irritation at this interruption. He then
continued—
“I repeat, the caprice of fashion is directed only too frequently, not
to those articles which are already in stock, but to some new-fangled
thing which takes the fancy of the moment. As a result of this, those
goods which are manufactured and exposed for sale by the
Community become often so-called shop-veterans, or they spoil—in
short, fail to fulfil the purpose for which they were produced; and all
this, forsooth, just because these goods do not quite take the fancy
of Mr. and Mrs. X. Y. Z. Now I put the question to you: are we
justified in so far yielding to the caprices of such persons, that we
offer them a choice of various goods to one and the same identical
end—such as nourishment, furnishing, and attire—in order that Mr.
and Mrs. X. may live, and dress, and furnish their house differently
from Mr. and Mrs. Y.? Just reflect how vastly all processes of
manufacture would be cheapened if, in place of having any variety in
goods which are destined to fulfil the same purpose, all such articles
were limited to a few patterns, or, better still, if they were all made
on one single pattern. All losses arising from goods being left on
hand as unsaleable, would be avoided if it were, once for all,
definitely understood that Mr. and Mrs. X. Y. Z. had to dine, and
attire themselves, and furnish their houses in that manner which had
been prescribed by the State.
“Hence, lady and gentlemen, the Government contemplates shortly
submitting to your consideration plans for regulating your other
meals in a manner similar to that which was adopted from the first
for the regulation of the chief meal of the day. It will also tend to
promote more real social equality if all household goods and
chattels, such as bedding, tables, chairs, wardrobes, linen, etc. etc.,
be declared the property of the State. By means of each separate
dwelling being furnished by the State with these various requisites,
all after one identical pattern, and all remaining as a permanent part
of each dwelling, the trouble and expense of removal are done away
with. And only then, when we shall have advanced thus far, shall we
be in a position to approach, at least approximately, the principle of
equality as respects the question of dwelling-houses, no matter how
different their situations and advantages. This problem we propose
to solve by a universal fresh drawing of lots from quarter to quarter.
In this way, the chances which everybody has to win a nice suite of
apartments on the first-floor front are renewed every quarter of a
year. (Laughter from the Left. Applause here and there from the
Right.)
“As an additional aid to the promotion of equality, we propose that in
future all persons shall attire themselves in garments whose cut,
material, and colour, it will be the province of this House to
determine beforehand. The length of time during which all garments
are to be worn will also be fixed with precision.”
The Chancellor’s lady—“Never, never.”
The dissent shown by this member was taken up by various ladies in
the strangers’ galleries.
The President—“All marks of approval or disapproval from the
strangers’ galleries are strictly prohibited.”
The Chancellor—“I wish not to be misunderstood. We do not
contemplate carrying equality in dress to such a length that all
diversities will be entirely abolished. On the contrary, we suggest the
wearing of various badges as marks whereby the ladies and
gentlemen of the different provinces, towns, and trades, may readily
be distinguished from each other at a glance. An arrangement of this
kind will materially facilitate the surveillance of individual persons on
the part of the checkers appointed by the State for that purpose
(hear, hear, from the Left,) and will thus render the present
unavoidable increase in the number of those checkers less large
than would otherwise have been the case. As you are aware, the
number of checkers hitherto has been in the ratio of one to fifty of
the population. But with the aid of the arrangement just proposed,
the Government is of opinion that the appointment of one checker to
every thirty of the population will abundantly suffice to make our
country an orderly one in the truest sense of the word, (disturbance
and cries of ‘Tyranny’ from the Left; the President touched his gong
and requested order,) and to ensure on the part of all a rigorous
observance of the laws and regulations respecting the taking of
meals, style of dress, manner of living, and so on.
“This is our programme. Should it meet with your approval, we
doubt not that a vigorous carrying out of the same will soon have
the effect of doing away with the deficit, and of leading the country,
on the basis of social equality, to unimagined heights of prosperity
and happiness, proportionate to the degree in which, in the course
of time, it shakes off and triumphs over the demoralising effects of a
former state of society.” (Applause from the Right; groans and hisses
from the Left.)
The President—“Before proceeding to discuss the measures which
have been unfolded by the Chancellor, it would be well for such
members as may desire fuller information on any of the points
noticed, to avail themselves of the present opportunity to direct
short queries to the Chancellor.”
The Chancellor said he was prepared to answer at once any
questions which might be addressed to him.
A member of the Government party wished the Chancellor to be
more explicit respecting the form it was proposed to give to the
morning and evening meals; and he further asked whether the
measures contemplated would have any retrogressive effect upon
the value of the coupons composing the money-certificates.
The Chancellor—“I am thankful to the last speaker for having called
my attention to several omissions in my statement. With a view to
preventing all overloading of the digestive organs, we propose to
reduce the bread rations for adults from one pound and a half per
diem to one pound. The large amount of starch which is a
constituent part of wheat is particularly liable to fermentation, which,
as experience has shown, frequently results in unpleasant internal
disorders. In addition to this bread ration, and which, as a matter of
course, serves for the whole day, each person will receive one
hundred and fifty grains of unroasted coffee, and a quarter of a pint
of skimmed milk for breakfast. This will yield one pint of coffee. The
Government is fully convinced that a conscientious adherence to
these proportions will result in the production of a compound which
will be free from those heating and deleterious effects which
frequently accompany the use of coffee as a beverage. (Laughter
from the Left.)
“The evening meal will be composed of a pint and a half of soup for
each adult, care being taken to secure due variety, so that these
soups may not pall upon the taste. Rice soup, meal soup, barley
soup, bread soup, and potato soup will alternate with each other;
and in order to obtain still more variety, half a pint of skimmed milk
will occasionally be substituted for the soup ration. On the three
chief political holidays of the year—the birthdays of Bebel, Lassalle,
and Liebknecht—each adult person will receive half a pound of meat,
and a pint of beer for dinner.
“I omitted to mention, too, that once a week there will be an
augmentation of each adult person’s ration by the addition of a
herring. Those persons who prefer to consume their herring at the
evening meal are at liberty to do so; and, indeed, this plan has much
to commend it, seeing that the mid-day meal is already enriched by
one-tenth of a pound of meat.
“Such are the proposals which we submit to Parliament for its
sanction. In attempting to formulate the nourishment of the people
on simple and natural principles, we have been guided by the
consideration that such a system would place us in a position to
export all our most valuable products, such as game and poultry,
hams, highly esteemed vegetables, the choicer kinds of fish, wine,
and so forth. By this means we calculate upon paying the bill for
such imports as we require for the sustenance of the people, more
particularly corn and coffee.
“As regards the money-certificates, it goes without saying that an
extended application of the plan of supplying the people with goods
must of necessity have an effect on the value of the coupons
corresponding to such application. It is also contemplated in future
to supply every dwelling with firing and lighting at a fixed rate,
which will be deducted from the money-certificates. Similarly, all
washing—naturally up to a certain maximum limit—will be done at
the State washing establishments without any direct charge being
made.
“Under these circumstances, and seeing that people will have
everything found for them, the Government turned its attention to a
consideration of the amount it would be judicious and prudent to fix
for each person’s private expenses, for what, in fact, is familiarly
designated pocket-money, and it appeared to us that for such sundry
outlays as would be involved in the purchase of an occasional little
extra in the way of eating and drinking, of tobacco, soap, in
amusements or occasional trips; in short, in procuring all that the
heart could wish, we should not be wrong in going to the extent of a
mark per head for every ten days. (Laughter from the Left.) It must
be understood that the application of this mark is not to be subject
to the slightest limitation, or to any sort of official control. It will thus

You might also like