Immediate download (Ebook) OpenCV 3 computer vision application programming cookbook recipes to help you build computer vision applications that make the most of the popular C++ library OpenCV 3 by Laganière, Robert ISBN 9781786469113, 9781786469717, 1786469111, 1786469715 ebooks 2024
Immediate download (Ebook) OpenCV 3 computer vision application programming cookbook recipes to help you build computer vision applications that make the most of the popular C++ library OpenCV 3 by Laganière, Robert ISBN 9781786469113, 9781786469717, 1786469111, 1786469715 ebooks 2024
com
DOWLOAD EBOOK
ebooknice.com
ebooknice.com
ebooknice.com
(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason;
Viles, James ISBN 9781459699816, 9781743365571,
9781925268492, 1459699815, 1743365578, 1925268497
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374
ebooknice.com
ebooknice.com
ebooknice.com
https://ebooknice.com/product/learning-opencv-3-computer-vision-with-
python-7295256
ebooknice.com
https://ebooknice.com/product/opencv-computer-vision-with-
python-55662098
ebooknice.com
OpenCV 3 Computer Vision
Application Programming
Cookbook
Third Edition
Robert Laganiere
BIRMINGHAM - MUMBAI
OpenCV 3 Computer Vision Application
Programming Cookbook
Third Edition
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the
publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its
dealers and distributors will be held liable for any damages caused or alleged to be caused
directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
I wish to thank all my students at the VIVA lab; I learn so much from them.
About the Reviewer
Luca Del Tongo is a computer engineer with a strong passion for algorithms, computer
vision, and image processing techniques. He's the coauthor of a free e-book called Data
Structures and Algorithms (DSA) with over 100k downloads so far and has published
several image processing tutorials on his YouTube channel using Emgu CV. During his
master's thesis, he developed an image forensic algorithm published in a scientific paper
called Copy Move forgery detection and localization by means of robust clustering with J-
Linkage. Currently, Luca works as a software engineer in the ophthalmology field
developing corneal topography, processing algorithms, IOL calculation, and computerized
chart projector. He loves to play sport and follow MOOC courses in his spare time.
Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a
print book customer, you are entitled to a discount on the eBook copy. Get in touch with us
at service@packtpub.com for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a
range of free newsletters and receive exclusive discounts and offers on Packt books and
eBooks.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt
books and video courses, as well as industry-leading tools to help you plan your personal
development and advance your career.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Customer Feedback
Thank you for purchasing this Packt book. We take our commitment to improving our
content and products to meet your needs seriously—that's why your feedback is so
valuable. Whatever your feelings about your purchase, please consider leaving a review on
this book's Amazon page. Not only will this help us, more importantly it will also help
others in the community to make an informed decision about the resources that they invest
in to learn.
You can also review for us on a regular basis by joining our reviewers' club. If you're
interested in joining, or would like to learn more about the benefits we offer, please
contact us: customerreviews@packtpub.com.
Table of Contents
Preface 1
Chapter 1: Playing with Images 8
Introduction 8
Installing the OpenCV library 9
Getting ready 9
How to do it… 9
How it works… 14
There's more… 15
The Visualization Toolkit and the cv::viz module 15
The OpenCV developer site 16
See also 16
Loading, displaying, and saving images 16
Getting ready 17
How to do it… 17
How it works… 20
There's more… 21
Clicking on images 22
Drawing on images 23
See also 24
Exploring the cv::Mat data structure 24
How to do it… 25
How it works… 27
There's more… 31
The input and output arrays 31
Manipulating small matrices 31
See also 32
Defining regions of interest 32
Getting ready 32
How to do it… 33
How it works… 34
There's more… 34
Using image masks 35
See also 36
Chapter 2: Manipulating Pixels 37
Introduction 37
Accessing pixel values 38
Getting ready 39
How to do it… 39
How it works… 41
There's more… 42
The cv::Mat_ template class 42
See also 42
Scanning an image with pointers 42
Getting ready 43
How to do it… 43
How it works… 45
There's more… 46
Other color reduction formulas 46
Having input and output arguments 47
Efficient scanning of continuous images 49
Low-level pointer arithmetic 50
See also 51
Scanning an image with iterators 51
Getting ready 51
How to do it… 51
How it works… 52
There's more… 54
See also 54
Writing efficient image-scanning loops 54
How to do it… 55
How it works… 55
There's more… 57
See also 58
Scanning an image with neighbor access 58
Getting ready 58
How to do it… 59
How it works… 60
There's more… 61
See also 62
Performing simple image arithmetic 63
Getting ready 63
How to do it… 63
How it works… 64
There's more… 65
Overloaded image operators 65
Splitting the image channels 66
[ ii ]
Remapping an image 67
How to do it… 67
How it works… 68
See also 70
Chapter 3: Processing the Colors of an Image 71
Introduction 71
Comparing colors using the Strategy design pattern 72
How to do it… 72
How it works… 74
There's more… 78
Computing the distance between two color vectors 78
Using OpenCV functions 79
The floodFill function 80
Functor or function object 82
The OpenCV base class for algorithms 82
See also 83
Segmenting an image with the GrabCut algorithm 83
How to do it… 84
How it works… 86
See also 87
Converting color representations 87
How to do it… 88
How it works… 89
See also 91
Representing colors with hue, saturation, and brightness 91
How to do it… 91
How it works… 94
There's more… 97
Using colors for detection – skin tone detection 97
See also 100
Chapter 4: Counting the Pixels with Histograms 101
Introduction 101
Computing an image histogram 102
Getting ready 102
How to do it… 103
How it works… 107
There's more… 108
Computing histograms of color images 109
See also 110
Applying look-up tables to modify the image's appearance 111
[ iii ]
How to do it… 111
How it works… 112
There's more… 112
Stretching a histogram to improve the image contrast 113
Applying a look-up table to color images 115
See also 115
Equalizing the image histogram 115
How to do it… 116
How it works… 117
Backprojecting a histogram to detect specific image content 118
How to do it… 118
How it works… 121
There's more… 121
Backprojecting color histograms 121
See also 125
Using the mean shift algorithm to find an object 125
How to do it… 126
How it works… 129
See also 130
Retrieving similar images using the histogram comparison 130
How to do it… 130
How it works… 132
See also 133
Counting pixels with integral images 133
How to do it… 134
How it works… 135
There's more… 137
Adaptive thresholding 137
Visual tracking using histograms 141
See also 145
Chapter 5: Transforming Images with Morphological Operations 146
Introduction 146
Eroding and dilating images using morphological filters 147
Getting ready 147
How to do it… 148
How it works… 150
There's more… 152
See also 152
Opening and closing images using morphological filters 152
How to do it… 152
[ iv ]
How it works… 154
See also 155
Applying morphological operators on gray-level images 155
How to do it… 156
How it works… 157
See also 158
Segmenting images using watersheds 159
How to do it… 159
How it works… 164
There's more… 165
See also 167
Extracting distinctive regions using MSER 167
How to do it… 167
How it works… 170
See also 172
Chapter 6: Filtering the Images 173
Introduction 173
Filtering images using low-pass filters 174
How to do it… 174
How it works… 176
See also 179
Downsampling images with filters 179
How to do it… 180
How it works… 182
There's more… 183
Interpolating pixel values 183
See also 185
Filtering images using a median filter 185
How to do it… 186
How it works… 186
Applying directional filters to detect edges 187
How to do it… 188
How it works… 191
There's more… 194
Gradient operators 195
Gaussian derivatives 197
See also 198
Computing the Laplacian of an image 198
How to do it… 198
[v]
How it works… 200
There's more… 204
Enhancing the contrast of an image using the Laplacian 204
Difference of Gaussians 204
See also 205
Chapter 7: Extracting Lines, Contours, and Components 206
Introduction 206
Detecting image contours with the Canny operator 207
How to do it… 207
How it works… 209
See also 211
Detecting lines in images with the Hough transform 211
Getting ready 211
How to do it… 212
How it works… 217
There's more… 220
Detecting circles 221
See also 223
Fitting a line to a set of points 223
How to do it… 223
How it works… 226
There's more… 226
Extracting connected components 226
How to do it… 227
How it works… 229
There's more… 230
Computing components' shape descriptors 232
How to do it… 232
How it works… 234
There's more… 235
Quadrilateral detection 235
Chapter 8: Detecting Interest Points 238
Introduction 238
Detecting corners in an image 238
How to do it… 239
How it works… 245
There's more… 247
Good features to track 247
See also 249
[ vi ]
Detecting features quickly 250
How to do it… 250
How it works… 251
There's more… 253
See also 255
Detecting scale-invariant features 256
How to do it… 256
How it works… 258
There's more… 260
The SIFT feature-detection algorithm 260
See also 262
Detecting FAST features at multiple scales 263
How to do it… 263
How it works… 264
There's more… 265
The ORB feature-detection algorithm 265
See also 266
Chapter 9: Describing and Matching Interest Points 267
Introduction 267
Matching local templates 268
How to do it… 269
How it works… 272
There's more… 274
Template matching 274
See also 275
Describing and matching local intensity patterns 275
How to do it… 276
How it works… 278
There's more… 281
Cross-checking matches 281
The ratio test 282
Distance thresholding 283
See also 284
Matching keypoints with binary descriptors 285
How to do it… 285
How it works… 287
There's more… 288
FREAK 288
See also 290
Chapter 10: Estimating Projective Relations in Images 291
[ vii ]
Introduction 291
Image formation 292
Computing the fundamental matrix of an image pair 295
Getting ready 295
How to do it… 296
How it works… 300
See also 301
Matching images using random sample consensus 301
How to do it… 302
How it works… 305
There's more… 307
Refining the fundamental matrix 307
Refining the matches 308
Computing a homography between two images 308
Getting ready 309
How to do it… 310
How it works… 313
There's more… 313
Generating image panoramas with the cv::Stitcher module 314
See also 315
Detecting a planar target in images 315
How to do it… 315
How it works… 319
See also 322
Chapter 11: Reconstructing 3D Scenes 323
Introduction 323
Digital image formation 324
Calibrating a camera 326
How to do it… 326
How it works… 332
There's more… 335
Calibration with known intrinsic parameters 335
Using a grid of circles for calibration 335
See also 335
Recovering camera pose 336
How to do it… 336
How it works… 339
There's more… 340
cv::Viz, a 3D Visualizer module 340
See also 342
[ viii ]
Reconstructing a 3D scene from calibrated cameras 342
How to do it… 342
How it works… 348
There's more… 350
Decomposing a homography 350
Bundle adjustment 351
See also 351
Computing depth from stereo image 351
Getting ready 352
How to do it… 353
How it works… 355
See also 357
Chapter 12: Processing Video Sequences 358
Introduction 358
Reading video sequences 359
How to do it… 359
How it works… 360
There's more… 362
See also 362
Processing the video frames 362
How to do it… 363
How it works… 364
There's more… 368
Processing a sequence of images 368
Using a frame processor class 370
See also 371
Writing video sequences 371
How to do it… 372
How it works… 373
There's more… 375
The codec four-character code 376
See also 377
Extracting the foreground objects in a video 377
How to do it… 379
How it works… 381
There's more… 381
The Mixture of Gaussian method 381
See also 384
Chapter 13: Tracking Visual Motion 385
[ ix ]
Introduction 385
Tracing feature points in a video 386
How to do it… 386
How it works… 391
See also 392
Estimating the optical flow 393
Getting ready 394
How to do it… 395
How it works… 397
See also 398
Tracking an object in a video 399
How to do it… 399
How it works… 403
See also 406
Chapter 14: Learning from Examples 407
Introduction 407
Recognizing faces using nearest neighbors of local binary patterns 408
How to do it… 408
How it works… 411
See also 415
Finding objects and faces with a cascade of Haar features 416
Getting ready 416
How to do it… 418
How it works… 422
There's more… 424
Face detection with a Haar cascade 425
See also 426
Detecting objects and people with Support Vector Machines and
histograms of oriented gradients 426
Getting ready 427
How to do it… 428
How it works… 431
There's more… 434
HOG visualization 435
People detection 437
Deep learning and Convolutional Neural Networks 439
See also 440
Index 441
[x]
Preface
Augmented reality, driving assistance, video monitoring; more and more applications are
now using computer vision and image analysis technologies, and yet we are still in the
infancy of the development of new computerized systems capable of understanding our
worlds through the sense of vision. And with the advent of powerful and affordable
computing devices and visual sensors, it has never been easier to create sophisticated
imaging applications. A multitude of software tools and libraries manipulating images and
videos are available, but for anyone who wishes to develop smart vision-based applications,
the OpenCV library is the tool to use. OpenCV (Open source Computer Vision) is an open
source library containing more than 500 optimized algorithms for image and video analysis.
Since its introduction in 1999, it has been largely adopted as the primary development tool
by the community of researchers and developers in computer vision. OpenCV was
originally developed at Intel by a team led by Gary Bradski as an initiative to advance
research in vision and promote the development of rich vision-based, CPU-intensive
applications. After a series of beta releases, version 1.0 was launched in 2006. A second
major release occurred in 2009 with the launch of OpenCV 2 that proposed important
changes, especially the new C++ interface, which we use in this book. In 2012, OpenCV
reshaped itself as a non-profit foundation (http://opencv.org/) relying on crowdfunding
for its future development. OpenCV3 was introduced in 2013; changes were made mainly to
improve the usability of library. Its structure has been revised to remove the unnecessary
dependencies, large modules have been split into smaller ones and the API has been
refined. This book is the third edition of the OpenCV Computer Vision Application
Programming Cookbook and the first one that covers OpenCV version 3. All the programming
recipes of the previous editions have been reviewed and updated. We also have added new
content and new chapters to provide readers with even better coverage of the essential
functionalities of the library. This book covers many of the library’s features and
explains how to use them to accomplish specific tasks. Our objective is not to provide
detailed coverage of every option offered by the OpenCV functions and classes but rather to
give you the elements you need to build your applications from the ground up. We also
explore, in this book, fundamental concepts in image analysis and we describe some of the
important algorithms in computer vision. This book is an opportunity for you to get
introduced to the world of image and video analysis. But this is just the beginning. The
good news is that OpenCV continues to evolve and expand. Just consult the OpenCV online
documentation at http://opencv.org/ to stay updated about what the library can do for
you. You can also visit the author’s website at http://www.laganiere.name/ for updated
information about this cookbook.
Preface
Chapter 2, Manipulating Pixels, explains how an image can be read. It describes different
methods for scanning an image in order to perform an operation on each of its pixels.
Chapter 3, Processing the Colors of an Image, consists of recipes presenting various object-
oriented design patterns that can help you to build better computer vision applications. It
also discusses the concept of colors in images.
Chapter 4, Counting the Pixels with Histograms, shows you how to compute image
histograms and how they can be used to modify an image. Different applications based on
histograms are presented that achieve image segmentation, object detection, and image
retrieval.
Chapter 6, Filtering the Images, teaches you the principle of frequency analysis and image
filtering. It shows how low-pass and high-pass filters can be applied to images and presents
the concept of derivative operators.
Chapter 7, Extracting Lines, Contours, and Components, focuses on the detection of geometric
image features. It explains how to extract contours, lines and connected components in an
image.
Chapter 8, Detecting Interest Points, describes various feature point detector in images.
Chapter 9, Describing and Matching Interest Points, explains how descriptors of interest
points can be computed and used to match points between images.
Chapter 10, Estimating Projective Relations in Images, explores the projective relations that
exist between two images in the same scene. It also describes how to detect specific targets
in an image.
Chapter 11, Reconstructing 3D scenes, allows you to reconstruct the 3D elements of a scene
from multiple images and recover the camera pose. It also includes a description of the
camera calibration process.
[2]
Preface
Chapter 12, Processing Video Sequences, provide a framework to read and write a video
sequence and to process its frames. It shows you also how it is possible to extract the
foreground objects moving in front of a camera.
Chapter 13, Tracking Visual Motion, addresses the visual tracking problem. It shows you
how to compute the apparent motion in videos. It also explains how to track moving objects
in an image sequence.
Chapter 14, Learning from Examples, introduces basic concepts in machine learning. It shows
how object classifiers can be built from image samples.
Sections
In this book, you will find several headings that appear frequently (Getting ready, How to
do it, How it works, There's more, and See also). To give clear instructions on how to
complete a recipe, we use these sections as follows:
Getting ready
This section tells you what to expect in the recipe, and describes how to set up any software
or any preliminary settings required for the recipe.
[3]
Preface
How to do it…
This section contains the steps required to follow the recipe.
How it works…
This section usually consists of a detailed explanation of what happened in the previous
section.
There's more…
This section consists of additional information about the recipe in order to make the reader
more knowledgeable about the recipe.
See also
This section provides helpful links to other useful information for the recipe.
Conventions
In this book, you will find a number of text styles that distinguish between different kinds
of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can
include other contexts through the use of the include directive."
When we wish to draw your attention to a particular part of a code block, the relevant lines
or items are set in bold:
// Compute Laplacian using LaplacianZC class
LaplacianZC laplacian;
laplacian.setAperture(7); // 7x7 laplacian
cv::Mat flap= laplacian.computeLaplacian(image);
laplace= laplacian.getLaplacianImage();
[4]
Preface
New terms and important words are shown in bold. Words that you see on the screen, for
example, in menus or dialog boxes, appear in the text like this: "Clicking the Next button
moves you to the next screen."
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this
book-what you liked or disliked. Reader feedback is important for us as it helps us develop
titles that you will really get the most out of.
If there is a topic that you have expertise in and you are interested in either writing or
contributing to a book, see our author guide at www.packtpub.com/authors .
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you
to get the most from your purchase.
1. Log in or register to our website using your e-mail address and password.
2. Hover the mouse pointer on the SUPPORT tab at the top.
3. Click on Code Downloads & Errata.
4. Enter the name of the book in the Search box.
5. Select the book for which you're looking to download the code files.
6. Choose from the drop-down menu where you purchased this book from.
7. Click on Code Download.
[5]
Preface
You can also download the code files by clicking on the Code Files button on the book's
webpage at the Packt Publishing website. This page can be accessed by entering the book's
name in the Search box. Please note that you need to be logged in to your Packt account.
Once the file is downloaded, please make sure that you unzip or extract the folder using the
latest version of:
The source code files of the examples presented in this cookbook are also hosted in the
author's Github repository. You can visit the author's repository at https://github.com/la
ganiereto obtain the latest version of the code.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-
we would be grateful if you could report this to us. By doing so, you can save other readers
from frustration and help us improve subsequent versions of this book. If you find any
errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting
your book, clicking on the Errata Submission Form link, and entering the details of your
errata. Once your errata are verified, your submission will be accepted and the errata will
be uploaded to our website or added to any list of existing errata under the Errata section of
that title.
[6]
Preface
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At
Packt, we take the protection of our copyright and licenses very seriously. If you come
across any illegal copies of our works in any form on the Internet, please provide us with
the location address or website name immediately so that we can pursue a remedy.
We appreciate your help in protecting our authors and our ability to bring you valuable
content.
Questions
If you have a problem with any aspect of this book, you can contact us
at questions@packtpub.com, and we will do our best to address the problem.
[7]
Playing with Images
1
In this chapter, we will get you started with the OpenCV library. You will learn how to
perform the following tasks:
Introduction
This chapter will teach you the basic elements of OpenCV and will show you how to
accomplish the most fundamental image processing tasks: reading, displaying, and saving
images. However, before you start with OpenCV, you need to install the library. This is a
simple process that is explained in the first recipe of this chapter.
All your computer vision applications will involve the processing of images. This is why
OpenCV offers you a data structure to handle images and matrices. It is a powerful data
structure with many useful attributes and methods. It also incorporates an advanced
memory management model that greatly facilitates the development of applications. The
last two recipes of this chapter will teach you how to use this important data structure of
OpenCV.
Playing with Images
Getting ready
When you visit the OpenCV official website at http://opencv.org/, you will find the latest
release of the library, the online documentation describing the Application Programming
Interface (API), and many other useful resources on OpenCV.
How to do it…
From the OpenCV website, find the latest available downloads and select the one that
corresponds to the platform of your choice (Windows, Linux/Mac, or iOS). Once the
OpenCV package is downloaded, run the WinZip self-extractor and select the location of
your choice. An opencv directory will be created; it is a good idea to rename it in a way that
will show which version you are using (for example, in Windows, your final directory
could be C:\opencv-3.2). This directory will contain a collection of files and directories
that constitute the library. Notably, you will find the sources directory that will contain all
the source files (yes, it is open source!).
In order to complete the installation of the library and have it ready for use, you need to
take an important step: generate the binary files of the library for the environment of your
choice. This is indeed the point where you have to make a decision on the target platform
you wish to use to create your OpenCV applications. Which operating system do you prefer
to use? Which compiler should you select? Which version? 32-bit or 64-bit? As you can see,
there are many possible options, and this is why you have to build the library that fits your
needs.
[9]
Playing with Images
The Integrated Development Environment (IDE) you will use in your project development
will also guide you to make these choices. Note that the library package also comes with
precompiled binaries that you can directly use if they correspond to your situation (check
the build directory adjacent to the sources directory). If one of the precompiled binaries
satisfies your requirements, then you are ready to go.
One important remark, however. Since version 3, OpenCV has been split into two major
components. The first one is the main OpenCV source repository that includes the mature
algorithms. This is the one you have downloaded. A separate contribution repository also
exists, and it contains the new computer vision algorithm, recently added by the OpenCV
contributors. If your plan is to use only the core functions of OpenCV, you do not need the
contrib package. But if you want to play with the latest state-of-the-art algorithms, then
there is a good chance that you will need this extra module. As a matter of fact, this
cookbook will show you how to use several of these advanced algorithms. You therefore
need the contrib modules to follow the recipes of this book. So you have to go to
https://github.com/opencv/opencv_contrib and download OpenCV's extra modules
(download the ZIP file). You can unzip the extra modules into the directory of your choice;
these modules should be found at opencv_contrib-master/modules. For simplicity, you
can rename this directory as contrib and copy it directly inside the sources directory of
the main package. Note that you can also pick the extra modules of your choice and only
save them; however, you will probably find it easier, at this point, to simply keep
everything.
You are now ready to proceed with the installation. To build the OpenCV binaries, it is
highly suggested that you use the CMake tool, available at http://cmake.org. CMake is
another open source software tool designed to control the compilation process of a software
system using platform-independent configuration files. It generates the required makefile
or solution files needed for compiling a software library in your environment. Therefore,
you have to download and install CMake. Also see the There's more… section of this recipe
for an additional software package, the Visualization Toolkit (VTK), that you may want to
install before compiling the library.
[ 10 ]
Playing with Images
You can run cmake using a command-line interface, but it is easier to use CMake with its
graphical interface (cmake-gui). In the latter case, all you need to do is specify the folder
containing the OpenCV library source and the one that will contain the binaries. Now click
on Configure and select the compiler of your choice:
[ 11 ]
Exploring the Variety of Random
Documents with Different Content
Midőn Pistától elvált, utolsó harczát küzdötte végig, arczát
megmelegíté a nagylelkűség, – legyőzte gőgjét, megismerte, hogy
ámbár Pista sem bátrabb, de szive nemesebb, – s ezen pillanattól
nem kivánt az emberek közt élni, hogy közönséges gyarlóságot
lásson, s e dibdáb népnek lábainál annyi legyen, mint a forgács, mit
vagy megtipornak, vagy odább löknek.
Kiment az erdőnek mélyébe, s néha födetlen fővel állt meg a
viharban, jól esett neki, mikor a szél összekóczolá, s ilyenkor
felnézett a százados tölgyre, melynek gyengébb ágait tépi meg a
vihar, maga pedig rendületlenül áll.
Télben a kályha szájánál ült, fütötte a kályhát, s az izzó parázsok
közé tekintve, agyában lerajzolá magát a harczos élet zaja, a
pattogó fának egyhangú zörejében a puskaropogás s olykor egy
hatalmas csattanásban kiegészítve lőn az ágyú, s még így
gondolatban is jól esett neki, hogy annyiszor röpült ő Pistával legelől,
s minő hátra marad el tőle a többi!
Történetünk idejében még a vad is szivesen húzódott volna el
valami sürűbe, ha az éhség ki nem veri szegény párát eledel után,
miért a rengetegeket igen gyakran messzire kellett összeszaladgálni;
mert tél és kegyetlen hideg volt, s a hótömeg ölnyire feküdt a föld
rétege fölött.
Alig törték meg az utat, már ismét behordta a szél, s a
«Kenyeretlen» csárda előtt hamarabb megállt a kocsi, mint máskor,
s a mi kis szénát összekotort nyáron a gazda, a beszorult emberek
mind elrimánkodták, hogy megkínzott barmaik valamikép éhen ne
veszszenek.
Pista volt a legutolsó vendég és látván, hogy a csárdában a
tüzelő-szalma is kifogyott, megigérte a szabadosnak, hogy másnap
estig legfölebb, megjön egy forduló szalmával, s azonkívül a
megfogyott élelmet megint kipótolja.
Néhány órával később az éjszaki szél ujabb vihart hozott, s nem
maradt embernyom az úton, csak a széles erdőnyilás vezette az
embert, ha ezen órában még az úton maradt volna, melyen a vadak
is eszeveszetten rohantak, mert vagy a vihar, vagy az éhség
kergethette őket.
A szabados hanyatlani érzé az erőt, sebeit elevenné tette a
kemény idő, melynek mérgétől nem kimélte magát, s néha órákig
elácsorgott a csárda előtt, vagy még messzebb is, ha tán valamely
megszorult utast a viharok künn szorítottak volna, – és Pista nagyon
észrevette, hogy a szabados önmagával birkózik, midőn
szenvedéseit tagadja, tehát föltette magában, hogy másnap
visszajön, nehogy inségben feledje az erdőn.
Fáradtan húzkodott be a konyhára néhány darab fát, mit előbb
vagdalt össze, – nehogy tűz nélkül maradjon, mert az utolsó szál
szalmát Pistának lovai ették meg, s míg az Keszthelyről megfordul,
ilyen zivatarban akár meg is fagyhat.
Alig veté le az utolsó fadarabot, s alig helyezkedék el egy
bundán, kegyetlen fájások rohanták meg, s majdnem elfásultan
hevert ott néhány óráig; – midőn pedig megszünvén a fájdalom, az
álom is lefogta szemét, a kályhában a parázs lassankint elhamvadt,
s mire fölébredt, már a hamu is megfázott.
Van-e valaki eleven ember ebben a házban? – szól egy ember,
kinek bajusza, szakálla jégcsappá dermedt, s mint egy csoda nézett
be a konyhaajtón.
– Itt vagyok! – mondja a szabados, fölkapaszkodván nagy kínnal,
hogy a betévedt embernek segéljen, ha tán segítségre lenne
szükség.
Az ajtó nyilásán át látta a gazda, hogy egy szánra rakott hintó áll
a félszer alatt, – előtte négy ló gőzölögve várja az enyhelyet, a
hintóból pedig két úrhölgyet segít ki egy úr és karjára fogva vezeti
őket az egykori borivóba.
– Irgalmas Isten, csakhogy megmenekülhettünk; – mondja az
idősebb hölgy, kiről a szépség virágai nem szálltak el, ámbár az
ifjabb hölgy gyermeke, de a két hölgy között alig van több különbség,
mint egy ágnak két virága közt, melyek közől az egyik a nyilott virág
egész pompájában, a másik pedig a most fakadó bimbó.
Utasaink gróf Dunay nejével és leányával, kik az egyezségre
indulának s a zivatar az útban kapta őket s ha a csárdához nem
érnek, a fáradt lovak már az úton összerogynak.
– Anyám, – édes szép anyám! – mondja a gyermeteg hölgy,
anyját átölelve, – már azt hittem, hogy az út közepén fagyunk meg
valamennyien.
A szabados megdöbbent a szóra és sietve botorkált a konyhába,
hogy a kályhában éleszsze a tüzet, de midőn kemény ujjaival a
hamuba markolt, egészen hidegnek találta.
Tűzszerszáma után kotorászott, egyetlen kénpapir darabnál
többet nem talált, de tudta azt, hogy egy szál szalma sincsen a
csárdában, mi lángot ereszszen a fa alá, hogy tüzet fogjon, aggódva
kérdé a bejövő kocsistól:
– Jó barátom, nincs széna a bakon?
– Csakhogy magunk ide értünk, hisz utóbb már a kocsiládákat is
lecsavartam és a hóba hánytam, mert a lovak alig birták el a terhet,
hanem fél zsákra való abrakom van.
– Adja a lovaknak barátom! – mondja a szabados és egy
törzsökre hanyatlott, mert megriadt a gondolattól, hogy ennyi embert
az isten hidege vegyen meg, s az istálló sokkal tágasabb volt,
minthogy azt a négy darab ló megmelegíteni birja.
Dunay kijött a szobából, hihetőleg megérezte a melegnek fogytát,
s azt mondja a gazdának:
– Van-e fája, édes jó barátom?
– Az erdőnek legmélyében vagyunk uram, hisz a fára látok ki az
ajtón.
– Szokták füteni a kályhát?
– Ma reggel még ökröt is megsüthettem volna benne, de
lenyomott a fájdalom, – beszéli a szabados, – s míg később
elszunnyadtam, az alatt elhamvadt az utolsó szikra is.
– Rakunk újra tüzet – mondja a gróf.
– Nem vártam volna a parancsolást uram; de nincs mit elgyújtani.
– Hisz akkor megfagyunk! – véli a gróf rémülten.
– Nekem jótétemény lenne uram; de szánom ott benn azt a két
ártatlan cselédet.
– Barátom!… mondja a gróf megriadva… ez igazság vagy tréfa?
– Uram, már mondám, hogy azokat sajnálom ott benn; mert hisz
mi férfiak nem ijedünk meg a haláltól, akár ma érjen el, akár holnap
– fejezi be a szabados, a kénpapir-szeletet forgatván kezében.
– Barátom, – mondja a gróf, – egy könnyű kendő meggyúl még
ettől!
– Nem hiszem, – okoskodik amaz, – alig akkora a papir, hogy a
ként rámázolhatták, – azonban próbáljuk meg, ha meg nem gyúl, –
megfagyni akkor is ráérünk.
A gróf beszaladt, de a téli ruhák között nem akadt egy darab,
mely használhatott volna, azért mielőtt a nőknek szólna, újra kiment
a konyhára, hogy finom ingét próbálja meg letépni, tán az megfogja
majd a lángot.
A szabados kiment a csárda elejére, hogyha tán elszóródott
valahol néhány szalmaszál, azonban a hó már a házoldalon kezdett
összegyülekezni, hanem midőn az erdőnyiláson végig nézne,
három-négy puskalövésnyire lát egy elakadt hintót, s valamivel idább
négy ember törtetett egyik fától a másikig.
– Nem hittem, hogy ennyien lesznek a temetésemen! – dörmögi
a szabados, ki után a gróf kisietett, s minthogy a jövőket meglátta, a
pihentebb lovakat elővezetteté, ha még megtennék a szolgálatot, és
a hóban bukdácsolókat egyenkint elhoznák.
A kocsis az első; a gróf a hátulsó lovak egyikére kapott, s az alsó
útra gázolának szél után, s ámbár elég kínnal, de mégis elég jókor
elérték a négy gyalogoló embert.
Az ösmerkedés nem sokáig tartott, – az inség előtt a lenyujtott
kéz a legnemesebb emberbarát keze, s midőn az ember halódni
készül, utolsónak vélt órájában önként nyúl leghalálosabb ellenének
keze után s a végső végórában felebarátjait látja.
Baltayt fölsegíté a gróf a lóra, s mind a négyet átengedték a
lihegő utasoknak, a gróf pedig kocsisával a törésen ballagott, s mire
a két nő akart a gróf után tekinteni, hatan nyitottak be.
Baltay és Imre, valamint András és a kocsis volt az ujon érkezett
vendég, kik bámulva néztek egymásra a szoba közepén, de itt is
András törte meg a csöndet, levetvén hóna alól egy nagy csomót,
aztán pedig a nagyságos urat kezdé kiszedni a fagyból.
– Most már itt vagyunk valamennyien, – dörmögi András, – csak
a prókátorok hiányzanak ebben a farkasordítóban, hanem találunk
majd helyettük farkasokat.
Mindenki hallgatott, egyik sem tudta folytatni a beszédet, s
minthogy sokáig tartott a hallgatás, Dunay gróf kihívta Andrást a
konyhába.
– András! – mondja a gróf, – mi itt abban a veszedelemben
vagyunk, hogy az erdőben a fa között fagyunk meg; mert nincsen
mivel alágyujtsuk a fát.
– Itt van minden gyújtószerünk, – mondja a szabados a kis
kénpapirt előmutatva, – pedig ezzel a nyers fát tudom meg nem
gyújtjuk.
– Hála légyen a jó úristenek, – mondja András, – csakhogy itt
vagyunk.
– De megkivánta kend a halódást, atyafi, – boszankodik a
szabados, – hogy így megörült kend neki.
– De még nem kivánkozom kihordozóskodni ebből a világból,
hallja, jó barátom, – mondja András, – majd csinálok én tüzet, ha
még olyan nedves is a kelmed fája.
– Az angyalok szólnak belőle, édes öregem, – véli a gróf, –
hanem ne késsék vele, fogjon rögtön hozzá, mert már a nők nagyon
érzik a hideget.
– Csak fél órát várjunk méltóságos uram, – hadd adjam meg a
módját, – azért menjen csak be, majd én az én uraimat hívom ki.
A gróf Andrásra hagyta a dolgot, – bement a nőkhöz, kik a kályha
mellett foglaltak helyet, az öreg úr pedig Imrét akarta kiküldeni, hogy
nézzen körül a házánál, hogy meg ne fagyjanak.
András kihívta a férfiakat, kik a hívásnak engedtek, s az öreg úr
Andrástól kérdezte:
– Mi a baj, András?
– Az, hogy itt fogunk megfagyni! – mondja András egész
komolysággal nézve szemközt, s elmondván, hogy nincs mit
meggyújtani.
– Ne kiáltson kend olyan hangosan! – mondja Baltay, – hisz én is
megijedtem, hát még azok a szerencsétlen asszonyok!
– No hát elhiszi a nagyságos úr, a mit mondtam? – kérdezkedék
András.
– El hát, – mondja kínosan, – csak azt sajnálom, hogy ezek a
szegény nők itt vannak.
– Magát sajnálja a nagyságos úr, jobb lesz!
– Legyen kendnek esze a pokolban, engem már elevenen
kinyújtóztathat kend!
András nem birta könyű nélkül megállni az öreg úrnak
lemondását, kivált mikor egy hosszú hallgatás után Baltay Imrére
nézett, s annak kezét részvéttel fogta meg.
– Imre, – mondja az öreg, – remélem emberré neveltelek, hanem
ha, mint remélem, tovább kibirod, mint mi, ezt a kis lányt megőrzöd,
a mig lehet.
– Bátyám, – nem tagadom, – érette szivesen meghalok.
– Szereted?
– Nem mertem eddig megmondani! – vallja be a fiú.
– Régen vártam erre, s én nem mertelek rákényszeríteni; –
mondja az öreg is megkönnyezve a végszót, s midőn kendőjeért
nyúlna, hogy könyűjét letörülje, oldalzsebében nem lelé, hanem a
helyett Kisfaludy munkáit húzta ki, mit a kilépő gróf is meglátott már.
– Nagyságos uram, – mondja András, – még van egy szál
kéngyertyánk.
– Hát aztán!
– Nem bánná meg, ha az úrfi a kisasszonyt elvenné?
– Ne támaszsza föl kend az embert, – András! – szól
reménykedve az öreg.
– Ha azt a Kisfaludyt meggyújtom ezzel a kéngyertyával, mindjárt
lesz tüzünk.
– Nem ezt akarta kend mondani, András? – véli az öreg, – tudja
kend, hogy ez legkedvesebb jószágom.
Dunay meghatottan állt az öreg háta mögött, – s láthatta, hogy
remegnek az öregnek kezei, melyekben a könyveket tartja.
– Hát nem adja oda, nagyságos uram?
– Meggyújtaná kend az imádságos könyvét? – kérdi átható
hangon Baltay.
– Nem tudom, nagyságos uram! – mondja meglepetve a hajdú.
– Nekem ez imádságos könyvem! – bizonykolja az öreg, mire
Dunay elébe lép és először annyi idő után megszólítja az öreget.
– Most meg én faragok róvást! – mondja Dunay a multakra
czélozva, mire Baltay a gróf kezét megfogván, mondja:
– Nem fogja azt tenni, – egyszersmind Andrásnak azt mondja: –
láttam, hogy elhozta kend azt a nagy pört, – gyújtsa meg kend azt, –
de Kisfaludyt el nem pörköli kend.
– Inkább a pört, mint a könyvet? – kérdi Dunay boldogságtól
csillogó arczczal.
– Megadom magamat! – vallja be az öreg, helyet adván
Andrásnak, ki a nagy csomó papirt a kályha szájához vitte, hol az
aprófa készen volt, azután egy ütet taplóval föllobbanták a
kéngyertyát, s a kis szelet papirról a láng a pörhalmaznak egyes
csomóiba kapott, s mire egy része elégett, a nedves fát is megjárta a
láng, durrogva égvén a kályhában, melyhez a didergő vendégek egy
nagy körbe ültek.
Midőn András a tűzbe lökte a pörnek utolsó levelét, azt mondja:
– Mondtam ugy-e, nagyságos uram, hogy én vetem ezt tűzbe!
– No, hogy jobban égjen, – teszi hozzá az öreg, – itt még a rovás
is, – mondja, kihúzván oldalzsebéből a rovást, mit oly régóta
hordozgat magával, – szent a béke köztünk.
Mire bemelegedett a kályha, Baltay megösmerkedett a kis
lánynyal, kit ma ölelt meg legelőször s kezét Imréébe adván, azt
mondja:
– Édes kis hugocskám, rég neked szántam én már ezt a fiút.
– Azt gondolja a nagyságos úr, – kiált közbe András, – hogy én
azt már régen nem tudtam?
– De nem tudta kend.
– Dehogy nem tudtam, – csak hogy nem akartam mondani a
nagyságos úrnak, hogy szivesen megbékülne, – csak valaki szép
módjával elkezdeni tudná.
– Semmit sem tud kend! – mondja Baltay, nagy diadallal szedvén
elő tárczájából egy rég meggyűrt levelet, s odaadá Dunaynak, ki
rögtön megismerte a boldogult herczeg írását, melynek hiányzó
sorai következők valának:
«– – – – – – – – – –
A végóra nagy későn mondja meg, édes jó barátom, hogy rövid
életünkben is temérdek jót tehettünk volna, s higyj nekem, nagy
nyugalom tudni, hogy sokan szerettek bennünket igazán, s elfeledni
akarva sem tudnak.
Öcséd, mint Dunaytól tudom, szép lelkü gyermek – Dunaynak
leánygyermeke van, ne engedd, hogy hajlékodból idegenek tanyája
legyen, a míg lehet; – vezesd össze a két gyermeket, hogy
szeretteid úgy sirassanak meg, mint az enyéim most engemet. – Ez
első és utolsó kérelme annak, ki hű barátod a sírig Herczeg
Batthyányi Lajos m. k.»
A sorokat Dunay hangosan olvasá, a két gyermek
összefogózkodék, s a nyomorult viskóban ölelkezék össze a rég
küzködő család, mely nem lelt elég helyet a széles birtokon egy
istenáldott szóra, míg a közös veszedelem egy csárda falai közt
hozta őket össze.
András három lépésről nézte őket, mint a fáradt művész nézte
ezt a munkát, mely nélküle nem tudott megkészülni, s melyből neki
csak az az osztaléka volt, a mi becsületes embernek mindenütt jut, s
miért a gazember fáradni nem akar; – az egyiknek kevés, a
másiknak pedig az öntudat végtelen jutalom.
– András! – kiált örömében Baltay, – ha haza megyünk, minden
rovást égessen kend össze.
– Senkire sem haragszik meg ezután nagyságos úr?
– Nem én, még kendre sem! – Tréfálódzék az öreg.
– Azt hiszi nagyságos uram, hogy nem lesz még olyan magyar
ember, kinek rováson a helye?
– Azt már ezután nem mi rójuk meg, hallja kend; de a
közvélemény.
XI.
(Egyezség prókátorok nélkül.)
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com