您的位置:首页 > 运维架构

OpenGL-----Projective Image Warp

2015-09-06 11:48 260 查看
Project Description:

build a warping tool based on projective warps, which includes all of the affine and perspective warps. The tool will provide for input of a sequence of operations, will compose a single transform from the sequence, and finally will apply the transform to the input image via inverse mapping.You need to consider constructing each of the projective transformations: translate, rotate, scale, flip, shear, and perspective.

The specifications for each transform follow. Your program should loop, reading these until the d command is input). Italics indicate floating point arguments, except for the f command, which takes integer arguments:

r θ counter clockwise rotation about image origin, θ in degrees

s sx sy scale (watch out for scale by 0!)

t dx dy translate

f xf yf flip -if xf=1 flip x coordinates, yf=1 flip ycoordinates

h hx hy shear

p px py perspective

d done

Matrix 3*3



Some Key Points:

1.Forward Mapping will cause gaps(because the image maybe larger than previous one, so some of points will no value )

2.use inverse transform.We can adjust the loop so that we do one copy for each output pixel instead of each input pixel,then we could you different interpolation ways.

Artifacts two types:

a.Aliasing: sampling the input image too coarsely. Occurs

when the image is being minified!

b.Reconstruction: using too crude a method (i.e. the psf) to

reconstruct a pixel. Occurs when the image is magnified.

Perspective Warping

This form of warping stretches and squishes in different places.

Straight lines stay straight, but not necessarily parallel.

Example:



Result example:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: