05-09-2013 04:02 AM - edited 05-09-2013 04:13 AM
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:)
05-09-2013 04:52 AM
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
05-09-2013 05:22 AM
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.
05-11-2013 01:38 AM - edited 05-11-2013 01:41 AM
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!
05-11-2013 10:16 AM
Hi Enriquez,
I guess I misunderstood your intention;
now I think I understand what you want to do:
Alex
05-14-2013 08:25 AM - edited 05-14-2013 08:25 AM
Here I've attached my VI
05-14-2013 01:53 PM
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
05-14-2013 08:41 PM
Hi,
I actually want all the rows of phase array corresponding to grey level array shown in the graph.
Thanks!
05-15-2013 04:39 AM - edited 05-15-2013 04:43 AM
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.