Rectifying the image to a top-down view

Instructions: Open your image file that includes a photographic reference scale, then drag the red markers to the corners of the reference scale in the image, and press 'Rectify'. If desired, refine the corner positions and 'Rectify' again. Detailed instructions are on the bottom half of this page. Works only with a mouse/trackpad.

About this tool

Distortion due to photographing at an oblique angle can be rectified using geometric transformations, as illustrated in fig 1 below. After rectification, the photographic reference scale, and anything in the same plane, appears as if it had been photographed from the direction perpendicular to that plane.

Rectifying the image to a top-down view

Fig 1. Image (close-up with wide angle lens) before and after use of rectification tool.

This tool is specialized to work with images containing this photographic reference scale design. You locate the corners of the reference scale in the image by dragging the red markers. Then the tool's browser-based software uses homology to map those points to the known shape of the reference scale, as outlined by the yellow dashed rectangle superimposed on your image -- and in the process transforms the entire image similarly.

This works well to rectify the reference scale. Whether the same transformation rectifies the rest of your image depends on what is in your photo. The transformation works best when everything in your photo is in the same plane as the reference scale. If the subject was not planar, or not co-planar with the reference scale, off-plane points in the image will likely still look distorted. Also, of course the image transformation cannot create information that isn't already in your photo; if something isn't visible in the photo, it won't be visible in the rectified image either, even though that 'something' might have been visible to the camera if the photo had been taken perpendicular to the subject.

The transformation can be based upon either three or four corners, using either orthographic or perspective transformation respectively. Orthographic transformation is a special case of perspective transformation, where the camera was an infinite distance from the subject. There is no harm in always using four corners -- it's just more slightly work, having to position the fourth marker.

Usage tips

  • If the reference scale is small in your photo, it's easier to position the corner markers roughly at first, press Rectify, and then position the markers more carefully on the now-expanded image, then press Rectify again.
  • While dragging a corner marker with the mouse button down, you can use the arrow keys to nudge the marker.
  • Once rectified as well as you want, press 'Fit image to window' to see the entire image. To see it full size, press 'Display image full size'. Click anyway to return to the tool.
  • To record a transformed image, use screen capture (perhaps display full size first, for highest resolution). Firefox has a built-in screen capture tool (right-click on the browser background when displaying the rectified image, select 'Take Screenshot').
  • Once you have the corner markers well-positioned, you can press 'Save marker locations' to store those positions in your browser so that next time you load that image, the markers will be auto-positioned.

Images are processed in your browser; they don't leave your browser. Your browser's local storage is used if you save marker locations (the file name and marker locations are saved).

Typical steps

Rectifying the image to a top-down view

Step 1: Open an image containing the reference scale

Rectifying the image to a top-down view

Step 2: Drag the corner markers to the corners of the reference scale

Rectifying the image to a top-down view

Step 3: Press 'Rectify'. The image will be transformed such that the area within your markers is mapped to the shape of the reference scale, as indicated by the dashed yellow lines. If necessary, reposition the markers and press 'Rectify' again.

Rectifying the image to a top-down view

To see the entire image, press 'Fit image to window'. The Firefox built-in screenshot tool is a convenient way to save the image to a file.

Sometimes, an object may look different in an image from how it appears in real life. This mismatch is due to perspective distortion. Images of the same object captured from different camera distances and angles of view exhibit different perspective distortion.

Perspective distortion in images of the same object captured from different distances and angles

Prerequisite: Enable the graphics processor

Photoshop requires at least 512 MB of video RAM (VRAM) to run the perspective warp feature on 16-bit and 32-bit documents. For details, see Photoshop graphics processor (GPU) card FAQ.

As a prerequisite to adjusting perspective, ensure that the graphics processor is enabled in your Photoshop preferences.

  1. Choose Edit > Preferences > Performance.
  2. In the Graphics Processor Settings area, select Use Graphics Processor.
  3. Click Advanced Settings. Ensure that Use Graphics Processor To Accelerate Computation is selected.
  4. Click OK.

Adjust perspective

Define planes

Before you adjust perspective, you must define the planes of the architecture in the image:

  1. Open the image in Photoshop.
  2. Choose Edit > Perspective Warp. Review the onscreen tip and close it.
  3. Draw quads along the planes of the architecture in the image. While drawing the quads, try to keep their edges parallel to the straight lines in the architecture.

Rectifying the image to a top-down view

Draw the edges of the quads roughly parallel to the lines in the architecture. As depicted in the illustration, you can snap two planes together. Here is a set of planes defined for a building.

Manipulate the planes

  1. Switch to the Warp mode from the Layout mode.

Rectifying the image to a top-down view

Warp mode

  1. Manipulate perspective in one of the available ways:
  • Move around the corners of the quads (pins) as appropriate. For example, you can adjust the perspective of this image, such that the two sides of the building exhibit foreshortening in equal measures. The resulting perspective would approximate a direct view of the building from a corner.

Rectifying the image to a top-down view

Adjusting the perspective, such that the two sides of the building are equally foreshortened

  • Shift-click an individual edge of a quad to straighten it and keep it straight during further perspective manipulation. Such a straightened edge is highlighted in yellow in the Warp mode. You can manipulate the corners of the quads (pins) for finer control while adjusting perspective.

Rectifying the image to a top-down view

Shift-click to straighten an individual edge of a quad and keep it straight during further perspective manipulation. The rightmost selected edge in this image is highlighted in yellow.

Rectifying the image to a top-down view

The selected edge is straightened. Also, the straightening of the edge is preserved during further perspective manipulation.

Shift-click the edge again if you don't want to preserve its straightening.

  • In the Warp mode, you can click the following icons for automatic perspective adjustment:

Rectifying the image to a top-down view
Automatically level near horizontal lines

Rectifying the image to a top-down view

Level horizontally

Rectifying the image to a top-down view
Automatically straighten near vertical lines

Rectifying the image to a top-down view

Straighten vertically

Rectifying the image to a top-down view
Automatically straighten both vertically and horizontally

Rectifying the image to a top-down view

Straighten horizontally and vertically

  1. Once you're done adjusting the perspective, click the Commit Perspective Warp icon (
    Rectifying the image to a top-down view
    ).

Keyboard shortcuts

The following keyboard shortcuts make it easier to adjust perspective:

Arrow keys

Slightly move a corner of a quad (pin)

H

Hides the grid when you're working in the Warp mode

L

Switches to the Layout mode

W

Switches to the Warp mode

Enter key

In the Layout mode, you can press the Enter key to quickly switch to the Warp mode. In the Warp mode, the Enter key commits the current changes to the perspective.

Shift-click

(Warp mode) Straightens an individual edge of a quad and keeps it straight during further perspective manipulation. If you don't want to preserve the straightening of the edge, Shift-click it again.

Shift-(drag an edge)

(Layout mode) Constrains the shape of a plane while lengthening it

Enhance landscapes using Perspective Warp

Video tutorial

FAQ

Yes. When you edit different perspectives in the same image, you can choose to:

  • Keep one part of the image having a certain perspective unchanged while adjusting the perspective for the rest of the image. To do so:
    1. Draw a quad around the part of the image whose perspective you want to preserve. Ensure that this quad is not snapped to any of the other planes whose perspective you're adjusting.
    2. Keep this quad unchanged while working with the other planes whose perspective you want to adjust.
  • Edit parts of the image having different perspectives independent of each other.
    1. Draw unconnected quads around the relevant parts of the image.
    2. Manipulate the quads independent of one another.

Photoshop requires at least 512 MB of video RAM (VRAM) to run the perspective warp feature on 16-bit and 32-bit documents. If your GPU has 256 MB of VRAM, you can run the perspective warp feature only on 8-bit documents.

Also, the nVidia GeForce GT 120 video card isn't currently supported for the perspective warp feature.

Follow these steps:

  1. Choose Edit > Preferences > General.
  2. Click Reset All Warning Dialogs and then click OK.

Yes. As an illustration, here are two different ways of defining planes for the gateway to the Taj Mahal:

What is rectifying an image?

Image rectification is a transformation process used to project images onto a common image plane. This process has several degrees of freedom and there are many strategies for transforming images to the common plane.

What are the techniques of Image rectification?

The image-to-map rectification process normally involves selecting GCP image pixel coordinates (row and column) with their map coordinate counterparts (e.g., meters northing and easting in a Universal Transverse Mercator map projection).

What is rectification in computer vision?

Image rectification is a transformation process used to project multiple images onto a common image surface. It is used to correct a distorted image into a standard coordinate system. It is used in computer stereo vision to simplify the problem of finding matching points between images.

What is the difference between rectification and undistortion?

– Radial Undistortion: Compensate effects of radial lens distortion. – Rectification: Transforming the epipolar geometry into a canonical form.