Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Speed optimization of image analysis

I have a vi that searches through U8 images for bright spots, finds the centers and stores the coordinates in an array (attached)
 
The vi works very well, but it is too slow. I need to use it in a program that acquire images at 40Hz (externally triggered CCD camera).
 
From running Performance profile I learned that IMAQ Convolute (which runs twice for every image) takes an average of 21ms - a total of 42ms per image. Is it possible to make it faster? - for running at 40Hz it needs to be a factor for 4 faster at least!
 
Could an external C++ function be called that does the same, and would it be faster?
 
 
0 Kudos
Message 1 of 5
(3,747 Views)
I believe you should be using Particle Analysis instead of the combination of Label/Threshold/Centroid that you implemented. See the attached vi (I have not actually run or debugged it, but it should get you started).

Also, due to the large kernel size, the call to IMAQ Convolute with the 7x7 kernel (the second call in your program) will take significantly longer than the first call to IMAQ Convolute. Using a smaller kernel will speed up the convolution considerably. I'm willing to guess you may be able to get by without the second call to IMAQ Convolute, but I would have to see some images to know for sure. If you could post some samples of the images you're dealing with, I'd love to take a look at them.

As far as calling an external C++ function is concerned, that is precisely what IMAQ Convolute is already doing. The Vision code executes in a separate DLL that is invoked by LabVIEW. We have many optimizations in place for image processing, so I doubt you'd be able to see much improvement from implementing your own.

Regards,
Kevin C.
National Instruments
Vision Algorithms

Message Edited by KevinC on 02-15-2006 07:10 PM

0 Kudos
Message 2 of 5
(3,728 Views)

Particle Analysis does work much faster but there are other problems associated with it. Especially when two hits are close together (see image 22 and 29).

I have made a program that compares the output from your method and the convolute method, and also added a version with only the gaussian convolution - you can have a look at them.

If I cannot separate the hits then I will have to make a routine that identifies asymmetric particles and removes them - or at least counts them.

Best Regards

Simon Viftrup

0 Kudos
Message 3 of 5
(3,653 Views)
Here are a few zipped images.
0 Kudos
Message 4 of 5
(3,648 Views)
Just a minor upgrade to of the program - Showing the images as they are beeing processed.
0 Kudos
Message 5 of 5
(3,634 Views)