LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

contrast

Hello, there;

I am using a 8 bit “raw “ image as my input data, which is 640 X 480 pixels, I would like to calculate the contrast of fringes, the calculation from my compiled labview programs has some problems. Could someone help me look at the programs.

Thanks;

Linghui

 

0 Kudos
Message 1 of 9
(3,861 Views)

Hi Linghui,

 

what kind of problems do you have with your "compiled labview program"?

 

How do you want to calculate the contrast? Do you want a single number as a result???

Or do you need some edge detection algorithm? Look at g**gle/Wikip*dia for such topics...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(3,854 Views)

Could you look at my labview program and a JPEG pictures? I want my program to calculate the contrast for each row first if there is contrast, if there is no fringe, the program do not calculate it, and then take an overal mean, and the mean contrast of rows is a single value that I want for the final result. My picture is 640 x 480 pixels, and the recorded fringes only exist in the middle of the picture, and I guess the contrast is like 0.6 or something, but the value by my program is 0.268804.

 

For my picture, I know there is no contrast for the first row and second row, and so on, because there is no fringe, but my program also find maximum gray values and minmum values for them, which is wrong, and I want to kick them out.

 

Thank you.

 

Linghui 

Download All
0 Kudos
Message 3 of 9
(3,850 Views)

In each row of a fringe picture, there are certain amount numbers of maximum and minimum for gray values, they are paired, for example, like 20 maximums and minmums, and the contrast for the row is: firslty, to use the mean maximum minus the mean minimum, and then calculate the mean maximum plus meam minimum, the next step is to use the former value to divide the latter one. This single value is the contrast for this row. At the same time, I have to calculate other contrasts for rest of rows. The final step is average those contrasts, and then a single whole value will be received.

 

The big problem is the fringes in the middle of picture, and there are no fringes on some rows, and there are some noise gray values, How to eliminate them is a big problem for me, and how to extract the effective fringe data out of the whole interference picture (640 x480)?

 

Thanks;

 

Linghui 

0 Kudos
Message 4 of 9
(3,838 Views)

Hi Linghui,

 

at the moment I only have access to LV7.1 - so no chance to look at your code...

 

"I know there is no contrast for the first row and second row"

When looking carefully at your JPG I notice  some dithering also at the borders of the picture - maybe it's the reason for the unwanted "maximum gray values and minmum values". (Use some color equalizing /histogram functions in a picture manipulation tool of your choice to see this.) Also JPG is not the best option for picture saving when wanting to analyze the pics afterwards...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 9
(3,800 Views)

Hello; Gerdw;

 

I rewrote the program in Labview 7.1 version. Could you help me look at my program to see what is wrong with my program.

For me, when I took data, I choose JPEG as the format of picture, which I know that Labview program can read it. I don't know whether Labview read TIFF or other picture's formats. 

For some of my pictures, the useful contrast part is in the middle of picture. For my picture size, it is 640 x 480 pixels, and the useful contrast part is smaller than this size. I want to calculate the column contrast in the effective area which contrains the fringes.  I want to kick out the part without contrast. so the most important thing for me is to build a 2D array to extract the 2 useful dimensional data from the whole data set. and use the method that I said in my previous post to calculate the contrast.

 

Thank you;

0 Kudos
Message 6 of 9
(3,783 Views)

Hello Linghui,

 

well, you have to use a filter to cancel that noise Smiley Wink I included a very simple filter in the example and simplified your vi a little bit. Probably there is a better way to get those min/max values...

 

You should use PNG instead of JPG, it compresses lossless and is supported by LV.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 9
(3,741 Views)

Hello Gerd W;

 

Thank you so much of your work to modify my program. I appreciate that. I used it to calcualted the contrast of some of pictures. The results for me are reasonable. But when I used it to calculate the contrast set of a 2D dataset which was generated in purpose, the contrast from the program is 0.31, but the contrast I could calculate by hand, and it should be around 0.5. Do you look at my program and see what is wrong there?

 

Sincerely;

 

Linghui  

0 Kudos
Message 8 of 9
(3,707 Views)

Hi Linghui,

 

for the full pic I only get 0.1696, see attachment.

How do you "calculate by hand"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 9
(3,696 Views)