Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering OpenCV 4 with Python

You're reading from  Mastering OpenCV 4 with Python

Product type Book
Published in Mar 2019
Publisher Packt
ISBN-13 9781789344912
Pages 532 pages
Edition 1st Edition
Languages
Author (1):
Alberto Fernández Villán Alberto Fernández Villán
Profile icon Alberto Fernández Villán

Table of Contents (20) Chapters

Preface 1. Section 1: Introduction to OpenCV 4 and Python
2. Setting Up OpenCV 3. Image Basics in OpenCV 4. Handling Files and Images 5. Constructing Basic Shapes in OpenCV 6. Section 2: Image Processing in OpenCV
7. Image Processing Techniques 8. Constructing and Building Histograms 9. Thresholding Techniques 10. Contour Detection, Filtering, and Drawing 11. Augmented Reality 12. Section 3: Machine Learning and Deep Learning in OpenCV
13. Machine Learning with OpenCV 14. Face Detection, Tracking, and Recognition 15. Introduction to Deep Learning 16. Section 4: Mobile and Web Computer Vision
17. Mobile and Web Computer Vision with Python and OpenCV 18. Assessments 19. Other Books You May Enjoy

Chapter 5

  1. The cv2.split() function splits the source multi-channel image into several single-channel images,
    (b, g, r) = cv2.split(image).
  2. The cv2.merge() function merges several single-channel images into a multi-channel image, image = cv2.merge((b, g, r)).
  3. The image can be translated as follows:
height, width = image.shape[:2]
M = np.float32([[1, 0, 150], [0, 1, 300]])
dst_image = cv2.warpAffine(image, M, (width, height))

  1. The image can be rotated in the following manner:
height, width = image.shape[:2]
M = cv2.getRotationMatrix2D((width / 2.0, height / 2.0), 30, 1)
dst_image = cv2.warpAffine(image, M, (width, height))
  1. The image can be built as follows:
kernel = np.ones((5, 5), np.float32) / 25
smooth_image = cv2.filter2D(image, -1, kernel)
  1. The grayscale image is as follows:
M = np.ones(image.shape, dtype="uint8") * 40
added_image = cv2.add(image, M)
  1. COLORMAP_JET...
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 €14.99/month. Cancel anytime}