OpenGL-----Projective Image Warp

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:
example

Result example:
这里写图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值