Solved

Cylindrical Distortion (bottle label)

Posted on 2008-06-12
4
1,433 Views
Last Modified: 2010-04-21
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 ?
0
Comment
Question by:verpies
  • 2
  • 2
4 Comments
 
LVL 26

Accepted Solution

by:
David Brugge earned 125 total points
Comment Utility
If the label wraps fully around the side of the bottle so that it disappears from view, there is no getting that information back

If, however, there is just a minor distortion, it can be compensated somewhat with the warp filter.

Remember that as you stretch the compressed areas of the image, they will not ever appear as sharp as the uncompressed areas because you are filling in between pixels with Photoshop's guess as to what those pixels should be.

That being said, enlarge your canvas to the size that the label would be if it were laid out flat.

Now, select the label area and go to Edit>Transform>Warp.

Your label will now have a grid over it with control points.

Start with the upper right control point and drag it to the right.

Now grab the lower right control point and drag it the same amount.

Now select the Bezier control for the upper right control point and move it to the right so that it is straight up and down

Do the same with the lower Bezier control point.

You should now have an image that is stretched out evenly from the center to the right.

Now grab the middle right control point at the top of the image and drag it to the left.

This is what restores the center part of your image and compensates for the original distortion. The relationship to the outer and inner control points is something that you have to play with in order to get the right amount of curve compensation.

After adjusting the top points to your satisfaction, drag the middle and bottom points so that thy line up under the top ones. (the middle points are where the grid lines cross)

The warp filter does not do a perfect job, because it tends to fall off at the outside edges. You may need to apply the filter several times to get the effect that you want.

Have fun, and best of luck.
0
 
LVL 1

Author Comment

by:verpies
Comment Utility
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 ?

0
 
LVL 26

Expert Comment

by:David Brugge
Comment Utility
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.
0
 
LVL 1

Author Closing Comment

by:verpies
Comment Utility
I am awarding points to this solution because nobody posted a better one, despite that I could not use it.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

HOW TO CREATE A WEB 2.0 IMAGE WITH A REFLECTION I would like to start by saying I know Web 2.0 isn't a style. It is actually the practice of information sharing or  collaboration on the Web. It is also associated with the technology that is used …
Read about why website design really matters in today's demanding market.
In this tutorial viewers will learn how to correct colors in Photoshop using the Hue and Saturation adjustment Open a photo for editing in Photoshop: Begin by creating a new adjustment layer by going to Layer > New Adjustment Layer > Hue and Saturat…
In this Micro Tutorial viewers will learn how to remove an unwanted object using Photoshop’s feature known as content-aware fill.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now