content of two Images into one image
Show older comments
I have 2 folders each containing equal number of images. I need to create a new folder which contain images which have the contents of both folder images in single image. For example one folder named A contain 100 images in each of it contain picture of a boy on left side of the image. Another Folder named B contain 100 images each contain the image of a girl on right side of the image. I need to create a new folder named C which contain 100 images in each image have picture of boy and girl on the left and right side respectively. Is there any way to perform such operation on matlab. Please help me to resolve this Background does not a matter
Answers (1)
Azzi Abdelmalek
on 28 Feb 2013
if your images are called picA1,picA2,...picAn in folder A, and picB1,... in folder B
for k=1:100
im1=imread(['folderA/' sprintf('picA%d.jpg',k)]);
im2=imread(['folderB/' sprintf('picB%d.jpg',k)]);
im=[im1 im2];
imwrite(im,['folderC/' sprintf('picC%d.jpg',k)])
end
1 Comment
Image Analyst
on 28 Feb 2013
If they're not all the same size, you can use imresize() to force them to have the same number of rows.
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!