图像运算平移,旋转,切变换
2015-10-20 15:13
281 查看
p=imread('lv.jpg');
%水平移动
figure;
s=maketform('affine',[1 0 50;0 1 50;0 0 1]'); %构建maketform结构体
g=imtransform(p,s,'XData',[1 size(p,2)],'YData',[1 size(p,1)],'FillValue',255);
%xdata显示范围,使用255色填充
imshow(g);
%旋转
figure;
x=maketform('affine',[sind(30),-cosd(30),0;cosd(30),sind(30),0;0 0 1]);
%cosd(30)表示30度
g=imtransform(p,x,'FillValue',255);
imshow(g);
%切变换
figure;
x=maketform('affine',[1 .2 0;.2 1 0;0 0 1]);
g=imtransform(p,x,'FillValue',255);
imshow(g);
相关文章推荐
- asp.net中ViewState的用法详解
- 事务简介及隔离
- android 使用AndroidAnnotations注解简化安卓开发
- php获取上传文件扩展名的方法
- 网站安全性测试
- IOS-照相,相片选取
- CountDownLatch的介绍和使用
- linux+FreeRadius+mysql+Apache安装搭建过程
- 织梦软件下载频道模型,文件类型后缀如何增加或修改
- 未来从此开始
- CocoaPods版本升级
- centos7 搭建GlusterFS
- hessian异常
- Restful API 的设计规范
- 伪静态URLRewrite
- Downloadable NLG systems
- php 二维数组排序方法
- SVN中tag和branch的区别
- NET中AJAX如何解决接收返回值是整个页面
- String s ; 和 String s = null ; 和 String s = "" ; 的却别