Let's say I have a whiteboard in a room full of people. I want to take a picture of the whiteboard but there are people in the way so I can't take a picture of the board straight on.

I'll have to mount the camera above, looking down at the whiteboard. This alters the perspective. Because we have full information of the plane of the whiteboard, it is theoretically possible to "undistort" the image and change the perspective such that it appears we have a 2D whiteboard, or simply looking directly at the board. Is there software that does this?

To better paint what I'm trying to say here's and image of a stop sign from an unfavorable perspective.

How do we distort it to look like this:

The surroundings in the image do not matter. I only care about the information on the flat plane of the sign/board.

Bonus points if you can do this in real time with a video stream. (Camera will be fixed so the distortion properties will be the same for all images in the video).

  • 1
    This is what Microsoft's Office Lens does.
    – dpollitt
    Jul 19 '15 at 1:11

There are transformations that you can apply to achieve some of what you're after, but there's not enough information in the source photo to come up with the final photo. For example, look at the heads of the two bolts. In the final photo, you can see that they're hexagonal, with round washers. But in the source photo you're looking at them from the side, so you have no way to know what shape they are: they could be round or hexagonal or square. Furthermore, there's extra information that you need to hide: in the source photo you see the edge of the sign, but this needs to be hidden when you change the viewing angle so that you're looking at the sign straight on.

For a whiteboard, however, the problem is much simpler because the surface is very flat and the thickness of the pen strokes is negligible. That is, the image on the whiteboard exists in a single plane. You can therefore use an affine transformation to stretch the image vertically, compress the bottom horizontally, and stretch the top horizontally. It should work pretty well provided you get enough resolution from your camera.


Many image editing programs (Photoshop, Gimp, etc.) have a perspective correction feature that can do this for individual images. That said, don't expect miracles: a very large change, like in your stop sign examples, may be possible, but you'll probably lose significant quality.

Not sure about doing it in real time for video; you may want to ask on the Video Production Stack Exchange.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.