Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

To Extract Intensity Profile from Image

Solved!
Go to solution
I am aquiring image of a fringe pattern from which I want to do some data processing My image is black and white line pattern(Enclosed sample file).I want to sum intensity of individual lines having nearly equal intensity to reduce this 2D distribution of intensity as 1D intensity pattern as intensity value of particular row or column will be same depending on orientaion of frimge. I am using labVIEW 6 with Vision to aquire and process these images.If I am selecting a portion of Image where good contrast straight line fringe pattern are available by ROI (Attached Image) I can get a Line Intensity profile and other imformations all right but I am in need of intensity profile for entire image which has to be reduced into 1D
intensity variation data i.e intensity values of all pixels under selection to be manupulated as 1D variation.For this I need to add intensity of pixels in al column to generate single element of a resultanr 1D array i.e sum all column vectors individually to reduce the 2D Array into one 1D Array of Row Vector or to Add Intensity values of Individual Row of Pixels to generate a Single 1D Column Vector.By this I want to reduce the 2D Image Intensity Distribution into 1D line intensity distribution from whoch I can generate Line profile which will be used for further processing.I am not able to do this I am not an expert in LabVIEW.Please help me.
Ajay Shankar
0 Kudos
Message 1 of 9
(8,737 Views)
It sounds like you want to use the function IMAQ LinearAverages, which will give you the average value of each column and row in an image. I think you can use it with an ROI or mask also.

If you aren't using the Vision toolkit, just convert the image to a 2D array and feed the array into an autoindexing loop. Sum each array within the loop, and the output will be what you want. To change between summing rows and columns, transpose the matrix before you enter the loop. You should probably convert the 2D array to I16 or DBL to prevent overflow.

Bruce
Bruce Ammons
Ammons Engineering
Message 2 of 9
(8,737 Views)
Thanks for your response.Howerver I am not looking for average value of each column but the total value of column found from summation of all pixel value in each column so that this 2D Array is converted to single row whose every element is summed value of columm elements.I want to process this 1D array further but I want to avoid using loop . I want to use some in-built function or a faster procedure. As I have to use this routine altimately for on line fringe data analysis/measurement where I will use ring aquisition and will compare this processed intensity peaks of fringe pattern with adjecent buffer image fringe peak to see and measure the movement of peak. I am trying to convert image into a 1D data sequence to measure the phase of fringe pattern.
This summation is going to provide me a high peak value making better interpolation possible. I will appriciate if you can suggest me something on this.
Ajay Shankar
0 Kudos
Message 3 of 9
(8,737 Views)
If you take the average value for each column and multiply by the number of rows, you will have the sum of the values in each column. The two curves have exactly the same shape. This sounds like exactly what you are asking for.

Convolution of the two arrays is probably the fastest way to measure the change of location of a peak.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 9
(8,739 Views)
Thanks ,it is working.
Ajay Shankar
0 Kudos
Message 5 of 9
(8,737 Views)
I am working on something very similar to Ajay.
Can you explain more about the Convolution technique to measure the phase shift between 2 fringe patterns?
0 Kudos
Message 6 of 9
(8,425 Views)

Convolution will give you a peak where the two patterns match best.  You can usually use the peak detection vi to locate all the peaks, then search for the peak with the largest magnitude.  If the pattern hasn't moved, the peak will be at the center value of the convolution.  If it has moved, it will be offset by a small amount.  If you divide this amount by the line spacing of the pattern, it will tell you the fraction of the shift.  Multiplying the fraction by 360 will give you the phase shift in degrees.

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 7 of 9
(8,406 Views)
Solution
Accepted by topic author AjayShankar

Hi Ajay

 

can you post your VI's

 

thanks

Message 8 of 9
(7,583 Views)

The VI used for my Grating Interferometer project is attached. If convolution technique work repost it ,I will like to see that solution.

Ajay

Ajay Shankar
0 Kudos
Message 9 of 9
(7,217 Views)