how to join two image

259 views (last 30 days)
Ibrahim Thorig
Ibrahim Thorig on 13 May 2014
Commented: Image Analyst on 24 Jan 2023 at 21:35
I have two fragments of one image, i want join these two piece. someone please tell me how to join these two fragments.
thanks in advance

Answers (2)

Benjamin Avants
Benjamin Avants on 13 May 2014
You should use the cat() function.
if your images are A and B and you want to merge them so that you get AB (A on the left with be on the right) the command looks like this:
newImg = cat(2,A,B);
If you want A on top of B:
newImg = cat(1,A,B);
  8 Comments
Image Analyst
Image Analyst on 24 Jan 2023 at 21:35
@Vaibhav it should not change the absolute color. Are both your images RGB? Or is one gray scale? Are both in a similar value range, like 0-1 or 0-255, or 0-65535? If the ranges are way different, then one may appear a lot darker than the other. If you still have problems, attach your code and both your images and create a new discussion thread.

Sign in to comment.


Image Analyst
Image Analyst on 13 May 2014
Have you checked out these similar questions: http://www.mathworks.com/matlabcentral/answers/?term=tag%3A%22torn%22
  2 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by