how to reconstruct original image from subimages?

hi...
i have an image which is cropped into a number of subimages using the Boundingbox..the subimages are processed and saved...
i want to reconstruct the original image from these subimages... is there a way to do that?please help !!
i used 'regionprops' to get the boundingbox and other parameters.

Answers (1)

Stitch them together:
sideBySide = [imageLeft, imageRight];
topAndBottom = [imageTop; imageBottom];
Do as many times as necessary. You can put multiple images inside the brackets.

5 Comments

i'm getting error.. my subimages are of different dimensions..
Error using horzcat
CAT arguments dimensions are not consistent.
Error in Untitled4 (line 40)
sidebyside=[I1,I2];
My code is something like this,
stats=regionprops(I,'all');
for index = 1 : length(stats)
boundinbox1 = stats(index).BoundingBox;
subimage = imcrop(I, boundinbox1);
figure,imshow(subimage);
end
is it possible to put the subimages back in its position in original image??
If they are going to go side by side they need to be the same number of rows. If they are going top and bottom, they need to be the same number of columns.
I'm not sure where in your code, you're rebuilding your image from parts. But when you do, put these lines just befor ethe stitiching line:
[rows1, columns1, numberOfColorChannels1] = size(I1) % No semicolon.
[rows2, columns2, numberOfColorChannels2] = size(I2) % No semicolon.
Now, see what it says, then recall what I said about the rows and columns matching and figure out what you're trying to stitch together and why it's not working - what dimension is mismatching and why.
hi, thank you for your explanation, Image Analyst.
If you don't mind, could you please show the full code example of this stitching proses, please ?
i also have the same question with jeena, actually. also want to reconstruct original image from subimages that has been devided into blocks 100x100pz using this code https://www.mathworks.com/matlabcentral/answers/uploaded_files/32899/blockproc_demo2.m
but im sorry, i still didn't understand the code above.
thankyou.
blockproc() processes images one block at a time. It does not split images up into separate blocks - separate variables or image files. So you don't "reconstruct" images from 100x100 blocks after using blockproc because there are no 100x100 images to be had.
so, is it mean i can't stitch its or reconstruct its or put it back together, like the original images, those blocks / tiles anymore, sir ?
is there another way to put it back again ?

Sign in to comment.

Asked:

on 22 Feb 2013

Commented:

on 14 Feb 2019

Community Treasure Hunt

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

Start Hunting!