|
SOLUTIONS
|
MATHEMATICA 内置符号
ImageCrop
ImageCrop[image]
通过删除均匀颜色的边界对 image 进行剪切.
更多信息更多信息
- ImageCrop[image] 实际上删除 image 的边界,其中图像的像素值基本上服从均匀分布.
- ImageCrop[image, {w, h}] 默认情况下从 image 对称清除像素, 或者当 w 或 h 大于 image,它对称增加像素.
- 在 ImageCrop[image, size] 中,图像大小指定 size 可以有以下格式:
-
width 特定宽度;基于高宽比的高度 {width} 最大宽度 {width,height} 特定宽度和高度 {width,depth,height} 三维空间中的特定宽度、深度和高度 - 任一维度的指定可以是下面任何指定:
-
d d 个像素 {d} 最大值 d 个像素 {dmin,dmax} 像素范围 Automatic 从高宽比确定数值 Full 在该维度上不进行剪切 - 在 ImageCrop[image, size, spec] 中的剪切规格 spec 可以具有下列形式:
-
side 在指定边的剪切,其它在中心剪切 {side1,side2} 在指定边剪切 {ax,ay} 每边赋予一个剪切分式 - 边的指定可以是 Left、Right、Bottom、Top. Center 表示对称剪切.
- 剪切分式介于
和
之间. 在水平情况下,
等于 Left,
等于 Right,
等于 Center. 在垂直情况下,
等于 Bottom,
等于 Top. - ImageCrop[image, size] 等价于 ImageCrop[image, size, Center].
- 若要获取高宽比为 r 的图像,使用 ImageCrop[image, width{1, r}].
- 如果 ImageCrop[image, ...] 指定的最后的图像超出了 image 的范围,则按照 Padding 的设置增加像素.
版本 7 的新功能 | 版本 9 修改功能
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »














