Cylindrical transformation of an image

1. Application

In panoramic stitching, in order to keep the spatial constraints in the picture consistent with the vision, preprocessing is required, such as cylindrical projection or spherical projection.

2. Principle

Construct a cylinder whose focal length is the radius of the camera so that it is tangent to the original image plane, project the original image onto the cylinder, and the projection center is the intersection of a straight line passing through the optical center of the image and perpendicular to the image plane and the axis of the cylinder.
insert image description here
The explanatory image comes from the https://www.cnblogs.com/cheermyang/p/5431170.html blog post, referring to the definition of the projection center, the projection result of EFGH is not IDJKCL. The effect of cylindrical projection is similar to that of a person observing the image behind the cylindrical surface at the projection center, and there will be compression around the image at this time.
As shown in the figure above (from https://www.cnblogs.com/cheermyang/p/5431170.html), the image coordinate system with the upper left corner as the origin is used as the reference, and the mapping relationship between the result image after projection transformation and the original image is derived , assuming that the pixel coordinates in the original image are (x, y), the width of the original image is W, the height is H, the focal length is f, and the coordinates after projection are (x', y'), we have

Guess you like

Origin blog.csdn.net/lwx309025167/article/details/105862528