/perspective-remover

Alter image of a flat surface to remove perspective

Primary LanguagePython

perspective-remover

Python script for transforming an image of a flat surface to remove perspective, synthesizing a new image with the surface appearing head-on.

The user provides corners of a rectangle in the angled image through mouse clicks. The script creates the corresponding image in a new coordinate frame such that the image is rotated to directly face the camera. Uses the method developed in the Perspective Removal lab of Philip Klein's excellent Linear Algebra course at https://www.coursera.org/course/matrix

Uses Johann C Rocholl's png.py PNG encoder/decoder.

Requires numpy to better facilitate some vector/matrix operations.

Examples

Before After
Birds, original Birds, perspective removed
Book, original Book, perspective removed