Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

image analysis using LABVIEW and IMAQ for IEEE 1394 cameras

Hello,
 
(i)
I am working on an application where I need to monitor an emission (produced by a laser beam when it is focused on a substrate), analyze the intensity of emission and generate an appropriate signal to the laser to increase/decrease its power in real time, to maintain a constant emission intensity.  One way of doing this is to have a photodiode and monitor its output to generate the necessary corrective signal for the laser. 
 
I am wondering if I can accomplish the same with a camera (SONY XCD-X710), IMAQ for IEEE 1394 cameras and LABVIEW.  I am not sure if there is a way we can tackle this by converting the produced images into arrays. If so, any suggestions about how to proceed would be appreciated.  I don't have NI-Vision although I believe it's a lot easier with it to analyze images.
 
Coming to the configuration of the system, the camera is mounted perpendicular to the focal spot (emission).
 
(ii)
Also, is there a way one can analyze the image (emission spot from setup above-mentioned) and find the center of the image using LABVIEW and IMAQ for IEEE 1394 cameras?
 
Thanks.
 
Ram
 
 
0 Kudos
Message 1 of 19
(6,046 Views)

Hello Ram

For (i):  the XCD-X710 is a DCAM compliant camera, so it will definitely work with the NI IMAQ for IEEE 1394 driver.  Without the IMAQ Vision software, you could convert the image to a 2D array of pixel values.  You could then write some code to average the pixel intensity (perhaps only over a certain region).  However, with the Vision software, you could fairly easily perform an intensity measurement within a region (no conversion to an array required).

Since the camera acquires at 30 frames per second, you would have roughly 33ms to perform all processing in before the next frame is acquired.  This would be as close to "real time" as you could get with this camera setup.

For (ii):  as with above, you could either create an algorithm that looks at the 2D array to find the center, or you could use the Vision software to perform the measurement.  With Vision, you might be able to do some particle analysis to detect the center of mass (depending on the image).

This definitely sounds possible from the description you provided.  The only question is - how close to "real time" is acceptable.  If 33ms rate is fast enough and the processing can be completed in this time, then everything should work out great.

Best Regards

Jesse D.
Applications Engineering
National Instruments

Message 2 of 19
(6,017 Views)
Hi Jesse,
 
Thanks for your suggestions.
 
As for writing the code to compute the intensity of the image (after it's been converted to an array), is there any readymade code that's available in LabView examples or other sources I could look up.  Also, I would appreciate if you can suggest some reading material that can help me in moving ahead with computing the intensity from the extracted array.
 
Thanks.
 
Ram
0 Kudos
Message 3 of 19
(5,974 Views)

Hi Jesse,

I just realized that I can find the average intensity of the image (from the converted array) by using the mean.vi to compute the average.  I could have used the IMAQ histogram if I had the IMAQ Vision software in hand. 

Attached you will find a picture of the emission spot I am interested in measuring the intensity as well as the area and the center of the spot.  As I mentioned earlier, I have with me the IMAQ for IEEE 1394 cameras and LabView 7.0.  I found this link on the NI discussion board (http://forums.ni.com/ni/board/message?board.id=200&message.id=4640&requireLogin=False) where Bruce Ammons suggested a procedure which I do not quite follow as of now.  I would appreciate if you can advice on how to go about with the above-mentioned tasks.

Thanks,

Ram

0 Kudos
Message 4 of 19
(5,969 Views)

I suspect my old post doesn't make sense because you don't have the Vision tools, and it uses a couple of those VIs.

Without the toolkit, you could sum the rows and columns of your image array.  For each sum, loop with autoindexing.  Multiply the sum value by the index array and output a new array.  Sum the values of the new array and the original array, then divide new/original.  This will give you the index of the centroid.

Bruce 

Bruce Ammons
Ammons Engineering
Message 5 of 19
(5,963 Views)
Hi Bruce,

Thanks for your response.  Here is your reponse:
"you could sum the rows and columns of your image array.  For each sum, loop with autoindexing.  Multiply the sum value by the index array and output a new array.  Sum the values of the new array and the original array, then divide new/original.  This will give you the index of the centroid."

I was wondering if you can elaborate on your reply by taking an example of a 2D array with 5 rows and 5 columns.  In the meantime, I will give it a shot and see if I can construct a VI using the algorithm you suggested.

Thanks.

Ram


0 Kudos
Message 6 of 19
(5,955 Views)

Start with the 2D matrix.  Autoindex it into a for loop and sum each 1D array.  The output should be an array that is the sum of each row (or column, I can never remember).  Call this A.

Use another for loop to autoindex the A array from last step.  Multiply each element of A by the index of the for loop.  For example, A(0)*0, A(1)*1, etc.  Output the new array and call it B.

The location of the centroid is equal to sum B/sum A.

Repeat the whole thing with the transpose of the original 2D matrix to get the other coordinate of the centroid.

Bruce
Bruce Ammons
Ammons Engineering
Message 7 of 19
(5,947 Views)
Hello Bruce,

Thanks for your suggestion.  Towards implementing your idea to find the centroid of the image, I have developed a VI that can compute the intensity (sum of all rows or columns in the input image array) of the image, as I also need to compute same in my application (I mentioned this in one of my earlier posts). 

However, I noticed that the time the VI takes to execute is 1 second.  I have a PENTIUM 4 Processor (operating at 3.0 GHz with a1GB RAM) and I find the time taken to be a bit on the higher side.  In my application, I would be capturing images at 30 frames per second and I should be able to do the analysis (finding the intensity and centroid of the image) within 1/30 of a second.  I am not sure if the slow performance of the VI is because of my algorithm or if it is the way I used the millisecond timers in the VI that's resulting in the poor performace.

I would very much appreciate if you can go through the attached VIs and lend your opinion.

Thanks.

Ram
0 Kudos
Message 8 of 19
(5,884 Views)
I cleaned up your sub-vi.  I used a for loop with autoindexing, and I used sum array for max speed.  I also moved the first "get timer value" inside the sub-vi.  The way you had it, you were probably timing the image acquisition as well as the processing.
 
See the attached vi.
 
Bruce
Bruce Ammons
Ammons Engineering
Message 9 of 19
(5,880 Views)
Hello Bruce,

You're amazing.  Thanks very much for your help with the VI.

I will keep you posted about my application.

Ram
0 Kudos
Message 10 of 19
(5,874 Views)