Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Practical Computer Vision

You're reading from  Practical Computer Vision

Product type Book
Published in Feb 2018
Publisher Packt
ISBN-13 9781788297684
Pages 234 pages
Edition 1st Edition
Languages
Author (1):
Abhinav Dadhich Abhinav Dadhich
Profile icon Abhinav Dadhich
Toc

Table of Contents (12) Chapters close

Preface 1. A Fast Introduction to Computer Vision 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

Image manipulation

As explained in previous chapters, an image in the digital domain, such as on a computer, is made up of a grid-like structure with each grid cell termed a pixel. These pixels store a value representing information about the image. For a simple grayscale image, these pixels store an integer with range [0, 255]. Changing these pixel values also changes the image. One of the basic image manipulation techniques is modifying pixel values.

Let's start by displaying what is inside an image at pixel level. For simplicity, we will do analysis on a grayscale image:

# read an image 
img = cv2.imread('gray_flower.png')

The earlier code reads a grayscale image from a file, in this case the image is in PNG format. We can also convert from one type of image color format to another. In this case, to convert a colored image to grayscale, OpenCV provides functions...

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 $15.99/month. Cancel anytime