November 2016
Beginner to intermediate
941 pages
21h 55m
English
Let's take a look at how to operate on images using OpenCV-Python. In this recipe, we will see how to load and display an image. We will also look at how to crop, resize, and save an image to an output file.
import sys import cv2 import numpy as np
forest.jpg, as follows:# Load and display an image -- 'forest.jpg' input_file = sys.argv[1] img = cv2.imread(input_file)
cv2.imshow('Original', img)