combining small image to a large image

I am trying to merge small images into a large image by copying the small images' matrix to a single matrix While when i try copying, the result is not as I expected, the part of the large matrix is as the same as the image. The size of the small image is 13X39,hence i set it manually for testing
tryq=imread([folder '/' num2str(i+1) ' ' num2str(j+1) 'temp.jpg '])
figure(2)
imshow(tryq)
figure(3)
finalImage(1:13,1:39,:)=tryq;
imshow(finalImage);

5 Kommentare

Walter Roberson
Walter Roberson am 24 Apr. 2014
I am not sure what result you are expecting that is different from what you got?
What did you initialize finalImage to be?
Chan
Chan am 25 Apr. 2014
I am trying to make a mosaic image by combining the small image,
while on the figure2, the small image is yellow color image,
while when i copy to the the matrix in figure3,
it become mostly white What i wnat will be the image in the left will be exactly copy to the right one.
My finalImage is define as below
finalImage=zeros(row*blocksize(1),column*blocksize(2),3);
Where the row and column is the total small image i have,
and the blocksize is the size of the small image
That's because it's a double. Try this
finalImage=zeros(row*blocksize(1),column*blocksize(2),3, 'uint8');
Chan
Chan am 25 Apr. 2014
thank you,it works
Image Analyst
Image Analyst am 25 Apr. 2014
Can you mark my Answer below as Accepted then? Thanks in advance.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 24 Apr. 2014

0 Stimmen

Attached is a demo for copying a small image onto a larger one. In my demo, the small image is actually chosen from part of the large image, but it could just as well be a totally separate image.

Gefragt:

am 24 Apr. 2014

Kommentiert:

am 25 Apr. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by