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!