How can I get the fringe visibility of a difference Image

2 views (last 30 days)
To measure the fringe visibility I need to know the maximal and minamale intensities of the Image and my problem is that I cannot calculte the intensities they are always Imax = 1 and Imin = 0.
Have any anyone an Idea ? thank u for help.
Here is my Matlab code :
A=im2double(rgb2gray(imread('Diffbild_sw.tif')));
maxA=max(max(A))
minA=min(min(A))
V = (maxA-minA)/(maxA+minA);

Answers (1)

Image Analyst
Image Analyst on 10 Jul 2015
If you want the original values, don't call im2double():
rgbImage = imread('Diffbild_sw.tif');
grayImage = rgb2gray(rgbImage);
maxGrayLevel = max(grayImage(:))
minGrayLevel = min(grayImage(:))
  6 Comments
Khaled Jbir
Khaled Jbir on 12 Jul 2015
Edited: Khaled Jbir on 12 Jul 2015
Yes, but can I use a filter or another method so that I can avoid that the minGrayLevel=0 because if it is the case my fringe visibility will be always equal 1.
(V = (maxGrayLevel-minGrayLevel)/(maxGrayLevel+minGrayLevel))
and it is not logic.
Image Analyst
Image Analyst on 12 Jul 2015
The min gray level is what it is. If you don't like it being that, you can always change it. What would you change it to? That formula will always be 1 if minGrayLevel = 0 of course. But I don't think you want to just arbitrarily change your min gray level to 42 or whatever. Besides, what would you do with the other gray levels? Like gray levels 1-41 or whatever? Or the brighter gray levels? Basically if you want to fudge your data, you can make the V be whatever you want -- just plug in the desired V, the actual max gray level, and solve for the min gray level.

Sign in to comment.

Categories

Find more on Read, Write, and Modify Image in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!