2

Have a look at this image.
an object exacted from a cylindrical surface

This is the edge of perspective projection result of a rectangle region on a cylindrical surface (like a bottle). The rectangle's vertical median line is parallel with the axis of the cylindrical surface.

I know how to do perspective tranformation of quadrangle on a plane (http://alumni.media.mit.edu/~cwren/interpolator/ and Perspective Transform in Matlab), but how to do it on a cylindrical surface?
what I want is to transform the region to the original rectangle.

My problem is almost like this: Unwarp curved surface

thanks for help!


here is a simple explaination in two images. I rolled image 1 and pasted it on a bottle, then I took a picture from some distance with a specific angle and orientation. Then how can I restore Image 1 from Image 2?
enter image description here
Image 1
enter image description here
Image 2

Community
  • 1
  • 1
zhy
  • 103
  • 2
  • 9
  • What _exactly_ do you want to do? and please, don't answer in a comment but rather edit your question. – gboffi Dec 14 '14 at 14:10
  • @gboffi sorry, but i've added some more description. – zhy Dec 14 '14 at 14:24
  • I have an answer ready if what you want, using the bottle analogy, is drawing on the label (the label being a planar rectangle!) of the bottle and then obtain a perspective view of what you've drawn on the label. Can you confirm my supposition? – gboffi Dec 14 '14 at 14:38
  • @gboffi I've added 2 pictures to make the question easy to understand. what i already get is a perspective view and i wanna transform it to its orignal shape. sorry, but my last reply should not be "yes" :( – zhy Dec 15 '14 at 06:10

1 Answers1

0

It's difficult to know what the OP really wants from the question that was posed.

If s/he wants to draw a polyline on the label of the bottle, a bottle of radius r, and then draw the same polyline in a generical perspective view, the idea is to first unfold the label to a plane, you can do it as a cylindrical surface is developable, then

  1. draw said polyline in plane x*-z' with y'=y0=r

fold back the label over the bottle surface

  1. map the polyline on a cylinder with axis x'=0, y'=0

    z' = z'
    angle = x*/y0
    y' = y0*cos(angle)
    x' = y0*sin(angle)
    

go back to global coordinates

  1. apply a generic change of coordinates (rotation+translation)

given your point of view, etc

  1. project perspectically

Note that horizontal lines on the label are curved lines in Cartesian coordinates, so a straight line has to be subdivided in a number of segments to be rendered with sufficient accuracy.

gboffi
  • 22,939
  • 8
  • 54
  • 85