joining images of different dimensions in matlab -


if have 2 images of different dimensions....than can have window size equal sum of sizes of 2 images, means window( size)=size of image1+size of image 2 , paste these mages on window show them jointly .....is possible?if yes how

from description sounds want construct block-diagonal matrix 2 images, since size of result sum of sizes (along each dimension). way use blkdiag function:

img1 = randn(70,100); img2 = randn(50,110); img = blkdiag(img1,img2); imshow(img) 

of course off-diagonal blocks padded zeros.

edit:

answering refined question, have pad shorter image zeros becomes @ same height longer image. can concatenate them side side. assuming img1 longer, like:

h1 = size(img1, 1); [h2, w2] = size(img2); img2a = [img2; zeros(h1-h2, w2)]; img = [img1, img2a]; 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -