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
Arrow up icon
GO TO TOP
Practical Computer Vision

You're reading from   Practical Computer Vision Extract insightful information from images using TensorFlow, Keras, and OpenCV

Arrow left icon
Product type Paperback
Published in Feb 2018
Publisher Packt
ISBN-13 9781788297684
Length 234 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Abhinav Dadhich Abhinav Dadhich
Author Profile Icon Abhinav Dadhich
Abhinav Dadhich
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. A Fast Introduction to Computer Vision FREE CHAPTER 2. Libraries, Development Platform, and Datasets 3. Image Filtering and Transformations in OpenCV 4. What is a Feature? 5. Convolutional Neural Networks 6. Feature-Based Object Detection 7. Segmentation and Tracking 8. 3D Computer Vision 9. Mathematics for Computer Vision 10. Machine Learning for Computer Vision 11. Other Books You May Enjoy

Revisiting the convolution operation

Extending our discussion on filters from Chapter 3, Image Filtering and Transformations in OpenCV, the convolution operation is taking a dot product of a shifted kernel matrix with a given input image. This process is explained in the following figure:

As shown in the previous figure, a kernel is a small two-dimensional array that computes dot product with the input image (on the left) to create a block of the output image (on the right).

In convolution, the output image is generated by taking a dot product between an Input image and a Kernel matrix. This is then shifted along the image and after each shift, corresponding values of the output are generated using a dot product:

As we saw in the previous chapter, we can perform a convolution operation using OpenCV as follows:

kernel = np.ones((5,5),np.float32)/25
dst = cv2.filter2D(gray,-1...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image