Why is the background becomes black after I subtract two images and signature becomes green?
3 次查看(过去 30 天)
显示 更早的评论
This code is a section of my project and I don't know what is happening mathematically but I know what each of these function does so I need some help. Any useful links/explanation are greatly appreciated. Thanks in advance.
Why is the background becomes black after I subtract two images and signature becomes green? why does signature becomes red after imcomplement()?
A = imread('s3.png'); B = imread('mask.png');
diff = minus (B, A); comp_img = imcomplement(diff);
0 个评论
采纳的回答
Image Analyst
2018-9-12
Think about it and you'll realize why. If they're equal, the difference is zero (or close to it) for all 3 color channels, and zero shows up as black.
Where they're not equal, you'll get the difference between the background and the black handwriting (which is near zero), so you'll get cyanish -- which is high green and blue signals, and low red signal. If you invert that, you'll get low green and blue signals, and high red signal so that's why it then shows up as red.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!