Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Speed Up IMAQ Find CoordSys (Pattern) 2

Hello,

 

I am a student using the NI 1722 Smart Camera LabView to track the vertical position of spinning helicopter blades for my senior design project. I inherited (from last year's project) a LabView program that uses IMAQ Find CoordSys (Pattern) 2.vi to compare an image of the blade tip to a template image and thus determine the y-position of the blade.This program works on stationary blades. One of my tasks is to use an external trigger to capture images of blades in motion and perform the same pattern recognition on them.

 

The problem that I am having is that the IMAQ Find CoordSys (Pattern) 2 VI is too slow. Helicopter blades rotate at about 4 rev/sec (x 4 blades means that for real-time data readout the application needs to process an image about 16 times a second, or every 62.5ms). In the program developed last year, the IMAQ Find CoordSys (Pattern) 2 VI takes about 140ms to compare the image to the template, which is not fast enough for real-time tracking of the blades.   

 

Is there anything I can do to speed up IMAQ Find CoordSys (Pattern) 2 vi?

 

I am running LabView on the school's laptop with the following specs:

1GHz Pentium III

256 Mb RAM

 Windows XP SP2

 

Would a faster machine would guarantee fast enough execution for real-time data (ie IMAQ Find CoordSys (Pattern) 2.vi executes in less than 60ms rather than 140ms)?

 

To further my confusion, I created a test program that reads an image from a .PNG file saved on the computer. (The .PNG file was acquired using Measurement and Automation Explorer with the camera in the same position it is in when the other LabView program is run). In this program, the IMAQ Find CoordSys (Pattern) 2 VI only takes about 20ms to run. 

 

I've attached the vi files (in a zip file) that I have been working with. 

 

Thanks everyone for any help that you may be able to provide.

 

Noah. 

 

0 Kudos
Message 1 of 3
(3,687 Views)

Might I suggest a different approach?

 

If you are trying to track the blades, you should be able to draw a line ROI that crosses the edges of the blade.  Use edge detection to find the two edges of the blade.  Based on these two points, it should be very easy to determine the center of the blade and its position.  This will only take a few msec instead of 140.

 

Do you have a picture of the blades, either stationary or in motion?  Both would be useful to make further suggestions.

 

After looking at the pictures I found in your attachment, I have a couple more comments.

 

You could use several edge finding lines to determine the position of the blade.  If you were to include more of the blade in the image, it might be easier.  If you had both sides of the blade visible, you could find their midpoint then run a perpendicular line ROI to find the end.

 

Geometric pattern matching might work better since you have a pretty clear edge on the stationary blade.  If you could shorten your shutter time and increase your gain, you would get a crisper image of the edge of the blade while in motion.

 

How are you getting images of the edge of the blade?  Are you triggering the camera somehow while the blade rotates?

 

Bruce

Message Edited by Bruce Ammons on 10-27-2008 09:07 PM
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 3
(3,685 Views)

Bruce,

 

Thank you very much for your suggestions.

 

What are the relative merits of geometric vs. pattern matching?  I tried geometric matching as well but had problems with it. For a stationary blade over a stationary camera, the y-position of the match would change drastically each time the program looped. The magnitude of this unpredictability was enough to make it unreliable to determine the y-position of the tip of the blade. Additionally, I found that geometric matching seemed to be much more sensitive to changes in light than pattern matching. If the sun came out, for example, the extra light coming in the lab windows would significantly alter the y-position of the match. Also, geometric matching doesn't seem to be much faster than pattern matching, and speed is the current issue I'm facing. 

 

Your edge detection with lines suggestion is a good one, especially if it is as fast as  you suggest. I'll try that next, as soon as I get some free time from my other schoolwork. 

 

As for your questions about the images - both of the images in the attachment are of stationary blades, taken with the camera positioned on an angled stand below the blades. One's just out of focus because I wasn't paying attention. I also plan on modifiying the stand so that I get both sides of the blade in the image. 

 

The idea is to trigger the camera using some sort of proximity sensors (magnetic?) mounted on the rotor so that the camera takes a picture when each blade is in the correct position above the camera. I have been able to decrease the exposure time and increase gain to get a sharp picture of a moving blade. 

 

Thanks again for your suggestions.

 

Noah 

 

0 Kudos
Message 3 of 3
(3,666 Views)