フィルターのクリア

How do I overlap 2 images in matlab?

1 回表示 (過去 30 日間)
jinwoo lee
jinwoo lee 2021 年 1 月 26 日
コメント済み: jinwoo lee 2021 年 2 月 1 日
Hi, all
There are two images of size M X N shown below.
In fact, my purpose was to create a topomap for the EEG signal, but it was difficult to use a known tool (e.g. EEGLAB), so I made it myself.
How do I make the black part in the right picture transparent and then overwrite the left picture? Or I would like to know how to show them at the same time.
The purpose is to make the following through two images.

回答 (1 件)

David Hill
David Hill 2021 年 1 月 26 日
Assuming the pictures are rgb matrixes.
picture2=reshape(picture2,[],3);
idx=ismember(picture2,[0 0 0],'rows');%find the black (I am assuming your image has no true black in the interior)
picture2(idx,:,:)=255;%change the black to white
picture2=reshape(picture2,size(picture1));%reshape to original matrix size
newPicture=min(picture1,picture2);%since picture1 is just black and white taking the minimum will produce the black of picture 1 overlayed on picture2
  1 件のコメント
jinwoo lee
jinwoo lee 2021 年 2 月 1 日
Thanks for any help. My one is not an rgb matrix, so I solved it in a different way.

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

カテゴリ

Help Center および File ExchangeEEG/MEG/ECoG についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by