Final project for EE 332: Introduction to Computer Vision, Northwestern University, Fall 2020.
The goal of this project is to implement a program that erases several handwritten characters on a newspaper page automatically and gradually in a given video, while keeping the background texture unchanged perceptively. This is accomplished using the techniques of color segmentation (in this case "red detection"), object tracking, and texture synthesis, in that order.
The handwritten characters spell “Can you erase me?” perpendicularly to the newspaper page and act as the foreground. The background is the newspaper page but is not detailed enough to be legible.
- Read all the separate frames from the input video.
- Use the
findRed()
function to detect the red pixels. - Isolate a portion of the first frame with no red pixels to use as a sample image.
- Start image tracking by manually finding and recording position of pen.
- Iterate through frames and do the following:
- Run
objectTracking()
to update position of pen. - Replace pixels in new frame that were updated in previous frames.
- Inpaint holes at pen location using texture via
synthesize()
function. - Save changed pixels to update with new frame.
- Save processed image to output list.
- Run
- Create output video from output list.
- OpenCV
- Import
original.avi
from Canvas. - Run
python3 vid2img.py
in project directory. - Run
python3 project.py
in project directory.