
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¶
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
)¶

data/test.jpg
In [9]:
# Your solution here
Print image height and width and the number of channels¶
In [10]:
# Your solution here
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
¶
- Open a video stream.
- Read in the first frame.
- Read in the second frame.
- Find the differences between the two frames.
- Display the first frame, the second frame and the differences as seen below.
- Close the video stream

In [7]:
# Your solution here
Capture a frame from webcam¶
- Open a camera stream.
- Read in one frame.
- Read in another frame.
- Find the differences between the two frames.
- Display the first frame, the second frame and the differences as seen below (your frames will be different).
- Close the video stream

In [8]:
# Your solution here

In [ ]: