Skip to Main Content
Getting Started with Python for the Internet of Things
book

Getting Started with Python for the Internet of Things

by Tim Cox, Dr. Steven Lawrence Fernandes, Sai Yamanoor, Srihari Yamanoor, Prof. Diwakar Vaish
February 2019
Intermediate to advanced content levelIntermediate to advanced
732 pages
17h 10m
English
Packt Publishing
Content preview from Getting Started with Python for the Internet of Things

How to do it...

  1. Import the Computer Vision package - cv2:
import cv2 
  1. Read the image using the built-in imread function:
image = cv2.imread('image_2.jpg')
  1. Display the original image using the built-in imshow function:
cv2.imshow("Original", image) 
  1. Wait until any key is pressed:
cv2.waitKey(0) 
  1. Perform the required operation on the test image:
# cv2.flip is used to flip images 
# Horizontal flipping of images using value '1' 
flipping = cv2.flip(image, 1) 
  1. Display the horizontally flipped image:
# Display horizontally flipped image 
cv2.imshow("Horizontal Flipping", flipping) 
  1. Wait until any key is pressed:
cv2.waitKey(0) 
  1. Perform vertical flipping of input image:
# Vertical flipping of images using value '0' flipping = cv2.flip(image, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Python Programming for IoT

Practical Python Programming for IoT

Gary Smart
Learning Python Networking - Second Edition

Learning Python Networking - Second Edition

José Manuel Ortega, Dr. M. O. Faruque Sarker, Sam Washington
Learn Quantum Computing with Python and Q#

Learn Quantum Computing with Python and Q#

Cassandra Granade, Sarah Kaiser

Publisher Resources

ISBN: 9781838555795Supplemental Content