Link to home
Start Free TrialLog in
Avatar of verpies
verpies

asked on

Cylindrical Distortion (bottle label)

I have a photo of a label glued on a bottle.  The label is glued on the curved wall of the bottle and the bottle is cylindrical where the label is attached.

The photo is taken pretty much head on the bottle, and the middle of the label  is in correct proportions but the edges are compresses more and more near the ends.

How can I "flatten" the image of this label in Photoshop to get rid of the cylindrical distortion ?
ASKER CERTIFIED SOLUTION
Avatar of David Brugge
David Brugge
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of verpies
verpies

ASKER

The label wraps a little under 1/2 around the bottle.

I tried the warp filter but it does not do a perfect job, indeed.
I do not think the bezier curves can approximate the proper compresion of the label edges.

Ideally I would like to input the magnification factor as some kind of an approximation of the function 1/SQRT(1-(x^2/r^2)) which says that the center of the label gets no magnification (x=0) and the edges get an infinite magnification (x=-r or x=+r).  Eyeballing of the compression factors in 3 linear zones is really not what I was looking for.

Also, I do not have symmetrical reference points on my label to be sure that I am eyeballing it well, even if it was possible.

Is there any kind of a plugin  that does a cylindrical distortion ?

I am not aware of any plugins that do this.

Here's another technique that we used to use before the days of the warp fillter.

Isolate the label onto a separate layer.

Switch to QuickMask mode and draw a Reflected Gradient from the center of your label to the outside edge.

The idea here being that the red area will protect the center (non compressed) area from being selected and the rest of the selection will continue with an even gradation from the center to the outside edge.

Switch back to standard mode.

Choose Edit>Transform and holding down the shift key, stretch the image to the new shape.

Here's what is happening. The stretch function is applied to each pixel on a logarithmic scale, applying the greatest amount of stretch on the outside edges and decreasing and it moves inward.

This method causes the image to become thin because it was being stretched into a blank space. To overcome this, duplicate the layer a dozen times or so (cmd+J) and selecting all of the layers merge them back into one (cmd+E)

This should give you more even and predictable results.

again, best of luck.
Avatar of verpies

ASKER

I am awarding points to this solution because nobody posted a better one, despite that I could not use it.