how to crop an image
3 次查看(过去 30 天)
显示 更早的评论
Hallo , im new here and i would like to know, how to crop an image on all sides by 10 percent ???
- a=imread('image1.jpg');
- ....
0 个评论
回答(2 个)
Doug Hull
2014-3-12
im = imread('pout.tif')
[r,c] = size(im)
per = 0.1
left = round(per*c);
right = c-left;
top = round(per*r);
bottom = r-top
newIM = im(top:bottom, left:right);
imshow(newIM)
0 个评论
Dishant Arora
2014-3-12
[rows cols planes] = size(imageArray);
rect = [fix(cols*0.10) , fix(row*0.10) , fix(cols*0.80) , fix(rows*0.80)];
croppedImage = imcrop(imageArray , rect);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!