How to subtract two images in matlab?

70 ビュー (過去 30 日間)
Warid Islam
Warid Islam 2019 年 8 月 20 日
コメント済み: Vikai 2024 年 1 月 20 日
I have couple of images below which I want to subtract from each other. The images are taken from the same sample at different time frames. I want to notice the movement of the particles between those time frames. So I want to take out the part of the image that only contains the liquid particles. I want to subtract INTENSITY14.JPG from INTENSITY15.JPG. Ideally, the resultant image should look like SUBTRACT.JPG where the red dased box shows the part of the image which contains the liquid. But, I am getting the result as shown in S1.jpg which is undesirable. Below is my code. Any suggestions would be very much appreciated. Thank you.
a = imread('Intensity15.jpg');
b = imread('Intensity14.jpg');
dblSubtractedImage = double(a) - double(b);
imshow(dblSubtractedImage, []);

採用された回答

Benjamin Brenner
Benjamin Brenner 2019 年 8 月 20 日
Your code is successfully subtracting the two images. The reason your subtraction looks like that is because your two images are so closely correlated that whatever is left after subtraction is mostly noise. How did you get SUBTRACT.jpg? I don't see how you could get an image like that from subtracting a and b.
  4 件のコメント
Warid Islam
Warid Islam 2019 年 8 月 21 日
Hi Benjamin,
That helps a lot. Thank you.
Vikai
Vikai 2024 年 1 月 20 日
Hi Benjamin,
I do not understand this image
What does it means. Could you please explain for me.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by