我是靠谱客的博主 美好御姐,这篇文章主要介绍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.

最后

以上就是美好御姐最近收集整理的关于MATLAB中imcrop函数的全部内容,更多相关MATLAB中imcrop函数内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(135)

评论列表共有 0 条评论

立即
投稿
返回
顶部