Image Unwrapper

Match 1, 2016


This is a more niche tool that was useful for analysis of microscope images of columnar structures. In such images a cylindrical object is photographed and we are interested in 'unwrapping' the features on the cylinder so the output image is a 2D map of the cylinder's surface. An example of this is a label on a soda can:

An example of the image unwrapper, on left is the original image of a soda can and on right is the unwrapped label.


The program operates largely through a click-and-drag interface. Internally it is based on the Image Straightener code, and even keeps the same namespace. We note a few limitations before starting:

  1. This will only work on photographs of a cylinder taken far enough away that the cylinder's visible sides are nearly parallel.
  2. This will output a pixel resolution with a width of pi*r and height of h corresponding to the drawn cylinder on the input image. The output image x coordinate will correspond linearly to angle around the cylinder.

As an example, we will unwrap a model of a coke can.

Step 1: Load Image and Outline Cylinder

Press the Load Image button and select the input image. Then move the two points defining a line to the left side of the cylinder, and one point defining cylinder radius to the right side.

An input image is loaded in the program and cylinder is outlined.

Step 2: Match Cylinder Angle

Check the 'Show Grid' checkbox, which will show a green grid and dot. Drag the green dot along the cylinder's axis of symmetry to get the grid lines to match the curvature of the cylinder, in case the cylinder is tilted towards/away from the camera.

The green grid lines visually match the curvature of the cylinder.

Step 3: Unwrap Image

Press the Unwrap button to finish the process.

The unwrapped image. It tapers towards the edges since our first assumption that cylinder edges are parallel was not satisfied.


The executable is available here. The installer file (which will also install .NET framework if it is missing) is available here. The source code is available here.