Unwarp cylinder🔗

Unwarps a cylindrical surface so that it appears flat.

Inputs🔗

  • image: An image of a cylinder in any angle.

  • startPoint: A 3D point on the cylinder’s rotation axle, in the world coordinate system. This point will be positioned on the left edge of the projected image.

  • endPoint: A 3D point on the cylinder’s rotation axle, in the world coordinate system. This point will be positioned on the right edge of the projected image.

  • radius: The radius of the cylinder, in world units.

  • sectorAngle: The angle of the sector to straighten, in degrees. The theoretical upper limit is 180, but projection error increases while approaching this limit. If sectorAngle is smaller than what the camera sees, it will be used as an upper bound to cut off image edges.

Outputs🔗

  • image: Straightened image.

  • sectorAngle: The actual angle of the extracted sector, in degrees. May be smaller than the corresponding input if the camera can’t see a wide enough sector.