How can I merge two Image?

2 ビュー (過去 30 日間)
bkshn
bkshn 2015 年 8 月 11 日
編集済み: Stephen23 2015 年 8 月 11 日
Hello
I want to merge two Image in one Image so that odd rows of image fill one of them and even row of image fill with another Image.
Thanks

採用された回答

Stephen23
Stephen23 2015 年 8 月 11 日
編集済み: Stephen23 2015 年 8 月 11 日
This sounds like a kind of image interlacing. Try this:
>> A = [1,2;3,4]
A =
1 2
3 4
>> B = [9,8;7,6]
B =
9 8
7 6
>> X = nan([2,1].*size(A));
>> X(2:2:end,:) = B;
>> X(1:2:end,:) = A
X =
1 2
9 8
3 4
7 6
These tutorials are a good place to learn basic MATLAB code like this:

その他の回答 (1 件)

Andreas Goser
Andreas Goser 2015 年 8 月 11 日
It is not totally clear what you want to achieve and especially what you already have tried, but here is a start. How to access odd rows of a matrix:
A=[1 2 3; 4 5 6; 7 8 9; 10 11 12]
A(1:2:end,:)
  2 件のコメント
bkshn
bkshn 2015 年 8 月 11 日
I want to create an OriginalImage , that odd rows of this OriginalImage fill with rows of "ImgA" and Even rows of OriginalImage fill with rows of ImgB.
Thanks
Andreas Goser
Andreas Goser 2015 年 8 月 11 日
Right. Give it a try and start coding. Learn while you succeed or fail. If you need help, post the reproducible code.

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

カテゴリ

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