MATLAB中imcrop函数

I=imread('图像名字(带扩展名及路径)');%首先读入一幅待裁剪的图像

I2=imcrop(I,[a b c d]);%利用裁剪函数裁剪图像,其中,(a,b)表示裁剪后左上角像素在原图像中的位置;c表示裁剪后图像的宽,d表示裁剪后图像的高

关于矩形区域[Xmin Ymin Width Height],Xmin是横向第Xmin个像素,Ymin是纵向第Ymin个像素;

 The WIDTH and HEIGHT of RECT do not always correspond exactly with the size of the output image. For example, suppose RECT is [20 20 40 30], using the default spatial coordinate system. The upper left corner of the specified rectangle is the center of the pixel (20,20) and the lower right corner is the center of the pixel (50,60). The resulting output image is 31-by-41, not 30-by-40, because the output image includes all pixels in the input that are completely or partially enclosed by the rectangle.

  • 34
    点赞
  • 45
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值