Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
OpenCV 3 Blueprints
OpenCV 3 Blueprints

OpenCV 3 Blueprints: Expand your knowledge of computer vision by building amazing projects with OpenCV 3

Arrow left icon
Profile Icon Joseph Howse Profile Icon Puttemans Profile Icon Sinha
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (12 Ratings)
Paperback Nov 2015 382 pages 1st Edition
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Joseph Howse Profile Icon Puttemans Profile Icon Sinha
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (12 Ratings)
Paperback Nov 2015 382 pages 1st Edition
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

OpenCV 3 Blueprints

Chapter 2. Photographing Nature and Wildlife with an Automated Camera

National Geographic is famous for its intimate photos of wild animals. Often, in the magazine's pages, the animals seem larger than life, as if they belong to the same "geographic" scale as the landscapes behind them. This enlargement effect can be achieved by capturing the subject at a very close distance with a wide-angle lens. For example, one memorable photograph by Steve Winter shows a snarling tiger reaching out to strike the lens!

Let's consider the possible methods behind such a photo. The photographer could try to stalk a wild tiger in person, but for safety, this approach would require some distance and a long lens. A close encounter is likely to endanger the human, the tiger, or both. Alternatively, the photographer could use a remote-controlled rover or drone to approach and photograph the tiger. This would be safer but like the first technique it is laborious, only covers one...

Planning the camera trap

Our camera trap will use a computer with two attached cameras. One camera will continuously capture low-resolution images. For example, this first camera may be an ordinary webcam. Our software will analyze the low-resolution images to detect the presence of a subject. We will explore three basic detection techniques based on motion, color, and object classification. When a subject is detected, the second camera will activate to capture and save a finite series of high-resolution images. This second camera will be a dedicated photo camera, with its own battery and storage. We will not necessarily analyze and record images at the fastest possible rate; rather, we will take care to conserve the host computer's resources as well as the photo camera's battery power and storage so that our photo trap can function for a long time.

Optionally, our software will configure the photo camera for exposure bracketing. This means that some photos in a series will be...

Controlling a photo camera with gPhoto2

gPhoto2 is an open source, vendor-neutral camera control tool for Unix-like systems, such as Linux and Mac. It supports photo cameras of multiple brands, including Canon, Nikon, Olympus, Pentax, Sony, and Fuji. The supported features vary by model. The following table lists gPhoto2's major features, alongside the official count of supported cameras for each feature:

Feature

Number of Supported Devices

Description

File transfer

2105

files to and from the device

Image capture

489

Make the device capture an image to its local storage

Configuration

428

Change the device's settings, such as shutter speed

Liveview

309

Continuously grab frames of live video from the device

These numbers are current as of version 2.5.8, and are conservative. For example, some configuration features are supported on the Nikon D80, even though the gPhoto2 documentation does not list this camera as configurable. For our purposes, image capture and configuration...

Detecting the presence of a photogenic subject

Chapter 1, Getting the Most out of Your Camera System, proposed that a photograph ought to capture a subject in a moment. Let's explore this notion further as we search for ways to detect a desirable or "photogenic" subject and moment.

As a medium, photography uses light, an aperture, a photosensitive surface, and time to draw an image of a scene. The earliest photographic technology, in the 1820s, lacked the resolution and speed to convey a detailed subject in a precise moment, but it was able to capture a grainy scene on a sunny day. Later, with better lenses, flashes, and photosensitive surfaces, photography became capable of capturing a sharp scene, a formal portrait, a faster and more natural portrait, and finally a moment of action, frozen in time.

Consider the following series of famous photographs, ranging from 1826 to 1942:

Detecting the presence of a photogenic subject

For general interest, here are some details about the preceding photographs:

  • Upper left: View from...

Processing images to show subtle colors and motion

By now, you have probably captured some exposure-bracketed photos and time-lapse photos. Upload them onto your computer using a photo management application, a file browser, or the following gPhoto2 command:

$ gphoto2 --get-all-files

The latter command will upload the files to the current working directory.

We will merge exposure-bracketed photos to create HDR images, which will improve color rendition in shadows and highlights. Similarly, we will merge time-lapse photos to create time-lapse videos, which will show gradual motion on an accelerated scale. We will start by processing some of the sample photos from the book's GitHub repository at https://github.com/OpenCVBlueprints/OpenCVBlueprints/tree/master/chapter_2/CameraTrap/media, and then you will be able to adapt the code to use your photos instead.

Creating HDR images

OpenCV 3 has a new module called "photo". Two of its classes, MergeDebevec and MergeMertens, create an...

Further study

Computational photography is a diverse and popular field, which combines the work of artists, technicians, and scientists. Thus, there are many types of authors, instructors, and mentors who can help you become a better "computational photographer". Here are just a few examples of helpful guides:

  • Learning Image Processing with OpenCV, by Gloria Bueno García et al (Packt Publishing, 2015), covers a wide range of OpenCV 3's capabilities with respect to image capture, image editing, and computational photography. The book uses C++, and is suitable for beginners in computer vision.
  • The National Geographic Masters of Photography video lectures (The Great Courses, 2015) provide great insight into the goals and techniques of master photographers. Several of the lecturers are wildlife photographers, whose use of camera traps was an inspiration for this chapter.
  • OpenSource Astrophotography, by Karl Sarnow (CreateSpace Independent Publishing Platform, 2013), covers...

Summary

This chapter has demonstrated a set of surprisingly flexible commands and classes, which enable us to conduct experiments in computational photography, with short and simple code. We have written scripts to control a photo camera. Along the way, we have acquainted ourselves with gPhoto2, the Bash shell, PTP communication, GVFS mount points, and Python's support for subprocesses. We have also scripted several variations of a photo trap to take pictures when a subject comes into view. For this, OpenCV has provided us with the capability to detect motion, measure color similarities, and classify objects. Finally, we have used OpenCV to combine a set of photos into a time-lapse video or HDR image.

So far, this book has provided a fairly broad survey of ways to capture light as data, control a camera, detect a subject, and process a photo. The remaining chapters will focus on a selection of advanced techniques, which will enable us to perform much finer classification and identification...

Left arrow icon Right arrow icon

Description

Computer vision is becoming accessible to a large audience of software developers who can leverage mature libraries such as OpenCV. However, as they move beyond their first experiments in computer vision, developers may struggle to ensure that their solutions are sufficiently well optimized, well trained, robust, and adaptive in real-world conditions. With sufficient knowledge of OpenCV, these developers will have enough confidence to go about creating projects in the field of computer vision. This book will help you tackle increasingly challenging computer vision problems that you may face in your careers. It makes use of OpenCV 3 to work around some interesting projects. Inside these pages, you will find practical and innovative approaches that are battle-tested in the authors’ industry experience and research. Each chapter covers the theory and practice of multiple complementary approaches so that you will be able to choose wisely in your future projects. You will also gain insights into the architecture and algorithms that underpin OpenCV’s functionality. We begin by taking a critical look at inputs in order to decide which kinds of light, cameras, lenses, and image formats are best suited to a given purpose. We proceed to consider the finer aspects of computational photography as we build an automated camera to assist nature photographers. You will gain a deep understanding of some of the most widely applicable and reliable techniques in object detection, feature selection, tracking, and even biometric recognition. We will also build Android projects in which we explore the complexities of camera motion: first in panoramic image stitching and then in video stabilization. By the end of the book, you will have a much richer understanding of imaging, motion, machine learning, and the architecture of computer vision libraries and applications!

What you will learn

  • Select and configure camera systems to see invisible light, fast motion, and distant objects Build a -camera trap, as used by nature photographers, and process photos to create beautiful effects Develop a facial expression recognition system with various feature extraction techniques and machine learning methods Build a panorama Android application using the OpenCV stitching module in C++ with NDK support Optimize your object detection model, make it rotation invariant, and apply scene-specific constraints to make it faster and more robust Create a person identification and registration system based on biometric properties of that person, such as their fingerprint, iris, and face Fuse data from videos and gyroscopes to stabilize videos shot from your mobile phone and create hyperlapse style videos

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 10, 2015
Length: 382 pages
Edition : 1st
Language : English
ISBN-13 : 9781784399757
Vendor :
Intel
Category :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Nov 10, 2015
Length: 382 pages
Edition : 1st
Language : English
ISBN-13 : 9781784399757
Vendor :
Intel
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 120.97
OpenCV 3 Blueprints
€36.99
Learning OpenCV 3 Computer Vision with Python (Update)
€41.99
OpenCV By Example
€41.99
Total 120.97 Stars icon
Banner background image

Table of Contents

8 Chapters
1. Getting the Most out of Your Camera System Chevron down icon Chevron up icon
2. Photographing Nature and Wildlife with an Automated Camera Chevron down icon Chevron up icon
3. Recognizing Facial Expressions with Machine Learning Chevron down icon Chevron up icon
4. Panoramic Image Stitching Application Using Android Studio and NDK Chevron down icon Chevron up icon
5. Generic Object Detection for Industrial Applications Chevron down icon Chevron up icon
6. Efficient Person Identification Using Biometric Properties Chevron down icon Chevron up icon
7. Gyroscopic Video Stabilization Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3
(12 Ratings)
5 star 66.7%
4 star 16.7%
3 star 8.3%
2 star 0%
1 star 8.3%
Filter icon Filter
Top Reviews

Filter reviews by




Amazon Customer Jan 17, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book is a very good recipe for those who have prior knowledge of opencv, it covers different subjects related to image processing and computer vision, while at the same time presents complete projects about different computer vision concepts. It provides an easy to follow flow over the text with a step by step explanation. It is not focused only to c++ and opencv development but includes other techniques/methods and technologies as well, e.g. python, android development, etc... Chapter 5 is excellent since it provides really important information and guidance related to machine learning and object detection, something quite interesting to many users, by giving you information related on how to modify settings and parameters for the best outcome. It is a nice to have book in your collection and I would definitely suggest to purchase it without second thoughts.
Amazon Verified review Amazon
Don Jan 18, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book was insightful and had an approachable layout and all the content necessary to get up and running with OpenCV 3. As I expect from an IT book, the content of this publication contained a step-by-step depiction of installing, using, and testing and pragmatic applications. What's more, I was so happy to gain value from supplier recommendation, relevant theoretical background information, and thorough steps to create projects in image capture and processing, machine learning, application development, and more a couple of more advanced facial recognition and gyroscope methods. If you are serious about learning and developing image-based approaches and applications, this is a wonderful resource to get you started.
Amazon Verified review Amazon
Lu Feb 01, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Very well written, imaginative, insightful, and humorous. Provides related background supplement for fast learning. Step by step introduction to full-function program with dedicated and highly organized source code creates a smooth reading experience. As for the topic, it covers some mobile app development and machine learning projects, all taking care of actual deployment as a good application reference. Last but not least, clear and simple explanations for complex concepts to brighten up the dry technical talk. Apparently, this’s a very useful and well-designed OpenCV 3 reference book.
Amazon Verified review Amazon
HRL Jan 24, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Quote from a friend:"Very well written, imaginative, insightful, and humorous. Provides related background supplement for fast learning. Step by step introduction to full-function program with dedicated and highly organized source code creates a smooth reading experience. As for the topic, it covers some mobile app development and machine learning projects, all taking care of actual deployment as a good application reference. Last but not least, clear and simple explanations for complex concepts to brighten up the dry technical talk. Apparently, this’s a very useful and well-designed OpenCV 3 reference book."
Amazon Verified review Amazon
M. Barnachon Feb 01, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you are an OpenCV user, and you want to go behind the tutorial, implement real-world applications, see how optimizations can be achieved with the latest release of OpenCV, this book is for you. If you want to understand how to implement a state-of-the-art paper, with tricks and optimizations, in a fast, but yet effective way, this book gives you 6 different projects to do it.Most of OpenCV tutorials and/or books teach you the documentation of the functions, a little of the background, and gives you some future directions. Here, you have real applications, which involve more than OpenCV/Computer Vision solutions. Don't expect that all the functions of OpenCV will be covered, they are presented in-place, while you are writing the (not so) toy application. This book won't teach you the theory behind the applications build, it will focus on the effectiveness. It assumes you already have this background, or you will learn it using another book. It's a great example of how to use a vast library (often used only for prototyping) inside industrial applications.What is of particular interest, in my opinion, is the focus made on extending the idea beyond the core of the method to the usage in the difficult / broad environment, with more than 2-3 users/cases. Don't hesitate to go behind the first chapter about camera type comparisons, that could be quite intimidating…A must have, if one of the chapter interest you!
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.