perspective view of a rectangular label pasted on cylindrical surface

503 views Asked by At

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

1

There are 1 answers

0
gboffi On

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.