creating dye distribution profile with image processing
5 ビュー (過去 30 日間)
古いコメントを表示
Hi All. I have two photos taken from a sandbox.the first one is reference and second one is the same sandbox after injection of dye which is blue. I did the following: ref=imread('ref.jpg'); p1=imread('photo.jpg'); dif=ref(:,:,:)-p1(:,:,:); imshow(dif)
since everything is the same in both pictures except dye, I expect to see the dye distribution by subtracting second photo from reference photo which doesnt have any dye but at the end I got a very black picture. does anybody know how to do this? I am a beginner so any help would be appreciated. Thanks.
0 件のコメント
採用された回答
John D'Errico
2017 年 2 月 20 日
編集済み: John D'Errico
2017 年 2 月 20 日
If both pics are mostly identical, then what do you get when you subtract them? ZERO.
What color is [0 0 0]? Black. So you saw black. This is no surprise.
Worse, if the images are scaled [0-255], then they are stored as uint8 arrays. If the second number in a difference is larger than the first, the difference truncates at zero. Again, black.
So it depends on what you want to see, how you want to view it. I'd probably convert the images to double arrays, using double. Then when you subtract the two arrays, negative numbers will still make sense.
Next, I'd then shift and scale the difference so that a difference of zero would get mapped to a mid-level gray, and then I'd convert back into uint8 to return it into an image form.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!