matlab code to resize multiple images
#1
Lightbulb 

I have 40 images of different sizes for my work. I would like to read the image , convert to gray and make uniform size ,say, 128x128. I like to have the matlab code for the above

Sakthi
Reasearch student
Reply
#2
place images in current directory and run this prog

dirData = dir('*.jpg'); %# Get the selected file data
fileNames = {dirData.name}; %# Create a cell array of file names
for iFile = 1:numel(fileNames) %# Loop over the file names
newName = sprintf('%1d.jpg',iFile); %# Make the new name
movefile(fileNames{iFile},newName); %# Rename the file
end


after that run this prog in same directory

q=1;
p=1;
for i=1:10
oq=imread(strcat(num2str(q),'.jpg'));
odprz=imresize(oq,[150 150]);
imwrite(odprz,strcat(num2str(p),'.png'));
q=q+1;
p=p+1;
end


get .png files that u needed
Reply
#3
THANKS A LOT...THIS IS MY LONG TERM DOUBT...FEEL VERY HAPPY...I THINK I GET INTO ONE OF MY SUCCESS STEP
Reply
#4
What is odprz ?
Since we can't use different variables..
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Tagged Pages: matlab,
Popular Searches: resize interpolation algorithm pdf, c program for resize of image using matlab, matlab program to resize the medical images, how to resize the more than one images at time using matlab, deskew images java code, blurring images matlab code, code for resize the image in matlab,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  how to calculate distance in heed protocol by using matlab 1 1,865 15-06-2018, 03:54 PM
Last Post: Guest
  matlab code for incremental conductance mppt 1 1,410 02-05-2018, 02:28 PM
Last Post: eksi
  anomaly detection code in matlab 3 2,073 23-04-2018, 12:04 AM
Last Post: Guest
  matlab code for liver tumor segmentation 2 1,571 01-04-2018, 06:29 PM
Last Post: [email protected]
  matlab code for vehicle tracking using unscented kalman filter 3 16,638 26-03-2018, 08:57 PM
Last Post: fodayj
  matlab code for facial expression recognition using frequency domain 1 2,658 19-02-2018, 06:03 PM
Last Post: Guest
  matlab code shadow detection and removal in colour images using matlab 2 2,236 12-01-2018, 01:24 PM
Last Post: dhanabhagya
  simulink matlab model upqc mdl 3 6,761 18-12-2017, 09:08 AM
Last Post: jaseela123d
  matlab code for speed breaker detection 1 1,285 27-10-2017, 10:22 AM
Last Post: Guest
  skin cancer detection using neural networks matlab code 13 3,825 23-10-2017, 02:52 PM
Last Post: Guest

Forum Jump: