How to I overlap two images?

1 回表示 (過去 30 日間)
Grosu Andrei
Grosu Andrei 2016 年 10 月 19 日
コメント済み: Grosu Andrei 2016 年 10 月 21 日
Hi,
So, I have this image with this code:
img = zeros(256,256); img(:, [1:6:end, 2:6:end, 3:6:end]) = 1; imshow(img), axis on;
and I want to have 2 images, one with red channel and the other one with green channel and i want to overlap the images at 30 degree to result yellow.
Could anyone help me with the code, please?

採用された回答

Massimo Zanetti
Massimo Zanetti 2016 年 10 月 19 日
編集済み: Massimo Zanetti 2016 年 10 月 19 日
Here it is
img = zeros(256,256);
img(:, [1:6:end, 2:6:end, 3:6:end]) = 1;
imshow(img), axis on;
%build RGB image
RGB=cat(3,img,imrotate(img,30,'crop'),zeros(256));
%show it
imshow(RGB); axis on;
  1 件のコメント
Grosu Andrei
Grosu Andrei 2016 年 10 月 21 日
Thank you very much! :D

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by