Borrar filtros
Borrar filtros

Cropping image without using imcrop or imresize

21 visualizaciones (últimos 30 días)
Alex Flores
Alex Flores el 20 de Mayo de 2017
Respondida: Walter Roberson el 20 de Mayo de 2017
Hey guys, So I have to crop a bunch of loaded in images without using imresize or imcrop to dimensions 120x129. I also have to plot all of the images onto a single figure. Ive tried a few things and nothing seems to work. This is the code I used to load in all of the images
imageFiles= dir('*.jpg')
nFiles=length(imageFiles)
iWant=cell(nFiles,1)
for ii=1:nFiles
iWant{ii}=imread(imageFiles(ii).name)
end

Respuestas (1)

Walter Roberson
Walter Roberson el 20 de Mayo de 2017
imcrop() works by indexing parts of the array. imcrop(A, [x y width height]) is
A(y:y+height-1, x:x+width-1, :)
There are multiple ways to resize images. One of them involves fft2(). One of them involves interp2(). One of them involves wavelets. There are other ways.

Categorías

Más información sobre Read, Write, and Modify Image en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by