Image tiling, Combining Images.

4 ビュー (過去 30 日間)
Sam
Sam 2013 年 2 月 6 日
Hello, I am quite new (my first month) with MATLAB, trying create an image with 4 different images. (function)
Something like one of those Andy Warhol/Instagram images where 4 different images on 4 different parts of the image (image1=upper left side image2= lower east side etc.) -All 4 images must be same dimension.
function [newimage} = CombinedImage(image1,image2,image3,image4)
this is the first line of my function but I am entirely lost at this point. Any help would be much appreciated. Thanks.

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 2 月 6 日
newimage = [image1, image2; image3, image4];
  2 件のコメント
Sam
Sam 2013 年 2 月 6 日
Error using horzcat CAT arguments dimensions are not consistent.
Error in TileImage (line 5) finalmatrix = [image1,image2;image3,image4];
This is the error I get :/
Still thank you though.
Walter Roberson
Walter Roberson 2013 年 2 月 6 日
In your question you imposed the constraint "All 4 images must be the same dimension". It appears that your images do not meet that constraint.
Add these debugging lines before you try to calculate finalmatrix:
disp(['image1 is ', num2str(size(image1))]);
disp(['image2 is ', num2str(size(image2))]);
disp(['image3 is ', num2str(size(image3))]);
disp(['image4 is ', num2str(size(image4))]);

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by