05-29-2006 01:44 PM
When there are few particles it works pretty well, but when there are lots I
have particles joined together.
What I really need is someone with expertise to review what I am doing and
seeing if my images are impossible, or if it can be done better than what I am
doing.
I have played around with a series of edge enhancement filters and a number of
the functions in Labview, but to some degree am limited by my experience, If
someone has the time to take a quick look at the images and tell me if they
thick the project is feasible, that would be great If they have simple
suggestions I could try to incorporate, that would be excellent, but if it
requires a more detailed setup we can see about setting up a contract to
improve the algorithm.
The basics of the program are a subtraction (removes the background differences
in light intensity), calibration, filtering for edge enhancement and smoothing,
thresholding, particle filtering (ratio of axis, size etc) and particle
identification. The code includes a bunch of stuff to determine the velocity of
particles, but this works fine and can be ignored. I have attached a zip file
with three demo images (in the TRACKING) folder, the first is easy, the second
works well and the third is the problem. (It is posted at
http://www.geog.ubc.ca/~azimmer/3231503119.046000.tif in an uncompressed
format, so takes some time to load)
There are also two other images in the main folder, one for the
subtraction and one for calibration. To run the algorithm set the paths to
where the folder has been unzipped and it should work. When the program is
completed running the problem is easily visible in the last two images (far
right). In the particle image a big hole where there should be some particles
is evident. These particles get rejected as they are weird shapes as the
particles that compose the hole are overlapping in the threshold image. I have
included a particle separation algorithm, but it doesn't seem to improve
things, and it adds a lot to the run time of the algorithm. As I have thousands
of such images to process, I need a relatively fast run time (approx. 1 sec per
image or less)
Thoughts? Suggestions?
Cheers,
Andre
05-29-2006 10:48 PM
05-30-2006 12:31 PM
05-31-2006 10:13 PM
Your problem is far from easy. Even for the human eye, identifying the particles is difficult, since there are bubbles distording the image. Overlapping particles can't be processed easily. An approach would be to detect the "funny" shaped particles and process them separately : once you know the bounding rect, you can extract the corresponding image piece, and run a dedicated algorithm on it.
In IMAQ Vision 8, there is threshold algorithm that features an automatic local background correction. Seems that it's even better than subtracting the empty field image.
You should spend some time to improve your coding style : your diagram is one of the worst I ever seen :). You should study the LabVIEW style guide. Reduce the number of bends. Avoid backward wires. Make all the wires visible. Try to structure the processing into sub-vis with clear functionnality. Remember that the whole diagram should fit entirely in a normal sized computer screen ! And suppress the array to cluster operations.
06-01-2006 10:37 AM
Andre,
Was able to download and take a look at your code and you definitely have the right idea. One immediate step that I noticed your code was missing was some basic erodes and dilates. Part of what's causing that large hole in the final picture in your code is that there are so many smaller particles touching those two large ones. They are all connected in some way or another and it is being picked up and filtered out as one giant particle. Two erodes followed by a dilate was something that I tried that seemed to separate each particle more. I think if you can play around some more with different processing functions you should be able to improve the results of your program.
Are you using the Vision Assistant at all? It is an extremely helpful program that allows you to perform different image processing steps to an image and see the effect of each individual step. You can adjust all the settings for each processing step and see the effects on the image as you change them. The Vision Assistant uses all of the same Vision functions used in LabVIEW. The best part about it is that you can then generate LabVIEW code for the processing steps you created. If you are not using this I would definitely recommend it because there are a lot of image processing functions and many settings to adjust for each one.
Setting up a contract with an IMAQ and Vision expert would certainly be a viable option as well. At www.ni.com/alliance you can search for Alliance Members near you whom you can contract to code for you. Alliance Members are separate companies from NI that provide development assistance to customers.
Jason N
06-06-2006 10:04 AM
01-20-2017 11:03 PM
For those of you still reading this old post. The code works and still lives. The trick turned out to be putting the flow through a box. Now the particle tracking works really well. Thankfully my code has gotten a bit better😀