how to crop an image

6 visualizaciones (últimos 30 días)
Martin Zima
Martin Zima el 12 de Mzo. de 2014
Respondida: Dishant Arora el 12 de Mzo. de 2014
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');
  • ....

Respuestas (2)

Doug Hull
Doug Hull el 12 de Mzo. de 2014
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)

Dishant Arora
Dishant Arora el 12 de Mzo. de 2014
[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);

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by