文档帮助中心文档
创建变形图像的输出视图
溃败= affineOutputView (sizeA tform)
溃败= affineOutputView (sizeA、tform BoundsStyle,风格)
溃败= affineOutputView (sizeA,tform)取输入图像的大小,sizeA,和仿射几何变换,tform,并返回一个空间引用对象,溃败.你可以使用这个对象作为输入imwarp控制扭曲图像的输出限制和网格间距。
溃败= affineOutputView (sizeA,tform)
溃败
sizeA
tform
imwarp
例子
溃败= affineOutputView (sizeA,tform“BoundsStyle”,风格)还指定了对输出视图的空间限制的约束,例如输出视图是否应该完全包含输出图像,或者输出视图是否应该匹配输入限制。
溃败= affineOutputView (sizeA,tform“BoundsStyle”,风格)
风格
全部折叠
读取并显示图像。要查看图像的空间范围,请使坐标轴可见。
一个= imread (“kobi.png”);iptsetpref (“ImshowAxesVisible”,“上”) imshow (A)
创建一个二维仿射变换。这个例子创建了一个随机变换,它包含范围为[1.2,2.4]的比例因子,范围为[- 45,45]度的旋转角度,以及范围为[100,200]像素的水平平移距离。
tform = randomAffine2d (“规模”[1.2, 2.4],“XTranslation”(100 200),“旋转”, -45年,45);
为图像和转换创建三个不同的输出视图。
centerOutput = affineOutputView(大小(A)、tform“BoundsStyle”,“CenterOutput”);followOutput = affineOutputView(大小(A)、tform“BoundsStyle”,“FollowOutput”);sameAsInput = affineOutputView(大小(A)、tform“BoundsStyle”,“SameAsInput”);
使用每种不同的输出视图样式对输入图像应用转换。
BCenterOutput = imwarp (tform,“OutputView”, centerOutput);BFollowOutput = imwarp (tform,“OutputView”, followOutput);BSameAsInput = imwarp (tform,“OutputView”, sameAsInput);
显示结果图像。
imshow (BCenterOutput)标题(“CenterOutput边界风格”);
imshow (BFollowOutput)标题(“FollowOutput边界风格”);
imshow (BSameAsInput)标题(“SameAsInput边界风格”);
iptsetpref (“ImshowAxesVisible”,“关闭”)
输入图像大小,指定为用于2-D图像输入的2元素数字向量或用于3-D体积图像输入的3元素数字向量。
affine2d
affine3d
仿射几何变换,指定为affine2d或affine3d对象。
“CenterOutput”
“FollowOutput”
“SameAsInput”
边界样式,指定为下列值之一。
imref2d
imref3d
空间引用,返回为imref2d或imref3d对象。使用溃败随着OutputView论点的imwarp函数指定扭曲的输出的空间引用。
OutputView
imwarp|randomAffine2d|randomAffine3d
randomAffine2d
randomAffine3d
您有这个示例的修改版本。您想打开这个示例与您的编辑吗?
你点击一个链接对应于这个MATLAB命令:
通过在MATLAB命令窗口中输入命令来运行命令。Web浏览器不支持MATLAB命令。金宝app
选择一个网站,在那里获得翻译的内容,并看到当地的活动和优惠。根据您的位置,我们建议您选择:.
你也可以从以下列表中选择一个网站:
选择中国网站(中文或英文)以获得最佳网站性能。其他MathWorks国家站点没有针对您所在位置的访问进行优化。
与当地办事处联系