1) Salt & Pepper (100 pts.)
1.1) Preprocessing (50 pts.)
In this part, we will work on the video "shapes_video.mp4". For every frame of the video,
a new card having a specific shape (star, square, pentagon) appears. However, each frame
has a salt & pepper noise as given in Figure 1.
Figure 1: A frame from the video
Filter each frame to avoid noise and save the video as a new file. To read the video frame by
frame, you can use the following lines.
import moviepy.video.io.VideoFileClip as mpy
import cv2
vid = mpy.VideoFileClip('shapes_video.avi')
frame_count = vid.reader.nframes
video_fps = vid.fps
for i in range(frame_count):
frame = vid.getframe(i*1.0/videofps)
1
1.2) Counting the shapes (50 pts.)
Implement Minimum Eigenvalue corner detector on the frames to obtain the corners of the
shapes. Then, count the exact counts of triangle, star and pentagon cards. (Hint: You can do
background subtraction between frames.)