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:
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:
相关文章推荐
- linux 守护进程
- Log4j.properties文件自动加载
- 如何在 Linux 上自动调整屏幕亮度保护眼睛
- Linux中which,whereis,locate和find的区别
- Linux互斥和同步应用程序(一):posix线程和线程之间的相互排斥
- ubuntu自定义命令设置一(bash)
- shell的折腾
- 某HPC集群开关机维护操作
- Centos6.5 安装 samba
- Can't use Subversion command line client: svn和Errors found while svn working copies detection
- Unix/Linux僵尸进程
- paramiko interactive shell
- Linux下安装JDK
- Centos 7 安装LAMP环境
- ubuntu14和centos7安装配置mysql
- linux -- ubuntu 14.10开机出现错误“Error found when loading /root/.profile”解决
- linux 内核编译 (如何正确选择内核驱动)
- hadoop 常用配置
- Linux文件系统十问,你知道吗?
- Hadoop 部署过程中的一些问题与解决方案