Hi, I have a specific problem in Image Processing. I have an image in BMP format and I perform contrast enhancement on this image and write it in jpeg format. But, the problem is I have to perform this operation on 500 images. Can I write a matlab script file to perform batch processing?? If yes, can anyone please instruct me on how to accomplish that task. (I am a novice in matlab, but I am good at C/C++ though). Thanks a bunch for your help. Deepak. |
|
Batch Image Processing
Started by ●September 7, 2004
Reply by ●September 8, 20042004-09-08
Deepak, Are your files having contigous names or contigous numbers. That can be changed by just incrementing a counter or something?? If you have them in that manner then the task is simple. Lets assume that you have file with filename varying from pic001.bmp to pic500.bmp skeleton of the code shud b something like this for i = 1 : 500 fname = [pic num2str(i)]; image = imread(fname,'bmp'); % do contrast enhancement% imwrite(image,fname,'bmp'); end Hope this shud help. Tarang ----- Original Message ----- From: roopireddy <> Date: Tue, 07 Sep 2004 21:30:00 -0000 Subject: [matlab] Batch Image Processing To: Hi, I have a specific problem in Image Processing. I have an image in BMP format and I perform contrast enhancement on this image and write it in jpeg format. But, the problem is I have to perform this operation on 500 images. Can I write a matlab script file to perform batch processing?? If yes, can anyone please instruct me on how to accomplish that task. (I am a novice in matlab, but I am good at C/C++ though). Thanks a bunch for your help. Deepak. _____________________________________ Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. _____________________________________ About this discussion group: To Join: To Post: To Leave: Archives: http://www.yahoogroups.com/group/matlab More DSP-Related Groups: http://www.dsprelated.com/groups.php3 ________________________________ Yahoo! Groups Links To |
Reply by ●September 8, 20042004-09-08
Deepak, Are your files having contigous names or contigous numbers. That can be changed by just incrementing a counter or something?? If you have them in that manner then the task is simple. Lets assume that you have file with filename varying from pic001.bmp to pic500.bmp skeleton of the code shud b something like this for i = 1 : 500 fname = [pic num2str(i)]; image = imread(fname,'bmp'); % do contrast enhancement% imwrite(image,fname,'bmp'); end Hope this shud help. Tarang ----- Original Message ----- From: roopireddy <> Date: Tue, 07 Sep 2004 21:30:00 -0000 Subject: [matlab] Batch Image Processing To: Hi, I have a specific problem in Image Processing. I have an image in BMP format and I perform contrast enhancement on this image and write it in jpeg format. But, the problem is I have to perform this operation on 500 images. Can I write a matlab script file to perform batch processing?? If yes, can anyone please instruct me on how to accomplish that task. (I am a novice in matlab, but I am good at C/C++ though). Thanks a bunch for your help. Deepak. _____________________________________ Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. _____________________________________ About this discussion group: To Join: To Post: To Leave: Archives: http://www.yahoogroups.com/group/matlab More DSP-Related Groups: http://www.dsprelated.com/groups.php3 ________________________________ Yahoo! Groups Links To |
Reply by ●September 9, 20042004-09-09
One way of doing this is as follows: I think all of your bitmaps are in a dir. Set matlab to the desired directory d = dir; //get directory contents for i= 3:length(d) img = imread(d(i).name); //read one bitmap %do contrast adjustment imwrite(img, d(i).name, 'JPEG'); //write back tye image end Regards Shehzad ---- Original Message ----- From: roopireddy <> Date: Tue, 07 Sep 2004 21:30:00 -0000 Subject: [matlab] Batch Image Processing To: Hi, I have a specific problem in Image Processing. I have an image in BMP format and I perform contrast enhancement on this image and write it in jpeg format. But, the problem is I have to perform this operation on 500 images. Can I write a matlab script file to perform batch processing?? If yes, can anyone please instruct me on how to accomplish that task. (I am a novice in matlab, but I am good at C/C++ though). Thanks a bunch for your help. Deepak. |