For your output files to display in the HTML template, you will have to save/ convert them to H.264 (*.mp4).
If you are having troubles with H.264, try downloading this DLL and placing it in the folder with the binary.
Alternatively, you can install FFMPEG and use it to convert your .avi files to .mp4 using the command below.
ffmpeg -i input.m4v -c:a aac -b:a 128k -c:v libx264 -crf 23 output.mp4
Do not waste time on this.
If you are unable to get these formats working within a few minutes, you are free to pick a different format or to let OpenCV pick its default - .avi is common.
CV_FOURCC('H','2','6','4'); // For H.264
You can use either MATLAB or OpenCV for writing your programs.
Part 1a
Write a program that reads an input video of the tetris game and generates its grayscale version. Your program should work for both movies shown below. Modify the HTML file to link to your output graysacle videos so that they show up in the web page below the original color videos.
|
|
|
|
Note: change the file name to link your code
Part 1b
Write a program that reads an input video of the tetris game and outputs a modified version of the same video that includes running counters of how many squares of each color are left. For example, in the first video these counters start from 0 and end up at purple 1, red 4, blue 5, cyan 1, and green 7. Link the modified versions of the videos with embedded counters below the corresponding original videos.
|
|
|
|
Note: change the file name to link your code
Part 1c
Write a program that reads an input video of the tetris game and outputs the same video with an overlayed counter of full lines that have been removed during the game until the current frame. Your program should process both movies shown below. Modify the HTML file to link to your output videos so that they show up in the web page.
|
|
|
|
Note: change the file name to link your code
Part 2a
Write a program that reads an input video of the Super Mario game and generates an annotated video that highlights the player avatar in each video frame. For example, this can be done by drawing a bounding box around the avatar.
|
|
|
|
|
|
Note: change the file name to link your code
Part 2b
Write a program that reads the input video of the Super Mario game and modifies its so that it displays a running counter of coins collected by the player. In this game the player's avatar does not always have to intersect with the coin to collect it because coins hidden in brick squares can be collected by hitting them from below by the avatar.
|
|
|
|
|
|
Note: change the file name to link your code
Part 2c
Modify your solution from Part 2b to also count the number of the fire projectiles launched by the player. That is, your output videos for this part should include both the coin counter and the counter of the fire projectiles.
|
|
|
|
Note: change the file name to link your code
Part 3
Repeat part 1C with the following two videos captured by the phone camera from the screen.
|
|
|
|
Note: change the file name to link your code
Extra Credit 1
Repeat task from Part 2B for the following three videos. Your coin counter should agree with the game's coin counter. Hint: you may need to stabilize the image before processing.
|
|
|
|
|
|
Note: change the file name to link your code
Extra Credit 2
Repeat the task from part 2c for the following videos. That is, your program should count both the coins collected by the player and the fire projectiles. Hint: you may need to stabilize the image before processing.
|
|
|
|
Note: change the file name to link your code