LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting grey level value

Hi Everyone!

 

How am I going to get the value of grey level of each pixel from the bmp file in a look up table?, I already got my phase value so its just the grey level that i have to get.

The attachment is what i have done.

 

Greatly appreciate anyones help:)

 

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

If you have the same problem you might want to stick with the same post

http://forums.ni.com/t5/LabVIEW/Calculating-phase/m-p/2418936#M746679

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 2 of 9
(3,420 Views)

Hi again Enriquez,

 

I assume you want your look-up-table to be in u8 as there are only 256 greyscales to be.

 

 

 

Your input is u32 = 2^32 =256^4

 

Your desired output is u8 = 2^8 = 256^1

 

 

You could divide your input u32 array 3 times through 256 e.g. using a FOR loop, or you could cube root the u32 array directly, or use the "split number.vi" three times sequentially.

 

 

Message 3 of 9
(3,416 Views)

Hi alex!

 

I have made changes in my program, instead of getting my grey level according to my bmp file, i made a constant to make my lens bmp file.

I have attached my vi:)

Thanks a lot!

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

Hi Enriquez,

 

I guess I misunderstood your intention;

now I think I understand what you want to do:

 

2013-05-11_grayscale 0-1.png

 

 

 

Alex

 

 

Message 5 of 9
(3,356 Views)

Here I've attached my VI

 

 

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

Hi Enriquez,

 

wow, this is quite ... creative.

 

Obviously, you want to plot "phase" as a function of "grey level" e.g. y_phase value = f(x_greylevel).

 

 

For which row or column of the phase array and the corresponding greylevel array?

 

Maybe, for all rows/columns?



 

Alex

0 Kudos
Message 7 of 9
(3,292 Views)

Hi,

 

 I actually want all the rows of phase array corresponding to grey level array shown in the graph.

 

Thanks! 

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

I think you're looking for somekind of distribution function

 

 

 

 

 

1# re-shape the 2d Arrays to 1d Arrays

 

So, if your 2d array has 50 rows x 50 columns your reshaped 1d array is supposed to have 1 row and 50*50=2500 columns

 

 

2# Build an 1d array of clusters with each cluster-element containing 1 greyscale and 1 phase value

 

Important: the greyscale array is to be the first cluster element!

 

 

3# Sort this 1d array of cluster with the "sort 1d array.vi";

 

this vi uses a stable sorting algorithm which maintains the relative order of phase values with equal greyscales

 

 

4# On the Frontpanel, change the greyscale indicator element in the 1d array of cluster element to a color constant

 

 

 

Now, you will have redundant values in the sorted 1d array of clusters which has the dimension 1 row x 2500 columns;

 

redundant values are indicated for example when i - (i+1) = 0 is TRUE.

 

 

 

 

 

 

 

 

 

 

 

0 Kudos
Message 9 of 9
(3,265 Views)