No description has been provided for this image

OpenCV + Python setup¶

Faisal Qureshi
Professor
Faculty of Science
Ontario Tech University
Oshawa ON Canada
http://vclab.science.ontariotechu.ca

Copyright information¶

© Faisal Qureshi

License¶

Creative Commons Licence
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Import required packages¶

In [1]:
# Your solution here

Load and display the image shown below (data/test.jpg)¶

No description has been provided for this image
data/test.jpg
In [9]:
# Your solution here

Print image height and width and the number of channels¶

In [10]:
# Your solution here

Convert image to grayscale¶

After conversion, the image will look something like this.

No description has been provided for this image
In [4]:
# Your solution here

Print the height, width and the number of channels of the grayscale image¶

In [5]:
# Your solution here

Save the grayscale image to file test_gray.jpg¶

In [6]:
# Your solution here

Display the first frame from the video data/traffic-short.mp4¶

  1. Open a video stream.
  2. Read in the first frame.
  3. Read in the second frame.
  4. Find the differences between the two frames.
  5. Display the first frame, the second frame and the differences as seen below.
  6. Close the video stream
No description has been provided for this image
In [7]:
# Your solution here

Capture a frame from webcam¶

  1. Open a camera stream.
  2. Read in one frame.
  3. Read in another frame.
  4. Find the differences between the two frames.
  5. Display the first frame, the second frame and the differences as seen below (your frames will be different).
  6. Close the video stream
No description has been provided for this image
In [8]:
# Your solution here
No description has been provided for this image
In [ ]: